Commit 5eddb4ea authored by tianyiming's avatar tianyiming

一码通新增功能修改

parent 330b48b3
...@@ -536,7 +536,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -536,7 +536,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", selectOne.getSupervisoryCode())); new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", selectOne.getSupervisoryCode()));
} }
//使用UUID生成一个record,多表关联关系用 //使用UUID生成一个record,多表关联关系用
resultMap.put("record", UUID.randomUUID().toString());
resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString()); resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString()); resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
resultMap.put("qrCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString()); resultMap.put("qrCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
...@@ -1311,8 +1310,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1311,8 +1310,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
LinkedHashMap supervisionMap = (LinkedHashMap) map.get(supervision_form_id); LinkedHashMap supervisionMap = (LinkedHashMap) map.get(supervision_form_id);
boolean saveFlag = false; boolean saveFlag = false;
String record = null; String record = null;
try {
LinkedHashMap superviseMap = (LinkedHashMap) map.get("data"); LinkedHashMap superviseMap = (LinkedHashMap) map.get("data");
String equCategory = String.valueOf(superviseMap.get("equCategory"));
try {
String claimStatus = String.valueOf(superviseMap.get("claimStatus")); String claimStatus = String.valueOf(superviseMap.get("claimStatus"));
String code96333 = String.valueOf(superviseMap.get("code96333")); String code96333 = String.valueOf(superviseMap.get("code96333"));
String operateType = String.valueOf(superviseMap.get("operateType")); String operateType = String.valueOf(superviseMap.get("operateType"));
...@@ -1322,7 +1322,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1322,7 +1322,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
log.info("准备生成监管码或96333电梯识别码"); log.info("准备生成监管码或96333电梯识别码");
String city = String.valueOf(superviseMap.get("city")); String city = String.valueOf(superviseMap.get("city"));
String county = String.valueOf(superviseMap.get("county")); String county = String.valueOf(superviseMap.get("county"));
String equCategory = String.valueOf(superviseMap.get("equCategory")); ;
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode")); String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy(); EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy();
//生成码 //生成码
...@@ -1340,7 +1340,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1340,7 +1340,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (lock.tryLock(3, 5, TimeUnit.SECONDS)) { if (lock.tryLock(3, 5, TimeUnit.SECONDS)) {
codeMap = categoryService.creatCode(city, county, equCategory, code96333, supervisionCode); codeMap = categoryService.creatCode(city, county, equCategory, code96333, supervisionCode);
log.info("已生成对应监管码或96333电梯识别码"); log.info("已生成对应监管码或96333电梯识别码");
record = codeMap.get("record");
flag = true; flag = true;
} }
if(flag){ if(flag){
...@@ -1359,12 +1358,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1359,12 +1358,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
StopWatch stopWatch1 = new StopWatch(); StopWatch stopWatch1 = new StopWatch();
stopWatch1.start(); stopWatch1.start();
// 根据操作状态判断是调用新增还是修改接口 // 根据操作状态判断是调用新增还是修改接口
saveFlag = "save".equals(operateType) ? batchSubmit(map, equCategory, record) : false; 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());
} }
if (saveFlag) { if (!ObjectUtils.isEmpty(record)) {
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.YSY.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.YSY.getCode());
} else { } else {
equipmentCategoryMapper.updateIsNotEs(String.valueOf(supervisionMap.get("SUPERVISORY_CODE"))); equipmentCategoryMapper.updateIsNotEs(String.valueOf(supervisionMap.get("SUPERVISORY_CODE")));
...@@ -1375,15 +1374,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1375,15 +1374,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
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);
//根据操作状态判断是调用新增还是修改接口 //根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, map) : record = "save".equals(operateType) ? batchSubmit(map, equCategory) : null;
idxFeignService.batchUpdate(null, map);
} else { } else {
map.remove("data"); map.remove("data");
responseModel = idxFeignService.batchUpdate(null, map); record = null;
} }
StopWatch stopWatch4 = new StopWatch(); StopWatch stopWatch4 = new StopWatch();
stopWatch4.start(); stopWatch4.start();
if (saveFlag) { if (!ObjectUtils.isEmpty(record)) {
checkEsData(record); checkEsData(record);
} }
stopWatch4.stop(); stopWatch4.stop();
...@@ -1414,11 +1412,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1414,11 +1412,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
equipmentCategoryMapper.updateIsNotEs(String.valueOf(supervisionMap.get("SUPERVISORY_CODE"))); equipmentCategoryMapper.updateIsNotEs(String.valueOf(supervisionMap.get("SUPERVISORY_CODE")));
if (!ObjectUtils.isEmpty(responseModel) && "200".equals(String.valueOf(responseModel.getStatus()))) { if (!ObjectUtils.isEmpty(record)) {
List<String> records = new ArrayList<>(); List<String> records = new ArrayList<>();
records.add(String.valueOf(responseModel.getResult())); records.add(record);
superviseInfoMapper.deleteDataAll(records); superviseInfoMapper.deleteDataAll(records);
esEquipmentCategory.deleteById(String.valueOf(responseModel.getResult())); esEquipmentCategory.deleteById(record);
} }
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
ResponseModel<Object> response = new ResponseModel<>(); ResponseModel<Object> response = new ResponseModel<>();
...@@ -1489,8 +1487,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1489,8 +1487,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
IdxBizJgProtectionDevicesServiceImpl idxBizJgProtectionDevicesService; IdxBizJgProtectionDevicesServiceImpl idxBizJgProtectionDevicesService;
private boolean batchSubmit(Map<String, Object> map,String equCategory,String record) { private String batchSubmit(Map<String, Object> map,String equCategory) {
Date date = new Date(); Date date = new Date();
String record = UUID.randomUUID().toString();
// 使用信息 // 使用信息
LinkedHashMap useInfoForm = (LinkedHashMap) map.get(use_info_form_id); LinkedHashMap useInfoForm = (LinkedHashMap) map.get(use_info_form_id);
IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(useInfoForm), IdxBizJgUseInfo.class); IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(useInfoForm), IdxBizJgUseInfo.class);
...@@ -1675,7 +1674,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1675,7 +1674,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
idxBizJgMainPartsService.saveBatch(mainPartsList); idxBizJgMainPartsService.saveBatch(mainPartsList);
idxBizJgProtectionDevicesService.saveBatch(protectionDevicesList); idxBizJgProtectionDevicesService.saveBatch(protectionDevicesList);
return true; 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 type, String record, Date date) {
......
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