| | |
| | | */ |
| | | @RequestMapping("/plaDetl/move/v1") |
| | | @ManagerAuth |
| | | public R plaDetlMove(@RequestBody JSONObject json){ |
| | | String brand = json.get("brand").toString(); |
| | | String batch = json.get("batch").toString(); |
| | | Integer packageNo = Integer.parseInt(json.get("packageNo").toString()); |
| | | String locNo = json.get("locNo").toString(); |
| | | public R plaDetlMove(@RequestBody PlaMoveParam param){ |
| | | |
| | | if(Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | return R.error("有参数为空,无法入库"); |
| | | } |
| | | |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo,brand); |
| | | if ((Cools.isEmpty(pla))){ |
| | | return R.error("该包物料未录入,无法查询到相关信息"); |
| | | } |
| | | if(!Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_1)){ |
| | | return R.error("该包物料状态不为已入库状态,无法转移"); |
| | | } |
| | | String locNo = param.getLocNo(); |
| | | |
| | | Node node = nodeService.selectByUuid(locNo); |
| | | if(Cools.isEmpty(node)){ |
| | | throw new CoolException("库位信息不正确"); |
| | | } |
| | | |
| | | String sourceLocNo = pla.getLocNo(); |
| | | List<PlaMoveParam.PlaMove> plas = param.getPlas(); |
| | | |
| | | pla.setLocNo(locNo); |
| | | pla.setStash(node.getParentName()); |
| | | pla.setModifyTime(new Date()); |
| | | param.getPlas().forEach(p -> { |
| | | String brand = p.getBrand(); |
| | | String batch = p.getBatch(); |
| | | Integer packageNo = p.getPackageNo(); |
| | | if(Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | throw new CoolException("有参数为空,无法入库"); |
| | | } |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo,brand); |
| | | if ((Cools.isEmpty(pla))){ |
| | | throw new CoolException("该包物料未录入,无法查询到相关信息"); |
| | | } |
| | | if(!Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_1) && !Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_3)){ |
| | | throw new CoolException("该包物料状态不为入库状态,无法转移"); |
| | | } |
| | | |
| | | plaService.updateById(pla); |
| | | String sourceLocNo = pla.getLocNo(); |
| | | pla.setLocNo(locNo); |
| | | pla.setStash(node.getParentName()); |
| | | pla.setModifyTime(new Date()); |
| | | |
| | | SaasUtils.insertLog(2,sourceLocNo,pla.getBrand(),pla.getWeightAnfme(),getUser().getUsername(), |
| | | locNo,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop()); |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(2,sourceLocNo,pla.getBrand(),pla.getWeightAnfme(),getUser().getUsername(), |
| | | locNo,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop()); |
| | | |
| | | return R.ok(); |
| | | }); |
| | | |
| | | return R.ok("移库成功"); |
| | | } |
| | | |
| | | /* |