| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | |
| | | if (Cools.isEmpty(param.getSourceStaNo())) { |
| | | return R.error("源站编号不能为空"); |
| | | } |
| | | // List<WaitPakin> waitPakins = null; |
| | | List<WaitPakin> waitPakins = null; |
| | | Mat mat = null; |
| | | if (param.getIoType() == 1) { |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | | } |
| | | Goods goods = erpService.selectGoodsOne(param.getBarcode()); |
| | | if (Cools.isEmpty(goods)) { |
| | | return R.error(param.getBarcode() + "条码不存在,请检查ERP数据!"); |
| | | } else { |
| | | erpService.updateStateForGoods(param.getBarcode(), 2); |
| | | // Goods goods = erpService.selectGoodsOne(param.getBarcode()); |
| | | // if (Cools.isEmpty(goods)) { |
| | | // return R.error(param.getBarcode() + "条码不存在,请检查ERP数据!"); |
| | | // } else { |
| | | // erpService.updateStateForGoods(param.getBarcode(), 2); |
| | | // } |
| | | // mat = matService.selectByMatnr(goods.getMaterialNO()); |
| | | // if (Cools.isEmpty(mat)) { |
| | | // return R.error(goods.getMaterialNO() + "条码商品资料不存在,请先添加!"); |
| | | // } |
| | | waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (wrkMast != null && (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 104 || wrkMast.getIoType() == 107)) { |
| | | return R.parse(CodeRes.PICK_600); |
| | | } |
| | | mat = matService.selectByMatnr(goods.getMaterialNO()); |
| | | if (Cools.isEmpty(mat)) { |
| | | return R.error(goods.getMaterialNO() + "条码商品资料不存在,请先添加!"); |
| | | return R.parse(CodeRes.NO_COMB_700); |
| | | } |
| | | // waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | // if (Cools.isEmpty(waitPakins)) { |
| | | // WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | // if (wrkMast != null && (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 104 || wrkMast.getIoType() == 107)) { |
| | | // return R.parse(CodeRes.PICK_600); |
| | | // } |
| | | // return R.parse(CodeRes.NO_COMB_700); |
| | | // } |
| | | // int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | // int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | // if (countLoc > 0 || countWrk > 0) { |
| | | // return R.error("工作档/库存条码数据已存在"); |
| | | // } |
| | | mat = matService.selectByMatnr(waitPakins.get(0).getMatnr()); |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0) { |
| | | return R.error("工作档/库存条码数据已存在"); |
| | | } |
| | | } |
| | | // if (Cools.isEmpty(param.getLocType1())){ |
| | | // return R.error("高低检测信号不能为空"); |