| | |
| | | //库存充足,减去相应库存 |
| | | farmProductStockService.stockReduce(inventory.getSaleNum(),inventory.getProid()); |
| | | } |
| | | inventory.setProdId(inventory.getProid()); |
| | | return R.status(inventoryService.saveOrUpdate(inventory)); |
| | | } |
| | | |
| | |
| | | inventory.setLandId(processInvVO.getLandId()); |
| | | processInvService.updateById(processInv); |
| | | } |
| | | inventory.setProdId(inventory.getProid()); |
| | | return R.status(inventoryService.saveOrUpdate(inventory)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | Inventory inventory = inventoryService.getById(Long.parseLong(ids)); |
| | | FarmProductStock farmProductStock = farmProductStockService.selectBy2Id(inventory.getStrainId(), inventory.getLandId()); |
| | | Double weight = Double.parseDouble(farmProductStock.getWeight())+inventory.getSaleNum(); |
| | | farmProductStock.setWeight(weight.toString()); |
| | | farmProductStockService.updateById(farmProductStock); |
| | | if (inventory.getType() == 0){ |
| | | FarmProductStock farmProductStock = farmProductStockService.getById(inventory.getProdId()); |
| | | Double weight = Double.parseDouble(farmProductStock.getWeight())+inventory.getSaleNum(); |
| | | farmProductStock.setWeight(weight.toString()); |
| | | farmProductStockService.updateById(farmProductStock); |
| | | }else { |
| | | ProcessInv inv = processInvService.findById(inventory.getProdId()); |
| | | Double weight = inv.getProductInventoryNum()+inventory.getSaleNum(); |
| | | inv.setProductInventoryNum(weight); |
| | | processInvService.updateById(inv); |
| | | } |
| | | return R.status(inventoryService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |