Commit 889f837d authored by tianyiming's avatar tianyiming

赋码修改

parent f154d8d2
...@@ -21,7 +21,8 @@ public enum EquipmentCategoryEnum { ...@@ -21,7 +21,8 @@ public enum EquipmentCategoryEnum {
CSM("96333初始码","00001"), CSM("96333初始码","00001"),
CSZT("初始状态","0"), CSZT("初始状态","0"),
YSY("已使用","1"), YSY("已使用","1"),
WSY("未使用","2"); WSY("未使用","2"),
BF("报废","6");
private String name; private String name;
private String code; private String code;
......
...@@ -179,10 +179,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -179,10 +179,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ObjectUtils.isEmpty(record)) { if (!ObjectUtils.isEmpty(record)) {
EquInfoDto equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record); EquInfoDto equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record);
String supervisorCode, elevatorCode; String supervisorCode, elevatorCode;
equState = EquipmentCategoryEnum.WSY.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode(); //设备状态为报废,对应电梯码作废
supervisorCode = EquipmentCategoryEnum.WSY.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("supervisorCode"); equState = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode();
elevatorCode = EquipmentCategoryEnum.WSY.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("elevatorCode"); supervisorCode = codeMap.get("supervisorCode");
elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("elevatorCode");
//对应电梯码作废
categoryOtherInfoMapper.updateCode(equInfoDto.getCode(), equState); categoryOtherInfoMapper.updateCode(equInfoDto.getCode(), equState);
//修改源数据的电梯码
categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record); categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record);
} else { } else {
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo(); SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
...@@ -332,6 +335,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -332,6 +335,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
CategoryOtherInfo otherInfo; CategoryOtherInfo otherInfo;
String prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city); String prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city);
//查询未使用的电梯码
CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode()); CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
if (!ObjectUtils.isEmpty(record)) { if (!ObjectUtils.isEmpty(record)) {
//查询对应record对应数据 //查询对应record对应数据
...@@ -349,6 +353,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -349,6 +353,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ObjectUtils.isEmpty(otherInfo.getCode())) { if (!ObjectUtils.isEmpty(otherInfo.getCode())) {
elevatorCode.append(new StringBuilder(otherInfo.getCode())); elevatorCode.append(new StringBuilder(otherInfo.getCode()));
} else { } else {
//如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode(); String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
elevatorCode.append(elevator); elevatorCode.append(elevator);
} }
...@@ -358,6 +363,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -358,6 +363,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String supervisor = createSupervisorCode(city, county, equipCategory); String supervisor = createSupervisorCode(city, county, equipCategory);
supervisorCode.append(supervisor); supervisorCode.append(supervisor);
if (equipCategory.startsWith("3") && !XIAN.equals(city)) { if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
//如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode(); String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
elevatorCode.append(elevator); elevatorCode.append(elevator);
} }
......
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