| | |
| | | wrapper.eq("brand", param.get("brand")); |
| | | param.remove("brand"); |
| | | } |
| | | // 仓库精确匹配 |
| | | if (!Cools.isEmpty(param.get("stash"))) { |
| | | wrapper.eq("stash", param.get("stash")); |
| | | param.remove("stash"); |
| | | } |
| | | // 没有选择的时候默认不显示已出库的物料 |
| | | if (Cools.isEmpty(param.get("status"))) { |
| | | wrapper.ne("status", "全部出库"); |
| | |
| | | @RequestMapping(value = "/pla/add/auth") |
| | | @ManagerAuth |
| | | public R add(@RequestBody List<Pla> plas) { |
| | | System.out.println(plas.toString()); |
| | | log.info(plas.toString()); |
| | | plas.forEach(pla -> { |
| | | plaService.insert(pla); |
| | | }); |
| | |
| | | @RequestMapping(value = "/pla/update/auth") |
| | | @ManagerAuth |
| | | public R update(@RequestBody List<Pla> plas) { |
| | | System.out.println(plas.toString()); |
| | | log.info(plas.toString()); |
| | | plas.forEach(pla -> { |
| | | Pla plaSave = plaService.selectById(pla.getId()); |
| | | pla.setModifyTime(new Date()); |
| | |
| | | @RequestMapping(value = "/pla/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestBody List<Pla> plas) { |
| | | System.out.println(plas.toString()); |
| | | log.info(plas.toString()); |
| | | plas.forEach(pla -> { |
| | | if (!pla.getStatus().equals(GlobleParameter.PLA_STATUS_00) && !pla.getStatus().equals(GlobleParameter.PLA_STATUS_0) && !pla.getStatus().equals(GlobleParameter.PLA_STATUS_1)) { |
| | | throw new CoolException("已入库的数据无法被删除"); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/sellout/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "sellout") |
| | | @Transactional |
| | | @Synchronized |
| | | public R sellout(@RequestBody List<Pla> plas) { |
| | |
| | | OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMaktx(orderNo, maktx); |
| | | |
| | | for (Pla pla : plas) { |
| | | |
| | | // 获取最新冻结状态 |
| | | Pla pla1 = plaService.selectOne(new EntityWrapper<Pla>().setSqlSelect("stock_freeze as stockFreeze,stock_freeze_by as stockFreezeBy,stock_freeze_date as stockFreezeDate").eq("id", pla.getId())); |
| | | pla.setStockFreeze(pla1.getStockFreeze()); |
| | | pla.setStockFreezeBy(pla1.getStockFreezeBy()); |
| | | pla.setStockFreezeDate(pla1.getStockFreezeDate()); |
| | | if (pla.getStockFreeze() == 0) { |
| | | // throw new CoolException("库存已被冻结,请重新选择库存"); |
| | | System.out.println(pla.getStockFreezeBy() + "," + getUser().getUsername()); |
| | | log.info("该库存已被其他用户冻结,请重新选择;{},{}", pla.getStockFreezeBy(), getUser().getUsername()); |
| | | if (!Cools.eq(pla.getStockFreezeBy(), getUser().getUsername())) { |
| | | throw new CoolException("该库存已被其他用户冻结,请重新选择"); |
| | | } |
| | |
| | | if (pla.getWeightAnfme() - pla.getQtyAnfme() - pla.getOrderWeight() < 0) { |
| | | throw new CoolException("批号:" + pla.getBatch() + ",包号:" + pla.getPackageNo() + " 剩余可出库重量不足,请调整出库重量"); |
| | | } |
| | | if (Cools.isEmpty(pla.getMassState())){ |
| | | throw new CoolException("质量指标为上传"); |
| | | } |
| | | pla.setQtyAnfme(pla.getQtyAnfme() + pla.getOrderWeight()); |
| | | pla.setHandlerBy(getUser().getUsername()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_2); |