自动化立体仓库 - WMS系统
#
Junjie
6 天以前 39bdfc374dcb4725c432106e97df9f77dd82e58a
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -13,9 +13,9 @@
import com.zy.asrs.entity.result.MobileAdjustResult;
import com.zy.asrs.mapper.ManLocDetlMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.MathUtils;
import com.zy.asrs.utils.OrderInAndOutUtil;
import com.zy.common.model.WrkDto;
import com.zy.common.model.enumUtils.OrderEnumVo;
import com.zy.common.utils.Synchro;
import com.zy.common.web.BaseController;
import com.zy.nc.entity.NccJcQilibcBarcodeflowWms;
@@ -59,6 +59,8 @@
    private ManLocDetlMapper manLocDetlMapper;
    @Autowired
    private WrkDetlLogService wrkDetlLogService;
    @Autowired
    private WrkMastLogService wrkMastLogService;
    @Autowired
    private MatService matService;
@@ -69,6 +71,9 @@
    @Resource
    private StaDescService staDescService;
    @Autowired
    private OrderDetlPakinService orderDetlPakinService;
    @RequestMapping("/pda/WarehouseOut/v1")
    @ManagerAuth(memo = "并板途中拣料-参考念初")
@@ -207,16 +212,18 @@
                    LinkedList<CombParam.CombMat> combMats = new LinkedList<>();
                    for (OrderDetl orderDetl : orderDetls) {
                        CombParam.CombMat combMat = new CombParam.CombMat();
                        Synchro.Copy(orderDetl, combMat);
                        combMat.setMatnr(orderDetl.getMatnr());
                        combMat.setBatch(orderDetl.getBatch());
                        combMat.setAnfme(orderDetl.getAnfme() - orderDetl.getWorkQty());
                        combMat.setAnfme(MathUtils.subtract(orderDetl.getAnfme(), orderDetl.getWorkQty()));
                        combMat.setMaktx(orderDetl.getMaktx());
                        combMat.setSpecs(orderDetl.getSpecs());
                        combMat.setEnableQty(MathUtils.subtract(orderDetl.getAnfme(), orderDetl.getWorkQty()));
                        combMats.add(combMat);
                    }
                    combParam.setCombMats(combMats);
                }
                combParam.setOrderNo(order.getOrderNo());
                //combParam.setOrderNo(order.getOrderNo());
                combParams.add(combParam);
            }
        }
@@ -239,9 +246,85 @@
        Mat mat = matService.selectByMatnr(nccJcQilibcBarcodeflowWms.getWlbm());
        MatParam matParam = new MatParam();
        Synchro.Copy(mat, matParam);
        OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>().eq("order_no", nccJcQilibcBarcodeflowWms.getZkdh()).eq("matnr", mat.getMatnr()).eq("batch", nccJcQilibcBarcodeflowWms.getVbatchcode()));
        if (orderDetlPakin == null) {
            throw new CoolException("未找到此单号");
        }
        matParam.setStandby1(orderDetlPakin.getStandby1());
        matParam.setOrderNo(nccJcQilibcBarcodeflowWms.getZkdh());
        matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode());
        matParam.setAnfme(12D);
        matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue());
        matParam.setWeight(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue());
        matParam.setAnfme2(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue());
        matParam.setTiaoma(nccJcQilibcBarcodeflowWms.getVbarcode());
        return R.ok().add(matParam);
    }
    @RequestMapping(value = "/mat/auth")
    @ManagerAuth
    public R pdaSearchV3(@RequestParam String matnr) {
        EntityWrapper<NccJcQilibcBarcodeflowWms> wrapper = new EntityWrapper<>();
        wrapper.eq("VBARCODE", matnr).orderBy("ts", false);
        NccJcQilibcBarcodeflowWms nccJcQilibcBarcodeflowWms = nccJcQilibcBarcodeflowWmsService.selectOne(wrapper);
        if (null == nccJcQilibcBarcodeflowWms) {
            return R.error("未找到此条码");
        } else {
            if (!nccJcQilibcBarcodeflowWms.getInfla().equals("出库")) {
                return R.error("该条码最后一次不是出库");
            }
        }
        Mat mat = matService.selectByMatnr(nccJcQilibcBarcodeflowWms.getWlbm());
        MatParam matParam = new MatParam();
        Synchro.Copy(mat, matParam);
        matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode());
        matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue());
        matParam.setAnfme2(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue());
        matParam.setTiaoma(nccJcQilibcBarcodeflowWms.getVbarcode());
        return R.ok().add(matParam);
    }
    @RequestMapping(value = "/mat/back")
    @ManagerAuth
    public R pdaSearchBack(@RequestParam String barcode) {
        WrkMastLog wrkMastLog = wrkMastLogService.selectOne(new EntityWrapper<WrkMastLog>()
                .eq("barcode", barcode)
                .in("io_type", 101, 103, 107)
                .orderBy("appe_time", false)
        );
        if(null == wrkMastLog) {
            return R.error("未找到此托盘码出库记录");
        }
        List<WrkDetlLog> wrkDetlLogs = wrkDetlLogService.selectList(new EntityWrapper<WrkDetlLog>()
                .eq("wrk_no", wrkMastLog.getWrkNo())
                .eq("zpallet", barcode)
                .orderBy("io_time", false)
        );
        if (wrkDetlLogs.isEmpty()) {
            return R.error("未找到此托盘码出库记录明细");
        }
        WrkDetlLog wrkDetlLog = wrkDetlLogs.get(0);
        String batch = wrkDetlLog.getBatch();
        HashMap<String, Object> map = new HashMap<>();
        Mat mat = matService.selectByMatnr(wrkDetlLog.getMatnr());
        if (mat == null) {
            return R.error("未找到物料明细");
        }
        MatParam matParam = new MatParam();
        Synchro.Copy(mat, matParam);
        matParam.setBatch(batch);
        matParam.setAnfme(0.0D);
        matParam.setAnfme2(0.0D);
        matParam.setTiaoma(batch);
        String[] split = wrkDetlLog.getOrderNo().split("-");
        map.put("orderNo", split[0]);
        map.put("matData", matParam);
        return R.ok().add(map);
    }
    @RequestMapping("/comb/auth")
@@ -501,6 +584,27 @@
        return R.ok();
    }
    @RequestMapping("/checkDetl/auth/v2")
    @ManagerAuth
    public R getCheckDetlV2(@RequestParam(required = false) String barcode) {
        if (Cools.isEmpty(barcode)) {
            return R.ok();
        }
        WrkMast wrkMast = wrkMastService.selectByBarcode(barcode);
        if (wrkMast != null && (wrkMast.getIoType() == 107 || wrkMast.getIoType() == 57)) {
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            if (!Cools.isEmpty(wrkDetls)) {
                MobileAdjustResult result = new MobileAdjustResult();
                result.setBarcode(barcode);
                result.setWrkNo(wrkMast.getWrkNo());
                result.setWrkDetls(wrkDetls);
                return R.ok().add(result);
            }
        }
        return R.ok();
    }
    @RequestMapping("/adjust/auth")
    @ManagerAuth(memo = "盘点")
    public R adjust(@RequestBody MobileAdjustParam combParam) {