| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.farmplant.entity.FarmProductStock; |
| | | import org.springblade.modules.farmplant.service.FarmProductStockService; |
| | | import org.springblade.modules.InventoryLoss.entity.Inventory; |
| | | import org.springblade.modules.InventoryLoss.service.InventoryService; |
| | |
| | | import org.springblade.modules.processInv.entity.ProcessInv; |
| | | import org.springblade.modules.processInv.service.IProcessInvService; |
| | | import org.springblade.modules.processInv.vo.ProcessInvVO; |
| | | import org.springblade.modules.sale.entity.Sale; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @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); |
| | | return R.status(inventoryService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |