Commit f406891c authored by tianyiming's avatar tianyiming

Merge remote-tracking branch 'origin/developer-tzs-V1.0.23.1' into developer

# Conflicts: # amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
parents 42409d64 280f240b
...@@ -12,6 +12,11 @@ public class UseUnitCreditCodeCategoryDto { ...@@ -12,6 +12,11 @@ public class UseUnitCreditCodeCategoryDto {
* 使用单位编码 * 使用单位编码
*/ */
private String useUnitCreditCode; private String useUnitCreditCode;
/**
* 管辖机构编码
*/
private String orgBranchCode;
/** /**
* 状态 * 状态
*/ */
......
...@@ -39,7 +39,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -39,7 +39,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record); Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record);
List<Map<String, Object>> getAllUnit(@Param("unitCodes")List<String> unitCodes); List<Map<String, Object>> getAllUnit(@Param("unitCodes")List<String> unitCodes,@Param("orgBranchCodes")List<String> orgBranchCodes);
List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode); List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode);
......
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 特种设备基本信息-监督管理信息 Mapper 接口 * 特种设备基本信息-监督管理信息 Mapper 接口
...@@ -16,7 +17,7 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> { ...@@ -16,7 +17,7 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> {
void updateRecordBatch(@Param("recordList") List<String> recordList); void updateRecordBatch(@Param("recordList") List<String> recordList);
List<String> selectUnitCodeList(@Param("records") List<String> records); List<Map<String,Object>> selectUnitCodeList(@Param("records") List<String> records);
List<String> selectSuperviseCodeList(@Param("records") List<String> records); List<String> selectSuperviseCodeList(@Param("records") List<String> records);
void deleteDataAll(@Param("records") List<String> records); void deleteDataAll(@Param("records") List<String> records);
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and status = #{status} and status = #{status}
</if> </if>
ORDER BY CODE96333 DESC LIMIT 1 <if test="status != 2 ">ORDER BY CODE96333 DESC LIMIT 1 </if>
<if test="status == 2 ">ORDER BY CODE96333 ASC LIMIT 1 </if>
</select> </select>
<select id="selectEquipInfo" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto"> <select id="selectEquipInfo" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto">
......
...@@ -129,22 +129,27 @@ ...@@ -129,22 +129,27 @@
<select id="getAllUnit" resultType="java.util.Map"> <select id="getAllUnit" resultType="java.util.Map">
SELECT SELECT
DISTINCT (USE_UNIT_CREDIT_CODE) use_code, ibjui.USE_UNIT_CREDIT_CODE use_code,
ifnull(ORG_BRANCH_CODE,50) supervise_org_code ibjsi.ORG_BRANCH_CODE supervise_org_code
FROM FROM
idx_biz_jg_use_info ibjui idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD" LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
WHERE WHERE
USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> '' ibjui.USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> ''
AND (lengthb(USE_UNIT_CREDIT_CODE)= 15 or lengthb(USE_UNIT_CREDIT_CODE)= 18) AND (lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 15 or lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 18)
<if test="unitCodes !=null and unitCodes.size>0"> <if test="unitCodes !=null and unitCodes.size>0">
and USE_UNIT_CREDIT_CODE in and ibjui.USE_UNIT_CREDIT_CODE in
<foreach collection="unitCodes" separator="," item="unitCode" open="(" close=")"> <foreach collection="unitCodes" separator="," item="unitCode" open="(" close=")">
#{unitCode} #{unitCode}
</foreach> </foreach>
</if> </if>
GROUP BY use_code <if test="orgBranchCodes !=null and orgBranchCodes.size>0">
ORDER BY use_code and ibjsi.ORG_BRANCH_CODE in
<foreach collection="orgBranchCodes" separator="," item="orgBranchCode" open="(" close=")">
#{orgBranchCode}
</foreach>
</if>
GROUP BY use_code,supervise_org_code
</select> </select>
<select id="getCategoryData" resultType="java.util.Map"> <select id="getCategoryData" resultType="java.util.Map">
...@@ -301,6 +306,7 @@ ...@@ -301,6 +306,7 @@
<select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitCreditCodeCategoryDto"> <select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitCreditCodeCategoryDto">
SELECT SELECT
ibjsi."ORG_BRANCH_CODE",
ibjui."USE_UNIT_CREDIT_CODE", ibjui."USE_UNIT_CREDIT_CODE",
ibjoi."CLAIM_STATUS", ibjoi."CLAIM_STATUS",
ibjri."EQU_LIST", ibjri."EQU_LIST",
...@@ -309,12 +315,12 @@ ...@@ -309,12 +315,12 @@
idx_biz_jg_use_info ibjui idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi."RECORD" = ibjui."RECORD"
where where
ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> '' ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> ''
and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> '' and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> ''
and ibjri."EQU_LIST" <![CDATA[ <> ]]> '' and ibjri."EQU_LIST" <![CDATA[ <> ]]> ''
GROUP BY ibjui."USE_UNIT_CREDIT_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST" GROUP BY ibjui."USE_UNIT_CREDIT_CODE",ibjsi."ORG_BRANCH_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST"
ORDER BY ibjui."USE_UNIT_CREDIT_CODE"
</select> </select>
<select id="getEquipExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo"> <select id="getEquipExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo">
select ORG_BRANCH_NAME as orgBranchName, select ORG_BRANCH_NAME as orgBranchName,
......
...@@ -9,15 +9,18 @@ ...@@ -9,15 +9,18 @@
</foreach> </foreach>
</update> </update>
<select id="selectUnitCodeList" resultType="java.lang.String"> <select id="selectUnitCodeList" resultType="java.util.Map">
SELECT SELECT
DISTINCT ( USE_UNIT_CREDIT_CODE ) unitCode ui."USE_UNIT_CREDIT_CODE" unitCode,
si."ORG_BRANCH_CODE" orgBranchCode
FROM FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
left join idx_biz_jg_supervision_info si ON ui."RECORD" = si."RECORD"
WHERE ui."RECORD" in WHERE ui."RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=")"> <foreach collection="records" separator="," item="record" open="(" close=")">
#{record} #{record}
</foreach> </foreach>
GROUP BY unitCode,orgBranchCode
</select> </select>
<select id="selectSuperviseCodeList" resultType="java.lang.String"> <select id="selectSuperviseCodeList" resultType="java.lang.String">
......
...@@ -162,6 +162,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -162,6 +162,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private static String USE_CODE = "use_code"; private static String USE_CODE = "use_code";
private static String ORG_BRANCH_CODE = "supervise_org_code";
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -495,6 +497,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -495,6 +497,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode()); categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建 //如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode(); String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
if(!ObjectUtils.isEmpty(categoryOtherInfo)){
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333",categoryOtherInfo.getCode()));
}
elevatorCode.append(elevator); elevatorCode.append(elevator);
resultMap.put("creatStatus",CREATE); resultMap.put("creatStatus",CREATE);
} else { } else {
...@@ -692,10 +697,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -692,10 +697,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class); Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
String finalSelectSql = selectSql; String finalSelectSql = selectSql;
System.out.println(finalSelectSql);
List<Map<String, Object>> mapList = bizJdbcTemplate.queryForList(finalSelectSql); List<Map<String, Object>> mapList = bizJdbcTemplate.queryForList(finalSelectSql);
page.setTotal(count); page.setTotal(count);
page.setRecords(mapList); page.setRecords(mapList);
return page; return page;
} }
...@@ -707,6 +712,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -707,6 +712,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private static final String LEVEL = "company"; private static final String LEVEL = "company";
private static final String EQUSTATE = "EQU_STATE"; private static final String EQUSTATE = "EQU_STATE";
private static final String USEPLACE = "USE_PLACE";
public Page<Map<String, Object>> getTable(Map<String, Object> map) { public Page<Map<String, Object>> getTable(Map<String, Object> map) {
...@@ -716,6 +722,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -716,6 +722,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
ResponseModel<Page<Map<String, Object>>> model = new ResponseModel<>(); ResponseModel<Page<Map<String, Object>>> model = new ResponseModel<>();
List<JSONObject> objectList = getCompanyType(); List<JSONObject> objectList = getCompanyType();
List<Map<String, Object>> res = new ArrayList<>(); List<Map<String, Object>> res = new ArrayList<>();
if (!ObjectUtils.isEmpty(map.get(USEPLACE))) {
String uesPlace = map.get(USEPLACE).toString();
String address = uesPlace.substring(1, uesPlace.length() - 1);
address = address.replace(", ", "/");
map.put(USEPLACE, address);
}
Long total = 0L; Long total = 0L;
for (JSONObject object : objectList) { for (JSONObject object : objectList) {
String level = object.getString("level"); String level = object.getString("level");
...@@ -855,15 +867,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -855,15 +867,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
log.info("初始化一码通总览数据开始"); log.info("初始化一码通总览数据开始");
} }
equipmentCategoryDataService.remove(new QueryWrapper<>()); equipmentCategoryDataService.remove(new QueryWrapper<>());
getCategoryData(null); getCategoryData(null,null);
} }
private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes) { private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes,List<String> orgBranchCodes) {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
List<EquipmentCategoryData> list = new ArrayList<>(); List<EquipmentCategoryData> list = new ArrayList<>();
// 查询所有单位 // 查询所有单位
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes); List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes,orgBranchCodes);
// 统计查询不同单位、不同装备定义、不同状态下的设备数量 // 统计查询不同单位、不同装备定义、不同状态下的设备数量
List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount(); List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount();
// 查询8大类设备定义 // 查询8大类设备定义
...@@ -878,6 +890,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -878,6 +890,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString()); equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString());
// 指定单位的设备统计信息 // 指定单位的设备统计信息
List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r->r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList()); List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r->r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList());
unitEquipCountList = unitEquipCountList.stream().filter(r->r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList());
for (EquipmentCategory category : equipmentCategories) { for (EquipmentCategory category : equipmentCategories) {
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
data.put("waitClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("waitClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
...@@ -888,14 +901,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -888,14 +901,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
equipmentCategoryData.setRecDate(new Date()); equipmentCategoryData.setRecDate(new Date());
list.add(equipmentCategoryData); list.add(equipmentCategoryData);
} }
if(ObjectUtils.isEmpty(unitCodes)){ if(!ObjectUtils.isEmpty(unitCodes)){
equipmentCategoryDataService.saveOrUpdateBatch(list); equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code",unitCodes));
} else {
for (EquipmentCategoryData equipmentCategoryData : list) {
equipmentCategoryDataService.update(equipmentCategoryData,
new QueryWrapper<EquipmentCategoryData>().eq("unit_code", equipmentCategoryData.getUnitCode()));
}
} }
equipmentCategoryDataService.saveOrUpdateBatch(list);
stopWatch.stop(); stopWatch.stop();
if(log.isInfoEnabled()){ if(log.isInfoEnabled()){
log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds()); log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds());
...@@ -944,11 +953,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -944,11 +953,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
private EquipmentCategoryData updateEquipmentCategoryData(String unitCode) { private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode,String orgBranchCode) {
List<String> unitCodeList = new ArrayList<>(); List<String> unitCodeList = new ArrayList<>();
unitCodeList.add(unitCode); unitCodeList.add(unitCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList); List<String> orgBranchCodeList = new ArrayList<>();
return equipmentCategoryData.get(0); orgBranchCodeList.add(orgBranchCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,null);
return equipmentCategoryData;
} }
@Override @Override
...@@ -958,7 +969,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -958,7 +969,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<String> records = new ArrayList<>(); List<String> records = new ArrayList<>();
List<ESEquipmentCategoryDto> list = new ArrayList<>(); List<ESEquipmentCategoryDto> list = new ArrayList<>();
if(recordList.toString().contains(",")){ if(recordList.toString().contains("[")){
for (String record : (List<String>) recordList) { for (String record : (List<String>) recordList) {
records.add(record); records.add(record);
ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto(); ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto();
...@@ -973,7 +984,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -973,7 +984,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
//删除监管码表数据 //删除监管码表数据
List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records); List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records);
List<String> unitCodeList = superviseInfoMapper.selectUnitCodeList(records); List<Map<String, Object>> unitCodeAndOrgBranchCodeList = superviseInfoMapper.selectUnitCodeList(records);
List<String> unitCodeList = new ArrayList<>();
List<String> orgBranchCodeList = new ArrayList<>();
for (Map<String, Object> objectMap : unitCodeAndOrgBranchCodeList) {
unitCodeList.add(String.valueOf(objectMap.get("unitCode")));
orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode")));
}
if(!ObjectUtils.isEmpty(superviseCodeList)){ if(!ObjectUtils.isEmpty(superviseCodeList)){
supervisoryCodeInfoMapper.updateStatus(superviseCodeList); supervisoryCodeInfoMapper.updateStatus(superviseCodeList);
} }
...@@ -982,7 +1000,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -982,7 +1000,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
superviseInfoMapper.deleteDataAll(records); superviseInfoMapper.deleteDataAll(records);
// 根据统一信用代码更新总览表 // 根据统一信用代码更新总览表
if(!ObjectUtils.isEmpty(unitCodeList)){ if(!ObjectUtils.isEmpty(unitCodeList)){
getCategoryData(unitCodeList); getCategoryData(unitCodeList,orgBranchCodeList);
} }
//删除es中的数据 //删除es中的数据
esEquipmentCategory.deleteAll(list); esEquipmentCategory.deleteAll(list);
...@@ -992,22 +1010,21 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -992,22 +1010,21 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseModel submit(Map<String, Object> map) { public ResponseModel submit(Map<String, Object> map) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo(); SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
ResponseModel responseModel = new ResponseModel(); ResponseModel responseModel = new ResponseModel();
LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(USE_INFO_FROM_ID); LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(USE_INFO_FROM_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");
useInfoFrom.put("REC_DATE", dateFormat.format(calendar.getTime())); useInfoFrom.put("REC_DATE", dateFormat.format(calendar.getTime()));
LinkedHashMap superviseMap = (LinkedHashMap) map.get("data");
String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE")); String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE"));
String code96333 = String.valueOf(superviseMap.get("code96333")); LinkedHashMap supervisionMap = (LinkedHashMap) map.get(SUPERVISION_FROM_ID);
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode")); String orgBranchCode = String.valueOf(supervisionMap.get("ORG_BRANCH_CODE"));
supervisoryCodeInfo.setCode96333("null".equals(code96333) ? null : code96333);
supervisoryCodeInfo.setSupervisoryCode("null".equals(supervisionCode) ? null : supervisionCode);
try { try {
LinkedHashMap superviseMap = (LinkedHashMap) map.get("data");
String claimStatus = String.valueOf(superviseMap.get("claimStatus")); String claimStatus = String.valueOf(superviseMap.get("claimStatus"));
String code96333 = String.valueOf(superviseMap.get("code96333"));
String operateType = String.valueOf(superviseMap.get("operateType")); String operateType = String.valueOf(superviseMap.get("operateType"));
//生成码 //生成码
Map<String, String> codeMap; Map<String, String> codeMap;
...@@ -1016,16 +1033,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1016,16 +1033,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
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 equCategory = String.valueOf(superviseMap.get("equCategory"));
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
//生成码 //生成码
codeMap = creatCode(city, county, equCategory, code96333, supervisionCode); codeMap = creatCode(city, county, equCategory, code96333, supervisionCode);
log.info("已生成对应监管码或96333电梯识别码"); log.info("已生成对应监管码或96333电梯识别码");
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据 //删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map.remove("data"); map.remove("data");
LinkedHashMap supervisionMap = (LinkedHashMap) map.get(SUPERVISION_FROM_ID);
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"));
supervisoryCodeInfo.setCode96333(codeMap.get("code96333"));
supervisoryCodeInfo.setSupervisoryCode(codeMap.get("superviseCode"));
map.put(SUPERVISION_FROM_ID, supervisionMap); map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 //根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) : responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
...@@ -1037,7 +1052,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1037,7 +1052,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
} else if (EquipmentCategoryEnum.DRL.getName().equals(claimStatus)) { } else if (EquipmentCategoryEnum.DRL.getName().equals(claimStatus)) {
map.remove("data"); map.remove("data");
LinkedHashMap supervisionMap = (LinkedHashMap) map.get(SUPERVISION_FROM_ID);
supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333); supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333);
map.put(SUPERVISION_FROM_ID, supervisionMap); map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 //根据操作状态判断是调用新增还是修改接口
...@@ -1047,16 +1061,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1047,16 +1061,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
map.remove("data"); map.remove("data");
responseModel = idxFeignService.batchUpdate(null, null, map); responseModel = idxFeignService.batchUpdate(null, null, map);
} }
stopWatch.stop();
if(log.isInfoEnabled()){
log.info("通用提交耗时:{} 秒",stopWatch.getTotalTimeSeconds());
}
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e);
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
ResponseModel<Object> response = new ResponseModel(); ResponseModel<Object> response = new ResponseModel<>();
response.setDevMessage(e.getMessage());
response.setResult(null); response.setResult(null);
response.setMessage("操作失败,请检查数据输入后重新提交"); response.setMessage("操作失败,请检查数据输入后重新提交");
response.setStatus(HttpStatus.BAD_REQUEST.value()); response.setStatus(HttpStatus.BAD_REQUEST.value());
return response; return response;
} finally { } finally {
updateEquipmentCategoryData(unitCode); updateEquipmentCategoryData(unitCode,orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode()));
} }
return responseModel; return responseModel;
} }
......
...@@ -12,7 +12,8 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl ...@@ -12,7 +12,8 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= true spring.liquibase.enabled= true
feign.client.config.default.connect-timeout=30000
feign.client.config.default.read-timeout=30000
## eureka properties: ## eureka properties:
eureka.client.registry-fetch-interval-seconds=5 eureka.client.registry-fetch-interval-seconds=5
......
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