Commit af8d4eee authored by yangyang's avatar yangyang

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 5771f33c 2d094de9
......@@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Update;
* @date 2023-12-20
*/
public interface JgChangeRegistrationReformEqMapper extends BaseMapper<JgChangeRegistrationReformEq> {
@Update("update jg_change_registration_reform set is_invalid = 1 where equ_id = #{equipId} and equip_transfer_id != #{currentDocumentId} ")
@Update("update tzs_jg_change_registration_reform_eq set is_invalid = 1 where equ_id = #{equipId} and equip_transfer_id != #{currentDocumentId} ")
void updateEquipIsVaildByEquipIdAndCurrentDocumentId(@Param("equipId") String equipId, @Param("currentDocumentId") String currentDocumentId);
}
......@@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Select;
* @date 2023-12-20
*/
public interface JgRegistrationHistoryMapper extends BaseMapper<JgRegistrationHistory> {
@Select("select sequence_nbr from jg_registration_history where equ_id = #{equid} and current_document_id = #{documentId}")
@Select("select sequence_nbr from tzs_jg_registration_history where equ_id = #{equid} and current_document_id = #{documentId}")
Long getSequenceNbrByEquidAndDocumentId(@Param("equid") String equid, @Param("documentId") String documentId);
}
......@@ -426,7 +426,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String param = map.getString("SEQUENCE_NBR");
String[] split = param.split(",");
for (String seq : split) {
seqBuilder.should(QueryBuilders.termQuery("SEQUENCE_NBR", seq));
seqBuilder.should(QueryBuilders.termQuery("SEQUENCE_NBR.keyword", seq));
}
seqBuilder.minimumShouldMatch(1);
boolMust.must(seqBuilder);
......
......@@ -148,7 +148,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = new JgChangeRegistrationReformEq();
jgChangeRegistrationReformEq.setEquId(map.get("equipId").toString());
// jgRelationEquip.setBusinessType(String.valueOf(BusinessTypeEnum.USAGE_REGISTRATION.getCode()));
List<String> applicationFormCode = iCreateCodeService.createApplicationFormCode(ApplicationFormTypeEnum.SYDJ.getCode(), 1);
List<String> applicationFormCode = iCreateCodeService.createApplicationFormCode(ApplicationFormTypeEnum.GZBG.getCode(), 1);
jgChangeRegistrationReform.setApplyNo(applicationFormCode.get(0));
jgChangeRegistrationReform.setAuditStatus("待提交");
jgChangeRegistrationReform.setStatus(FlowStatusEnum.TO_BE_SUBMITTED.getName());
......@@ -190,7 +190,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
//启动流程
try {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("useRegistration");
dto.setProcessDefinitionKey("renovationRegistrationReview");
dto.setBusinessKey("submit");
AjaxResult ajaxResult = Workflow.taskClient.startByVariable(dto);
instanceId = ((Map) ajaxResult.get("data")).get("id").toString();
......@@ -325,7 +325,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
Map<String, Object> detail = this.baseMapper.getDetail(id);
Map<String, Object> inspectDetail = this.baseMapper.getInspectDetail(id);
Map<String, Object> useDetail = this.baseMapper.getUseDetail(id);
if(detail.get("").equals("已完成")){
if(detail.get("status").equals("已完成")){
}else {
}
detail.putAll(inspectDetail);
......@@ -358,8 +360,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
* @param currentDocumentId
*/
public void updateTechparamsByEquIdAndCurrentDoucumentId(String equipId, String currentDocumentId){
ResponseModel<String> responseModel = tzsServiceFeignClient.useRegistrationCode(idxBizJgOtherInfoMapper.getSupervisoryCodeByEquipmentCode(equipId));
String newUseRegistrationCertificateNumber=responseModel.getResult().split("-")[0];
String useOrgCode = idxBizJgOtherInfoMapper.getSupervisoryCodeByEquipmentCode(equipId).split("-")[0];
ResponseModel<String> responseModel = tzsServiceFeignClient.useRegistrationCode(useOrgCode);
String newUseRegistrationCertificateNumber=responseModel.getResult();
IdxBizJgTechParamsElevator idxBizJgTechParamsElevator =idxBizJgTechParamsElevatorMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsElevator>().eq("RECORD",equipId));
JgRegistrationHistory jgRegistrationHistory=jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>()
.eq("equ_id",equipId)
......@@ -373,7 +376,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
String newData = jgRegistrationHistory.getChangeData();
//将历史数据更新到技术参数表中
IdxBizJgTechParamsElevator idxBizJgTechParamsElevatorNew = JSONObject.parseObject(newData,IdxBizJgTechParamsElevator.class);
BeanUtil.copyProperties(idxBizJgTechParamsElevatorNew,idxBizJgTechParamsElevator, "SEQUENCE_NBR","RECORD");
BeanUtil.copyProperties(idxBizJgTechParamsElevatorNew,idxBizJgTechParamsElevator, "sequenceNbr","record");
idxBizJgTechParamsElevatorMapper.updateById(idxBizJgTechParamsElevator);
//将历史数据回填到历史记录表中
jgRegistrationHistory.setChangeData(historyData);
......
......@@ -26,10 +26,12 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultServic
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -54,6 +56,7 @@ import java.util.stream.Collectors;
public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel, JyjcInspectionResult, JyjcInspectionResultMapper> implements IJyjcInspectionResultService {
private static final String JYJC_SUBMIT_FILE_PREFIX = "JYJC_";
private static final String JYJC_SUBMIT_FILE_JYBG = "JYBG";
private static final String JYJC_SUBMIT_KEY = "inspectResult";
private static final String JYJC_RESULT_STATUS = "2";
......@@ -88,6 +91,9 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
@Autowired
private Sequence sequence;
@Autowired
TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
/**
* 检验检测单位分页查询
*/
......@@ -137,6 +143,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
LambdaQueryWrapper<JyjcInspectionResultAttachment> fileWrapper = new LambdaQueryWrapper<>();
fileWrapper.eq(JyjcInspectionResultAttachment::getResultSeq, model.getSequenceNbr());
List<JyjcInspectionResultAttachment> fileList = attachmentService.list(fileWrapper);
JyjcInspectionResultAttachment jybgFile = new JyjcInspectionResultAttachment();
map.forEach((k, v) -> {
if (k.contains(JYJC_SUBMIT_FILE_PREFIX)) {
......@@ -153,6 +160,10 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
}
attachmentList.add(attachment);
if (k.contains(JYJC_SUBMIT_FILE_JYBG)) {
jybgFile.setAttachmentUrl(JSON.toJSONString(map.get(k)));
attachment.setAttachmentType(k);
}
}
});
if (!CollectionUtils.isEmpty(attachmentList)) {
......@@ -187,27 +198,36 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
wrapper.lambda().eq(InspectionDetectionInfo::getInspectReportNo, model.getResultNo());
List<InspectionDetectionInfo> list = inspectionDetectionInfoMapper.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
extracted(model, info);
extracted(model, info, jybgFile);
info.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfoMapper.insert(info);
} else {
info = list.get(0);
extracted(model, info);
extracted(model, info, jybgFile);
inspectionDetectionInfoMapper.updateById(info);
}
return model;
}
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info) {
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info, JyjcInspectionResultAttachment jybgFile ) {
// 回填检验机构名称
LambdaQueryWrapper<TzBaseEnterpriseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseEnterpriseInfo::getUseCode, model.getInspectionUnitCode());
List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfos = tzBaseEnterpriseInfoMapper.selectList(wrapper);
if (!CollectionUtils.isEmpty(tzBaseEnterpriseInfos)) {
info.setInspectOrgName(tzBaseEnterpriseInfos.get(0).getUseUnit());
}
info.setInspectType(model.getInspectionType());
info.setInspectOrgName(model.getInspectionUnitCode());
info.setRecord(model.getEquipUnicode());
info.setInspectDate(model.getInspectionDate());
info.setInspectStaff(model.getInspector());
info.setInspectReport(jybgFile.getAttachmentUrl());
info.setInspectConclusion(model.getInspectionConclusion());
info.setProblemRemark(model.getNonConformance());
info.setNextInspectDate(model.getNextInspectionDate());
info.setSequenceCode(model.getEquipUnicode());
info.setInspectOrgCode(model.getUseUnitCreditCode());
info.setInspectOrgCode(model.getInspectionUnitCode());
info.setInspectReportNo(model.getResultNo());
info.setRecDate(new Date());
}
......
......@@ -16,6 +16,6 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
@Select("select use_org_code from idx_biz_jg_register_info where record = #{equipCode}")
String getUseOrgCodeByEquip(@Param("equipCode") String equipCode);
@Select("updateidx_biz_jg_register_info set use_org_code = #{useOrgCode} where record = #{equipCode}")
@Select("update idx_biz_jg_register_info set use_org_code = #{useOrgCode} where record = #{equipCode}")
Boolean updateUseOrgCodeByEquip(@Param("equipCode") String equipCode,@Param("useOrgCode") String useOrgCode);
}
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