Commit 3f7532b9 authored by Lambertliu's avatar Lambertliu

fix(jg):特殊登记修改

parent 39e78c5f
...@@ -940,16 +940,24 @@ ...@@ -940,16 +940,24 @@
ri."EQU_CATEGORY" = '2300' ri."EQU_CATEGORY" = '2300'
and ui."DATA_SOURCE" like 'jg%' and ui."DATA_SOURCE" like 'jg%'
and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1) and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.DATA_SOURCE != null and jsonObject.DATA_SOURCE != 'jg_his'">
and ui."DATA_SOURCE" like 'jg%'
and ui."DATA_SOURCE" not like 'jg_his%'
</if>
<if test="jsonObject.DATA_SOURCE != null and jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
</if>
<if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''"> <if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''">
and ui."DATA_SOURCE" like 'jg%' and ui."DATA_SOURCE" like 'jg%'
</if> </if>
<if test="jsonObject.DATA_SOURCE != null">
<choose>
<when test="jsonObject.DATA_SOURCE == 'jg_his_black'">
and ui."DATA_SOURCE" like 'jg_his_black%'
</when>
<when test="jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
and ui."DATA_SOURCE" not like 'jg_his_black%'
</when>
<otherwise>
and ui."DATA_SOURCE" like 'jg%'
and ui."DATA_SOURCE" not like 'jg_his%'
</otherwise>
</choose>
</if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备 -- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null"> <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
......
...@@ -108,6 +108,7 @@ import java.time.LocalDateTime; ...@@ -108,6 +108,7 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1334,26 +1335,33 @@ public class CommonServiceImpl implements ICommonService { ...@@ -1334,26 +1335,33 @@ public class CommonServiceImpl implements ICommonService {
@Override @Override
public Object invokeBusinessType(Map<String, Object> map) { public Object invokeBusinessType(Map<String, Object> map) {
String historyEquType = (String) map.get(HISTORY_EQU_TYPE); String historyEquType = (String) map.get(HISTORY_EQU_TYPE);
Map<String, Object> noticeObj = (Map<String, Object>) map.get(SECOND); JSONObject jsonObject = new JSONObject((Map<String, Object>) map.get(SECOND));
JSONObject jsonObject = new JSONObject(noticeObj); Map<String, Object> useRegFormUploadObj = (Map<String, Object>) map.get(useRegFormUpload);
switch (historyEquType) { String uploadMode = String.valueOf(useRegFormUploadObj.get("uploadMode"));
case "unit":
return jgUseRegistrationServiceImpl.handleUnitHistoryEquip(jsonObject); Map<String, Function<JSONObject, Object>> handlerMap = new HashMap<>();
case "vehicle": handlerMap.put("unit", jgUseRegistrationServiceImpl::handleUnitHistoryEquip);
return jgVehicleInformationService.saveOrUpdateHisData(jsonObject); handlerMap.put("vehicle", jgVehicleInformationService::saveOrUpdateHisData);
case "set_sp"://特殊历史登记 handlerMap.put("set_sp", obj -> handleSpecialRegistration(obj, useRegFormUploadObj, uploadMode,
Map<String, Object> useRegFormUploadObj = (Map<String, Object>) map.get(useRegFormUpload); jgUseRegistrationServiceImpl::handleUseRegistration));
jsonObject.put("regType", "2"); handlerMap.put("unit_sp", obj -> handleSpecialRegistration(obj, useRegFormUploadObj, uploadMode,
jsonObject.put("businessCode", "DJ_SY"); jgUseRegistrationServiceImpl::handleUnitUseRegistration));
String uploadMode = String.valueOf(useRegFormUploadObj.get("uploadMode")); return handlerMap.getOrDefault(historyEquType, jgUseRegistrationServiceImpl::handleHistoryEquip)
if (Integer.toString(1).equals(uploadMode)) { .apply(jsonObject);
jsonObject.put("submit", Boolean.TRUE); }
}
jsonObject.putAll(useRegFormUploadObj); /**
return jgUseRegistrationServiceImpl.handleUseRegistration(jsonObject); * 处理特殊登记逻辑
default: */
return jgUseRegistrationServiceImpl.handleHistoryEquip(jsonObject); private Object handleSpecialRegistration(JSONObject jsonObject, Map<String, Object> useRegFormUploadObj,
} String uploadMode, Function<JSONObject, Object> handler) {
jsonObject.put("regType", "2");
jsonObject.put("businessCode", "DJ_SY");
if ("1".equals(uploadMode)) {
jsonObject.put("submit", Boolean.TRUE);
}
jsonObject.putAll(useRegFormUploadObj);
return handler.apply(jsonObject);
} }
@Override @Override
......
...@@ -513,8 +513,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -513,8 +513,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.doubleValue() .doubleValue()
); );
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString()); // 历史黑设备新增由使用单位新增
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString()); if(dataSource.contains("black")){
projectContraption.setUseUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
} else {
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString());
}
projectContraption.setIsFirstMerge(false); projectContraption.setIsFirstMerge(false);
idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption); idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption);
...@@ -685,6 +691,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -685,6 +691,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setSTATUS("已认领"); esEquipmentDto.setSTATUS("已认领");
esEquipmentDto.setUSC_UNIT_CREDIT_CODE(projectContraption.getUscUnitCreditCode()); esEquipmentDto.setUSC_UNIT_CREDIT_CODE(projectContraption.getUscUnitCreditCode());
esEquipmentDto.setUSC_UNIT_NAME(projectContraption.getUscUnitName()); esEquipmentDto.setUSC_UNIT_NAME(projectContraption.getUscUnitName());
esEquipmentDto.setUSE_UNIT_CREDIT_CODE(projectContraption.getUseUnitCreditCode());
esEquipmentDto.setUSE_UNIT_NAME(projectContraption.getUseUnitName());
esEquipmentDto.setPROJECT_CONTRAPTION(projectContraption.getProjectContraption()); esEquipmentDto.setPROJECT_CONTRAPTION(projectContraption.getProjectContraption());
esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName()); esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(String.valueOf(sequenceNbr)); esEquipmentDto.setProjectContraptionId(String.valueOf(sequenceNbr));
...@@ -1166,11 +1174,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1166,11 +1174,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.filter(x -> "8300".equals(x.getDictDataKey())) .filter(x -> "8300".equals(x.getDictDataKey()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
// if (EquipmentClassifityEnum.YLGD.getCode().equals(equList) && "black".equals(dataSource)) { }
// return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream() if (EquipmentClassifityEnum.YLGD.getCode().equals(equList)) {
// .filter(x -> !"8300".equals(x.getDictDataKey())) return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream()
// .collect(Collectors.toList()); .sorted(Comparator.comparing(DictionarieValueModel::getDictDataKey, Comparator.reverseOrder()))
// } .collect(Collectors.toList());
} }
return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList); return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList);
} }
......
...@@ -925,6 +925,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -925,6 +925,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setApplyNo(listResponseModel.getResult().get(0)); useRegistration.setApplyNo(listResponseModel.getResult().get(0));
useRegistration.setAuditStatus("待提交"); useRegistration.setAuditStatus("待提交");
useRegistration.setStatus(WorkFlowStatusEnum.USE_SUBMIT.getPass()); useRegistration.setStatus(WorkFlowStatusEnum.USE_SUBMIT.getPass());
useRegistration.setRegType("2".equals(map.get("regType")) ? "2" : "0");
this.save(useRegistration); this.save(useRegistration);
} else { } else {
this.updateById(useRegistration); this.updateById(useRegistration);
......
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