| | |
| | | import org.springblade.core.mp.support.Query; |
| | | 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.farm.entity.Farm; |
| | | import org.springblade.modules.farm.vo.FarmVO; |
| | | import org.springblade.modules.resource.endpoint.OssEndpoint; |
| | |
| | | */ |
| | | @GetMapping("/selcetByStrainId") |
| | | public R selcetByStrainId(String strainId,String farmId) { |
| | | List<Land> list = landService.selectByStrainId(strainId,farmId); |
| | | List<LandVO> list = landService.selectByStrainId(strainId,farmId); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | } else { |
| | | v1 = (double) Math.round(area * 100) / 100; |
| | | } |
| | | String myArea = land.getLandArea(); |
| | | land.setLandArea(String.valueOf(v1)); |
| | | land.setLandArea(myArea); |
| | | } else { |
| | | land.setLandArea("0"); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | land.setType(1); |
| | | return R.status(landService.saveLandInfo(land)); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | land.setLandArea(String.valueOf(v1)); |
| | | |
| | | Land myLand = landService.getById(land.getId()); |
| | | if (myLand.getLandArea().equals(land.getLandArea())){ |
| | | land.setLandArea(String.valueOf(v1)); |
| | | }else { |
| | | land.setLandArea(land.getLandArea()); |
| | | } |
| | | |
| | | |
| | | return R.status(landService.updateLandById(land)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(landService.deleteLogic(Func.toLongList(ids))); |
| | | //先要判断该地块是否还有正在种植的作物,先结束才能删除地块 |
| | | List<LandVO> land= landService.findPlantInLand(ids); |
| | | if (land.size()<=0) { |
| | | return R.status(landService.deleteLogic(Func.toLongList(ids))); |
| | | }else { |
| | | throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("请先结束该地块正在种养品种")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.data(landService.selectLandList(userid)); |
| | | } |
| | | |
| | | /** |
| | | * 获取采收地块列表 |
| | | */ |
| | | @GetMapping("/selectRecoveryLandList") |
| | | public R selectRecoveryLandList(String farmId){return R.data(landService.selectRecoveryLandList(farmId));} |
| | | |
| | | /** |
| | | * 地块列表(不分页) |
| | |
| | | if (unit.equals("0")) { |
| | | num += area1; |
| | | } |
| | | if (unit.equals("1")) { |
| | | else if (unit.equals("1")) { |
| | | double v = area1 * 0.1; |
| | | num += v; |
| | | } else { |
| | |
| | | if (unit.equals("0")) { |
| | | snum += area1; |
| | | } |
| | | if (unit.equals("1")) { |
| | | else if (unit.equals("1")) { |
| | | double v = area1 * 0.1; |
| | | snum += v; |
| | | } else { |
| | | } else{ |
| | | double v = area1 * 0.0015; |
| | | snum += v; |
| | | } |
| | |
| | | if (unit.equals("0")) { |
| | | num += area1; |
| | | } |
| | | if (unit.equals("1")) { |
| | | else if (unit.equals("1")) { |
| | | double v = area1 * 0.1; |
| | | num += v; |
| | | } else { |
| | |
| | | if (unit.equals("0")) { |
| | | snum += area1; |
| | | } |
| | | if (unit.equals("1")) { |
| | | else if (unit.equals("1")) { |
| | | double v = area1 * 0.1; |
| | | snum += v; |
| | | } else { |
| | |
| | | if (unit.equals("0")) { |
| | | wnum += area1; |
| | | } |
| | | if (unit.equals("1")) { |
| | | else if (unit.equals("1")) { |
| | | double v = area1 * 0.1; |
| | | wnum += v; |
| | | } else { |