Commit 9f538f19 authored by tianyiming's avatar tianyiming

一码通更新功能修改

parent 5eddb4ea
...@@ -452,7 +452,7 @@ ...@@ -452,7 +452,7 @@
USE_UNIT_CREDIT_CODE, USE_UNIT_CREDIT_CODE,
USE_UNIT_NAME, USE_UNIT_NAME,
RECORD as id, RECORD as id,
RECORD as sequenceNbr SEQUENCE_NBR as sequenceNbr
from idx_biz_jg_use_info from idx_biz_jg_use_info
where RECORD = #{record} where RECORD = #{record}
</select> </select>
...@@ -467,7 +467,7 @@ ...@@ -467,7 +467,7 @@
jdi.DESIGN_UNIT_NAME, jdi.DESIGN_UNIT_NAME,
jdi.DESIGN_USE_DATE, jdi.DESIGN_USE_DATE,
jdi.DRAWING_DO, jdi.DRAWING_DO,
jdi.RECORD as sequenceNbr, jdi.SEQUENCE_NBR as sequenceNbr,
jdi.RECORD as id, jdi.RECORD as id,
jfi.FACTORY_NUM, jfi.FACTORY_NUM,
jfi.FACTORY_STANDARD, jfi.FACTORY_STANDARD,
...@@ -549,7 +549,7 @@ ...@@ -549,7 +549,7 @@
jri.ENGINE_NUMBER, jri.ENGINE_NUMBER,
jri.MOTOR_NUMBER, jri.MOTOR_NUMBER,
jri.RECORD as id, jri.RECORD as id,
jri.RECORD as sequenceNbr, jri.SEQUENCE_NBR as sequenceNbr,
t.* t.*
from idx_biz_jg_register_info jri from idx_biz_jg_register_info jri
LEFT JOIN ${tableName} t on jri.RECORD = t.RECORD LEFT JOIN ${tableName} t on jri.RECORD = t.RECORD
......
...@@ -56,6 +56,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext; ...@@ -56,6 +56,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.DateUtil; import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException; import java.io.IOException;
...@@ -186,7 +187,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -186,7 +187,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private static final String COPY_KEY = "stashType"; private static final String COPY_KEY = "stashType";
@Autowired @Autowired
RestHighLevelClient restHighLevelClient; RestHighLevelClient restHighLevelClient;
private static String USE_CODE = "use_code"; private static String USE_CODE = "use_code";
...@@ -453,11 +454,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -453,11 +454,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String useOrgCode = (String) obj.get("USE_ORG_CODE"); String useOrgCode = (String) obj.get("USE_ORG_CODE");
String record = (String) obj.get("id"); String record = (String) obj.get("id");
Map<String, Long> map = categoryOtherInfoMapper.checkCode(type, code96333, equCode, useOrgCode, record); Map<String, Long> map = categoryOtherInfoMapper.checkCode(type, code96333, equCode, useOrgCode, record);
if(map.containsKey("equCode") && map.get("equCode") > 0){ if (map.containsKey("equCode") && map.get("equCode") > 0) {
result = "设备代码重复,请确认数据是否输入正确,或联系管辖机构处理。"; result = "设备代码重复,请确认数据是否输入正确,或联系管辖机构处理。";
} else if (map.containsKey("useOrgCode") && map.get("useOrgCode") > 0){ } else if (map.containsKey("useOrgCode") && map.get("useOrgCode") > 0) {
result = "使用登记证编号重复,请确认数据是否输入正确,或联系管辖机构处理。"; result = "使用登记证编号重复,请确认数据是否输入正确,或联系管辖机构处理。";
} else if (map.containsKey("code") && map.get("code") > 0){ } else if (map.containsKey("code") && map.get("code") > 0) {
result = "96333码重复,请确认数据是否输入正确,或联系管辖机构处理。"; result = "96333码重复,请确认数据是否输入正确,或联系管辖机构处理。";
} }
return result; return result;
...@@ -648,7 +649,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -648,7 +649,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return new HashMap<>(); return new HashMap<>();
} }
EquipmentTypeEnum equipmentMessage = EquipmentTypeEnum.getEnumByCode(alias); EquipmentTypeEnum equipmentMessage = EquipmentTypeEnum.getEnumByCode(alias);
if (equipmentMessage == null && ObjectUtils.isEmpty(equipmentMessage)){ if (equipmentMessage == null && ObjectUtils.isEmpty(equipmentMessage)) {
return new HashMap<>(); return new HashMap<>();
} }
HashMap<String, Map<String, Object>> result = new HashMap<>(); HashMap<String, Map<String, Object>> result = new HashMap<>();
...@@ -691,7 +692,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -691,7 +692,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private Map<String, Object> getUseInfo(Map<String, Object> map) { private Map<String, Object> getUseInfo(Map<String, Object> map) {
Map<String, Object> useInfo = equipmentCategoryMapper.selectTzsUseInfo(String.valueOf(map.get("id"))); Map<String, Object> useInfo = equipmentCategoryMapper.selectTzsUseInfo(String.valueOf(map.get("id")));
if (ObjectUtils.isEmpty(useInfo)){ if (ObjectUtils.isEmpty(useInfo)) {
return new HashMap<>(); return new HashMap<>();
} }
useInfo.put("LONGITUDE_LATITUDE", JSON.parse(String.valueOf(useInfo.get("LONGITUDE_LATITUDE")))); useInfo.put("LONGITUDE_LATITUDE", JSON.parse(String.valueOf(useInfo.get("LONGITUDE_LATITUDE"))));
...@@ -721,7 +722,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -721,7 +722,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "3000": case "3000":
// 电梯 // 电梯
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
result.put("EXPLOSIONPROOF_SIGN_COMPLETE", JSON.parseArray(String.valueOf(result.get("EXPLOSIONPROOF_SIGN_COMPLETE")))); result.put("EXPLOSIONPROOF_SIGN_COMPLETE", JSON.parseArray(String.valueOf(result.get("EXPLOSIONPROOF_SIGN_COMPLETE"))));
...@@ -729,7 +730,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -729,7 +730,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "4000": case "4000":
// 起重机械 // 起重机械
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
List<Map<String, Object>> lbjJriInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> lbjJriInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id")));
...@@ -741,7 +742,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -741,7 +742,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "5000": case "5000":
// 厂车 // 厂车
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
List<Map<String, Object>> celbjJriInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> celbjJriInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id")));
...@@ -751,7 +752,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -751,7 +752,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "1000": case "1000":
// 锅炉 // 锅炉
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
List<Map<String, Object>> glaqfjJriInfo = equipmentCategoryMapper.selectTzsaqfjJriInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> glaqfjJriInfo = equipmentCategoryMapper.selectTzsaqfjJriInfo(String.valueOf(map.get("id")));
...@@ -760,7 +761,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -760,7 +761,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "2000": case "2000":
// 压力容器 // 压力容器
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
List<Map<String, Object>> ylrqaqfjJriInfo = equipmentCategoryMapper.selectTzsaqfjJriInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> ylrqaqfjJriInfo = equipmentCategoryMapper.selectTzsaqfjJriInfo(String.valueOf(map.get("id")));
...@@ -771,7 +772,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -771,7 +772,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "8000": case "8000":
// 压力容器 // 压力容器
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
List<Map<String, Object>> ylgdjJriInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> ylgdjJriInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id")));
...@@ -780,14 +781,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -780,14 +781,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
case "6000": case "6000":
// 游乐设施 // 游乐设施
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
break; break;
case "9000": case "9000":
// 游乐设施 // 游乐设施
result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName()); result = equipmentCategoryMapper.selectTzsqzjJriInfo(String.valueOf(map.get("id")), equipmentMessage.getTableName());
if (ObjectUtils.isEmpty(result)){ if (ObjectUtils.isEmpty(result)) {
return new HashMap<>(); return new HashMap<>();
} }
List<Map<String, Object>> sdJriLbjInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> sdJriLbjInfo = equipmentCategoryMapper.selectTzslbjJriInfo(String.valueOf(map.get("id")));
...@@ -810,7 +811,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -810,7 +811,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private Map<String, Object> getInsInfo(Map<String, Object> map) { private Map<String, Object> getInsInfo(Map<String, Object> map) {
List<Map<String, Object>> InsInfo = equipmentCategoryMapper.selectTzsInsInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> InsInfo = equipmentCategoryMapper.selectTzsInsInfo(String.valueOf(map.get("id")));
if (ObjectUtils.isEmpty(InsInfo)){ if (ObjectUtils.isEmpty(InsInfo)) {
return new HashMap<>(); return new HashMap<>();
} }
HashMap<String, Object> insInfoMap = new HashMap<>(); HashMap<String, Object> insInfoMap = new HashMap<>();
...@@ -820,7 +821,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -820,7 +821,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
insInfoMap.put("id", item.get("RECORD")); insInfoMap.put("id", item.get("RECORD"));
} }
if (!insInfoMap.containsKey("sequenceNbr")) { if (!insInfoMap.containsKey("sequenceNbr")) {
insInfoMap.put("sequenceNbr", item.get("RECORD")); insInfoMap.put("sequenceNbr", item.get("SEQUENCE_NBR"));
} }
item.put("Symbol_key", item.get("SEQUENCE_NBR")); item.put("Symbol_key", item.get("SEQUENCE_NBR"));
}); });
...@@ -836,7 +837,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -836,7 +837,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private Map<String, Object> getMainInfo(Map<String, Object> map) { private Map<String, Object> getMainInfo(Map<String, Object> map) {
List<Map<String, Object>> mainInfo = equipmentCategoryMapper.selectTzsMainInfo(String.valueOf(map.get("id"))); List<Map<String, Object>> mainInfo = equipmentCategoryMapper.selectTzsMainInfo(String.valueOf(map.get("id")));
if (ObjectUtils.isEmpty(mainInfo)){ if (ObjectUtils.isEmpty(mainInfo)) {
return new HashMap<>(); return new HashMap<>();
} }
HashMap<String, Object> mainInfoMap = new HashMap<>(); HashMap<String, Object> mainInfoMap = new HashMap<>();
...@@ -846,7 +847,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -846,7 +847,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
mainInfoMap.put("id", item.get("RECORD")); mainInfoMap.put("id", item.get("RECORD"));
} }
if (!mainInfoMap.containsKey("sequenceNbr")) { if (!mainInfoMap.containsKey("sequenceNbr")) {
mainInfoMap.put("sequenceNbr", item.get("RECORD")); mainInfoMap.put("sequenceNbr", item.get("SEQUENCE_NBR"));
} }
item.put("Symbol_key", item.get("SEQUENCE_NBR")); item.put("Symbol_key", item.get("SEQUENCE_NBR"));
}); });
...@@ -871,7 +872,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -871,7 +872,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
comMap.put("id", item.get("RECORD")); comMap.put("id", item.get("RECORD"));
} }
if (!comMap.containsKey("sequenceNbr")) { if (!comMap.containsKey("sequenceNbr")) {
comMap.put("sequenceNbr", item.get("RECORD")); comMap.put("sequenceNbr", item.get("SEQUENCE_NBR"));
} }
item.put("Symbol_key", item.get("SEQUENCE_NBR")); item.put("Symbol_key", item.get("SEQUENCE_NBR"));
}); });
...@@ -887,7 +888,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -887,7 +888,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private Map<String, Object> getDesInfo(Map<String, Object> map) { private Map<String, Object> getDesInfo(Map<String, Object> map) {
Map<String, Object> desInfo = equipmentCategoryMapper.selectTzsDesInfo(String.valueOf(map.get("id"))); Map<String, Object> desInfo = equipmentCategoryMapper.selectTzsDesInfo(String.valueOf(map.get("id")));
if (ObjectUtils.isEmpty(desInfo)){ if (ObjectUtils.isEmpty(desInfo)) {
return new HashMap<>(); return new HashMap<>();
} }
desInfo.put("DESIGN_DOC", JSON.parseArray(String.valueOf(desInfo.get("DESIGN_DOC")))); desInfo.put("DESIGN_DOC", JSON.parseArray(String.valueOf(desInfo.get("DESIGN_DOC"))));
...@@ -899,6 +900,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -899,6 +900,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
desInfo.put("PRODUCT_QUALITY_YIELD_PROVE", JSON.parseArray(String.valueOf(desInfo.get("PRODUCT_QUALITY_YIELD_PROVE")))); desInfo.put("PRODUCT_QUALITY_YIELD_PROVE", JSON.parseArray(String.valueOf(desInfo.get("PRODUCT_QUALITY_YIELD_PROVE"))));
return desInfo; return desInfo;
} }
/** /**
* 分页查询数据 * 分页查询数据
*/ */
...@@ -1176,12 +1178,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1176,12 +1178,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
list.add(equipmentCategoryData); list.add(equipmentCategoryData);
} }
} }
if (!ObjectUtils.isEmpty(unitCodes) && !ObjectUtils.isEmpty(orgBranchCodes) ) { if (!ObjectUtils.isEmpty(unitCodes) && !ObjectUtils.isEmpty(orgBranchCodes)) {
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>() equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>()
.in("unit_code", unitCodes) .in("unit_code", unitCodes)
.in("org_branch_code",orgBranchCodes)); .in("org_branch_code", orgBranchCodes));
} }
if (!ObjectUtils.isEmpty(unitCodes) && ObjectUtils.isEmpty(orgBranchCodes) ) { if (!ObjectUtils.isEmpty(unitCodes) && ObjectUtils.isEmpty(orgBranchCodes)) {
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>() equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>()
.in("unit_code", unitCodes)); .in("unit_code", unitCodes));
} }
...@@ -1301,7 +1303,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1301,7 +1303,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
StopWatch stopWatch3 = new StopWatch(); StopWatch stopWatch3 = new StopWatch();
stopWatch3.start(); stopWatch3.start();
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo(); SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
ResponseModel responseModel = new ResponseModel();
LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(use_info_form_id); LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(use_info_form_id);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -1342,12 +1343,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1342,12 +1343,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
log.info("已生成对应监管码或96333电梯识别码"); log.info("已生成对应监管码或96333电梯识别码");
flag = true; flag = true;
} }
if(flag){ if (flag) {
lock.unlock(); // 释放锁 lock.unlock(); // 释放锁
log.info("释放锁"); log.info("释放锁");
} }
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据 //添加对应监管码和96333码调用通用新增保存接口进行修改
map.remove("data");
supervisionMap.put("CODE96333", codeMap.get("code96333")); supervisionMap.put("CODE96333", codeMap.get("code96333"));
supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode")); supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode"));
map.put(supervision_form_id, supervisionMap); map.put(supervision_form_id, supervisionMap);
...@@ -1357,8 +1357,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1357,8 +1357,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
StopWatch stopWatch1 = new StopWatch(); StopWatch stopWatch1 = new StopWatch();
stopWatch1.start(); stopWatch1.start();
// 根据操作状态判断是调用新增还是修改接口 record = batchSubmitOrUpdate(map, equCategory, operateType);
record = "save".equals(operateType) ? batchSubmit(map, equCategory) : null;
stopWatch1.stop(); stopWatch1.stop();
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
log.info("业务存数据耗时:{} 秒", stopWatch1.getTotalTimeSeconds()); log.info("业务存数据耗时:{} 秒", stopWatch1.getTotalTimeSeconds());
...@@ -1370,14 +1369,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1370,14 +1369,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
} }
} else if (EquipmentCategoryEnum.DRL.getName().equals(claimStatus)) { } else if (EquipmentCategoryEnum.DRL.getName().equals(claimStatus)) {
map.remove("data");
supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333); supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333);
map.put(supervision_form_id, supervisionMap); map.put(supervision_form_id, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 //根据操作状态判断是调用新增还是修改接口
record = "save".equals(operateType) ? batchSubmit(map, equCategory) : null; record = batchSubmitOrUpdate(map, equCategory, operateType);
} else { } else {
map.remove("data"); record = batchSubmitOrUpdate(map, equCategory, operateType);
record = null;
} }
StopWatch stopWatch4 = new StopWatch(); StopWatch stopWatch4 = new StopWatch();
stopWatch4.start(); stopWatch4.start();
...@@ -1426,7 +1423,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1426,7 +1423,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
response.setStatus(HttpStatus.BAD_REQUEST.value()); response.setStatus(HttpStatus.BAD_REQUEST.value());
return response; return response;
} }
return responseModel; return ResponseHelper.buildResponse("SUCCESS");
} }
@Autowired @Autowired
...@@ -1439,12 +1436,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1439,12 +1436,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
IdxBizJgOtherInfoServiceImpl idxBizJgOtherInfoService; IdxBizJgOtherInfoServiceImpl idxBizJgOtherInfoService;
@Autowired @Autowired
IdxBizJgOtherInfoMapper idxBizJgOtherInfoMapper;
@Autowired
IdxBizJgDesignInfoServiceImpl idxBizJgDesignInfoService; IdxBizJgDesignInfoServiceImpl idxBizJgDesignInfoService;
@Autowired @Autowired
IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService; IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
@Autowired @Autowired
IdxBizJgFactoryInfoMapper idxBizJgFactoryInfoMapper;
@Autowired
IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService; IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired @Autowired
...@@ -1460,248 +1463,320 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1460,248 +1463,320 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
IdxBizJgTechParamsElevatorServiceImpl idxBizJgTechParamsElevatorService; IdxBizJgTechParamsElevatorServiceImpl idxBizJgTechParamsElevatorService;
@Autowired @Autowired
IdxBizJgTechParamsElevatorMapper idxBizJgTechParamsElevatorMapper;
@Autowired
IdxBizJgTechParamsVehicleServiceImpl idxBizJgTechParamsVehicleService; IdxBizJgTechParamsVehicleServiceImpl idxBizJgTechParamsVehicleService;
@Autowired @Autowired
IdxBizJgTechParamsVehicleMapper idxBizJgTechParamsVehicleMapper;
@Autowired
IdxBizJgTechParamsRopewayServiceImpl idxBizJgTechParamsRopewayService; IdxBizJgTechParamsRopewayServiceImpl idxBizJgTechParamsRopewayService;
@Autowired @Autowired
IdxBizJgTechParamsRopewayMapper idxBizJgTechParamsRopewayMapper;
@Autowired
IdxBizJgTechParamsRidesServiceImpl idxBizJgTechParamsRidesService; IdxBizJgTechParamsRidesServiceImpl idxBizJgTechParamsRidesService;
@Autowired @Autowired
IdxBizJgTechParamsRidesMapper idxBizJgTechParamsRidesMapper;
@Autowired
IdxBizJgTechParamsBoilerServiceImpl idxBizJgTechParamsBoilerService; IdxBizJgTechParamsBoilerServiceImpl idxBizJgTechParamsBoilerService;
@Autowired @Autowired
IdxBizJgTechParamsBoilerMapper idxBizJgTechParamsBoilerMapper;
@Autowired
IdxBizJgTechParamsVesselServiceImpl idxBizJgTechParamsVesselService; IdxBizJgTechParamsVesselServiceImpl idxBizJgTechParamsVesselService;
@Autowired @Autowired
IdxBizJgTechParamsVesselMapper idxBizJgTechParamsVesselMapper;
@Autowired
IdxBizJgTechParamsPipelineServiceImpl idxBizJgTechParamsPipelineService; IdxBizJgTechParamsPipelineServiceImpl idxBizJgTechParamsPipelineService;
@Autowired @Autowired
IdxBizJgTechParamsPipelineMapper idxBizJgTechParamsPipelineMapper;
@Autowired
IdxBizJgTechParamsLiftingServiceImpl idxBizJgTechParamsLiftingService; IdxBizJgTechParamsLiftingServiceImpl idxBizJgTechParamsLiftingService;
@Autowired @Autowired
IdxBizJgTechParamsLiftingMapper idxBizJgTechParamsLiftingMapper;
@Autowired
IdxBizJgMainPartsServiceImpl idxBizJgMainPartsService; IdxBizJgMainPartsServiceImpl idxBizJgMainPartsService;
@Autowired @Autowired
IdxBizJgMainPartsMapper idxBizJgMainPartsMapper;
@Autowired
IdxBizJgProtectionDevicesServiceImpl idxBizJgProtectionDevicesService; IdxBizJgProtectionDevicesServiceImpl idxBizJgProtectionDevicesService;
@Autowired
IdxBizJgProtectionDevicesMapper idxBizJgProtectionDevicesMapper;
private String batchSubmit(Map<String, Object> map,String equCategory) {
private String batchSubmitOrUpdate(Map<String, Object> map, String equCategory, String type) {
Date date = new Date(); Date date = new Date();
String record = UUID.randomUUID().toString(); String record = null;
// 使用信息
LinkedHashMap useInfoForm = (LinkedHashMap) map.get(use_info_form_id); LinkedHashMap useInfoForm = (LinkedHashMap) map.get(use_info_form_id);
IdxBizJgFactoryInfo idxBizJgFactoryInfo = null;
IdxBizJgOtherInfo otherInfo = null;
IdxBizJgTechParamsElevator techParamsElevator = null;
IdxBizJgTechParamsVehicle techParamsVehicle = null;
IdxBizJgTechParamsRopeway techParamsRopeway = null;
IdxBizJgTechParamsRides techParamsRides = null;
IdxBizJgTechParamsBoiler techParamsBoiler = null;
IdxBizJgTechParamsVessel techParamsVessel = null;
IdxBizJgTechParamsPipeline techParamsPipeline = null;
IdxBizJgTechParamsLifting techParamsLifting = null;
if ("save".equals(type)) {
record = UUID.randomUUID().toString();
} else {
record = useInfoForm.get("id").toString();
idxBizJgFactoryInfo = idxBizJgFactoryInfoMapper.selectOne(new QueryWrapper<IdxBizJgFactoryInfo>().eq("RECORD", record));
otherInfo = idxBizJgOtherInfoMapper.selectOne(new QueryWrapper<IdxBizJgOtherInfo>().eq("RECORD", record));
techParamsElevator = idxBizJgTechParamsElevatorMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsElevator>().eq("RECORD", record));
techParamsVehicle = idxBizJgTechParamsVehicleMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsVehicle>().eq("RECORD", record));
techParamsRopeway = idxBizJgTechParamsRopewayMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsRopeway>().eq("RECORD", record));
techParamsRides = idxBizJgTechParamsRidesMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsRides>().eq("RECORD", record));
techParamsBoiler = idxBizJgTechParamsBoilerMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsBoiler>().eq("RECORD", record));
techParamsVessel = idxBizJgTechParamsVesselMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsVessel>().eq("RECORD", record));
techParamsPipeline = idxBizJgTechParamsPipelineMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsPipeline>().eq("RECORD", record));
techParamsLifting = idxBizJgTechParamsLiftingMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsLifting>().eq("RECORD", record));
}
// 使用信息
IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(useInfoForm), IdxBizJgUseInfo.class); IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(useInfoForm), IdxBizJgUseInfo.class);
useInfo.setRecord(record); useInfo.setRecord(record);
useInfo.setRecDate(date); useInfo.setRecDate(date);
idxBizJgUseInfoService.save(useInfo); idxBizJgUseInfoService.saveOrUpdate(useInfo);
//监督管理信息 //监督管理信息
LinkedHashMap supervisionForm = (LinkedHashMap) map.get(supervision_form_id); LinkedHashMap supervisionForm = (LinkedHashMap) map.get(supervision_form_id);
IdxBizJgSupervisionInfo supervisionInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgSupervisionInfo.class); IdxBizJgSupervisionInfo supervisionInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgSupervisionInfo.class);
supervisionInfo.setRecord(record); supervisionInfo.setRecord(record);
supervisionInfo.setRecDate(date); supervisionInfo.setRecDate(date);
idxBizJgSupervisionInfoService.save(supervisionInfo); idxBizJgSupervisionInfoService.saveOrUpdate(supervisionInfo);
IdxBizJgOtherInfo idxBizJgOtherInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgOtherInfo.class); IdxBizJgOtherInfo idxBizJgOtherInfo = JSON.parseObject(JSON.toJSONString(supervisionForm), IdxBizJgOtherInfo.class);
idxBizJgOtherInfo.setRecord(record); if (!ObjectUtils.isEmpty(idxBizJgOtherInfo)) {
idxBizJgOtherInfo.setRecDate(date); idxBizJgOtherInfo.setRecord(record);
idxBizJgOtherInfoService.save(idxBizJgOtherInfo); idxBizJgOtherInfo.setRecDate(date);
idxBizJgOtherInfo.setSequenceNbr("save".equals(type) ? null : otherInfo.getSequenceNbr());
idxBizJgOtherInfoService.saveOrUpdate(idxBizJgOtherInfo);
}
//设计制造信息 //设计制造信息
LinkedHashMap designForm = (LinkedHashMap) map.get(design_from_id); LinkedHashMap designForm = (LinkedHashMap) map.get(design_from_id);
IdxBizJgDesignInfo designInfo = JSON.parseObject(JSON.toJSONString(designForm), IdxBizJgDesignInfo.class); IdxBizJgDesignInfo designInfo = JSON.parseObject(JSON.toJSONString(designForm), IdxBizJgDesignInfo.class);
designInfo.setRecord(record); designInfo.setRecord(record);
designInfo.setRecDate(date); designInfo.setRecDate(date);
idxBizJgDesignInfoService.save(designInfo); designInfo.setSequenceNbr("save".equals(type) ? null : designInfo.getSequenceNbr());
idxBizJgDesignInfoService.saveOrUpdate(designInfo);
IdxBizJgFactoryInfo factoryInfo = JSON.parseObject(JSON.toJSONString(designForm), IdxBizJgFactoryInfo.class); IdxBizJgFactoryInfo factoryInfo = JSON.parseObject(JSON.toJSONString(designForm), IdxBizJgFactoryInfo.class);
factoryInfo.setRecord(record); if (!ObjectUtils.isEmpty(factoryInfo)) {
factoryInfo.setRecDate(date); factoryInfo.setRecord(record);
idxBizJgFactoryInfoService.save(factoryInfo); factoryInfo.setRecDate(date);
factoryInfo.setSequenceNbr("save".equals(type) ? null : idxBizJgFactoryInfo.getSequenceNbr());
idxBizJgFactoryInfoService.saveOrUpdate(factoryInfo);
}
//检验检测信息 //检验检测信息
LinkedHashMap inspectionForm = (LinkedHashMap) map.get(inspection_form_id); LinkedHashMap inspectionForm = (LinkedHashMap) map.get(inspection_form_id);
List inspectionList = (ArrayList)inspectionForm.get("subForm_pbim1pfid8"); List inspectionList = (ArrayList) inspectionForm.get("subForm_pbim1pfid8");
List<IdxBizJgInspectionDetectionInfo> detectionInfoList = new ArrayList<>(); List<IdxBizJgInspectionDetectionInfo> detectionInfoList = new ArrayList<>();
for (Object obj : inspectionList) { for (Object obj : inspectionList) {
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgInspectionDetectionInfo.class); IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgInspectionDetectionInfo.class);
inspectionDetectionInfo.setRecord(record); inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfo.setRecDate(date); inspectionDetectionInfo.setRecDate(date);
inspectionDetectionInfo.setSequenceNbr(null); inspectionDetectionInfo.setSequenceNbr("save".equals(type) ? null : inspectionDetectionInfo.getSequenceNbr());
detectionInfoList.add(inspectionDetectionInfo); detectionInfoList.add(inspectionDetectionInfo);
} }
idxBizJgInspectionDetectionInfoService.saveBatch(detectionInfoList); idxBizJgInspectionDetectionInfoService.saveOrUpdateBatch(detectionInfoList);
//施工信息 //施工信息
LinkedHashMap constructionForm = (LinkedHashMap) map.get(construction_form_id); LinkedHashMap constructionForm = (LinkedHashMap) map.get(construction_form_id);
List constructionlist = (ArrayList)constructionForm.get("subForm_b2x2wmcy2s"); List constructionlist = (ArrayList) constructionForm.get("subForm_b2x2wmcy2s");
List<IdxBizJgConstructionInfo> constructionInfoList = new ArrayList<>(); if (!ObjectUtils.isEmpty(constructionlist)) {
for (Object obj : constructionlist) { List<IdxBizJgConstructionInfo> constructionInfoList = new ArrayList<>();
IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgConstructionInfo.class); for (Object obj : constructionlist) {
constructionInfo.setRecord(record); IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgConstructionInfo.class);
constructionInfo.setRecDate(date); constructionInfo.setRecord(record);
constructionInfo.setSequenceNbr(null); constructionInfo.setRecDate(date);
constructionInfoList.add(constructionInfo); constructionInfo.setSequenceNbr("save".equals(type) ? null : constructionInfo.getSequenceNbr());
} constructionInfoList.add(constructionInfo);
idxBizJgConstructionInfoService.saveBatch(constructionInfoList); }
idxBizJgConstructionInfoService.saveOrUpdateBatch(constructionInfoList);
}
//八大类技术参数实体填充 //八大类技术参数实体填充
List<IdxBizJgMainParts> mainPartsList = new ArrayList<>(); List<IdxBizJgMainParts> mainPartsList = new ArrayList<>();
List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>(); List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>();
LinkedHashMap registerForm = null;
if(equCategory.startsWith("3")){ if (equCategory.startsWith("3")) {
//维保备案信息 //维保备案信息
LinkedHashMap maintenanceForm = (LinkedHashMap) map.get(maintenance_form_id); LinkedHashMap maintenanceForm = (LinkedHashMap) map.get(maintenance_form_id);
List subFormMaintenanceList = (ArrayList)maintenanceForm.get("subForm_6i16fox27e"); List subFormMaintenanceList = (ArrayList) maintenanceForm.get("subForm_6i16fox27e");
List<IdxBizJgMaintenanceRecordInfo> maintenanceList = new ArrayList<>(); if (!ObjectUtils.isEmpty(subFormMaintenanceList)) {
for (Object obj : subFormMaintenanceList) { List<IdxBizJgMaintenanceRecordInfo> maintenanceList = new ArrayList<>();
IdxBizJgMaintenanceRecordInfo maintenanceRecordInfo = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgMaintenanceRecordInfo.class); for (Object obj : subFormMaintenanceList) {
maintenanceRecordInfo.setRecord(record); IdxBizJgMaintenanceRecordInfo maintenanceRecordInfo = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgMaintenanceRecordInfo.class);
maintenanceRecordInfo.setRecDate(date); maintenanceRecordInfo.setRecord(record);
maintenanceRecordInfo.setSequenceNbr(null); maintenanceRecordInfo.setRecDate(date);
maintenanceList.add(maintenanceRecordInfo); maintenanceRecordInfo.setSequenceNbr("save".equals(type) ? null : maintenanceRecordInfo.getSequenceNbr());
maintenanceList.add(maintenanceRecordInfo);
}
idxBizJgMaintenanceRecordInfoService.saveOrUpdateBatch(maintenanceList);
} }
idxBizJgMaintenanceRecordInfoService.saveBatch(maintenanceList);
//技术参数 //技术参数
LinkedHashMap registerForm = (LinkedHashMap) map.get(dt_register_from_id); registerForm = (LinkedHashMap) map.get(dt_register_from_id);
IdxBizJgRegisterInfo registerInfo = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgRegisterInfo.class);
registerInfo.setRecord(record);
registerInfo.setRecDate(date);
idxBizJgRegisterInfoService.save(registerInfo);
IdxBizJgTechParamsElevator elevator = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsElevator.class); IdxBizJgTechParamsElevator elevator = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsElevator.class);
elevator.setRecord(record); if (!ObjectUtils.isEmpty(elevator)) {
elevator.setRecDate(date); elevator.setRecord(record);
elevator.setSequenceNbr(null); elevator.setRecDate(date);
idxBizJgTechParamsElevatorService.save(elevator); elevator.setSequenceNbr("save".equals(type) ? null : techParamsElevator.getSequenceNbr());
idxBizJgTechParamsElevatorService.saveOrUpdate(elevator);
} else if(equCategory.startsWith("1")){ }
LinkedHashMap registerForm = (LinkedHashMap) map.get(gl_register_from_id); } else if (equCategory.startsWith("1")) {
registerForm = (LinkedHashMap) map.get(gl_register_from_id);
IdxBizJgTechParamsBoiler boiler = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsBoiler.class); IdxBizJgTechParamsBoiler boiler = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsBoiler.class);
boiler.setRecord(record); if (!ObjectUtils.isEmpty(boiler)) {
boiler.setRecDate(date); boiler.setRecord(record);
idxBizJgTechParamsBoilerService.save(boiler); boiler.setRecDate(date);
boiler.setSequenceNbr("save".equals(type) ? null : techParamsBoiler.getSequenceNbr());
List<String> subFormMainPartsList = new ArrayList<>() ; idxBizJgTechParamsBoilerService.saveOrUpdate(boiler);
subFormMainPartsList.add("subForm_1hh88r4m69"); List<String> subFormMainPartsList = new ArrayList<>();
mainPartsList = getAccessoryEntity(registerForm,subFormMainPartsList, main_parts, record, date); subFormMainPartsList.add("subForm_1hh88r4m69");
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date, type);
} else if(equCategory.startsWith("2")){ }
} else if (equCategory.startsWith("2")) {
LinkedHashMap registerForm = (LinkedHashMap) map.get(ylrq_register_from_id); registerForm = (LinkedHashMap) map.get(ylrq_register_from_id);
IdxBizJgTechParamsVessel vessel = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsVessel.class); IdxBizJgTechParamsVessel vessel = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsVessel.class);
vessel.setRecord(record); if (!ObjectUtils.isEmpty(vessel)) {
vessel.setRecDate(date); vessel.setRecord(record);
idxBizJgTechParamsVesselService.save(vessel); vessel.setRecDate(date);
vessel.setSequenceNbr("save".equals(type) ? null : techParamsVessel.getSequenceNbr());
List<String> subFormMainPartsList = new ArrayList<>(); idxBizJgTechParamsVesselService.saveOrUpdate(vessel);
subFormMainPartsList.add("subForm_fie04854f2"); List<String> subFormMainPartsList = new ArrayList<>();
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date); subFormMainPartsList.add("subForm_fie04854f2");
List<String> subFormProtectionDevicesList = new ArrayList<>(); mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date, type);
subFormProtectionDevicesList.add("subForm_d4xdzhsgdj"); List<String> subFormProtectionDevicesList = new ArrayList<>();
protectionDevicesList = getAccessoryEntity(registerForm, subFormProtectionDevicesList, protection_devices, record, date); subFormProtectionDevicesList.add("subForm_d4xdzhsgdj");
protectionDevicesList = getAccessoryEntity(registerForm, subFormProtectionDevicesList, protection_devices, record, date, type);
}
} else if(equCategory.startsWith("4")){ } else if (equCategory.startsWith("4")) {
registerForm = (LinkedHashMap) map.get(qzjx_register_from_id);
LinkedHashMap registerForm = (LinkedHashMap) map.get(qzjx_register_from_id);
IdxBizJgTechParamsLifting lifting = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsLifting.class); IdxBizJgTechParamsLifting lifting = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsLifting.class);
lifting.setRecord(record); if (!ObjectUtils.isEmpty(lifting)) {
lifting.setRecDate(date); lifting.setRecord(record);
idxBizJgTechParamsLiftingService.save(lifting); lifting.setRecDate(date);
lifting.setSequenceNbr("save".equals(type) ? null : techParamsLifting.getSequenceNbr());
List<String> subFormMainPartsList = new ArrayList<>(); idxBizJgTechParamsLiftingService.saveOrUpdate(lifting);
subFormMainPartsList.add("subForm_bqirdyvztt"); List<String> subFormMainPartsList = new ArrayList<>();
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date); subFormMainPartsList.add("subForm_bqirdyvztt");
List<String> subFormProtectionDevicesList = new ArrayList<>(); mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date, type);
subFormProtectionDevicesList.add("subForm_29yy3pdzhl"); List<String> subFormProtectionDevicesList = new ArrayList<>();
subFormProtectionDevicesList.add("subForm_h5h4x0zhur"); subFormProtectionDevicesList.add("subForm_29yy3pdzhl");
protectionDevicesList = getAccessoryEntity(registerForm, subFormProtectionDevicesList, protection_devices, record, date); subFormProtectionDevicesList.add("subForm_h5h4x0zhur");
protectionDevicesList = getAccessoryEntity(registerForm, subFormProtectionDevicesList, protection_devices, record, date, type);
}
} else if(equCategory.startsWith("5")){ } else if (equCategory.startsWith("5")) {
registerForm = (LinkedHashMap) map.get(cc_register_from_id);
LinkedHashMap registerForm = (LinkedHashMap) map.get(cc_register_from_id);
IdxBizJgTechParamsVehicle vehicle = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsVehicle.class); IdxBizJgTechParamsVehicle vehicle = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsVehicle.class);
vehicle.setRecord(record); if (!ObjectUtils.isEmpty(vehicle)) {
vehicle.setRecDate(date); vehicle.setRecord(record);
idxBizJgTechParamsVehicleService.save(vehicle); vehicle.setRecDate(date);
vehicle.setSequenceNbr("save".equals(type) ? null : techParamsVehicle.getSequenceNbr());
List<String> subFormMainPartsList = new ArrayList<>(); idxBizJgTechParamsVehicleService.saveOrUpdate(vehicle);
subFormMainPartsList.add("subForm_sey164b51a"); List<String> subFormMainPartsList = new ArrayList<>();
subFormMainPartsList.add("subForm_tef7yf5fbr"); subFormMainPartsList.add("subForm_sey164b51a");
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date); subFormMainPartsList.add("subForm_tef7yf5fbr");
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date, type);
}
} else if(equCategory.startsWith("6")){ } else if (equCategory.startsWith("6")) {
registerForm = (LinkedHashMap) map.get(ylss_register_from_id);
LinkedHashMap registerForm = (LinkedHashMap) map.get(ylss_register_from_id);
IdxBizJgTechParamsRides rides = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsRides.class); IdxBizJgTechParamsRides rides = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsRides.class);
rides.setRecord(record); if (!ObjectUtils.isEmpty(rides)) {
rides.setRecDate(date); rides.setRecord(record);
idxBizJgTechParamsRidesService.save(rides); rides.setRecDate(date);
rides.setSequenceNbr("save".equals(type) ? null : techParamsRides.getSequenceNbr());
idxBizJgTechParamsRidesService.saveOrUpdate(rides);
} else if(equCategory.startsWith("8")){ }
} else if (equCategory.startsWith("8")) {
LinkedHashMap registerForm = (LinkedHashMap) map.get(ylgd_register_from_id); registerForm = (LinkedHashMap) map.get(ylgd_register_from_id);
IdxBizJgTechParamsPipeline pipeline = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsPipeline.class); IdxBizJgTechParamsPipeline pipeline = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsPipeline.class);
pipeline.setRecord(record); if (!ObjectUtils.isEmpty(pipeline)) {
pipeline.setRecDate(date); pipeline.setRecord(record);
idxBizJgTechParamsPipelineService.save(pipeline); pipeline.setRecDate(date);
pipeline.setSequenceNbr("save".equals(type) ? null : techParamsPipeline.getSequenceNbr());
idxBizJgTechParamsPipelineService.saveOrUpdate(pipeline);
List<String> subFormMainPartsList = new ArrayList<>(); List<String> subFormMainPartsList = new ArrayList<>();
subFormMainPartsList.add("subForm_9n7nu55z8r"); subFormMainPartsList.add("subForm_9n7nu55z8r");
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date); mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date, type);
}
} else { } else {
registerForm = (LinkedHashMap) map.get(kysd_register_from_id);
LinkedHashMap registerForm = (LinkedHashMap) map.get(kysd_register_from_id);
IdxBizJgTechParamsRopeway ropeway = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsRopeway.class); IdxBizJgTechParamsRopeway ropeway = JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgTechParamsRopeway.class);
ropeway.setRecord(record); if (!ObjectUtils.isEmpty(ropeway)) {
ropeway.setRecDate(date); ropeway.setRecord(record);
idxBizJgTechParamsRopewayService.save(ropeway); ropeway.setRecDate(date);
ropeway.setSequenceNbr("save".equals(type) ? null : techParamsRopeway.getSequenceNbr());
List<String> subFormMainPartsList = new ArrayList<>(); idxBizJgTechParamsRopewayService.saveOrUpdate(ropeway);
subFormMainPartsList.add("subForm_5fi0jewuyh"); List<String> subFormMainPartsList = new ArrayList<>();
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date); subFormMainPartsList.add("subForm_5fi0jewuyh");
mainPartsList = getAccessoryEntity(registerForm, subFormMainPartsList, main_parts, record, date, type);
}
}
IdxBizJgRegisterInfo registerInfo =JSON.parseObject(JSON.toJSONString(registerForm), IdxBizJgRegisterInfo.class);
registerInfo.setRecord(record);
registerInfo.setRecDate(date);
registerInfo.setSequenceNbr("save".equals(type) ? null : registerForm.get("sequenceNbr").toString());
idxBizJgRegisterInfoService.saveOrUpdate(registerInfo);
if (!ObjectUtils.isEmpty(mainPartsList)) {
idxBizJgMainPartsService.saveOrUpdateBatch(mainPartsList);
}
if (!ObjectUtils.isEmpty(protectionDevicesList)) {
idxBizJgProtectionDevicesService.saveOrUpdateBatch(protectionDevicesList);
} }
idxBizJgMainPartsService.saveBatch(mainPartsList);
idxBizJgProtectionDevicesService.saveBatch(protectionDevicesList);
return record; return record;
} }
private List getAccessoryEntity(Map<String, Object> map, List<String> list, String type, String record, Date date) { private List getAccessoryEntity(Map<String, Object> map, List<String> list, String subFormType, String record, Date date,String type) {
List<IdxBizJgMainParts> mainPartsList = new ArrayList<>(); List<IdxBizJgMainParts> mainPartsList = new ArrayList<>();
List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>(); List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>();
if ("mainParts".equals(type)) { if ("mainParts".equals(subFormType)) {
for (Object s : list) { for (Object s : list) {
List subFormMainPartsList = (ArrayList) map.get(s); List subFormMainPartsList = (ArrayList) map.get(s);
for (Object obj : subFormMainPartsList) { if(!ObjectUtils.isEmpty(subFormMainPartsList)){
IdxBizJgMainParts mainParts = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgMainParts.class); for (Object obj : subFormMainPartsList) {
mainParts.setRecord(record); IdxBizJgMainParts mainParts = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgMainParts.class);
mainParts.setRecDate(date); mainParts.setRecord(record);
mainParts.setSequenceNbr(null); mainParts.setRecDate(date);
mainPartsList.add(mainParts); mainParts.setSequenceNbr("save".equals(type) ? null : mainParts.getSequenceNbr());
mainPartsList.add(mainParts);
}
} }
} }
return mainPartsList; return mainPartsList;
} else { } else {
for (Object s : list) { for (Object s : list) {
List subFormProtectionDevicesList = (ArrayList) map.get(s); List subFormProtectionDevicesList = (ArrayList) map.get(s);
for (Object obj : subFormProtectionDevicesList) { if(!ObjectUtils.isEmpty(subFormProtectionDevicesList)){
IdxBizJgProtectionDevices protectionDevices = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgProtectionDevices.class); for (Object obj : subFormProtectionDevicesList) {
protectionDevices.setRecord(record); IdxBizJgProtectionDevices protectionDevices = JSON.parseObject(JSON.toJSONString(obj), IdxBizJgProtectionDevices.class);
protectionDevices.setRecDate(date); protectionDevices.setRecord(record);
protectionDevices.setSequenceNbr(null); protectionDevices.setRecDate(date);
protectionDevicesList.add(protectionDevices); protectionDevices.setSequenceNbr("save".equals(type) ? null : protectionDevices.getSequenceNbr());
protectionDevicesList.add(protectionDevices);
}
} }
} }
return protectionDevicesList; return protectionDevicesList;
......
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