代码更新
This commit is contained in:
@@ -119,7 +119,7 @@ public class DevicerepairplanmstServiceImpl implements DevicerepairplanmstServic
|
||||
|
||||
// 校验 : 是否有相同设备 相同周期
|
||||
JSONObject jsonObject = mstTab.query("devicerecord_id = '" + whereJson.getString("devicerecord_id") + "' and maintenancecycle = '" + whereJson.getString("maintenancecycle") + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("此设备已经存在此周期的计划");
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("该设备当前周期计划已经存在");
|
||||
|
||||
// 插入主表
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
@@ -191,7 +191,7 @@ public class DevicerepairplanmstServiceImpl implements DevicerepairplanmstServic
|
||||
|
||||
// 校验 : 是否有相同设备 相同周期
|
||||
JSONArray jsonObject = mstTab.query("devicerecord_id = '" + whereJson.getString("devicerecord_id") + "' and maintenancecycle = '" + whereJson.getString("maintenancecycle") + "' and is_delete = '0'").getResultJSONArray(0);
|
||||
if (jsonObject.size() > 1) throw new BadRequestException("此设备已经存在此周期的计划");
|
||||
if (jsonObject.size() > 1) throw new BadRequestException("该设备当前周期计划已经存在");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -119,7 +119,7 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
|
||||
|
||||
// 校验:相同的设备、周期只能存在一个
|
||||
JSONObject jsonObject = mstTab.query("devicerecord_id = '" + whereJson.getString("devicerecord_id") + "' and maintenancecycle = '" + whereJson.getString("maintenancecycle") + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("此计划的周期只能存在一个");
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("该设备当前周期计划已经存在");
|
||||
|
||||
// 插入主表
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
@@ -194,7 +194,7 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
|
||||
}
|
||||
|
||||
JSONArray jsonObject = mstTab.query("devicerecord_id = '" + whereJson.getString("devicerecord_id") + "' and maintenancecycle = '" + whereJson.getString("maintenancecycle") + "' and is_delete = '0'").getResultJSONArray(0);
|
||||
if (jsonObject.size() > 1) throw new BadRequestException("此计划的周期只能存在一个");
|
||||
if (jsonObject.size() > 1) throw new BadRequestException("该设备当前周期计划已经存在");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user