Commit bbcaeda2 authored by zhangyingbin's avatar zhangyingbin

安装告知申请新增回显接口修改、通过内容获取二维码图片接口

parent 3c91499f
...@@ -13,9 +13,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice; ...@@ -13,9 +13,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -25,7 +23,6 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -25,7 +23,6 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.*; import java.util.*;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.InstallNoticeServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -60,6 +57,9 @@ public class InstallNoticeController extends BaseController { ...@@ -60,6 +57,9 @@ public class InstallNoticeController extends BaseController {
@Autowired @Autowired
OrgServiceImpl orgServiceImpl; OrgServiceImpl orgServiceImpl;
@Autowired
UnitLicenceServiceImpl unitLicenceService;
/** /**
* 新增安装告知表 * 新增安装告知表
...@@ -323,4 +323,26 @@ public class InstallNoticeController extends BaseController { ...@@ -323,4 +323,26 @@ public class InstallNoticeController extends BaseController {
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option); projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option);
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice)); return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
} }
/**
* 新增告知时页面回显接口
* @param projectId
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getInstallNoticeByProjectId")
@ApiOperation(httpMethod = "GET", value = "新增告知时页面回显接口", notes = "新增告知时页面回显接口")
public ResponseModel<JSONObject> getInstallNoticeByProjectId(Long projectId){
if(ValidationUtil.isEmpty(projectId)){
return null;
}
JSONObject jsonObject = new JSONObject();
ProjectDto projectDto = projectServiceImpl.getDetail(projectId);
Map map = new org.apache.commons.beanutils.BeanMap(projectDto);
jsonObject.putAll(map);
//项目指定的安装单位的许可信息
Long companyId = projectDto.getInstallationUnitId();
jsonObject = unitLicenceService.getLicenceByCompanyId(jsonObject,companyId);
return ResponseHelper.buildResponse(jsonObject);
}
} }
...@@ -203,4 +203,15 @@ public class WeldController extends BaseController { ...@@ -203,4 +203,15 @@ public class WeldController extends BaseController {
return ResponseHelper.buildResponse(weldServiceImpl.selectDept(projectId)); return ResponseHelper.buildResponse(weldServiceImpl.selectDept(projectId));
} }
/**
* 通过焊口码生成二维码接口
* @return 二维码url地址
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getWeldQRCode")
@ApiOperation(httpMethod = "GET", value = "通过焊口码生成二维码接口", notes = "通过焊口码生成二维码接口")
public ResponseModel<IPage> getWeldQRCode(String HKCode){
return ResponseHelper.buildResponse(weldServiceImpl.getWeldQRCode(HKCode));
}
} }
...@@ -5,29 +5,40 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,29 +5,40 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto; import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice; import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule; import com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService; import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto; import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.http.entity.ContentType;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Wrapper; import java.sql.Wrapper;
import java.util.*; import java.util.*;
...@@ -52,6 +63,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -52,6 +63,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
ProjectResourceServiceImpl projectResourceServiceImpl; ProjectResourceServiceImpl projectResourceServiceImpl;
@Autowired @Autowired
SuperviseRuleServiceImpl superviseRuleServiceImpl; SuperviseRuleServiceImpl superviseRuleServiceImpl;
@Autowired
UnitLicenceServiceImpl unitLicenceService;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -127,9 +140,9 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -127,9 +140,9 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode()); installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto.setLicenseNum(object.getString("licenseNum")); installNoticeDto.setLicenseNum(object.getString("licenseNum"));
installNoticeDto.setLicenseCompany(object.getString("licenseCompany")); installNoticeDto.setLicenseCompany(object.getString("licenseCompany"));
final JSONArray licenseAttch = object.getJSONArray("licenseAttch"); // final JSONArray licenseAttch = object.getJSONArray("licenseAttch");
final JSONArray contractAttch = object.getJSONArray("contractAttch"); final JSONArray contractAttch = object.getJSONArray("contractAttch");
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch)); // installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch)); installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode()); installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
...@@ -160,10 +173,15 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -160,10 +173,15 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
public JSONObject selectOneBySeq(Long sequenceNbr) { public JSONObject selectOneBySeq(Long sequenceNbr) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
final InstallNoticeDto installNoticeDto = selectOneById(sequenceNbr); final InstallNoticeDto installNoticeDto = selectOneById(sequenceNbr);
//项目信息
final ProjectDto projectDto = projectServiceImpl.queryBySeq(installNoticeDto.getProjectId()); final ProjectDto projectDto = projectServiceImpl.queryBySeq(installNoticeDto.getProjectId());
SuperviseRule superviseRule = superviseRuleServiceImpl.getOne(new LambdaQueryWrapper<SuperviseRule>().eq(SuperviseRule::getAdminRegionCode,projectDto.getInstallRegionCode())); SuperviseRule superviseRule = superviseRuleServiceImpl.getOne(new LambdaQueryWrapper<SuperviseRule>().eq(SuperviseRule::getAdminRegionCode,projectDto.getInstallRegionCode()));
Map map = new org.apache.commons.beanutils.BeanMap(projectDto); Map map = new org.apache.commons.beanutils.BeanMap(projectDto);
jsonObject.putAll(map); jsonObject.putAll(map);
//项目指定的安装单位的许可信息
Long companyId = projectDto.getInstallationUnitId();
jsonObject = unitLicenceService.getLicenceByCompanyId(jsonObject,companyId);
if(!ValidationUtil.isEmpty(superviseRule)){ if(!ValidationUtil.isEmpty(superviseRule)){
jsonObject.put("inspectionUnit",orgServiceImpl.getdetialInfo(String.valueOf(superviseRule.getInspectionUnitId())).get("name")); jsonObject.put("inspectionUnit",orgServiceImpl.getdetialInfo(String.valueOf(superviseRule.getInspectionUnitId())).get("name"));
jsonObject.put("superviseDept",orgServiceImpl.getdetialInfo(String.valueOf(superviseRule.getSuperviseDeptId())).get("name")); jsonObject.put("superviseDept",orgServiceImpl.getdetialInfo(String.valueOf(superviseRule.getSuperviseDeptId())).get("name"));
...@@ -172,7 +190,7 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -172,7 +190,7 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
// jsonObject.put("installRegion",projectDto.getInstallRegion()); // jsonObject.put("installRegion",projectDto.getInstallRegion());
jsonObject.put("licenseNum",installNoticeDto.getLicenseNum()); jsonObject.put("licenseNum",installNoticeDto.getLicenseNum());
jsonObject.put("licenseCompany",installNoticeDto.getLicenseCompany()); jsonObject.put("licenseCompany",installNoticeDto.getLicenseCompany());
jsonObject.put("licenseAttch",JSON.parseArray(installNoticeDto.getLicenseAttch())); // jsonObject.put("licenseAttch",JSON.parseArray(installNoticeDto.getLicenseAttch()));
jsonObject.put("contractAttch",JSON.parseArray(installNoticeDto.getContractAttch())); jsonObject.put("contractAttch",JSON.parseArray(installNoticeDto.getContractAttch()));
jsonObject.put("installPri",installNoticeDto.getInstallPri()); jsonObject.put("installPri",installNoticeDto.getInstallPri());
jsonObject.put("projectId",map.get("sequenceNbr")); jsonObject.put("projectId",map.get("sequenceNbr"));
......
...@@ -176,6 +176,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua ...@@ -176,6 +176,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
for(Project project:projectResourceService.getProjectList()){ for(Project project:projectResourceService.getProjectList()){
projectIds.add(String.valueOf(project.getSequenceNbr())); projectIds.add(String.valueOf(project.getSequenceNbr()));
} }
qualityProblemMapper.getItems(new Page<>(1,2),new QualityProblemDto(),projectIds);
return qualityProblemMapper.qualityProblemStatistics(projectIds); return qualityProblemMapper.qualityProblemStatistics(projectIds);
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ugp.biz.service.impl; package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence; import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.yeejoin.amos.boot.module.ugp.api.mapper.UnitLicenceMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.UnitLicenceMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IUnitLicenceService; import com.yeejoin.amos.boot.module.ugp.api.service.IUnitLicenceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.List;
import java.util.Map;
/** /**
* 单位许可信息表 服务实现类 * 单位许可信息表 服务实现类
...@@ -15,4 +22,24 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +22,24 @@ import org.springframework.stereotype.Service;
@Service @Service
public class UnitLicenceServiceImpl extends ServiceImpl<UnitLicenceMapper, UnitLicence> implements IUnitLicenceService { public class UnitLicenceServiceImpl extends ServiceImpl<UnitLicenceMapper, UnitLicence> implements IUnitLicenceService {
@Autowired
OrgServiceImpl orgServiceImpl;
public JSONObject getLicenceByCompanyId(JSONObject jsonObject,Long companyId){
Map<String,String> installationMap = orgServiceImpl.getdetialInfo(String.valueOf(companyId));
String creditCode = "";
if(!ValidationUtil.isEmpty(installationMap)){
creditCode = installationMap.get("creditCode");
}
if (!ValidationUtil.isEmpty(creditCode)) {
List<UnitLicence> unitLicenceList = this.list(new LambdaQueryWrapper<UnitLicence>().eq(UnitLicence::getUnitCode,creditCode));
if(unitLicenceList.iterator().hasNext()){
UnitLicence unitLicence = unitLicenceList.iterator().next();
jsonObject.put("licenseCompany",unitLicence.getUnitName());
jsonObject.put("licenseNum",unitLicence.getCertNo());
}
}
return jsonObject;
}
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
...@@ -22,14 +23,22 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper; ...@@ -22,14 +23,22 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectInitiationService; import com.yeejoin.amos.boot.module.ugp.api.service.IProjectInitiationService;
import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService; import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.http.entity.ContentType;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -317,4 +326,34 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements ...@@ -317,4 +326,34 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
return weldDtos; return weldDtos;
} }
/**
* 获取焊口编号
* @return
*/
public IPage getWeldQRCode(String HKCode){
String url = "";
JSONObject jsonObject = new JSONObject();
byte[] bytes = QRCodeUtil.generateQRCodeImageByteData(HKCode,200);
InputStream inputStream = new ByteArrayInputStream(bytes);
try {
MultipartFile file = new MockMultipartFile(HKCode+".jpg",HKCode+".jpg", ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFileFree(file, "ugp/qrcode");
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
String urlString=it.next();
jsonObject.put("fileUrl", urlString);
jsonObject.put("fileName", map.get(urlString));
}
} catch (IOException e) {
e.printStackTrace();
}
List list = new ArrayList();
list.add(jsonObject);
IPage page = new Page(1,100);
page.setRecords(list);
return page;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment