优化
This commit is contained in:
@@ -172,6 +172,9 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||
String nowStatus = jsonMst.getString("status");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if ("10".equals(status)) {//启用
|
||||
if (!"11,00".contains(nowStatus)) {
|
||||
throw new BadRequestException("只有停用、生成状态才可启用!");
|
||||
}
|
||||
if (StrUtil.isEmpty(jsonMst.getString("device_bom_id"))) {
|
||||
throw new BadRequestException("设备BOM不能为空!");
|
||||
}
|
||||
@@ -200,7 +203,9 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
|
||||
EM_BI_DeviceLifeCycle.insert(jo2);
|
||||
} else if ("11".equals(status)) {//禁用
|
||||
map.put("status", "11");
|
||||
|
||||
if (!"10".contains(nowStatus)) {
|
||||
throw new BadRequestException("只有启用状态才可停用!");
|
||||
}
|
||||
JSONObject jo2 = new JSONObject();
|
||||
jo2.put("devicechangedtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo2.put("devicerecord_id", jsonMst.getString("devicerecord_id"));
|
||||
|
||||
Reference in New Issue
Block a user