diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java index a55362c..f377e95 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java @@ -59,11 +59,11 @@ public class SendMaterialServiceImpl implements SendMaterialService { @Override @Transactional public Map bussConfirm(@RequestBody Map param) { - String start_point_code = (String) param.get("point_code"); + String device_code = (String) param.get("point_code"); String vehicle_code = (String) param.get("vehicle_code"); String qty = (String) param.get("qty"); String is_full = (String) param.get("is_full"); - if (StrUtil.isEmpty(start_point_code)) { + if (StrUtil.isEmpty(device_code)) { throw new PdaRequestException("点位不能为空!"); } if (StrUtil.isEmpty(vehicle_code)) { @@ -79,14 +79,24 @@ public class SendMaterialServiceImpl implements SendMaterialService { JSONObject jsonObject = new JSONObject(); jsonObject.put("pcsn", "pcsn"); jsonObject.put("create_mode", "03"); - JSONObject produceInfoByCode = this.getProduceInfoByCode(start_point_code); - jsonObject.put("cust_id", produceInfoByCode.getString("cust_id")); - jsonObject.put("material_id", produceInfoByCode.getString("material_id")); - jsonObject.put("stewing_time", produceInfoByCode.getString("stewing_time")); - jsonObject.put("producetask_id", produceInfoByCode.getString("producetask_id")); - jsonObject.put("start_point_code", start_point_code); - jsonObject.put("vehicle_code", vehicle_code); - jsonObject.put("qty", qty); + if (!StrUtil.equals(device_code, "CYBZW")) { + JSONObject produceInfoByCode = this.getProduceInfoByCode(device_code); + jsonObject.put("material_id", produceInfoByCode.getString("material_id")); + produceInfoByCode = this.getProduceInfoByCode(device_code); + //批次 物料,客户要从排产单里面去取 + jsonObject.put("material_id", produceInfoByCode.getString("material_id")); + jsonObject.put("cust_id", produceInfoByCode.getString("cust_id")); + jsonObject.put("stewing_time", produceInfoByCode.getString("stewing_time")); + jsonObject.put("producetask_id", produceInfoByCode.getString("producetask_id")); + } else { + JSONObject groupObj = WQLObject.getWQLObject("st_buss_vehiclegroup").query("vehicle_code='" + vehicle_code + "'", "create_time desc").uniqueResult(0); + jsonObject.put("create_mode", "01"); + jsonObject.put("material_id", groupObj.getString("material_uuid")); + jsonObject.put("cust_id", groupObj.getString("cust_id")); + jsonObject.put("stewing_time", "0"); + jsonObject.put("vehicle_code", vehicle_code); + jsonObject.put("producetask_id", groupObj.getString("producetask_id")); + } jsonObject.put("is_full", is_full); sendMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); JSONObject returnjo = new JSONObject();