Commit 0dd3e344 authored by 刘林's avatar 刘林

fix(jg):96333西咸生成超码问题处理

parent f2caa909
......@@ -133,5 +133,6 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("select * from biz_jg_supervisory_code where supervisory_code = #{supervisoryCode} ORDER BY supervisory_code")
SupervisoryCodeInfo searchSupervisoryBySupervisoryCode(@Param("supervisoryCode") String supervisoryCode);
List<Map<String, String>> selectError96333Code();
}
......@@ -52,4 +52,6 @@ public interface IEquipmentCategoryService {
String handleErrorElevatorCode(String supervisorCode, String elevatorCode);
JSONObject batchHandlerCode96333();
String handleError96333Code();
}
......@@ -728,4 +728,15 @@
</where>
ORDER BY parent_id
</select>
<select id="selectError96333Code" resultType="java.util.Map">
SELECT v1."SUPERVISORY_CODE" as supervisoryCode,
v1."CODE96333" as code,
v2.REC_DATE
FROM "idx_biz_jg_other_info" v1
LEFT JOIN "biz_jg_supervisory_code" v2 on v1.SUPERVISORY_CODE = v2.SUPERVISORY_CODE
WHERE v1."SUPERVISORY_CODE" ~ 'X31' AND v1."CODE96333" ~ '^32'
AND v2.create_status = '1'
ORDER BY v2."REC_DATE" DESC
</select>
</mapper>
......@@ -702,4 +702,16 @@ public class EquipmentCategoryController extends BaseController {
public ResponseModel<JSONObject> batchHandlerCode96333() {
return ResponseHelper.buildResponse(equipmentCategoryService.batchHandlerCode96333());
}
/**
* 处理西咸生成96333超31成32 问题
*
* @return s
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/handleError96333Code", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "处理西咸生成96333超31成32 问题", notes = "处理西咸生成96333超31成32 问题")
public ResponseModel<String> handleError96333Code() {
return ResponseHelper.buildResponse(equipmentCategoryService.handleError96333Code());
}
}
......@@ -835,8 +835,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
param.put("CODE96333", elevatorCode);
objMap.put(otherInfo.getRecord(), param);
this.commonUpdateEsDataByIds(objMap);
}
Optional<ESEquipmentInfo> equipmentDaoById = esEquipmentDao.findById(otherInfo.getRecord());
equipmentDaoById.ifPresent(data -> {
data.setCODE96333(elevatorCode);
esEquipmentDao.save(data);
});
}
return "96333码修复成功!";
}
......@@ -2746,6 +2751,20 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
.fluentPut("异常数据,需手动处理:", JSONObject.toJSONString(manualProcessData));
}
@Override
public String handleError96333Code() {
List<Map<String, String>> exceptionData = equipmentCategoryMapper.selectError96333Code();
exceptionData.stream()
.map(data -> data.get("supervisoryCode"))
.filter(Objects::nonNull)
.forEach(supervisoryCode -> {
String elevatorCode = createElevatorCode("31");
handleErrorElevatorCode(supervisoryCode, elevatorCode);
});
return String.format("修复96333码成功,共处理 %d 条", exceptionData.size());
}
private void saveCode96333ForEs(String record, String code96333) {
// idx_biz_view_jg_all
Optional<ESEquipmentCategoryDto> esEquipmentCategoryDto = esEquipmentCategory.findById(record);
......
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