自动化立体仓库 - WMS系统
skyouc
1 天以前 232d815eb48ca0a8e16b559d2ae3bf803036c05f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
package com.zy.asrs.task.handler;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.api.entity.OrderItemsParam;
import com.zy.api.entity.OutOrderParams;
import com.zy.api.entity.PubOrderParams;
import com.zy.api.entity.ReportOrderParam;
import com.zy.api.entity.ReportOrderParams;
import com.zy.api.entity.StockAdjustParams;
import com.zy.api.entity.StockUpOrderParams;
import com.zy.api.entity.dto.XSR;
import com.zy.api.service.KopenApiService;
import com.zy.asrs.entity.*;
import com.zy.asrs.enums.OrderTypeEnum;
import com.zy.asrs.service.*;
import com.zy.asrs.service.impl.CheckOrderDetlServiceImpl;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.OrderInAndOutUtil;
import com.zy.asrs.utils.Utils;
import com.zy.common.constant.MesConstant;
import com.zy.common.model.DetlDto;
import com.zy.common.model.MesPakinParam;
import com.zy.common.model.MesPakoutParam;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
 
/**
 * Created by vincent on 2020/7/7
 */
@Slf4j
@Service
public class OrderSyncHandler extends AbstractHandler<String> {
 
    private final CheckOrderDetlServiceImpl checkOrderDetlService;
 
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
    private ApiLogService apiLogService;
    @Autowired
    private DocTypeService docTypeService;
    @Autowired
    private OrderPakinService orderPakinService;
    @Autowired
    private OrderDetlPakinService orderDetlPakinService;
    @Autowired
    private KopenApiService kopenApiService;
    @Autowired
    private MatService matService;
 
    OrderSyncHandler(CheckOrderDetlServiceImpl checkOrderDetlService) {
        this.checkOrderDetlService = checkOrderDetlService;
    }
 
    @Transactional
    public ReturnT<String> startOrderIssuedOnceMore(Order order) {
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
        }
 
        Order order1 = OrderInAndOutUtil.selectByNo(order.getPakinPakoutStatus$(), order.getOrderNo());
        if (!Cools.isEmpty(order1)) {
            return FAIL.setMsg("请等待...订单执行档案正在转历史档案!!!");
        }
        List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
        if (!Cools.isEmpty(orderDetls) || !orderDetls.isEmpty()) {
            return FAIL.setMsg("请等待...订单执行明细档案正在转历史档案!!!");
        }
 
        // 单据明细档
        List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(order.getId());
        for (OrderDetl orderDetl : orderDetlList) {
            if (orderDetl.getQty().equals(0D)) {
                continue;
            }
            orderDetl.setWorkQty(orderDetl.getQty());
            orderDetl.setAnfme(orderDetl.getAnfme() - orderDetl.getQty());
            orderDetl.setQty(0D);
            orderDetlService.updateById(orderDetl);
        }
 
