| | |
| | | import org.springblade.modules.recovery.entity.Recovery; |
| | | import org.springblade.modules.recovery.service.RecoveryService; |
| | | import org.springblade.modules.recovery.vo.RecoveryVO; |
| | | import org.springblade.modules.stock.vo.StocksVO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | farmingRecordService.save(record); |
| | | |
| | | //库存 |
| | | //先查询是否有该农产品的库存 |
| | | //先查询是否有该农产品的库存(根据地块,农产品) |
| | | FarmProductStock stock = new FarmProductStock(); |
| | | // stock.setFarmPlantId(recovery.getFarmPlantId()); |
| | | stock.setStrainId(recovery.getStrainId()); |
| | | stock.setLandId(recovery.getLandId()); |
| | | FarmProductStock stock1 = farmProductStockService.getOne(new QueryWrapper<>(stock)); |
| | | if (null != stock1) { |
| | | //更新库存 |
| | |
| | | return R.status(recoveryService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 数据统计采收详情 |
| | | */ |
| | | @PostMapping("/recoveryStatistics") |
| | | public R<IPage<RecoveryVO>> recoveryStatistics(RecoveryVO recoveryVO, Query query){ |
| | | IPage<RecoveryVO> pages = recoveryService.recoveryStatistics(Condition.getPage(query), recoveryVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 小程序采收详情列表自定义分页 |