| | |
| | | @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("已入库的数据无法被删除"); |
| | |
| | | |
| | | 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("该库存已被其他用户冻结,请重新选择"); |
| | | } |