Commit 10a49d1a authored by tianyiming's avatar tianyiming

更新96333码

parent 5c4b04c2
...@@ -29,6 +29,19 @@ public class EquInfoDto { ...@@ -29,6 +29,19 @@ public class EquInfoDto {
*/ */
private String record; private String record;
/**
* 电梯96333识别码
*/
private String code;
/**
* 监管码
*/
private String supervisor;
/**
* 设备认领状态
*/
private String status;
} }
...@@ -58,7 +58,7 @@ public class CategoryOtherInfo{ ...@@ -58,7 +58,7 @@ public class CategoryOtherInfo{
@TableField("SUPERVISORY_CODE") @TableField("SUPERVISORY_CODE")
private String supervisoryCode; private String supervisoryCode;
@ApiModelProperty(value = "认领状态:1代表已认领,0代表待认领,2代表拒领") @ApiModelProperty(value = "认领状态:6035代表已认领,6036代表待认领,6037代表拒领")
@TableField("CLAIM_STATUS") @TableField("CLAIM_STATUS")
private String claimStatus; private String claimStatus;
} }
...@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Param;
*/ */
public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> { public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
int updateSupervisorCode(String supervisorCode, String code, String sequenceNbr); int updateSupervisorCode(String supervisorCode, String code, String record);
CategoryOtherInfo selectSupervisorCode(@Param("supervisorCode") String supervisorCode); CategoryOtherInfo selectSupervisorCode(@Param("supervisorCode") String supervisorCode);
......
...@@ -17,12 +17,16 @@ ...@@ -17,12 +17,16 @@
<update id="updateSupervisorCode"> <update id="updateSupervisorCode">
UPDATE idx_biz_jg_other_info UPDATE idx_biz_jg_other_info
SET "SUPERVISORY_CODE" = #{supervisorCode} SET
"RECORE" = #{record}
<if test="supervisorCode != null and supervisorCode != ''">
, "SUPERVISORY_CODE" = #{supervisorCode}
</if>
<if test="code != null and code != ''"> <if test="code != null and code != ''">
, "CODE96333" = #{code} , "CODE96333" = #{code}
</if> </if>
WHERE WHERE
"SEQUENCE_NBR" = #{sequenceNbr} "REOCRD" = #{reocrd}
</update> </update>
<select id="selectElevatorCode" resultType="com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo"> <select id="selectElevatorCode" resultType="com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo">
...@@ -43,6 +47,8 @@ ...@@ -43,6 +47,8 @@
"COUNTY", "COUNTY",
"EQU_LIST" equipList, "EQU_LIST" equipList,
"EQU_CATEGORY" equipCategory, "EQU_CATEGORY" equipCategory,
ibjoi."CODE96333" code,
ibjoi."CLAIM_STATUS" STATUS,
ibjoi."RECORD" ibjoi."RECORD"
FROM FROM
idx_biz_jg_other_info ibjoi idx_biz_jg_other_info ibjoi
......
...@@ -140,19 +140,26 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -140,19 +140,26 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
equipList = map.get("EQU_LIST").toString(); equipList = map.get("EQU_LIST").toString();
} else { } else {
EquInfoDto equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record); EquInfoDto equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record);
//判断这条数据是否已经有电梯96333码和监管码
//如果都有则直接返回
if (ObjectUtils.isEmpty(equInfoDto.getSupervisor()) || ObjectUtils.isEmpty(equInfoDto.getCode())) {
city = equInfoDto.getCity(); city = equInfoDto.getCity();
county = equInfoDto.getCounty(); county = equInfoDto.getCounty();
equipCategory = equInfoDto.getEquipCategory(); equipCategory = equInfoDto.getEquipCategory();
equipList = equInfoDto.getEquipList(); equipList = equInfoDto.getEquipList();
} else {
return 0;
}
} }
//生成码 //生成码
Map<String, String> codeMap = new HashMap<>(); Map<String, String> codeMap = new HashMap<>();
synchronized (EquipmentCategoryServiceImpl.class) { synchronized (EquipmentCategoryServiceImpl.class) {
codeMap = creatCode(city, county, equipCategory, equipList, record); codeMap = creatCode(city, county, equipCategory, equipList, record);
} }
//查询最后一条数据并进行修改 if (ObjectUtils.isEmpty(codeMap)) {
CategoryOtherInfo otherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().orderByDesc("REC_DATE").last("limit 1")); return 0;
return categoryOtherInfoMapper.updateSupervisorCode(codeMap.get("supervisorCode"), codeMap.get("elevatorCode"), otherInfo.getSequenceNbr()); }
return categoryOtherInfoMapper.updateSupervisorCode(codeMap.get("supervisorCode"), codeMap.get("elevatorCode"), record);
} }
@Override @Override
...@@ -226,6 +233,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -226,6 +233,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisorCode.append(division).append(equipCategory); supervisorCode.append(division).append(equipCategory);
//获取行政区划区县、市是否存在历史监管码 //获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString()); CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
//查询对应record对应数据
CategoryOtherInfo otherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("RECORD", record));
if (!ObjectUtils.isEmpty(otherInfo) && ObjectUtils.isEmpty(otherInfo.getSupervisoryCode())) {
//生成对应监管码 //生成对应监管码
if (!ObjectUtils.isEmpty(supervisor)) { if (!ObjectUtils.isEmpty(supervisor)) {
if (supervisor.getSupervisoryCode() != null) { if (supervisor.getSupervisoryCode() != null) {
...@@ -246,13 +256,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -246,13 +256,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} else { } else {
supervisorCode.append(EquipmentCategoryEnum.JGM.getCode()); supervisorCode.append(EquipmentCategoryEnum.JGM.getCode());
} }
}
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
//判断是否是否需要生成96333电梯码 //判断是否是否需要生成96333电梯码
if (EquipmentClassifityEnum.DT.getCode().equals(equipList)) { if (EquipmentClassifityEnum.DT.getCode().equals(equipList)) {
//查询最后一条数据并进行修改 if (!ObjectUtils.isEmpty(otherInfo) && ObjectUtils.isEmpty(otherInfo.getCode())) {
CategoryOtherInfo otherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("RECORD", record));
if (!ObjectUtils.isEmpty(otherInfo)) {
List<CategoryOtherInfo> codeList = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("CODE96333", otherInfo.getCode())); List<CategoryOtherInfo> codeList = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("CODE96333", otherInfo.getCode()));
if (ObjectUtils.isEmpty(codeList)) { if (ObjectUtils.isEmpty(codeList)) {
//生成生成96333电梯码前缀 //生成生成96333电梯码前缀
...@@ -284,8 +293,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -284,8 +293,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
} }
} }
resultMap.put("supervisorCode", ObjectUtils.isEmpty(supervisorCode.toString()) ? null : supervisorCode.toString()); if (ObjectUtils.isEmpty(supervisorCode) && ObjectUtils.isEmpty(elevatorCode)) {
resultMap.put("elevatorCode", ObjectUtils.isEmpty(elevatorCode.toString()) ? null : elevatorCode.toString()); return null;
}
resultMap.put("supervisorCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("elevatorCode", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
return resultMap; return resultMap;
} }
......
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