Commit 30af3d39b7e8d9fbba779049b79cf22d3859f1f6
1 parent
ffc41d25
修改生产领料单回传erp接口
Showing
2 changed files
with
28 additions
and
13 deletions
src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java
... | ... | @@ -137,28 +137,43 @@ public class TaskReturnServiceImpl implements TaskReturnService { |
137 | 137 | if (fbillno == null) { |
138 | 138 | throw new ServiceException("上游单据为空"); |
139 | 139 | } |
140 | - Object[] fentities = null; | |
141 | - Object[] erweima = null; | |
140 | + Object[] fentitys = null; | |
141 | + Object[] batteryPackTwoCodes=null; | |
142 | + List<String> batteryPackList=new ArrayList<>(); | |
143 | + | |
142 | 144 | if (method.equals("PRD_PickMtrl")) {//生产领料单(原料出库) |
143 | 145 | ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(new LambdaQueryWrapper<ShipmentHeader>().eq(ShipmentHeader::getReferId, fid)); |
144 | - //出库组盘明细 | |
145 | - List<ShipmentContainerDetail> shipmentContainerDetailList=shipmentContainerDetailService.list(new LambdaQueryWrapper<ShipmentContainerDetail>().eq(ShipmentContainerDetail::getShipmentId,shipmentHeader.getId())); | |
146 | 146 | //出库明细 |
147 | 147 | List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId())); |
148 | - //电池包号 | |
149 | - List<String> toMesInfoList = shipmentContainerDetailList.stream().map(ShipmentContainerDetail::getBatteryPackTwoCode).collect(Collectors.toList()); | |
150 | - //体制码 | |
151 | - List<String> fentityList = shipmentDetails.stream().map(ShipmentDetail::getFentity).collect(Collectors.toList()); | |
152 | - erweima = toMesInfoList.toArray(); | |
153 | - fentities = fentityList.toArray(); | |
148 | + | |
149 | + for (int i = 0; i < shipmentDetails.size(); i++) { | |
150 | + //每一条明细下多个组盘明细 | |
151 | + List<ShipmentContainerDetail> shipmentContainerDetailList1=shipmentContainerDetailService.list(new LambdaQueryWrapper<ShipmentContainerDetail>().eq(ShipmentContainerDetail::getShipmentDetailId,shipmentDetails.get(i).getId())); | |
152 | + //电池包号 | |
153 | + List<String> codes = shipmentContainerDetailList1.stream().map(ShipmentContainerDetail::getBatteryPackTwoCode).collect(Collectors.toList()); | |
154 | + String batteryPackTwoCode=""; | |
155 | + for (String code : codes) { | |
156 | + if (StringUtils.isEmpty(batteryPackTwoCode)){ | |
157 | + batteryPackTwoCode=code; | |
158 | + }else { | |
159 | + batteryPackTwoCode=batteryPackTwoCode+","+code; | |
160 | + } | |
161 | + } | |
162 | + batteryPackList.add(batteryPackTwoCode); | |
163 | + //体制码 | |
164 | + List<String> fentitys1 = shipmentDetails.stream().map(ShipmentDetail::getFentity).collect(Collectors.toList()); | |
165 | + fentitys=fentitys1.toArray(); | |
166 | + } | |
167 | + | |
154 | 168 | } |
155 | 169 | //2、转换实体 |
156 | 170 | ErpInfo erpInfo = new ErpInfo(); |
157 | 171 | erpInfo.setFid(fid); |
158 | 172 | erpInfo.setFbillno(fbillno); |
159 | 173 | if (method.equals("PRD_PickMtrl")) {//生产领料单(原料出库) |
160 | - erpInfo.setF_JY_WMSMSG(erweima); | |
161 | - erpInfo.setFentity(fentities); | |
174 | + Object[] wms = batteryPackList.toArray(); | |
175 | + erpInfo.setF_JY_WMSMSG(wms); | |
176 | + erpInfo.setFentity(fentitys); | |
162 | 177 | } |
163 | 178 | // erpInfo.setQty(totalSum); |
164 | 179 | SaveParam<ErpInfo> param = new SaveParam<>(); |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -285,7 +285,7 @@ public class RyTask extends BaseController { |
285 | 285 | public void proReceiptReturn(String params){ |
286 | 286 | BarCodeHeader barCodeHeader = barCodeHeaderService.getOne(new LambdaQueryWrapper<BarCodeHeader>() |
287 | 287 | .lt(BarCodeHeader::getPushErrorCount, 3) |
288 | - .eq(BarCodeHeader::getLocked, 2)); | |
288 | + .in(BarCodeHeader::getLocked, 2,4)); | |
289 | 289 | List<Fentity> fentities = new ArrayList<>(); |
290 | 290 | List<BarCodeDetail> barCodeDetailList = barCodeDetailService.list(new LambdaQueryWrapper<BarCodeDetail>().eq(BarCodeDetail::getReceiptId, barCodeHeader.getId())); |
291 | 291 | //物料编号、数量、订单号、入库类型 |
... | ... |