Commit 20555cb8 authored by zhangyingbin's avatar zhangyingbin

修改告知回显接口,修改焊口码列表筛选接口

parent 5a36dbc7
...@@ -73,7 +73,7 @@ public class InstallNoticeController extends BaseController { ...@@ -73,7 +73,7 @@ public class InstallNoticeController extends BaseController {
UnitLicenceServiceImpl unitLicenceService; UnitLicenceServiceImpl unitLicenceService;
@Resource @Resource
private IInstallNoticeService iInstallNoticeService; private InstallNoticeServiceImpl iInstallNoticeService;
@Resource @Resource
private IPipeServiceImpl pipeService; private IPipeServiceImpl pipeService;
...@@ -409,56 +409,13 @@ public class InstallNoticeController extends BaseController { ...@@ -409,56 +409,13 @@ public class InstallNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getInfoByProjectId") @GetMapping(value = "/getInfoByProjectId")
@ApiOperation(value = "告知页面回显内容", notes = "告知页面回显内容") @ApiOperation(value = "告知页面回显内容", notes = "告知页面回显内容")
public ResponseModel<InstallNoticeDto> getInfoByProjectId(@RequestParam("sequenceNbr") Long projectId) { public ResponseModel<JSONObject> getInfoByProjectId(@RequestParam("sequenceNbr") Long projectId) {
if (ObjectUtils.isEmpty(projectId)) { if (ObjectUtils.isEmpty(projectId)) {
return null; return null;
} }
LambdaQueryWrapper<InstallNotice> lambdaQueryWrapper = new LambdaQueryWrapper<>(); JSONObject jsonObject = new JSONObject();
lambdaQueryWrapper.eq(InstallNotice::getProjectId, projectId); jsonObject.put("installNoticeInfo",iInstallNoticeService.getInfoByProjectId(projectId));
lambdaQueryWrapper.eq(InstallNotice::getIsDelete, Boolean.FALSE); jsonObject.put("projectInfo",projectServiceImpl.selectById(projectId));
InstallNotice one = iInstallNoticeService.getOne(lambdaQueryWrapper); return ResponseHelper.buildResponse(jsonObject);
ProjectDto projectDto = projectServiceImpl.getDetail(projectId);
InstallNoticeDto installNoticeDto = new InstallNoticeDto();
if (ObjectUtils.isNotEmpty(one)) {
BeanUtils.copyProperties(one, installNoticeDto);
}
installNoticeDto.setEquipPosition(projectDto.getAddress());
installNoticeDto.setImplementDate(projectDto.getStartDate());
installNoticeDto.setConstructionUnit(projectDto.getInstallationUnit());
installNoticeDto.setUseUnitName(orgServiceImpl.getOrgUsr().getBizOrgName());
//查询设备型号(参数)
LambdaQueryWrapper<Pipe> lambda = new LambdaQueryWrapper<>();
lambda.eq(Pipe::getProjectId, projectId);
lambda.eq(Pipe::getIsDelete, Boolean.FALSE);
List<Pipe> list = pipeService.list(lambda);
String specifications = list.stream().map(Pipe::getSpecification).distinct().collect(Collectors.joining(","));
installNoticeDto.setEquipType(specifications);
//查询制造单位信息
LambdaQueryWrapper<ProjectResource> lambdaProjectResource = new LambdaQueryWrapper<>();
lambdaProjectResource.eq(ProjectResource::getProjectId, projectId);
lambdaProjectResource.eq(ProjectResource::getType, ProjectResourceEnum.管材资源.getCode());
lambdaProjectResource.eq(ProjectResource::getIsDelete, 0);
List<Long> collect1 = projectResourceService.list(lambdaProjectResource).stream().map(ProjectResource::getResourceId).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect1)) {
LambdaQueryWrapper<Material> materialLambdaQueryWrapper = new LambdaQueryWrapper<>();
materialLambdaQueryWrapper.in(Material::getSequenceNbr, collect1);
materialLambdaQueryWrapper.eq(Material::getIsDelete, Boolean.FALSE);
List<String> collect = materialService.list(materialLambdaQueryWrapper).stream().map(Material::getManufacturer).distinct().collect(Collectors.toList());
ResponseModel<List<UnitLicence>> licenceByCompanyName = tzsServiceFeignClient.getLicenceByCompanyName(collect);
String manufacturers = String.join(",", collect);
String cerNos = licenceByCompanyName.getResult().stream().map(UnitLicence::getCertNo).collect(Collectors.joining(","));
installNoticeDto.setMadeUnit(manufacturers);
installNoticeDto.setMadeLicenceCode(cerNos);
}
List<String> list1 = Collections.singletonList(projectDto.getInstallationUnit());
ResponseModel<List<UnitLicence>> buildLicenceInfo = tzsServiceFeignClient.getLicenceByCompanyName(list1);
String buildLicenceCode = buildLicenceInfo.getResult().stream().map(UnitLicence::getCertNo).collect(Collectors.joining(","));
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN);
String collect = buildLicenceInfo.getResult().stream().map(t -> sdf.format(t.getExpiryDate())).collect(Collectors.joining(","));
installNoticeDto.setBuildLicenceCode(buildLicenceCode);
installNoticeDto.setBuildLicenceDateLine(collect);
installNoticeDto.setProjectId(projectId);
installNoticeDto.setInstanceId(projectDto.getInstanceId());
return ResponseHelper.buildResponse(installNoticeDto);
} }
} }
...@@ -179,8 +179,8 @@ public class WeldController extends BaseController { ...@@ -179,8 +179,8 @@ public class WeldController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "查看焊口编码", notes = "查看焊口编码") @ApiOperation(httpMethod = "GET", value = "查看焊口编码", notes = "查看焊口编码")
@GetMapping(value = "/lookCode") @GetMapping(value = "/lookCode")
public ResponseModel<IPage<Weld>> lookCode(long current,long size,String projectId) { public ResponseModel<IPage<Weld>> lookCode(long current,long size,String projectId, WeldDto weldDto) {
return ResponseHelper.buildResponse(weldServiceImpl.lookCode(current,size,projectId)); return ResponseHelper.buildResponse(weldServiceImpl.lookCode(current,size,projectId,weldDto));
} }
/** /**
...@@ -190,8 +190,8 @@ public class WeldController extends BaseController { ...@@ -190,8 +190,8 @@ public class WeldController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "查看焊口编码", notes = "查看焊口编码") @ApiOperation(httpMethod = "GET", value = "查看焊口编码", notes = "查看焊口编码")
@GetMapping(value = "/weldInfos") @GetMapping(value = "/weldInfos")
public ResponseModel<IPage<WeldDto>> getWeldInfoByProjectId(long current,long size,String projectId) { public ResponseModel<IPage<WeldDto>> getWeldInfoByProjectId(long current,long size,String projectId, WeldDto weldDto) {
return ResponseHelper.buildResponse(weldServiceImpl.getWeldInfoByProjectId(current,size,projectId)); return ResponseHelper.buildResponse(weldServiceImpl.getWeldInfoByProjectId(current,size,projectId,weldDto));
} }
/** /**
......
...@@ -4,18 +4,20 @@ import com.alibaba.fastjson.JSON; ...@@ -4,18 +4,20 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; 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.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil; 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.Enum.ProjectResourceEnum;
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.*;
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.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.fegin.TzsServiceFeignClient;
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.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
...@@ -40,7 +42,9 @@ import java.io.ByteArrayInputStream; ...@@ -40,7 +42,9 @@ import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.sql.Wrapper; import java.sql.Wrapper;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 安装告知表服务实现类 * 安装告知表服务实现类
...@@ -65,6 +69,18 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -65,6 +69,18 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
SuperviseRuleServiceImpl superviseRuleServiceImpl; SuperviseRuleServiceImpl superviseRuleServiceImpl;
@Autowired @Autowired
UnitLicenceServiceImpl unitLicenceService; UnitLicenceServiceImpl unitLicenceService;
@Autowired
IPipeServiceImpl pipeService;
@Autowired
ProjectResourceServiceImpl projectResourceService;
@Autowired
MaterialServiceImpl materialService;
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -196,4 +212,54 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -196,4 +212,54 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
jsonObject.put("projectId",map.get("sequenceNbr")); jsonObject.put("projectId",map.get("sequenceNbr"));
return jsonObject; return jsonObject;
} }
public InstallNoticeDto getInfoByProjectId(Long projectId){
LambdaQueryWrapper<InstallNotice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(InstallNotice::getProjectId, projectId);
lambdaQueryWrapper.eq(InstallNotice::getIsDelete, Boolean.FALSE);
InstallNotice one = this.getOne(lambdaQueryWrapper);
ProjectDto projectDto = projectServiceImpl.getDetail(projectId);
InstallNoticeDto installNoticeDto = new InstallNoticeDto();
if (ObjectUtils.isNotEmpty(one)) {
BeanUtils.copyProperties(one, installNoticeDto);
}
installNoticeDto.setEquipPosition(projectDto.getAddress());
installNoticeDto.setImplementDate(projectDto.getStartDate());
installNoticeDto.setConstructionUnit(projectDto.getInstallationUnit());
installNoticeDto.setUseUnitName(orgServiceImpl.getOrgUsr().getBizOrgName());
//查询设备型号(参数)
LambdaQueryWrapper<Pipe> lambda = new LambdaQueryWrapper<>();
lambda.eq(Pipe::getProjectId, projectId);
lambda.eq(Pipe::getIsDelete, Boolean.FALSE);
List<Pipe> list = pipeService.list(lambda);
String specifications = list.stream().map(Pipe::getSpecification).distinct().collect(Collectors.joining(","));
installNoticeDto.setEquipType(specifications);
//查询制造单位信息
LambdaQueryWrapper<ProjectResource> lambdaProjectResource = new LambdaQueryWrapper<>();
lambdaProjectResource.eq(ProjectResource::getProjectId, projectId);
lambdaProjectResource.eq(ProjectResource::getType, ProjectResourceEnum.管材资源.getCode());
lambdaProjectResource.eq(ProjectResource::getIsDelete, 0);
List<Long> collect1 = projectResourceService.list(lambdaProjectResource).stream().map(ProjectResource::getResourceId).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect1)) {
LambdaQueryWrapper<Material> materialLambdaQueryWrapper = new LambdaQueryWrapper<>();
materialLambdaQueryWrapper.in(Material::getSequenceNbr, collect1);
materialLambdaQueryWrapper.eq(Material::getIsDelete, Boolean.FALSE);
List<String> collect = materialService.list(materialLambdaQueryWrapper).stream().map(Material::getManufacturer).distinct().collect(Collectors.toList());
ResponseModel<List<UnitLicence>> licenceByCompanyName = tzsServiceFeignClient.getLicenceByCompanyName(collect);
String manufacturers = String.join(",", collect);
String cerNos = licenceByCompanyName.getResult().stream().map(UnitLicence::getCertNo).collect(Collectors.joining(","));
installNoticeDto.setMadeUnit(manufacturers);
installNoticeDto.setMadeLicenceCode(cerNos);
}
List<String> list1 = Collections.singletonList(projectDto.getInstallationUnit());
ResponseModel<List<UnitLicence>> buildLicenceInfo = tzsServiceFeignClient.getLicenceByCompanyName(list1);
String buildLicenceCode = buildLicenceInfo.getResult().stream().map(UnitLicence::getCertNo).collect(Collectors.joining(","));
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN);
String collect = buildLicenceInfo.getResult().stream().map(t -> sdf.format(t.getExpiryDate())).collect(Collectors.joining(","));
installNoticeDto.setBuildLicenceCode(buildLicenceCode);
installNoticeDto.setBuildLicenceDateLine(collect);
installNoticeDto.setProjectId(projectId);
installNoticeDto.setInstanceId(projectDto.getInstanceId());
return installNoticeDto;
}
} }
\ No newline at end of file
...@@ -235,18 +235,19 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements ...@@ -235,18 +235,19 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
/** /**
* 通过项目id获取焊口编码 * 通过项目id获取焊口编码
*/ */
public IPage<Weld> lookCode(long current,long size,String projectId){ public IPage<Weld> lookCode(long current,long size,String projectId, WeldDto weldDto){
IPage<Weld> page = new Page<>(); IPage<Weld> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Weld::getProjectId,projectId); wrapper.eq(Weld::getProjectId,projectId);
getWeldWapper(wrapper,weldDto);
IPage<Weld> weldPage = this.page(page,wrapper); IPage<Weld> weldPage = this.page(page,wrapper);
return weldPage; return weldPage;
} }
public IPage<WeldDto> getWeldInfoByProjectId(long current,long size,String projectId){ public IPage<WeldDto> getWeldInfoByProjectId(long current,long size,String projectId, WeldDto weldDto){
IPage<Weld> weldPage = lookCode(current,size,projectId); IPage<Weld> weldPage = lookCode(current,size,projectId,weldDto);
List<WeldDto> weldDtos = getWeldVerify(weldPage); List<WeldDto> weldDtos = getWeldVerify(weldPage);
IPage<WeldDto> page = new Page<>(); IPage<WeldDto> page = new Page<>();
BeanUtils.copyProperties(weldPage, page); BeanUtils.copyProperties(weldPage, page);
...@@ -263,6 +264,7 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements ...@@ -263,6 +264,7 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
String weldCode = weld.getCode(); String weldCode = weld.getCode();
LambdaQueryWrapper<Verify> wapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Verify> wapper = new LambdaQueryWrapper<>();
wapper.eq(Verify::getCode,weldCode); wapper.eq(Verify::getCode,weldCode);
List<Verify> verifyList = verifyService.list(wapper); List<Verify> verifyList = verifyService.list(wapper);
for (Verify verify : verifyList) { for (Verify verify : verifyList) {
if(StageEnum.焊前人员.getStage().equals(verify.getStage())){ if(StageEnum.焊前人员.getStage().equals(verify.getStage())){
...@@ -319,6 +321,15 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements ...@@ -319,6 +321,15 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
return weldDtos; return weldDtos;
} }
public void getWeldWapper(LambdaQueryWrapper<Weld> wapper,WeldDto weldDto){
if(!ValidationUtil.isEmpty(weldDto.getCode())){
wapper.eq(Weld::getCode,weldDto.getCode());
}
if(!ValidationUtil.isEmpty(weldDto.getStatus())){
wapper.eq(Weld::getStatus,weldDto.getStatus());
}
}
/** /**
* 通过项目id获取焊口智能监验信息 * 通过项目id获取焊口智能监验信息
......
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