Commit 10dfc1ca authored by hcing's avatar hcing

feat(ymt):批量更新电梯的96333码

parent f8e8400f
...@@ -27,5 +27,5 @@ public interface RiskReportMapper extends BaseMapper<RiskReport> { ...@@ -27,5 +27,5 @@ public interface RiskReportMapper extends BaseMapper<RiskReport> {
Map<String, String> getCompanyBySeq(@Param("companySeq") String companySeq); Map<String, String> getCompanyBySeq(@Param("companySeq") String companySeq);
@Select("select all_risk_disposal_unit_org_code from tzs_risk_report where sequence_nbr = #{sequenceNbr}") @Select("select all_risk_disposal_unit_org_code from tzs_risk_report where sequence_nbr = #{sequenceNbr}")
String getRiskDisposalUnitOrgCode(Long sequenceNbr); String getAllRiskDisposalUnitOrgCode(Long sequenceNbr);
} }
...@@ -218,7 +218,7 @@ public class RiskReportServiceImpl extends BaseService<RiskReport, RiskReport, R ...@@ -218,7 +218,7 @@ public class RiskReportServiceImpl extends BaseService<RiskReport, RiskReport, R
private String buildAllRiskDisposalUnitOrgCode(String defaultOrgCode, Long sequenceNbr) { private String buildAllRiskDisposalUnitOrgCode(String defaultOrgCode, Long sequenceNbr) {
if (!ObjectUtils.isEmpty(sequenceNbr)) { if (!ObjectUtils.isEmpty(sequenceNbr)) {
String allRiskDisposalUnitOrgCode = riskReportMapper.getRiskDisposalUnitOrgCode(sequenceNbr); String allRiskDisposalUnitOrgCode = riskReportMapper.getAllRiskDisposalUnitOrgCode(sequenceNbr);
if (!ObjectUtils.isEmpty(allRiskDisposalUnitOrgCode)) { if (!ObjectUtils.isEmpty(allRiskDisposalUnitOrgCode)) {
return String.join(",", Stream.concat( return String.join(",", Stream.concat(
Arrays.stream(allRiskDisposalUnitOrgCode.split(",")), Arrays.stream(allRiskDisposalUnitOrgCode.split(",")),
......
...@@ -14,38 +14,41 @@ public enum EquipmentCategoryEnum { ...@@ -14,38 +14,41 @@ public enum EquipmentCategoryEnum {
* *行政区划分及对应初始监管码 * *行政区划分及对应初始监管码
*/ */
XZQHDT("行政区划电梯", "XZQHDT", "行政区划电梯"), XZQHDT("行政区划电梯", "XZQHDT", "行政区划电梯", null),
XZQH("行政区划", "XZQH", "行政区划"), XZQH("行政区划", "XZQH", "行政区划", null),
BLW("补零位", "0", "补零位"), BLW("补零位", "0", "补零位", null),
JGM("监管码初始码", "0000001", "监管码初始码"), JGM("监管码初始码", "0000001", "监管码初始码", null),
XXCSM("西咸96333初始码", "85000", "31"), XXCSM("西咸96333初始码", "85000", "31", "610100"),
BJCSM("宝鸡96333初始码", "13000", "32"), BJCSM("宝鸡96333初始码", "13000", "32", "610300"),
XYCSM("咸阳96333初始码", "75000", "33"), XYCSM("咸阳96333初始码", "75000", "33", "610400"),
TCCSM("铜川96333初始码", "05000", "34"), TCCSM("铜川96333初始码", "05000", "34", "610200"),
WNCSM("渭南96333初始码", "13000", "35"), WNCSM("渭南96333初始码", "13000", "35", "610500"),
YACSM("延安96333初始码", "11000", "36"), YACSM("延安96333初始码", "11000", "36", "610600"),
YUCSM("榆林96333初始码", "10000", "37"), YUCSM("榆林96333初始码", "10000", "37", "610800"),
HZCSM("汉中96333初始码", "09000", "38"), HZCSM("汉中96333初始码", "09000", "38", "610700"),
AKCSM("安康96333初始码", "11000", "39"), AKCSM("安康96333初始码", "11000", "39", "610900"),
SLCSM("商洛96333初始码", "06000", "40"), SLCSM("商洛96333初始码", "06000", "40", "611000"),
YLCSM("杨凌96333初始码", "70000", "41"), YLCSM("杨陵96333初始码", "70000", "41", "610403"),
HCCSM("韩城96333初始码", "08000", "42"), HCCSM("韩城96333初始码", "08000", "42", "610581"),
SMCSM("神木96333初始码", "06000", "43"), SMCSM("神木96333初始码", "06000", "43", "610881"),
FGCSM("府谷96333初始码", "02000", "44"), FGCSM("府谷96333初始码", "02000", "44", "610822"),
YJL("已拒领", "6037", "已拒领"), YJL("已拒领", "6037", "已拒领", null),
YRL("已认领", "6035", "已认领"), YRL("已认领", "6035", "已认领", null),
DRL("待认领", "6036", "待认领"), DRL("待认领", "6036", "待认领", null),
CSZT("初始状态", "0", "初始状态"), CSZT("初始状态", "0", "初始状态", null),
YSY("已使用", "1", "已使用"), YSY("已使用", "1", "已使用", null),
WSY("未使用", "2", "未使用"), WSY("未使用", "2", "未使用", null),
BF("报废", "6", "报废"); BF("报废", "6", "报废", null);
private String name; private String name;
private String code; private String code;
private String value; private String value;
private String cityCode;
public static Map<String, String> getName = new HashMap<>(); public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>(); public static Map<String, String> getCode = new HashMap<>();
public static Map<String, String> getValue = new HashMap<>(); public static Map<String, String> getValue = new HashMap<>();
public static Map<String, String> getCityCode = new HashMap<>();
public static final Map<String, String> getCodeValueMap = new HashMap<>();
private static final Map<String, String> valueToCodeMap = new HashMap<>(); private static final Map<String, String> valueToCodeMap = new HashMap<>();
static { static {
...@@ -53,7 +56,11 @@ public enum EquipmentCategoryEnum { ...@@ -53,7 +56,11 @@ public enum EquipmentCategoryEnum {
getName.put(e.code, e.name); getName.put(e.code, e.name);
getCode.put(e.value, e.code); getCode.put(e.value, e.code);
getValue.put(e.value, e.code); getValue.put(e.value, e.code);
valueToCodeMap.put("96333_"+ e.value, e.getValue() + e.getCode()); if (e.cityCode != null) {
getCityCode.put(e.cityCode, e.code);
}
getCodeValueMap.put(e.code, e.value);
valueToCodeMap.put("96333_" + e.value, e.getValue() + e.getCode());
} }
} }
...@@ -61,4 +68,9 @@ public enum EquipmentCategoryEnum { ...@@ -61,4 +68,9 @@ public enum EquipmentCategoryEnum {
public static String getCodeByValue(String value) { public static String getCodeByValue(String value) {
return valueToCodeMap.get(value); return valueToCodeMap.get(value);
} }
// 根据code获取对应的value
public static String getValueByCode(String code) {
return getCodeValueMap.get(code);
}
} }
...@@ -6,8 +6,9 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; ...@@ -6,8 +6,9 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.UseUnitCreditCodeCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.UseUnitCreditCodeCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.entity.SupervisoryCodeInfo;
import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -109,5 +110,29 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -109,5 +110,29 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("SELECT * FROM tz_equipment_category WHERE parent_id = #{parentId}") @Select("SELECT * FROM tz_equipment_category WHERE parent_id = #{parentId}")
List<EquipmentCategoryDto> getEquDefineByParentId(String parentId); List<EquipmentCategoryDto> getEquDefineByParentId(String parentId);
@Select("SELECT\n" +
"\tri.record,\n" +
"\tri.EQU_LIST equList,\n" +
"\tui.\"CITY\" city,\n" +
"\tui.\"COUNTY\" county,\n" +
"\tui.\"IS_NOT_XIXIAN\" isNotXixian,\n" +
"\toi.code96333,\n" +
"\toi.SUPERVISORY_CODE supervisoryCode \n" +
"FROM\n" +
"\tidx_biz_jg_register_info ri\n" +
"\tLEFT JOIN idx_biz_jg_use_info ui ON ui.record = ri.record\n" +
"\tLEFT JOIN idx_biz_jg_other_info oi ON oi.record = ri.record \n" +
"WHERE\n" +
"\tri.equ_list = '3000' \n" +
"\tAND ui.IS_INTO_MANAGEMENT = 1 \n" +
"\tAND oi.SUPERVISORY_CODE IS NOT NULL \n" +
"\tAND ( oi.code96333 IS NULL OR oi.code96333 = '' ) \n" +
"\tAND ( ui.city != '610100' OR ui.\"IS_NOT_XIXIAN\" = 1 )\n" +
"\tand oi.SUPERVISORY_CODE in ('A3100-0002769')\n")
List<Map<String, String>> selectExceptionCode96333();
@Select("select * from biz_jg_supervisory_code where supervisory_code = #{supervisoryCode} ORDER BY supervisory_code")
SupervisoryCodeInfo searchSupervisoryBySupervisoryCode(@Param("supervisoryCode") String supervisoryCode);
} }
package com.yeejoin.amos.boot.module.ymt.api.service; package com.yeejoin.amos.boot.module.ymt.api.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -49,4 +50,6 @@ public interface IEquipmentCategoryService { ...@@ -49,4 +50,6 @@ public interface IEquipmentCategoryService {
String selectExceedElevatorCode(String prefix); String selectExceedElevatorCode(String prefix);
String handleErrorElevatorCode(String supervisorCode, String elevatorCode); String handleErrorElevatorCode(String supervisorCode, String elevatorCode);
JSONObject batchHandlerCode96333();
} }
...@@ -680,4 +680,26 @@ public class EquipmentCategoryController extends BaseController { ...@@ -680,4 +680,26 @@ public class EquipmentCategoryController extends BaseController {
@RequestParam("elevatorCode") String elevatorCode) { @RequestParam("elevatorCode") String elevatorCode) {
return ResponseHelper.buildResponse(equipmentCategoryService.handleErrorElevatorCode(supervisorCode, elevatorCode)); return ResponseHelper.buildResponse(equipmentCategoryService.handleErrorElevatorCode(supervisorCode, elevatorCode));
} }
/**
* 批量更新电梯的96333码
* 1,先于【码表 biz_jg_supervisory_code】中进行匹配,有的话使用码表的写入other_info数据库
* 2,码表没有直接生成后写入
*
* @return 程序处理的数据 + 异常的需要手动处理的数据集合
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT",
value = "批量更新电梯的96333码," +
"1,先于【码表 biz_jg_supervisory_code】中进行匹配,有的话使用码表的写入other_info数据库," +
"2,码表没有直接生成后写入," +
"返回值:异常的需要手动处理的数据集合",
notes = "批量更新电梯的96333码," +
"1,先于【码表 biz_jg_supervisory_code】中进行匹配," +
"有的话使用码表的写入other_info数据库,2,码表没有直接生成后写入," +
"返回值:异常的需要手动处理的数据集合")
@PutMapping(value = "/batchHandlerCode96333")
public ResponseModel<JSONObject> batchHandlerCode96333() {
return ResponseHelper.buildResponse(equipmentCategoryService.batchHandlerCode96333());
}
} }
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