| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.InventoryCheckOrder; |
| | | import com.zy.asrs.entity.InventoryCheckOrderDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | private WorkService workService; |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | private LocMastService locMastService; |
| | | |
| | | @Autowired |
| | | private InventoryCheckOrderService inventoryCheckOrderService; |
| | |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | return R.error("无法通过托盘码找到该工作档,请检查托盘码是否正确"); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("barcode", param.getPalletBarcode())); |
| | | if (locMast == null) { |
| | | throw new CoolException("该托盘不存在库中"); |
| | | } |
| | | LocDetlAdjustParam adjustParam = new LocDetlAdjustParam(); |
| | | adjustParam.setLocNo(wrkMast.getWrkSts() < 100 ? wrkMast.getLocNo() : wrkMast.getSourceLocNo()); |
| | | adjustParam.setLocNo(locMast.getLocNo()); |
| | | List<LocDetlAdjustParam.LocDetlAdjust> list = new ArrayList<>(); |
| | | param.getDetails().forEach(elem -> { |
| | | list.add(new LocDetlAdjustParam.LocDetlAdjust(elem.getMatnr(), elem.getBatch(), elem.getActulQty(), elem.getDanger())); |
| | | list.add(new LocDetlAdjustParam.LocDetlAdjust(elem.getProductionCode(), elem.getBatch(), elem.getActulQty(), elem.getQuality(),elem.getCode())); |
| | | }); |
| | | workService.adjustLocDetl(adjustParam, getUserId()); |
| | | return R.ok(); |
| | |
| | | checkOrder.setStatus("1"); |
| | | param.getDetails().forEach(elem -> { |
| | | Mat mat = matService.selectByMatnr(elem.getProductionCode()); |
| | | if (mat==null){ |
| | | if (mat == null) { |
| | | throw new CoolException("物料不存在"); |
| | | } |
| | | //checkOrder.setArea(param.getArea()); |