        // 修改订单状态 99.再次作业 ===>> 1.待作业
        if (!orderService.updateSettle(order.getId(), 1L, null)) {
            throw new CoolException("服务器内部错误,请联系管理员");
        }
        return SUCCESS;
    }
 
    @Transactional(rollbackFor = Exception.class)
    public ReturnT<String> startOrderIssued(Order order) {
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
        }
        List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
 
        OrderInAndOutUtil.insertOrder(order.getPakinPakoutStatus$(), order);
        // 单据明细档
        List<DetlDto> list = new ArrayList<>();
        List<OrderDetl> orderDetlList = new ArrayList<>();
 
        for (OrderDetl detail : orderDetls) {
            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getBrand(), detail.getStandby1(),
                    detail.getStandby2(), detail.getStandby3(),
                    detail.getBoxType1(), detail.getBoxType2(), detail.getBoxType3(), detail.getAnfme(),
                    detail.getThreeCode());
            if (DetlDto.has(list, dto)) {
                DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch(), dto.getBrand(), dto.getStandby1(),
                        dto.getStandby2(), dto.getStandby3(), dto.getBoxType1(), dto.getBoxType2(), dto.getBoxType3());
                assert detlDto != null;
                detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme());
 
                OrderDetl orderDetl = OrderDetl.find(orderDetlList, dto.getMatnr(), dto.getBatch(), dto.getBrand(),
                        dto.getStandby1(), dto.getStandby2(), dto.getStandby3(), dto.getBoxType1(), dto.getBoxType2(),
                        dto.getBoxType3());
                assert orderDetl != null;
                orderDetl.setAnfme(orderDetl.getAnfme() + detail.getAnfme());
            } else {
                list.add(dto);
                orderDetlList.add(detail);
            }
        }
        for (OrderDetl orderDetl : orderDetlList) {
            orderDetl.setWorkQty(0D);
            OrderInAndOutUtil.insertOrderDetl(order.getPakinPakoutStatus$(), order, orderDetl);
            // 小松:如果下发备货派工单,则生成备货出库+备货入库
            if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())) {
                try {
                    ifTransfetInsertStockIn(order, orderDetl);
                } catch (Exception e) {
                    throw new CoolException(e.getMessage());
                }
            }
        }
        // 修改订单状态 1.未作业 ===>> 2.作业中
        if (!orderService.updateSettle(order.getId(), 2L, null)) {
            throw new CoolException("服务器内部错误,请联系管理员");
        }
        return SUCCESS;
    }
 
    @Transactional(rollbackFor = Exception.class)
    public void ifTransfetInsertStockIn(Order order, OrderDetl orderDetl) {
        OrderPakin orderPakin = new OrderPakin();
        BeanUtils.copyProperties(order, orderPakin);
        orderPakin.setDocType(OrderTypeEnum.STOCK_IN.type.longValue());
 
        if (!orderPakinService.insert(orderPakin)) {
            throw new CoolException("插入备货入库单失败");
        }
        OrderDetlPakin orderDetlPakin = new OrderDetlPakin();
        BeanUtils.copyProperties(orderDetl, orderDetlPakin);
        orderDetlPakin.setOrderId(orderPakin.getId());
 
        if (!orderDetlPakinService.insert(orderDetlPakin)) {
            throw new CoolException("插入备货入库单失败");
        }
 
    }
 
    @Transactional
    public ReturnT<String> startOrderInAndOutUtil(Order order) {
        // 小松:轮训到备货派工单是查询备货入库单是否完成
        if (order.getDocType().equals(OrderTypeEnum.STOCK_IN.type.longValue())) {
            return SUCCESS;
        }
        if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())) {
            OrderPakin orderPakin = orderPakinService.selectByNo(order.getOrderNo());
            if (null != orderPakin) {
                if (!orderPakin.getSettle().equals(4L)) {
                    return SUCCESS;
                }
            }
        }
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
        }
        Order orderSou = orderService.selectByNo(order.getOrderNo());
        if (!orderSou.getSettle().equals(2L)) {
            return FAIL.setMsg("订单状态不正确,请联系管理员");
        }
        List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(orderSou.getId());
 
        List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
 
        for (OrderDetl orderDetlSou : orderDetlList) {
            for (OrderDetl orderDetl : orderDetls) {
                if (orderDetl.getQty().equals(0D)) {
                    continue;
                }
                if (orderDetlSou.beSimilar(orderDetl)) {
                    double v = orderDetlSou.getAnfme() - orderDetlSou.getQty();
                    if (v < orderDetl.getQty() || orderDetl.getQty().equals(v)) {
                        orderDetlSou.setQty(orderDetlSou.getAnfme());
                        orderDetl.setQty(orderDetl.getQty() - v);
                        break;
                    } else {
                        orderDetlSou.setQty(orderDetlSou.getQty() + orderDetl.getQty());
                        orderDetl.setQty(0D);
                    }
                }
            }
        }
        for (OrderDetl orderDetlSou : orderDetlList) {
            orderDetlService.updateById(orderDetlSou);
        }
        // 修改订单状态 2.作业中 ===>> 4.待上报
        if (!orderService.updateSettle(orderSou.getId(), 4L, null)) {
            throw new CoolException("服务器内部错误,请联系管理员");
        }
        // 修改订单状态 4.完成 ===>> 6.结束
        OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 6L, null);
        return SUCCESS;
    }
 
    /**
     * 单据上报
     *
     * @param order
     * @return com.zy.asrs.task.core.ReturnT<java.lang.String>
     * @author Ryan
     * @date 2025/12/15 16:14
     */
    @Transactional
    public ReturnT<String> startOrderReport(Order order) {
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
        }
        long settle = 6L;
        List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
        if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.PICKING.type)) {
            // 上架派工单完成
            ReportOrderParam orderParam = new ReportOrderParam();
            orderParam.setCompany_id(order.getCstmrName())
                    .setWms_id(order.getId() + "")
                    .setOrder_no(order.getOrderNo())
                    .setType(order.getDocType() + "")
                    .setInv_no(order.getNumber())
                    .setPm_tktid(order.getItemName())
                    .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss"))
                    .setTarget_location("");
 
            List<ReportOrderParams> reportOrderParams = new ArrayList<>();
            orderDetls.forEach(detl -> {
                Mat material = matService.selectByMatnr(detl.getMatnr());
                if (Objects.isNull(material)) {
                    throw new CoolException("物料不存在");
                }
                ReportOrderParams itemParam = new ReportOrderParams();
                // BS Code
                itemParam.setTotal_serial(detl.getThreeCode())
                        // 上报时,默认产品类型是null
                        .setPro_type(material.getProType())
                        // 上报时,默认产品编码
                        .setPro_komcode(detl.getMatnr())
                        // 上报时,默认产品id是供应商编码
                        .setPro_id(detl.getSuppCode())
                        // 上报时,默认来源位置是null
                        .setLocation_no(null)
                        // 上报时,默认目标位置是null
                        .setLocation_type(null)
                        // 上报时,默认上报时间是更新时间
                        .setSj_date(order.getUpdateBy().toString())
                        // 上报时,默认上报人是更新人
                        .setSj_emp(order.getUpdateBy$())
                        // 上报时,默认上报数量是订单数量
                        .setPick_qty(detl.getQty().intValue())
                        // 上报时,默认损坏数量是0
                        .setDamage_qty(0)
                        // 上报时,默认差异数量是0
                        .setDiff_qty(0);
 
                reportOrderParams.add(itemParam);
            });
 
            orderParam.setDetails(reportOrderParams);
 
            XSR response = null;
            boolean success = false;
            try {
                List<ReportOrderParam> orderParams = new ArrayList<>();
                orderParams.add(orderParam);
                response = kopenApiService.getInDispatchResult(orderParams);
 
                // if (true) {
                // success = true;
                // // 修改订单状态 4.完成 ===>> 6.已上报
                // if (!orderService.updateSettle(order.getId(), settle, null)) {
                // throw new CoolException("服务器内部错误,请联系管理员");
                // }
                // } else {
                // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL +
                // MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response);
                // throw new CoolException("上报mes系统失败");
                // }
            } catch (Exception e) {
                log.error("fail", e);
                // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                return FAIL.setMsg(e.getMessage());
            } finally {
                try {
                    // 保存接口日志
                    apiLogService.save(
                            "上架派工单完成上报",
                            MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(orderParam),
                            JSON.toJSONString(response),
                            success);
                } catch (Exception e) {
                    log.error("", e);
                }
            }
        } else if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.TRANSFER.type)) {
            // 备货派工单(出库)
            ReportOrderParam orderParam = new ReportOrderParam();
            orderParam.setCompany_id(order.getCstmrName())
                    .setWms_id(order.getId() + "")
                    .setOrder_no(order.getOrderNo())
                    .setType(order.getDocType() + "")
                    .setInv_no(order.getNumber())
                    .setPm_tktid(order.getItemName())
                    .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss"))
                    .setTarget_location("");
 
            List<ReportOrderParams> reportOrderParams = new ArrayList<>();
            orderDetls.forEach(detl -> {
                Mat material = matService.selectByMatnr(detl.getMatnr());
                if (Objects.isNull(material)) {
                    throw new CoolException("物料不存在");
                }
                ReportOrderParams itemParam = new ReportOrderParams();
                // BS Code
                itemParam.setTotal_serial(detl.getThreeCode())
                        // 上报时,默认产品类型是null
                        .setPro_type(material.getProType())
                        // 上报时,默认产品编码
                        .setPro_komcode(detl.getMatnr())
                        // 上报时,默认产品id是供应商编码
                        .setPro_id(detl.getSuppCode())
                        // 上报时,默认来源位置是null
                        .setLocation_no(null)
                        // 上报时,默认目标位置是null
                        .setLocation_type(null)
                        // 上报时,默认上报时间是更新时间
                        .setSj_date(order.getUpdateBy().toString())
                        // 上报时,默认上报人是更新人
                        .setSj_emp(order.getUpdateBy$())
                        // 上报时,默认上报数量是订单数量
                        .setPick_qty(detl.getQty().intValue())
                        // 上报时,默认损坏数量是0
                        .setDamage_qty(0)
                        // 上报时,默认差异数量是0
                        .setDiff_qty(0);
 
                reportOrderParams.add(itemParam);
            });
 
            orderParam.setDetails(reportOrderParams);
 
            XSR response = null;
            boolean success = false;
            try {
                // response = new HttpHandler.Builder()
                // .setUri(MesConstant.URL)
                // .setPath(MesConstant.PAKOUT_URL)
                // .setJson(JSON.toJSONString(pakoutParam))
                // .build()
                // .doPost();
                // JSONObject jsonObject = JSON.parseObject(response);
                // if (jsonObject.getInteger("code").equals(200)) {
                if (true) {
                    success = true;
                    // 修改订单状态 4.完成 ===>> 6.已上报
                    if (!orderService.updateSettle(order.getId(), settle, null)) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                    }
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}",
                            MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT,
                            JSON.toJSONString(orderParam), JSON.toJSONString(response));
                    throw new CoolException("上报KOPEN系统失败");
                }
            } catch (Exception e) {
                log.error("fail", e);
                return FAIL.setMsg(e.getMessage());
            } finally {
                try {
                    // 保存接口日志
                    apiLogService.save(
                            "备货派工单完成上报",
                            MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(orderParam),
                            JSON.toJSONString(response),
                            success);
                } catch (Exception e) {
                    log.error("", e);
                }
            }
        } else if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.STOCK.type)) {
            // 备货单反馈
            StockUpOrderParams stockUpOrderParams = new StockUpOrderParams();
            stockUpOrderParams.setCompany_id(order.getCstmrName())
                    .setWms_id(order.getId() + "")
                    .setDispatch_no(order.getNumber());
 
            OutOrderParams pubOrderParams = new OutOrderParams();
            pubOrderParams.setPick_no(order.getOrderNo())
                    .setOrder_no(order.getShipCode())
                    .setCus_id(order.getCstmrName())
                    .setCus_address(order.getTel());
 
            List<OrderItemsParam> reportOrderParams = new ArrayList<>();
            orderDetls.forEach(detl -> {
                Mat material = matService.selectByMatnr(detl.getMatnr());
                if (Objects.isNull(material)) {
                    throw new CoolException("物料不存在");
                }
                OrderItemsParam itemParam = new OrderItemsParam();
                // 上报时,默认产品类型是null
                itemParam.setPro_type(material.getProType());
                // 上报时,默认产品编码
                itemParam.setPro_komcode(material.getMatnr());
                // 上报时,默认产品id是供应商编码
                itemParam.setPro_id(detl.getSuppCode());
 
                // 上报时,默认上报时间是更新时间
                itemParam.setPick_qty(detl.getQty().intValue());
                reportOrderParams.add(itemParam);
            });
            pubOrderParams.setPartList(reportOrderParams);
 
            List<OutOrderParams> pubOrderParamsList = new ArrayList<>();
            pubOrderParamsList.add(pubOrderParams);
            // 设置派工单明细
            stockUpOrderParams.setDetails(pubOrderParamsList);
            stockUpOrderParams.setUpdate_time(order.getUpdateBy$());
 
            XSR response = null;
            boolean success = false;
            try {
                // response = new HttpHandler.Builder()
                // .setUri(MesConstant.URL)
                // .setPath(MesConstant.PAKOUT_URL)
                // .setJson(JSON.toJSONString(pakoutParam))
                // .build()
                // .doPost();
                // JSONObject jsonObject = JSON.parseObject(response);
                // if (jsonObject.getInteger("code").equals(200)) {
                if (true) {
                    success = true;
                    // 修改订单状态 4.完成 ===>> 6.已上报
                    if (!orderService.updateSettle(order.getId(), settle, null)) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                    }
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}",
                            MesConstant.URL + MesConstant.OUT_DETAILS_RESULT,
                            JSON.toJSONString(stockUpOrderParams), JSON.toJSONString(response));
                    throw new CoolException("上报KOPEN系统失败");
                }
            } catch (Exception e) {
                log.error("fail", e);
                return FAIL.setMsg(e.getMessage());
            } finally {
                try {
                    // 保存接口日志
                    apiLogService.save(
                            "备货单完成上报",
                            MesConstant.URL + MesConstant.OUT_DETAILS_RESULT,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(stockUpOrderParams),
                            JSON.toJSONString(response),
                            success);
                } catch (Exception e) {
                    log.error("", e);
                }
            }
 
        }
        return SUCCESS;
    }
 
    /**
     * 损溢单完结上报
     * 
     * @param order
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public ReturnT<String> startCheckOrderReport(CheckOrder order) {
        List<StockAdjustParams> adjustParams = new ArrayList<>();
 
        StockAdjustParams adjustParam = new StockAdjustParams();
 
        adjustParam.setCompany_id(order.getCstmrName())
                .setWms_id(order.getId() + "")
                .setType(0 + "")
                .setCompany_id(order.getCstmrName());
 
        adjustParam.setBsby_no(order.getNumber())
                .setResason("")
                .setReason_name("");
        List<CheckOrderDetl> detls = checkOrderDetlService
                .selectList(new EntityWrapper<CheckOrderDetl>().eq("order_id", order.getId()));
        if (Objects.isNull(detls) || detls.isEmpty()) {
            throw new CoolException("损溢单详情不存在");
        }
        List<OrderItemsParam> items = new ArrayList<>();
        detls.forEach(detl -> {
            Mat material = matService.selectByMatnr(detl.getMatnr());
            if (Objects.isNull(material)) {
                throw new CoolException("物料不存在");
            }
            OrderItemsParam itemParam = new OrderItemsParam();
            itemParam.setLocation_no(detl.getZpallet())
                    .setPro_komcode(material.getMatnr())
                    .setPro_id(detl.getSuppCode())
                    .setBsby_qty(detl.getDiffQty().intValue());
            items.add(itemParam);
        });
        adjustParam.setDetails(items);
 
        adjustParams.add(adjustParam);
 
        return SUCCESS;
        // TODO Auto-generated method stub
 
    }
 
}