Commit ae51bbe3 authored by tianyiming's avatar tianyiming

渭南韩城市96333码生成错乱修改

parent 0804f4b6
......@@ -466,11 +466,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
//判断数据是否携带96333电梯码,携带则使用,不携带则生成
if("null".equals(code96333)){
prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city);
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();
//查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(prefix) : categoryOtherInfo.getCode();
if(!ObjectUtils.isEmpty(categoryOtherInfo)){
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333",categoryOtherInfo.getCode()));
}
......@@ -555,20 +556,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/**
* 生成96333电梯识别码
*
* @param city 行政区划市
* @param county 行政区划区
* @param prefix 电梯码前缀
* @return 96333电梯识别码
*/
public String createElevatorCode(String city, String county) {
public String createElevatorCode(String prefix) {
StringBuilder elevatorCode = new StringBuilder();
//生成生成96333电梯码前缀
Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county);
String elevator = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString();
elevatorCode.append(elevator);
elevatorCode.append(prefix);
String initCode = elevatorCode + EquipmentCategoryEnum.getValue.get(elevatorCode.toString());
CategoryOtherInfo initSupervisoryCode = categoryOtherInfoMapper.queryInitCode(initCode); // 查询是否已经生成过初始值
if (ValidationUtil.isEmpty(initSupervisoryCode)) {
elevatorCode.append(EquipmentCategoryEnum.getValue.get(elevator));
elevatorCode.append(EquipmentCategoryEnum.getValue.get(prefix));
} else {
//获取行政区划区县、市是否存在历史96333电梯码
CategoryOtherInfo elevatorOtherInfo = categoryOtherInfoMapper.selectElevatorCode(elevatorCode.toString(), null);
......
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