From d285f095815e6666459b07883ce15cc6ddb5ffcc Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Fri, 2 Dec 2022 18:38:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HandNewMaterialServiceImpl.java | 135 +++++++++--------- .../java/org/nl/wms/pf/wql/QPF_FORMULA01.wql | 2 + .../impl/FactorywarrantymstServiceImpl.java | 9 +- .../service/impl/PhysicalMstServiceImpl.java | 3 +- .../impl/PowderOrderQueryServiceImpl.java | 20 ++- mes/qd/src/views/wms/pf/formula/index.vue | 1 + mes/qd/src/views/wms/pf/formula2/index.vue | 1 + 7 files changed, 98 insertions(+), 73 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/in/service/impl/HandNewMaterialServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/in/service/impl/HandNewMaterialServiceImpl.java index 4535a807..1dee7d47 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/in/service/impl/HandNewMaterialServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/in/service/impl/HandNewMaterialServiceImpl.java @@ -13,7 +13,6 @@ import org.nl.exception.BadRequestException; import org.nl.modules.security.service.dto.JwtUserDto; import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.util.CodeUtil; -import org.nl.pda.exception.PdaRequestException; import org.nl.pda.st.in.service.HandNewMaterialService; import org.nl.utils.SecurityUtils; import org.nl.utils.SpringContextHolder; @@ -51,27 +50,27 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task"); WQLObject point_wql = WQLObject.getWQLObject("SCH_BASE_Point"); if (ObjectUtil.isEmpty(jsonObject.get("storagevehicle_code"))) { - throw new PdaRequestException("输入的载具号不能为空!"); + throw new BadRequestException("输入的载具号不能为空!"); } String storagevehicle_code = (String) jsonObject.get("storagevehicle_code"); String flag = (String) jsonObject.get("option"); JSONObject vehicle_jo = vehicle_wql.query("storagevehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND is_used = '1'").uniqueResult(0); if (ObjectUtil.isEmpty(vehicle_jo)) { - throw new PdaRequestException("该载具不存在!"); + throw new BadRequestException("该载具不存在!"); } //查询是否存在未完成的任务 JSONObject task_jo = task_wql.query("vehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND task_status < '99'").uniqueResult(0); if (!ObjectUtil.isEmpty(task_jo)) { - throw new PdaRequestException("该载具存在未完成的任务!"); + throw new BadRequestException("该载具存在未完成的任务!"); } //查询该载具是否存在组盘记录 if (!flag.equals("5")) { JSONArray mater_rows = bucket_wql.query("storagevehicle_code = '" + vehicle_jo.getString("storagevehicle_code") + "' AND status IN ('03','02')").getResultJSONArray(0); if (mater_rows.size() > 0) { - throw new PdaRequestException("请选择空托盘!"); + throw new BadRequestException("请选择空托盘!"); } } @@ -82,28 +81,28 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { case "1": case "2": if (!ObjectUtil.isEmpty(point_jo)) { - throw new PdaRequestException("该载具存在点位上!"); + throw new BadRequestException("该载具存在点位上!"); } //校验载具为塑料托盘 if (!vehicle_jo.getString("storagevehicle_type").equals("20")) { - throw new PdaRequestException("必须使用塑料托盘!"); + throw new BadRequestException("必须使用塑料托盘!"); } break; case "3": //校验载具为塑料托盘 if (!vehicle_jo.getString("storagevehicle_type").equals("10")) { - throw new PdaRequestException("必须使用铁托盘!"); + throw new BadRequestException("必须使用铁托盘!"); } String point_code2 = (String) jsonObject.get("point_code"); if (!ObjectUtil.isEmpty(point_jo) && !point_jo.getString("point_code").equals(point_code2)) { - throw new PdaRequestException("该载具存在别的点位上!"); + throw new BadRequestException("该载具存在别的点位上!"); } break; case "4": case "7": String point_code = (String) jsonObject.get("point_code"); if (!ObjectUtil.isEmpty(point_jo) && !point_jo.getString("point_code").equals(point_code)) { - throw new PdaRequestException("该载具存在别的点位上!"); + throw new BadRequestException("该载具存在别的点位上!"); } break; case "5": @@ -125,7 +124,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { WQLObject mater_wql = WQLObject.getWQLObject("md_me_materialbase"); WQLObject unit_wql = WQLObject.getWQLObject("md_pb_measureunit"); if (ObjectUtil.isEmpty(jsonObject.get("bucket_code"))) { - throw new PdaRequestException("桶码不能为空!"); + throw new BadRequestException("桶码不能为空!"); } String bucket_code = (String) jsonObject.get("bucket_code"); String flag = (String) jsonObject.get("option"); @@ -164,48 +163,48 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { bucket_jo.put("qty_unit_id", mater_jo.getString("base_unit_id")); bucket_jo.put("qty_unit_name", unit_jo.getString("unit_name")); } catch (Exception e) { - throw new PdaRequestException("桶二维码数据有误!"); + throw new BadRequestException("桶二维码数据有误!"); } /*if (!bill.get("pcsn").equals(bucket_jo.getString("pcsn"))) { - throw new PdaRequestException("单据批次和桶批次不同!"); + throw new BadRequestException("单据批次和桶批次不同!"); }*/ } else { if (!bucket_jo.getString("storagevehicle_type").equals("01") && !bucket_jo.getString("storagevehicle_type").equals("02")) { - throw new PdaRequestException("桶类型必须为原料桶或辅料桶!"); + throw new BadRequestException("桶类型必须为原料桶或辅料桶!"); } if (!bucket_jo.getString("status").equals("01")) { - throw new PdaRequestException("桶状态必须为生成!"); + throw new BadRequestException("桶状态必须为生成!"); } /*if (!bill.get("material_id").equals(bucket_jo.getString("material_id"))) { - throw new PdaRequestException("单据物料和桶物料不同!"); + throw new BadRequestException("单据物料和桶物料不同!"); } if (!bill.get("pcsn").equals(bucket_jo.getString("pcsn"))) { - throw new PdaRequestException("单据批次和桶批次不同!"); + throw new BadRequestException("单据批次和桶批次不同!"); }*/ } break; case "2": if (ObjectUtil.isEmpty(bucket_jo)) { - throw new PdaRequestException("未查询到桶相关信息"); + throw new BadRequestException("未查询到桶相关信息"); } if (!bucket_jo.getString("storagevehicle_type").equals("02")) { - throw new PdaRequestException("桶类型必须为辅料桶!"); + throw new BadRequestException("桶类型必须为辅料桶!"); } if (!bucket_jo.getString("status").equals("01")) { - throw new PdaRequestException("桶状态必须为生成!"); + throw new BadRequestException("桶状态必须为生成!"); } break; case "5": if (ObjectUtil.isEmpty(bucket_jo)) { - throw new PdaRequestException("未查询到桶相关信息"); + throw new BadRequestException("未查询到桶相关信息"); } if (!bucket_jo.getString("status").equals("01")) { - throw new PdaRequestException("桶状态必须为生成!"); + throw new BadRequestException("桶状态必须为生成!"); } boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null); //桶内物料必须为软废; if (!is_rf) { - throw new PdaRequestException("桶内物料不为软废!"); + throw new BadRequestException("桶内物料不为软废!"); } bucket_jo.put("is_new", "1"); break; @@ -213,31 +212,31 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { case "4": case "6": if (ObjectUtil.isEmpty(bucket_jo)) { - throw new PdaRequestException("未查询到桶相关信息"); + throw new BadRequestException("未查询到桶相关信息"); } if (!bucket_jo.getString("status").equals("01")) { - throw new PdaRequestException("桶状态必须为生成!"); + throw new BadRequestException("桶状态必须为生成!"); } boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null); //桶内物料必须为PG粉; if (!is_pgf) { - throw new PdaRequestException("桶内物料不为PG粉!"); + throw new BadRequestException("桶内物料不为PG粉!"); } break; case "7": if (ObjectUtil.isEmpty(bucket_jo)) { - throw new PdaRequestException("未查询到桶相关信息"); + throw new BadRequestException("未查询到桶相关信息"); } if (!bucket_jo.getString("status").equals("01")) { - throw new PdaRequestException("桶状态必须为生成!"); + throw new BadRequestException("桶状态必须为生成!"); } is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null); //桶内物料必须为软废; if (!is_rf) { - throw new PdaRequestException("桶内物料不为软废!"); + throw new BadRequestException("桶内物料不为软废!"); } if (!bucket_jo.getString("is_active").equals("1")) { - throw new PdaRequestException("桶内物料必须可用!"); + throw new BadRequestException("桶内物料必须可用!"); } break; @@ -273,7 +272,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { HashMap vehicle = (HashMap) jsonObject.get("vehicle"); HashMap source_bill = (HashMap) jsonObject.get("bill"); if (ObjectUtil.isEmpty(vehicle)) { - throw new PdaRequestException("载具不能为空,请点击查询载具是否可用!"); + throw new BadRequestException("载具不能为空,请点击查询载具是否可用!"); } HashMap point = new HashMap<>(); String flag = (String) jsonObject.get("option"); @@ -288,32 +287,32 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { if (flag.equals("3") || flag.equals("4") || flag.equals("7")) { point = (HashMap) jsonObject.get("point"); if (ObjectUtil.isEmpty(point)){ - throw new PdaRequestException("点位不能为空,请点击查询点位是否可用!"); + throw new BadRequestException("点位不能为空,请点击查询点位是否可用!"); } JSONObject vehicle_jo = vehicle_wql.query("storagevehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND is_used = '1'").uniqueResult(0); //校验载具为塑料托盘 if (flag.equals("3")){ if (!vehicle_jo.getString("storagevehicle_type").equals("10")) { - throw new PdaRequestException("必须使用铁托盘!"); + throw new BadRequestException("必须使用铁托盘!"); } } //查询该载具是否存在组盘记录 JSONArray mater_rows = bucket_wql.query("storagevehicle_code = '" + vehicle_jo.getString("storagevehicle_code") + "' AND status IN ('03','02')").getResultJSONArray(0); if (mater_rows.size() > 0) { - throw new PdaRequestException("请选择空托盘!"); + throw new BadRequestException("请选择空托盘!"); } JSONObject point_jo = point_wql.query("vehicle_code = '" + storagevehicle_code + "'").uniqueResult(0); if (!ObjectUtil.isEmpty(point_jo) && !point_jo.getString("point_code").equals(point.get("point_code"))) { - throw new PdaRequestException("该载具存在别的点位上!"); + throw new BadRequestException("该载具存在别的点位上!"); } //查询是否存在未完成的任务 JSONObject task_jo = task_wql.query("vehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND task_status < '99'").uniqueResult(0); if (!ObjectUtil.isEmpty(task_jo)) { - throw new PdaRequestException("该载具存在未完成的任务!"); + throw new BadRequestException("该载具存在未完成的任务!"); } JSONObject start_point = point_wql.query("point_code = '" + point.get("point_code") + "'").uniqueResult(0); if (!start_point.getString("lock_type").equals("00")) { - throw new PdaRequestException("该点位已被锁定!"); + throw new BadRequestException("该点位已被锁定!"); } } //插入主表 @@ -347,7 +346,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { } JSONObject jo_now = WQL.getWO("QPADST_IN_SERVICE").addParam("flag", "11").addParam("storagevehicle_code", storagevehicle_code).process().uniqueResult(0); if(jo_now!=null){ - throw new PdaRequestException("该载具"+storagevehicle_code+"已存在未完成的出入库单!"); + throw new BadRequestException("该载具"+storagevehicle_code+"已存在未完成的出入库单!"); } JSONObject mst_jo = new JSONObject(); String bill_code = CodeUtil.getNewCode("IO_CODE"); @@ -392,20 +391,20 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { JSONObject bucket_jo = bucket_wql.query("bucketunique = '" + row.get("bucketunique") + "' AND material_id = '" + row.get("material_id") + "' AND pcsn = '" + row.get("pcsn") + "'").uniqueResult(0); if (ObjectUtil.isEmpty(bucket_jo)) { - throw new PdaRequestException("桶号:"+row.get("bucketunique")+"查不到对应物料批次记录!"); + throw new BadRequestException("桶号:"+row.get("bucketunique")+"查不到对应物料批次记录!"); } if (!ObjectUtil.isEmpty(bucket_jo) && !bucket_jo.getString("status").equals("01")) { //如果为软废采购入库,判断是否为新加,不是新加的不需要判断是否组盘 if (!flag.equals("5") && row.containsKey("is_new") && row.get("is_new").equals("0")) { - throw new PdaRequestException("桶" + bucket_jo.getString("bucketunique") + "已经组盘!"); + throw new BadRequestException("桶" + bucket_jo.getString("bucketunique") + "已经组盘!"); } } if (flag.equals("1")) { if (StrUtil.isNotEmpty(material_id) && StrUtil.isNotEmpty(pcsn)) { if (!row.get("material_id").equals(material_id) || !pcsn.equals(row.get("pcsn"))) { - throw new PdaRequestException("存在不同物料、批次的明细!"); + throw new BadRequestException("存在不同物料、批次的明细!"); } } } @@ -415,7 +414,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null); //桶内物料必须为PG粉; if (!is_pgf) { - throw new PdaRequestException("桶内物料不为PG粉!"); + throw new BadRequestException("桶内物料不为PG粉!"); } } @@ -424,7 +423,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null); //桶内物料必须为软废; if (!is_rf) { - throw new PdaRequestException("桶内物料不为软废!"); + throw new BadRequestException("桶内物料不为软废!"); } } @@ -445,7 +444,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null); //桶内物料必须为PG粉; if (!is_pgf) { - throw new PdaRequestException("桶内物料不为PG粉!"); + throw new BadRequestException("桶内物料不为PG粉!"); } } @@ -475,7 +474,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { if (flag.equals("7")) { //判断软废是否可用 if (!bucket_now.getString("is_active").equals("1")) { - throw new PdaRequestException(bucket_now.getString("bucketunique") + "桶,软废不可用!"); + throw new BadRequestException(bucket_now.getString("bucketunique") + "桶,软废不可用!"); } } @@ -546,28 +545,28 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { String source_bill_code = (String) bill.get("source_bill_code"); String source_billdtl_id = (String) bill.get("source_billdtl_id"); if (!source_billdtl_id.equals(source_bill.get("source_billdtl_id"))) { - throw new PdaRequestException("关联单据不同!"); + throw new BadRequestException("关联单据不同!"); } JSONObject receive_mst_jo = receive_mst.query("receive_code = '" + source_bill_code + "'").uniqueResult(0); JSONObject receive_dtl_jo = receive_dtl.query("receivedtl_id = '" + source_billdtl_id + "'").uniqueResult(0); if (!bill.get("material_id").equals(row.get("material_id")) || !bill.get("pcsn").equals(row.get("pcsn"))) { - throw new PdaRequestException("单据物料批次和桶物料批次不同!"); + throw new BadRequestException("单据物料批次和桶物料批次不同!"); } if (ObjectUtil.isEmpty(receive_mst_jo) || ObjectUtil.isEmpty(receive_dtl_jo)) { - throw new PdaRequestException("传入的收货单信息有误!"); + throw new BadRequestException("传入的收货单信息有误!"); } if (receive_mst_jo.getString("status").equals("99") || receive_mst_jo.getString("is_delete").equals("1")) { - throw new PdaRequestException("该到货通知单:" + source_bill_code + "已完成或删除"); + throw new BadRequestException("该到货通知单:" + source_bill_code + "已完成或删除"); } if (receive_dtl_jo.getString("status").equals("99")) { - throw new PdaRequestException("收货单明细已完成!"); + throw new BadRequestException("收货单明细已完成!"); } double unin = receive_dtl_jo.getDouble("receive_qty")-receive_dtl_jo.getDouble("instor_qty"); if (unin <= 0) { - throw new PdaRequestException("收货明细未入库数为0!"); + throw new BadRequestException("收货明细未入库数为0!"); } if(bucket_now.getDouble("storage_qty") > unin){ - throw new PdaRequestException("当前组盘入库数"+bucket_now.getDouble("storage_qty")+"大于收货明细未入库数"+unin+"!"); + throw new BadRequestException("当前组盘入库数"+bucket_now.getDouble("storage_qty")+"大于收货明细未入库数"+unin+"!"); } bucket_now.put("source_billdtl_id", bill.get("source_billdtl_id")); bucket_now.put("source_bill_type", bill.get("source_bill_type")); @@ -591,7 +590,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { //查询该单据是否存在 JSONObject pro_jo = WQLObject.getWQLObject("PCS_IF_PurchaseOrderProc").query("id = '" + row.get("source_billdtl_id") + "'").uniqueResult(0); if (ObjectUtil.isEmpty(pro_jo)){ - throw new PdaRequestException("采购订单数据发生变化,请重新选择选择明细生成入库单!"); + throw new BadRequestException("采购订单数据发生变化,请重新选择选择明细生成入库单!"); } HashMap proc_map = new HashMap<>(); proc_map.put("proc_status", "02"); @@ -718,11 +717,11 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { public Map findVehicle(Map jsonObject, HttpContext ctx) { String bucket_code = jsonObject.get("bucket_code"); if (StrUtil.isEmpty(bucket_code)) { - throw new PdaRequestException("桶码不能为空!"); + throw new BadRequestException("桶码不能为空!"); } JSONObject bucket_jo = WQLObject.getWQLObject("md_pb_bucketrecord").query("bucketunique = '" + bucket_code + "' AND status = '01'").uniqueResult(0); if (ObjectUtil.isEmpty(bucket_jo)) { - throw new PdaRequestException("未查询到相关桶信息!"); + throw new BadRequestException("未查询到相关桶信息!"); } JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + bucket_jo.getString("material_id") + "'").uniqueResult(0); String material_code = mater_jo.getString("material_code"); @@ -737,7 +736,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { map.put("material_id", mater_jo.getString("material_id")); String max_quantity = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MAX_QUANTITY").getValue(); if (StrUtil.isEmpty(max_quantity)){ - throw new PdaRequestException("未设置满托盘桶数'MAX_QUANTITY'系统参数"); + throw new BadRequestException("未设置满托盘桶数'MAX_QUANTITY'系统参数"); } map.put("max_quantity", max_quantity); JSONObject vehicle_rows = WQL.getWO("QPADST_IN_SERVICE").addParamMap(map).pageQuery(ctx, "seq_no,bucket_num"); @@ -755,13 +754,13 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { WQLObject vehicle_wql = WQLObject.getWQLObject("MD_PB_StorageVehicleInfo"); WQLObject bucket_wql = WQLObject.getWQLObject("MD_PB_BucketRecord"); if (ObjectUtil.isEmpty(jsonObject.get("point_code"))) { - throw new PdaRequestException("输入点位不能为空!"); + throw new BadRequestException("输入点位不能为空!"); } String point_code = (String) jsonObject.get("point_code"); JSONObject point_jo = point_wql.query("point_code = '" + point_code + "'").uniqueResult(0); if (ObjectUtil.isEmpty(point_jo)) { - throw new PdaRequestException("未查询到相关点位信息!"); + throw new BadRequestException("未查询到相关点位信息!"); } String vehicle_code = point_jo.getString("vehicle_code"); @@ -771,13 +770,13 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { vehicle = vehicle_wql.query("storagevehicle_code = '" + vehicle_code + "'").uniqueResult(0); if (!vehicle.getString("storagevehicle_type").equals("10")) { - throw new PdaRequestException("请选择铁托盘!"); + throw new BadRequestException("请选择铁托盘!"); } //获取桶信息 JSONArray rows = bucket_wql.query("storagevehicle_code = '" + vehicle_code + "' AND status IN ('01','02','03')").getResultJSONArray(0); if (rows.size() > 0) { - throw new PdaRequestException("点位上不为空载具!"); + throw new BadRequestException("点位上不为空载具!"); } } JSONObject returnjo = new JSONObject(); @@ -793,21 +792,21 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { public Map needVehicle(Map jsonObject) { WQLObject point_wql = WQLObject.getWQLObject("SCH_BASE_Point"); if (ObjectUtil.isEmpty(jsonObject.get("point"))) { - throw new PdaRequestException("点位不能为空!"); + throw new BadRequestException("点位不能为空!"); } String point = (String) jsonObject.get("point"); JSONObject point_jo = point_wql.query("point_code = '" + point + "'").uniqueResult(0); if (!StrUtil.isEmpty(point_jo.getString("storagevehicle_code"))) { - throw new PdaRequestException("该点位上存在载具!"); + throw new BadRequestException("该点位上存在载具!"); } if (!point_jo.getString("lock_type").equals("00")) { - throw new PdaRequestException("该点位已被锁定!"); + throw new BadRequestException("该点位已被锁定!"); } JSONObject start_point = point_wql.query("point_status = '01' AND lock_type = '00' AND is_used = '1' AND is_delete = '0' AND area_type = '27'").uniqueResult(0); if (ObjectUtil.isEmpty(start_point)) { - throw new PdaRequestException("暂无空托盘!"); + throw new BadRequestException("暂无空托盘!"); } //创建任务 @@ -831,7 +830,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { mapnow.put("task_status", "02"); WQLObject.getWQLObject("SCH_BASE_Task").update(mapnow, "taskdtl_id = '" + task_id + "'"); } else { - throw new PdaRequestException("任务下发失败:" + result.getString("message")); + throw new BadRequestException("任务下发失败:" + result.getString("message")); } } @@ -845,7 +844,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { @Override public Map queryLKvehicle(Map jsonObject) { if (ObjectUtil.isEmpty(jsonObject.get("lk_vehicle"))) { - throw new PdaRequestException("立库载具码不能为空!"); + throw new BadRequestException("立库载具码不能为空!"); } String lk_vehicle = (String) jsonObject.get("lk_vehicle"); JSONArray rows = WQL.getWO("QPADST_IN_SERVICE").addParam("flag", "3").addParam("storagevehicle_code", lk_vehicle).process().getResultJSONArray(0); @@ -870,10 +869,10 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService { @Override public Map askVehicle(Map jsonObject) { if (ObjectUtil.isEmpty(jsonObject.get("point"))) { - throw new PdaRequestException("点位不能为空!"); + throw new BadRequestException("点位不能为空!"); } if (ObjectUtil.isEmpty(jsonObject.get("vehicle_row"))) { - throw new PdaRequestException("选择载具不能为空!"); + throw new BadRequestException("选择载具不能为空!"); } String point_code = (String) jsonObject.get("point"); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/wql/QPF_FORMULA01.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/wql/QPF_FORMULA01.wql index 71e3c70d..578e450a 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/wql/QPF_FORMULA01.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/wql/QPF_FORMULA01.wql @@ -50,9 +50,11 @@ SELECT Formula.*, mb.material_code, mb.material_name, + WorkOrder.remark AS remark2, FormulaDtl2.detail_count FROM PDM_BI_Formula Formula + LEFT JOIN PDM_BI_WorkOrder WorkOrder ON WorkOrder.workorder_id = Formula.workorder_id LEFT JOIN md_me_materialbase mb ON mb.material_id = Formula.material_id LEFT JOIN ( SELECT diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/FactorywarrantymstServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/FactorywarrantymstServiceImpl.java index 75e31265..7d01b7fc 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/FactorywarrantymstServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/FactorywarrantymstServiceImpl.java @@ -131,6 +131,10 @@ public class FactorywarrantymstServiceImpl implements FactorywarrantymstService if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("此批次物料厂家质保书已存在"); JSONObject jsonSheet = sheetDtlTab.query("material_id = '" + MapUtil.getStr(map, "material_id") + "' and pcsn = '" + MapUtil.getStr(map, "pcsn") + "'").uniqueResult(0); + + if (ObjectUtil.isEmpty(jsonSheet)) { + throw new BadRequestException("此批次物料质检单不存在,请联系相关人员新增!"); + } /* * 插入厂家质保书主表 */ @@ -170,7 +174,8 @@ public class FactorywarrantymstServiceImpl implements FactorywarrantymstService * 传递参数 param:inspection_type,remark,pcsn,other_device_no,other_device_wd,inspection_code */ if (ObjectUtil.isEmpty(jsonSheet)) { - HashMap param = new HashMap<>(); + throw new BadRequestException("此批次物料质检单不存在,请联系相关人员新增!"); + /*HashMap param = new HashMap<>(); // 判断此物料是什么类型 String material_type_id = jsonMater.getString("material_type_id"); //是否原料 @@ -196,7 +201,7 @@ public class FactorywarrantymstServiceImpl implements FactorywarrantymstService JSONObject SheetM = WQLObject.getWQLObject("QL_TEST_InspectionSheetMst").query("inspection_id = '" + SheetD.getString("inspection_id") + "'").uniqueResult(0); jsonFat.put("source_bill_id", SheetM.getString("inspection_id")); jsonFat.put("source_bill_code", SheetM.getString("inspection_code")); - jsonFat.put("source_bill_type", SheetM.getString("inspection_type")); + jsonFat.put("source_bill_type", SheetM.getString("inspection_type"));*/ } fatMstTab.insert(jsonFat); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java index 7f36db1e..53f0c008 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java @@ -558,7 +558,8 @@ public class PhysicalMstServiceImpl implements PhysicalMstService { throw new BadRequestException("发送立库失败:" + resultJson.getString("messsage")); } } - } else if (StrUtil.equals(inspection_type, "10") || StrUtil.equals(inspection_type, "20")) { + } + else if (StrUtil.equals(inspection_type, "10") || StrUtil.equals(inspection_type, "20")) { // 原料碳化钨、原料钴粉 /* * 更新【理化报告单主表】 diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/PowderOrderQueryServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/PowderOrderQueryServiceImpl.java index bd08a3f2..d6b22978 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/PowderOrderQueryServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/PowderOrderQueryServiceImpl.java @@ -77,7 +77,15 @@ public class PowderOrderQueryServiceImpl implements PowderOrderQueryService { String formula_qty = ""; for (int k = 0; k < mIdFormulaDtl.size(); k++) { JSONObject jsonObject = (JSONObject)mIdFormulaDtl.get(k); - resPcsn = resPcsn + jsonObject.getString("pcsn") + "+"; + if(StrUtil.isNotEmpty(resPcsn)){ + if(StrUtil.isNotEmpty( jsonObject.getString("pcsn"))){ + resPcsn = resPcsn + "+" + jsonObject.getString("pcsn") ; + } + }else{ + if(StrUtil.isNotEmpty( jsonObject.getString("pcsn"))){ + resPcsn = jsonObject.getString("pcsn"); + } + } if(k == (mIdFormulaDtl.size()-1)){ formula_qty = formula_qty + NumberUtil.round(jsonObject.getDouble("formula_qty"),3); }else{ @@ -200,7 +208,15 @@ public class PowderOrderQueryServiceImpl implements PowderOrderQueryService { String formula_qty = ""; for (int k = 0; k < arr.size(); k++) { JSONObject jsonObject = arr.getJSONObject(k); - resPcsn = resPcsn + jsonObject.getString("pcsn") + "+"; + if(StrUtil.isNotEmpty(resPcsn)){ + if(StrUtil.isNotEmpty( jsonObject.getString("pcsn"))){ + resPcsn = resPcsn + "+" + jsonObject.getString("pcsn") ; + } + }else{ + if(StrUtil.isNotEmpty( jsonObject.getString("pcsn"))){ + resPcsn = jsonObject.getString("pcsn"); + } + } if(k == (arr.size()-1)){ formula_qty = formula_qty + NumberUtil.round(jsonObject.getDouble("formula_qty"),3); }else{ diff --git a/mes/qd/src/views/wms/pf/formula/index.vue b/mes/qd/src/views/wms/pf/formula/index.vue index 3c33865a..2e6d63d4 100644 --- a/mes/qd/src/views/wms/pf/formula/index.vue +++ b/mes/qd/src/views/wms/pf/formula/index.vue @@ -183,6 +183,7 @@ + diff --git a/mes/qd/src/views/wms/pf/formula2/index.vue b/mes/qd/src/views/wms/pf/formula2/index.vue index aaf73f46..29d97622 100644 --- a/mes/qd/src/views/wms/pf/formula2/index.vue +++ b/mes/qd/src/views/wms/pf/formula2/index.vue @@ -117,6 +117,7 @@ +