Commit 889f837d authored by tianyiming's avatar tianyiming

赋码修改

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