Commit 3f7532b9 authored by Lambertliu's avatar Lambertliu

fix(jg):特殊登记修改

parent 39e78c5f
......@@ -940,15 +940,23 @@
ri."EQU_CATEGORY" = '2300'
and ui."DATA_SOURCE" like 'jg%'
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'">
<if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''">
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'">
<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%'
</if>
<if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''">
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)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
......
......@@ -108,6 +108,7 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
......@@ -1334,26 +1335,33 @@ public class CommonServiceImpl implements ICommonService {
@Override
public Object invokeBusinessType(Map<String, Object> map) {
String historyEquType = (String) map.get(HISTORY_EQU_TYPE);
Map<String, Object> noticeObj = (Map<String, Object>) map.get(SECOND);
JSONObject jsonObject = new JSONObject(noticeObj);
switch (historyEquType) {
case "unit":
return jgUseRegistrationServiceImpl.handleUnitHistoryEquip(jsonObject);
case "vehicle":
return jgVehicleInformationService.saveOrUpdateHisData(jsonObject);
case "set_sp"://特殊历史登记
JSONObject jsonObject = new JSONObject((Map<String, Object>) map.get(SECOND));
Map<String, Object> useRegFormUploadObj = (Map<String, Object>) map.get(useRegFormUpload);
String uploadMode = String.valueOf(useRegFormUploadObj.get("uploadMode"));
Map<String, Function<JSONObject, Object>> handlerMap = new HashMap<>();
handlerMap.put("unit", jgUseRegistrationServiceImpl::handleUnitHistoryEquip);
handlerMap.put("vehicle", jgVehicleInformationService::saveOrUpdateHisData);
handlerMap.put("set_sp", obj -> handleSpecialRegistration(obj, useRegFormUploadObj, uploadMode,
jgUseRegistrationServiceImpl::handleUseRegistration));
handlerMap.put("unit_sp", obj -> handleSpecialRegistration(obj, useRegFormUploadObj, uploadMode,
jgUseRegistrationServiceImpl::handleUnitUseRegistration));
return handlerMap.getOrDefault(historyEquType, jgUseRegistrationServiceImpl::handleHistoryEquip)
.apply(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");
String uploadMode = String.valueOf(useRegFormUploadObj.get("uploadMode"));
if (Integer.toString(1).equals(uploadMode)) {
if ("1".equals(uploadMode)) {
jsonObject.put("submit", Boolean.TRUE);
}
jsonObject.putAll(useRegFormUploadObj);
return jgUseRegistrationServiceImpl.handleUseRegistration(jsonObject);
default:
return jgUseRegistrationServiceImpl.handleHistoryEquip(jsonObject);
}
return handler.apply(jsonObject);
}
@Override
......
......@@ -513,8 +513,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.doubleValue()
);
// 历史黑设备新增由使用单位新增
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);
idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption);
......@@ -685,6 +691,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setSTATUS("已认领");
esEquipmentDto.setUSC_UNIT_CREDIT_CODE(projectContraption.getUscUnitCreditCode());
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.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(String.valueOf(sequenceNbr));
......@@ -1166,11 +1174,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.filter(x -> "8300".equals(x.getDictDataKey()))
.collect(Collectors.toList());
}
// if (EquipmentClassifityEnum.YLGD.getCode().equals(equList) && "black".equals(dataSource)) {
// return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream()
// .filter(x -> !"8300".equals(x.getDictDataKey()))
// .collect(Collectors.toList());
// }
}
if (EquipmentClassifityEnum.YLGD.getCode().equals(equList)) {
return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream()
.sorted(Comparator.comparing(DictionarieValueModel::getDictDataKey, Comparator.reverseOrder()))
.collect(Collectors.toList());
}
return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList);
}
......
......@@ -925,6 +925,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setApplyNo(listResponseModel.getResult().get(0));
useRegistration.setAuditStatus("待提交");
useRegistration.setStatus(WorkFlowStatusEnum.USE_SUBMIT.getPass());
useRegistration.setRegType("2".equals(map.get("regType")) ? "2" : "0");
this.save(useRegistration);
} else {
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