智慧农业后台管理
guoshilong
2022-09-15 fa326e87de2805d8b66b301daee596b1d959e430
src/main/java/org/springblade/modules/recovery/controller/RecoveryController.java
@@ -21,6 +21,7 @@
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.service.RecoveryService;
import org.springblade.modules.recovery.vo.RecoveryVO;
import org.springblade.modules.stock.vo.StocksVO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@@ -29,6 +30,7 @@
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
 * 农事记录控制器
@@ -104,7 +106,7 @@
         record.setLandId(recovery.getLandId());
         record.setDeptId(recovery.getDeptId());
         record.setTenantId(recovery.getTenantId());
         record.setStrainId(recovery.getStrainId());
         record.setStrainId(Integer.parseInt(recovery.getStrainId()));
         record.setOperator(recovery.getOperator());
         Strain strain = strainService.getById(recovery.getStrainId());
         record.setContent("品种: " + strain.getStrainName() + ", 重量:" + recovery.getWeight());
@@ -114,7 +116,7 @@
         //库存
         //先查询是否有该农产品的库存(根据地块,农产品)
         FarmProductStock stock = new FarmProductStock();
         stock.setStrainId(recovery.getStrainId());
         stock.setStrainId(Integer.parseInt(recovery.getStrainId()));
         stock.setLandId(recovery.getLandId());
         FarmProductStock stock1 = farmProductStockService.getOne(new QueryWrapper<>(stock));
         if (null != stock1) {
@@ -138,7 +140,7 @@
            productStock.setLeaves(recovery.getLeaves());
            productStock.setOperator(recovery.getOperator());
            productStock.setTime(recovery.getTime());
            productStock.setStrainId(recovery.getStrainId());
            productStock.setStrainId(Integer.parseInt(recovery.getStrainId()));
            productStock.setWeight(recovery.getWeight());
            productStock.setRecovery(recovery.getWeight());
            productStock.setFarmPlantId(recovery.getFarmPlantId());
@@ -199,6 +201,23 @@
      return R.status(recoveryService.removeByIds(Func.toLongList(ids)));
   }
   /**
    * 数据统计采收详情
    */
   @PostMapping("/recoveryStatistics")
   public  R<IPage<RecoveryVO>> recoveryStatistics(RecoveryVO recoveryVO, Query query){
      IPage<RecoveryVO> pages = recoveryService.recoveryStatistics(Condition.getPage(query), recoveryVO);
      return R.data(pages);
   }
   /**
    * xcx数据统计采收详情
    */
   @GetMapping("/recoveryStatisticsx")
   public  R recoveryStatisticsx( RecoveryVO recoveryVO, Query query){
      IPage<RecoveryVO> pages = recoveryService.recoveryStatisticsx(Condition.getPage(query), recoveryVO);
      return R.data(pages);
   }
   /**
    * 小程序采收详情列表自定义分页