| | |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | *首页当前种养产品总和 |
| | | */ |
| | | @GetMapping("/strainCount") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入farmPlant") |
| | | public R<IPage<FarmPlantVO>> strainCount(FarmPlantVO farmPlant, Query query) { |
| | | IPage<FarmPlantVO> pages = farmplantService.selectFarmPlantPageCount(Condition.getPage(query), farmPlant); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询种养记录列表(不分页) |
| | |
| | | return R.status(status); |
| | | } |
| | | |
| | | @PostMapping("/overAll") |
| | | public R overAll(@RequestBody FarmPlantVO farmPlantVO){ |
| | | boolean status = false; |
| | | for (int i=0;i<farmPlantVO.getIds().length;i++){ |
| | | FarmPlant farmPlant = new FarmPlant(); |
| | | farmPlant.setId(farmPlantVO.getIds()[i]); |
| | | farmPlant.setEndPlantTime(farmPlantVO.getEndPlantTime()); |
| | | farmPlant.setStatus("2"); |
| | | status = farmplantService.updateById(farmPlant); |
| | | //判断该地块是否还有种植的农产品 |
| | | FarmPlant farmPlant2 = farmplantService.getById(farmPlant.getId()); |
| | | FarmPlant farmPlant1 = new FarmPlant(); |
| | | farmPlant1.setLandId(farmPlant2.getLandId()); |
| | | farmPlant1.setStatus("1"); |
| | | List<FarmPlant> list = farmplantService.list(new QueryWrapper<>(farmPlant1)); |
| | | if (list.size() < 1) { |
| | | //更新该地块的耕种状态 |
| | | Land land = new Land(); |
| | | land.setType(1); |
| | | land.setId(Long.parseLong(farmPlant2.getLandId())); |
| | | landService.updateById(land); |
| | | } |
| | | } |
| | | return R.data(status); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |