Commit 25ae6d2f authored by suhuiguang's avatar suhuiguang

feat(jyjc): 报检结果接收调整

1.检验人员名称为空bug
parent 410908c7
...@@ -18,7 +18,6 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultAt ...@@ -18,7 +18,6 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultAt
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultServiceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionCylinderAttachment; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionCylinderAttachment;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgInspectionCylinderAttachmentMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgInspectionCylinderAttachmentMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgInspectionDetectionInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgInspectionDetectionInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper;
...@@ -31,7 +30,6 @@ import java.util.Collections; ...@@ -31,7 +30,6 @@ import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
...@@ -151,8 +149,8 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc ...@@ -151,8 +149,8 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc
info.setRecord(jyjcInspectionResult.getEquipUnicode()); info.setRecord(jyjcInspectionResult.getEquipUnicode());
info.setInspectReport(this.getReport(jyjcInspectionResult)); info.setInspectReport(this.getReport(jyjcInspectionResult));
info.setInspectDate(jyjcInspectionResult.getInspectionDate()); info.setInspectDate(jyjcInspectionResult.getInspectionDate());
info.setInspectStaff(getInspectUserName(jyjcInspectionResult));
info.setInspectStaffCode(jyjcInspectionResult.getInspector()); info.setInspectStaffCode(jyjcInspectionResult.getInspector());
info.setInspectStaff(commonService.getInspectUserName(jyjcInspectionResult.getInspector()));
info.setInspectConclusion(jyjcInspectionResult.getInspectionConclusion()); info.setInspectConclusion(jyjcInspectionResult.getInspectionConclusion());
info.setProblemRemark(jyjcInspectionResult.getNonConformance()); info.setProblemRemark(jyjcInspectionResult.getNonConformance());
info.setNextInspectDate(jyjcInspectionResult.getNextInspectionDate()); info.setNextInspectDate(jyjcInspectionResult.getNextInspectionDate());
...@@ -167,9 +165,4 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc ...@@ -167,9 +165,4 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc
JyjcInspectionResultAttachment jybgFile = inspectionResultService.getReportAttachment(jyjcInspectionResult.getSequenceNbr()); JyjcInspectionResultAttachment jybgFile = inspectionResultService.getReportAttachment(jyjcInspectionResult.getSequenceNbr());
return jybgFile.getAttachmentUrl(); return jybgFile.getAttachmentUrl();
} }
private String getInspectUserName(JyjcInspectionResult model) {
List<TzsUserInfo> userInfos = commonService.getUserInfosByUnitCode(model.getInspectionUnitCode());
return userInfos.stream().filter(u -> model.getInspector().contains(u.getSequenceNbr() + "")).map(TzsUserInfo::getName).collect(Collectors.joining(","));
}
} }
...@@ -421,13 +421,13 @@ public class CommonServiceImpl { ...@@ -421,13 +421,13 @@ public class CommonServiceImpl {
info.setInspectOrgName(model.getInspectionUnitName()); info.setInspectOrgName(model.getInspectionUnitName());
info.setInspectType(model.getInspectionType()); info.setInspectType(model.getInspectionType());
info.setRecord(record); info.setRecord(record);
info.setResultSeq(model.getSequenceNbr() + "");
info.setInspectDate(model.getInspectionDate()); info.setInspectDate(model.getInspectionDate());
info.setInspectStaff(getInspectUserName(model));
info.setInspectStaffCode(model.getInspector()); info.setInspectStaffCode(model.getInspector());
info.setInspectStaff(getInspectUserName(model.getInspector()));
info.setInspectReport(jybgFile.getAttachmentUrl()); info.setInspectReport(jybgFile.getAttachmentUrl());
info.setInspectConclusion(model.getInspectionConclusion()); info.setInspectConclusion(model.getInspectionConclusion());
// json字段暂时注释 info.setProblemRemark(model.getNonConformance());
// info.setProblemRemark(model.getNonConformance());
info.setNextInspectDate(model.getNextInspectionDate()); info.setNextInspectDate(model.getNextInspectionDate());
info.setSequenceCode(record); info.setSequenceCode(record);
info.setInspectOrgCode(model.getInspectionUnitCode()); info.setInspectOrgCode(model.getInspectionUnitCode());
...@@ -440,8 +440,8 @@ public class CommonServiceImpl { ...@@ -440,8 +440,8 @@ public class CommonServiceImpl {
info.setInspectType(model.getInspectionType()); info.setInspectType(model.getInspectionType());
info.setRecord(record); info.setRecord(record);
info.setInspectDate(model.getInspectionDate()); info.setInspectDate(model.getInspectionDate());
info.setInspectStaff(getInspectUserName(model));
info.setInspectStaffCode(model.getInspector()); info.setInspectStaffCode(model.getInspector());
info.setInspectStaff(getInspectUserName(model.getInspector()));
info.setInspectReport(jybgFile.getAttachmentUrl()); info.setInspectReport(jybgFile.getAttachmentUrl());
info.setInspectConclusion(model.getInspectionConclusion()); info.setInspectConclusion(model.getInspectionConclusion());
info.setResultSeq(model.getSequenceNbr() + ""); info.setResultSeq(model.getSequenceNbr() + "");
...@@ -453,14 +453,20 @@ public class CommonServiceImpl { ...@@ -453,14 +453,20 @@ public class CommonServiceImpl {
info.setRecDate(new Date()); info.setRecDate(new Date());
} }
private String getInspectUserName(JyjcInspectionResult model) {
List<TzsUserInfo> userInfos = this.getUserInfosByUnitCode(model.getInspectionUnitCode()); public String getInspectUserName(String inspector) {
return userInfos.stream().filter(u -> model.getInspector().contains(u.getSequenceNbr() + "")).map(TzsUserInfo::getName).collect(Collectors.joining(",")); if(StringUtils.isNotBlank(inspector)) {
List<TzsUserInfo> userInfos = this.getUserInfosByIds(inspector);
return userInfos.stream().map(TzsUserInfo::getName).collect(Collectors.joining(","));
}
return "";
} }
private String getInspectUserName(JyjcInspectionResultModel model) { private List<TzsUserInfo> getUserInfosByIds(String inspector) {
List<TzsUserInfo> userInfos = this.getUserInfosByUnitCode(model.getInspectionUnitCode()); LambdaQueryWrapper<TzsUserInfo> userInfoQueryWrapper = new LambdaQueryWrapper<>();
return userInfos.stream().filter(u -> model.getInspector().contains(u.getSequenceNbr() + "")).map(TzsUserInfo::getName).collect(Collectors.joining(",")); userInfoQueryWrapper.in(TzsUserInfo::getSequenceNbr, Arrays.asList(inspector.split(",")));
userInfoQueryWrapper.select(BaseEntity::getSequenceNbr, TzsUserInfo::getName);
return userInfoMapper.selectList(userInfoQueryWrapper);
} }
/** /**
......
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