代码更新

This commit is contained in:
2022-07-21 17:24:27 +08:00
parent cf45b1fd9a
commit 1cc293d879
2 changed files with 4 additions and 4 deletions

View File

@@ -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); 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(); 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); 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 @Override

View File

@@ -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); 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(); 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); 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 @Override