代码更新

This commit is contained in:
2022-07-21 16:29:43 +08:00
parent bf4154797d
commit 4333de556c
3 changed files with 14 additions and 3 deletions

View File

@@ -622,17 +622,21 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
public void submitReceive(JSONObject whereJson) {
JSONObject jsonMst = whereJson.getJSONObject("mst"); // 维修单主表
JSONArray tableData = whereJson.getJSONArray("tableData"); // 更换备件明细
String devicerecord_id = jsonMst.getString("devicerecord_id");
WQLObject recoudTab = WQLObject.getWQLObject("EM_BI_DeviceRepairReplaceRecord"); // 设备维修单更换记录表
WQLObject spareBOMTab = WQLObject.getWQLObject("EM_BI_EquipmentSpareBOM"); // 设备档案BOM备件表
WQLObject mst_wql = WQLObject.getWQLObject("EM_BI_IOStorInv"); // 出入库主表
WQLObject dtl_wql = WQLObject.getWQLObject("EM_BI_IOStorInvDtl"); // 出入库明细表
WQLObject dis_wql = WQLObject.getWQLObject("EM_BI_IOStorInvDis"); // 出入库分配表
WQLObject file_wql = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 设备档案表
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getNickName();
String now = DateUtil.now();
JSONObject jsonFile = file_wql.query("devicerecord_id = '" + devicerecord_id + "'").uniqueResult(0);
JSONObject stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_attachment = '1'").uniqueResult(0);
String stor_id = stor.getString("stor_id");
// 出库单主表标识
@@ -769,9 +773,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
io_mst.put("dis_optname", nickName);
io_mst.put("dis_time", DateUtil.now());
io_mst.put("update_time", now);
io_mst.put("device_id", jsonMst.get("device_id"));
io_mst.put("device_code", jsonMst.get("device_code"));
io_mst.put("device_name", jsonMst.get("device_name"));
io_mst.put("device_id", jsonFile.get("devicerecord_id"));
io_mst.put("device_code", jsonFile.get("device_code"));
io_mst.put("device_name", jsonFile.get("device_name"));
io_mst.put("is_delete", "0");
io_mst.put("is_upload", "0");
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();

View File

@@ -188,6 +188,10 @@ public class DevicerepairplanmstServiceImpl implements DevicerepairplanmstServic
jsonDtl.put("dtl_remark", json.getString("dtl_remark"));
dtlTab.insert(jsonDtl);
}
// 校验 是否有相同设备 相同周期
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("此设备已经存在此周期的计划");
}
@Override

View File

@@ -192,6 +192,9 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
jsonDtl.put("dtl_remark", json.getString("dtl_remark"));
dtlTab.insert(jsonDtl);
}
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("此计划的周期只能存在一个");
}
@Override