| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.GDYKConfirmGoodsParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.license.AbstractServerInfos; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | |
| | | |
| | | private static Logger logger = LogManager.getLogger(MobileController.class); |
| | | |
| | | // 商品上架 |
| | | @RequestMapping("/mat/onSale/auth") |
| | |
| | | combMat.setAnfme(orderDetl.getAnfme() - orderDetl.getWorkQty()); |
| | | combMat.setMaktx(orderDetl.getMaktx()); |
| | | combMat.setSpecs(orderDetl.getSpecs()); |
| | | combMat.setDetId(orderDetl.getDetId()); |
| | | combMat.setDetlId(orderDetl.getId()); |
| | | combMats.add(combMat); |
| | | } |
| | | combParam.setCombMats(combMats); |
| | | } |
| | | combParam.setBillNo(order.getOrderNo()); |
| | | combParam.setOrderNo(order.getOrderNo()); |
| | | combParams.add(combParam); |
| | | } |
| | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam) { |
| | | logger.info("组托参数:{}",combParam); |
| | | if (Cools.isEmpty(combParam.getOrderNo())) { |
| | | combParam.setOrderNo(combParam.getBillNo()); |
| | | } |
| | |
| | | mobileService.comb(combParam, getUserId()); |
| | | return R.ok("组托成功"); |
| | | } |
| | | |
| | | @RequestMapping("/pickIn/auth") |
| | | // @ManagerAuth(memo="盘点入库") |
| | | public R pickIn(@RequestParam String barcode){ |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(barcode); |
| | | List<PickInParam> param = wrkDetlService.selectDetByBarcode(barcode); |
| | | for(PickInParam pickInParam : param){ |
| | | pickInParam.setStaNo(wrkMast.getStaNo()); |
| | | pickInParam.setWorkNo(wrkMast.getWrkNo()); |
| | | } |
| | | return R.ok().add(param); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/pack/get/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/callBarcode") |
| | | @ManagerAuth(memo = "PDA呼叫托盘出库") |
| | | public R callBarcode(@RequestBody CombParam combParam) { |
| | | logger.info("PDA呼叫托盘出库"); |
| | | if (combParam == null){ |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | combParam.getCombMats().forEach(combMat -> { |
| | | Mat mat = matService.selectByMatnr(combMat.getMatnr()); |
| | | if (mat == null){ |
| | | throw new CoolException("商品档案不存在"); |
| | | } |
| | | MatBarcode matBarcode = matBarcodeService.selectbyMatnr(combMat.getMatnr()); |
| | | if (matBarcode == null){ |
| | | throw new CoolException("该物料未与托盘绑定"); |
| | | } |
| | | LocMast locMast=locMastService.selectByBarcode(matBarcode.getZpallet()); |
| | | if (locMast == null){ |
| | | throw new CoolException("未找到与该物料绑定的托盘"); |
| | | } |
| | | int wrkNo=commonService.getWorkNo(0); |
| | | Date now = new Date(); |
| | | //生成工作档 |
| | | WrkMast wrkMast=new WrkMast(); |
| | | wrkMast.setWrkNo(wrkNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L);//工作状态:生成出库ID |
| | | wrkMast.setIoType(101);//入出库状态:并板出库 |
| | | wrkMast.setIoPri(13D);//优先级 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | // wrkMast.setSourceStaNo(dto.getSourceStaNo());//源站 |
| | | wrkMast.setStaNo(101);// 目标站 |
| | | wrkMast.setSourceLocNo(locMast.getLocNo());// 源库位 |
| | | wrkMast.setBarcode(matBarcode.getZpallet()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | // wrkMast.setScWeight(weight); |
| | | wrkMast.setCtnType(0); // 容器类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts("R"); // R.出库预约 |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(locMast.getLocNo() + "目标库位状态不为F"); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | } |