Commit 540cd54a authored by tianyiming's avatar tianyiming

添加西咸新区生成96333码和监管码规则

parent 285586bc
...@@ -214,4 +214,11 @@ public class IdxBizJgUseInfo extends TzsBaseEntity { ...@@ -214,4 +214,11 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
@TableField("\"DATA_SOURCE\"") @TableField("\"DATA_SOURCE\"")
private String dataSource; private String dataSource;
/**
* 是否西咸
*/
@TableField("\"IS_NOT_XIXIAN\"")
private String isNotXiXian;
} }
...@@ -451,6 +451,7 @@ ...@@ -451,6 +451,7 @@
USE_STATE_CHANGE_DATE, USE_STATE_CHANGE_DATE,
USE_UNIT_CREDIT_CODE, USE_UNIT_CREDIT_CODE,
USE_UNIT_NAME, USE_UNIT_NAME,
IS_NOT_XIXIAN,
RECORD as id, RECORD as id,
SEQUENCE_NBR as sequenceNbr SEQUENCE_NBR as sequenceNbr
from idx_biz_jg_use_info from idx_biz_jg_use_info
......
...@@ -239,6 +239,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -239,6 +239,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private static final String STREET_LEVEL = "4"; private static final String STREET_LEVEL = "4";
//西安行政区划code //西安行政区划code
private static final String XIAN = "610100"; private static final String XIAN = "610100";
//咸阳行政区划code
private static final String XIAN_YANG = "610400";
//判断行政区划查询市还是区 //判断行政区划查询市还是区
private static final String END_CODE = "0000"; private static final String END_CODE = "0000";
//判断行政区划查询街道 //判断行政区划查询街道
...@@ -452,7 +454,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -452,7 +454,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
//生成码 //生成码
EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy(); EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy();
Map<String, String> codeMap = categoryService.creatCode(city, county, equipCategory, null, null); Map<String, String> codeMap = categoryService.creatCode(null,city, county, equipCategory, null, null);
if (ObjectUtils.isEmpty(codeMap)) { if (ObjectUtils.isEmpty(codeMap)) {
return new HashMap<>(); return new HashMap<>();
} }
...@@ -686,7 +688,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -686,7 +688,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* 具体生成监管码和电梯96333识别码逻辑 * 具体生成监管码和电梯96333识别码逻辑
*/ */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333, String supervisionCode) { public synchronized Map<String, String> creatCode(String isNotXiXian,String city, String county, String equipCategory, String code96333, String supervisionCode) {
RLock lock = redissonClient.getLock(LOCK_KEY); RLock lock = redissonClient.getLock(LOCK_KEY);
Map<String, String> resultMap = null; Map<String, String> resultMap = null;
try { try {
...@@ -698,11 +700,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -698,11 +700,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo(); CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo();
String prefix; String prefix;
//判断是否需要生成96333电梯码 //判断是否需要生成96333电梯码
if (equipCategory.startsWith("3") && !XIAN.equals(city)) { if (equipCategory.startsWith("3") && (((XIAN.equals(city) || XIAN_YANG.equals(city)) && "1".equals(isNotXiXian)) || !XIAN.equals(city))) {
//判断数据是否携带96333电梯码,携带则使用,不携带则生成 //判断数据是否携带96333电梯码,携带则使用,不携带则生成
if ("null".equals(code96333)) { if ("null".equals(code96333)) {
if (((XIAN.equals(city) || XIAN_YANG.equals(city)) && "1".equals(isNotXiXian))) {
prefix = EquipmentCategoryEnum.XXCSM.getValue();
} else {
Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county); Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county);
prefix = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString(); prefix = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString();
}
//查询未使用的电梯码 //查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode()); categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建 //如果存在未使用的电梯码则启用未使用的否则创建
...@@ -719,7 +725,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -719,7 +725,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成 //判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if ("null".equals(supervisionCode)) { if ("null".equals(supervisionCode)) {
String supervisor = createSupervisorCode(city, county, equipCategory); String supervisor = createSupervisorCode(isNotXiXian, city, county, equipCategory);
supervisorCode.append(supervisor); supervisorCode.append(supervisor);
} else { } else {
supervisorCode = new StringBuilder(supervisionCode); supervisorCode = new StringBuilder(supervisionCode);
...@@ -768,11 +774,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -768,11 +774,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @param county 行政区划区 * @param county 行政区划区
* @return 监管码 * @return 监管码
*/ */
public String createSupervisorCode(String city, String county, String equipCategory) { public String createSupervisorCode(String isNotXiXian, String city, String county, String equipCategory) {
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
String division = null;
if (((XIAN.equals(city) || XIAN_YANG.equals(city)) && "1".equals(isNotXiXian))) {
division = "X";
} else {
//生成监管码前缀 //生成监管码前缀
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county); Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString(); division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString();
}
supervisorCode.append(division).append(equipCategory).append("-"); supervisorCode.append(division).append(equipCategory).append("-");
//获取行政区划区县、市是否存在历史监管码 //获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString()); CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
...@@ -920,6 +931,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -920,6 +931,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result.put(equipmentMessage.getDesInfo(), desInfo); result.put(equipmentMessage.getDesInfo(), desInfo);
// 监督管理信息 // 监督管理信息
Map<String, Object> supInfo = getSupInfo(map); Map<String, Object> supInfo = getSupInfo(map);
if ("1".equals(useInfo.get("IS_NOT_XIXIAN"))) {
supInfo.put("CITY", "咸阳");
} else {
supInfo.put("CITY", useInfo.get("CITY_NAME"));
}
result.put(equipmentMessage.getSupInfo(), supInfo); result.put(equipmentMessage.getSupInfo(), supInfo);
// 施工信息 // 施工信息
Map<String, Object> comInfo = getComInfo(map); Map<String, Object> comInfo = getComInfo(map);
...@@ -1450,6 +1466,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1450,6 +1466,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
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()));
String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE")); String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE"));
String isNotXiXian = "null".equals(String.valueOf(useInfoFrom.get("IS_NOT_XIXIAN"))) ? "0" : String.valueOf(useInfoFrom.get("IS_NOT_XIXIAN"));
LinkedHashMap supervisionMap = (LinkedHashMap) map.get(supervision_form_id); LinkedHashMap supervisionMap = (LinkedHashMap) map.get(supervision_form_id);
String record = null; String record = null;
LinkedHashMap superviseMap = (LinkedHashMap) map.get("data"); LinkedHashMap superviseMap = (LinkedHashMap) map.get("data");
...@@ -1494,7 +1511,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1494,7 +1511,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode")); String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy(); EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy();
//生成码 //生成码
codeMap = categoryService.creatCode(city, county, equCategory, code96333, supervisionCode); codeMap = categoryService.creatCode(isNotXiXian,city, county, equCategory, code96333, supervisionCode);
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据 //删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map.remove("data"); map.remove("data");
supervisionMap.put("CODE96333", codeMap.get("code96333")); supervisionMap.put("CODE96333", codeMap.get("code96333"));
...@@ -1663,7 +1680,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1663,7 +1680,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//八大类技术参数实体填充 //八大类技术参数实体填充
List<IdxBizJgMainParts> mainPartsList = new ArrayList<>(); List<IdxBizJgMainParts> mainPartsList = new ArrayList<>();
List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>(); List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>();
String equList = idxBizJgOtherInfo.getAlias().toString();
if (EquipmentTypeEnum.DT.getCode().equals(alias)) { if (EquipmentTypeEnum.DT.getCode().equals(alias)) {
//维保备案信息 //维保备案信息
LinkedHashMap maintenanceForm = (LinkedHashMap) map.get(maintenance_form_id); LinkedHashMap maintenanceForm = (LinkedHashMap) map.get(maintenance_form_id);
......
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