diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java index bb4f0b48..40045aed 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java @@ -19,14 +19,17 @@ import org.nl.wms.basedata.master.constant.MaterOptTypeEnum; import org.nl.wms.basedata.master.service.MaterialbaseService; import org.nl.wms.st.core.service.StorPublicService; import org.nl.wql.WQL; +import org.nl.wql.core.bean.ResultBean; import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.content.HttpContext; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -76,8 +79,7 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService { } String workorder_id = jo.getString("workorder_id"); JSONObject wo = pdm_bi_workorder.query("workorder_id='"+workorder_id+"'").uniqueResult(0); - String workorder_code2 = wo.getString("workorder_code"); - if(!workorder_code2.equals(workorder_code)){ + if(wo == null ||!workorder_code.equals(wo.getString("workorder_code"))){ throw new PdaRequestException("该载具"+storagevehicle_code+"组盘工令与所选工令不一致!"); } //3、 通过托盘,查询【桶记录表】状态=入库,得到载具桶库存信息,无结果提示错误; @@ -92,6 +94,9 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService { @Transactional(rollbackFor = Exception.class) @Override public Map confirmOutStore(JSONObject jsonObject) { + //出库时更新桶记录表桶状态 + WQLObject bucket = WQLObject.getWQLObject("md_pb_bucketrecord"); + Long currentUserId = SecurityUtils.getCurrentUserId(); UserDto userDto = userService.findById(currentUserId); JSONObject mst = jsonObject.getJSONObject("mst"); @@ -132,8 +137,10 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService { if(set.size()>=2){ throw new PdaRequestException("发货物料存在多种物料,不允许发货!"); } + Set bucketuniques = new HashSet<>(); for(int i=0;i map = new HashMap(); map.put("is_send","1"); @@ -142,6 +149,12 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService { map.put("out_time",DateUtil.now()); PDM_BI_ProcedureOffline.update(map,"diskrecord_id='"+diskrecord_id+"'"); } + Map updateParam = new HashMap<>(); + updateParam.put("status","04"); + if (!CollectionUtils.isEmpty(bucketuniques)){ + String allBucketunique = "(\""+bucketuniques.stream().collect(Collectors.joining("\",\""))+"\")"; + bucket.update(updateParam, "bucketunique in " + allBucketunique + " and status in ('02','03')"); + } JSONObject returnjo = new JSONObject(); returnjo.put("code", "1"); returnjo.put("desc", "操作成功!"); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java index e61881c9..9fda1163 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java @@ -581,13 +581,10 @@ public class StatisticalReportServiceImpl implements StatisticalReportService { // 仓位属性表【ST_IVT_StructAttr】 WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline"); - JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0); + JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"' and diskrecord_id='"+jsonObject.getString("diskrecord_id")+"'").uniqueResult(0); if(jo==null){ throw new BadRequestException("该载具"+storagevehicle_code+"无组盘记录!"); } - if (!jo.getString("diskrecord_id").equals(jsonObject.getString("diskrecord_id"))){ - throw new BadRequestException("该载具"+storagevehicle_code+"对应编号不一致!"); - } String is_send = jo.getString("is_send"); if(!"1".equals(is_send)){ throw new BadRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!"); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql index 77ae4bbe..f0624acf 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql @@ -200,6 +200,8 @@ procedureoffline.is_send AS is_send, procedureoffline.send_name AS send_name, procedureoffline.send_time AS send_time, + procedureoffline.out_name AS out_name, + procedureoffline.out_time AS out_time, procedureoffline.create_name AS create_name, procedureoffline.STATUS AS STATUS, procedureoffline.create_time AS create_time,