| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/pages") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入farmProductStock") |
| | | public R<List<FarmProductStockVO>> pages(FarmProductStockVO farmProductStock) { |
| | | List<FarmProductStockVO> pages = farmProductStockService.selectFarmProductStockPages(farmProductStock); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @GetMapping("/getFarmProductStockByFarmIdAndStrainId") |
| | | public R<FarmProductStock> findFarmProductStockByFarmIdAndStrainId(String farmId,Integer strainId) { |
| | | List<FarmProductStock> farmProductStockList = farmProductStockService.findFarmProductStockByFarmIdAndStrainId(farmId,strainId); |
| | | if (farmProductStockList.size() == 0) { |
| | | return R.data(null); |
| | | } |
| | | return R.data(farmProductStockList.get(0)); |
| | | } |
| | | |
| | | /** |
| | | * 统计产量 |
| | | * |
| | | * @param farmProductStock |
| | |
| | | * 大屏经营概况库存数量与年产量 |
| | | */ |
| | | @GetMapping("/statisticsStockAndYield") |
| | | public R statisticsStockAndYield(String year,String deptId) { |
| | | public R statisticsStockAndYield(String year,String farmId) { |
| | | |
| | | //库存数量统计 |
| | | Map map = new HashMap(); |
| | | //统计当前库存农产品 |
| | | Map<String, String> sum = farmProductStockService.statisticsStock(year, deptId); |
| | | Map<String, String> sum = farmProductStockService.statisticsStock(year, farmId); |
| | | //统计当前库存加工产品 |
| | | Map<String, String> jgsum = null; |
| | | map.put("sum",sum.get("sum")); |
| | | if (sum != null){ |
| | | map.put("sum",sum.get("sum")); |
| | | map.put("ncpNcl", sum.get("cssum")); |
| | | }else{ |
| | | map.put("sum",0); |
| | | map.put("ncpNcl",0); |
| | | } |
| | | map.put("jgsum",0); |
| | | |
| | | //农产品年产量统计 |
| | | // List<Map<String, Double>> Nsum = farmProductStockService.statisticsYield(year, deptId); |
| | | // double ncpNcl = Nsum.get(1).get("sum") + Nsum.get(0).get("sum"); |
| | | |
| | | map.put("ncpNcl", sum.get("cssum")); |
| | | |
| | | |
| | | //加工产品年产量统计 |
| | | map.put("jgNcl",0); |
| | |
| | | * 按月份统计产量 |
| | | */ |
| | | @GetMapping("/statisticsStockMonth") |
| | | public R statisticsStockMonth(String year,String deptId) { |
| | | public R statisticsStockMonth(String year,String farmId) { |
| | | |
| | | //采收数量统计 |
| | | Map map = new HashMap(); |
| | | Map<String, String> cssum = farmProductStockService.statisticsStockMonth(year, deptId); |
| | | List<Map<String, String>> cssum = farmProductStockService.statisticsStockMonth(year, farmId); |
| | | //加工产品数量统计 |
| | | Map<String, String> jgsum = null; |
| | | |
| | |
| | | * 农产品监管 |
| | | */ |
| | | @GetMapping("/productsSupervise") |
| | | public R productsSupervise(String year,String deptId) { |
| | | public R productsSupervise(String year,String farmId) { |
| | | |
| | | Map<String, String> cssum = farmProductStockService.productsSupervise(year, deptId); |
| | | Map<String, String> cssum = farmProductStockService.productsSupervise(year, farmId); |
| | | |
| | | return R.data(cssum); |
| | | } |