| | |
| | | import org.springblade.modules.farm.entity.FarmingRecord; |
| | | import org.springblade.modules.farm.service.FarmingRecordService; |
| | | import org.springblade.modules.farm.vo.FarmingRecordVO; |
| | | import org.springblade.modules.farmplant.entity.Strain; |
| | | import org.springblade.modules.farmplant.service.StrainService; |
| | | import org.springblade.modules.soldr.entity.Soldr; |
| | | import org.springblade.modules.soldr.service.ISoldrService; |
| | | import org.springblade.modules.soldrecord.service.ISoldrecordService; |
| | |
| | | private final ISoldrService soldrService; |
| | | private final ISoldrecordService soldrecordService; |
| | | private final IStockfactoryService stockfactoryService; |
| | | |
| | | private final StrainService strainService; |
| | | /** |
| | | * 详情 |
| | | */ |
| | |
| | | public R<FarmingRecord> detail(FarmingRecord farm) { |
| | | FarmingRecord detail = farmService.getOne(Condition.getQueryWrapper(farm)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 获取农事记录详情带中文 |
| | | * @param farmingRecordVO |
| | | * @return |
| | | */ |
| | | @GetMapping("/details") |
| | | public R details(FarmingRecordVO farmingRecordVO){ |
| | | return R.data(farmService.getDetails(farmingRecordVO)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R<IPage<FarmingRecordVO>> page(FarmingRecordVO farm, Query query) { |
| | | IPage<FarmingRecordVO> pages = farmService.selectFarmingRecordPage(Condition.getPage(query), farm); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @GetMapping("/pageNz") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入farm") |
| | | public R<IPage<FarmingRecordVO>> pageNz(FarmingRecordVO farm, Query query) { |
| | | IPage<FarmingRecordVO> pages = farmService.selectFarmingRecordPageByNz(Condition.getPage(query), farm); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 查询农事操作记录(不分页) |
| | | * @param farm |
| | | * @return |
| | | */ |
| | | @GetMapping("/getFarmingRecordList") |
| | | public R getFarmingRecordList(FarmingRecordVO farm) { |
| | | return R.data(farmService.getFarmingRecordListfarm(farm)); |
| | | } |
| | | |
| | | /** |
| | |
| | | stockfactory.setId(ids); |
| | | Stockfactory detailstock = stockfactoryService.getOne(Condition.getQueryWrapper(stockfactory)); |
| | | String agriculturalName = detailstock.getAgriculturalName(); |
| | | String content = agriculturalName + " " + v + "公斤"; |
| | | Strain strain = strainService.getById(farm.getStrainId()); |
| | | String content =strain.getStrainName()+"-"+ agriculturalName + " " + v + "公斤"; |
| | | farm.setContent(content); |
| | | //使用农资数量等于已出农资数量 |
| | | if (farm.getSnum() == detail.getAmount1()) { |
| | | soldrService.dels(id); |
| | | } else { |
| | | soldrecordService.updateSold(amount1 - farm.getSnum(), id, detail.getCensus() - v); |
| | | detail.setAmount1(detail.getAmount1()-farm.getSnum()); |
| | | soldrService.updateById(detail); |
| | | } |
| | | } |
| | | return R.status(farmService.save(farm)); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getFarmingCount") |
| | | public R getFarmingCount(String deptId) { |
| | | return R.data(farmService.getFarmingCount(deptId)); |
| | | public R getFarmingCount(String farmId) { |
| | | return R.data(farmService.getFarmingCount(farmId)); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getFarmingStatis") |
| | | public R getFarmingStatis(String deptId) { |
| | | return R.data(farmService.getFarmingStatis(deptId)); |
| | | public R getFarmingStatis(String farmId) { |
| | | return R.data(farmService.getFarmingStatis(farmId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 大屏农资使用概况统计 |
| | | * |
| | | * @param farmId 农场id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getStockCount") |
| | | public R getStockCount(String deptId) { |
| | | public R getStockCount(String farmId) { |
| | | //今年 |
| | | Double aDouble = farmService.selectJyCount(deptId); |
| | | Double aDouble = farmService.selectJyCount(farmId); |
| | | //去年 |
| | | Double aDouble1 = farmService.selectQyCount(deptId); |
| | | Double aDouble1 = farmService.selectQyCount(farmId); |
| | | //本月 |
| | | Double aDouble2 = farmService.selectByCount(deptId); |
| | | Double aDouble2 = farmService.selectByCount(farmId); |
| | | Map map = new HashMap(); |
| | | map.put("jn", aDouble); |
| | | map.put("qn", aDouble1); |