智慧农业后台管理
zengh
2022-07-19 64ce8e808e8b7dc95c79eecd9201d302d4335dfa
src/main/java/org/springblade/modules/sale/controller/SaleController.java
@@ -112,7 +112,7 @@
   @PostMapping("/submit")
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "新增或修改", notes = "传入sale")
   public R submit(@Valid @RequestBody Sale sale) {
   public R submit(@Valid @RequestBody SaleVO sale) {
      boolean res = farmProductStockService.stockCompare(sale.getSaleNum(),sale.getStrainId());
      if (!res){
         throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前库存不足!"));
@@ -137,17 +137,35 @@
   /**
    * 大屏销售统计
    */
   @PostMapping("/selctSaletCount")
   public R selctSaletCount(String year) {
      return R.data(saleService.selctSaletCount(year));
   @GetMapping("/selctSaletCount")
   public R selctSaletCount(String farmId) {
      return R.data(saleService.selctSaletCount(farmId));
   }
   /**
    * 统计今年和去年的销售总额
    */
   @PostMapping("/selctSaletZ")
   public R selctSaletZ() {
      return R.data(saleService.selctSaletZ());
   @GetMapping("/selctSaletZ")
   public R selctSaletZ(SaleVO sale) {
      return R.data(saleService.selctSaletZ(sale));
   }
   /**
    * 统计市场流通/去年流通量/本月流通量
    * @param sale
    * @return
    */
   @GetMapping("/selectMarketCirculate")
   public R selectMarketCirculate(SaleVO sale) {
      return R.data(saleService.selectMarketCirculate(sale));
   }
   /**
    * 按行政区统计市场流通
    */
   @GetMapping("/selectMarketDistrict")
   public R selectMarketDistrict(String farmId) {
      return R.data(saleService.selectMarketDistrict(farmId));
   }
}