Browse Source

精准饲喂

wwh 1 year ago
parent
commit
2f58bd166f
27 changed files with 725 additions and 470 deletions
  1. 15 20
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/controller/EnergyThresholdController.java
  2. 3 27
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/entity/EnergyThreshold.java
  3. 1 8
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/entity/vo/EnergyThresholdListVo.java
  4. 1 3
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/entity/vo/EnergyThresholdVo.java
  5. 1 1
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/param/EnergyThresholdModifyParam.java
  6. 1 1
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/param/EnergyThresholdOrgIdParam.java
  7. 1 2
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/param/EnergyThresholdSaveParam.java
  8. 1 1
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/param/EnergyThresholdSyncParam.java
  9. 5 5
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/service/EnergyThresholdService.java
  10. 35 18
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/service/impl/EnergyThresholdServiceImpl.java
  11. 0 108
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/controller/EnergyThresholdController.java
  12. 0 83
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/entity/EnergyThreshold.java
  13. 0 61
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/service/EnergyThresholdService.java
  14. 0 119
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/service/impl/EnergyThresholdServiceImpl.java
  15. 101 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/controller/FeedingThresholdController.java
  16. 104 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/entity/FeedingThreshold.java
  17. 6 6
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/enums/EnergyThresholdEnum.java
  18. 6 6
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/mapper/EnergyThresholdMapper.java
  19. 1 1
      snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/mapper/mapping/EnergyThresholdMapper.xml
  20. 39 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/AddFeedingParam.java
  21. 37 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/FeedingEditParam.java
  22. 73 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/FeedingThresholdAddParam.java
  23. 35 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/FeedingThresholdIdParam.java
  24. 62 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/service/FeedingThresholdService.java
  25. 126 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/service/impl/FeedingThresholdServiceImpl.java
  26. 48 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/vo/FeedingThresholdVo.java
  27. 23 0
      snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/vo/FeedingThresholdVo2.java

+ 15 - 20
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/controller/EnergyThresholdController.java

@@ -18,21 +18,16 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import vip.xiaonuo.common.pojo.CommonResult;
-import vip.xiaonuo.modular.energy.energyThreshold.entity.EnergyThreshold;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdModifyParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdSaveParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdSyncParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdUnitIdParam;
+import vip.xiaonuo.modular.energy.energyThreshold.entity.vo.EnergyThresholdListVo;
+import vip.xiaonuo.modular.energy.energyThreshold.param.*;
 import vip.xiaonuo.modular.energy.energyThreshold.service.EnergyThresholdService;
-import vip.xiaonuo.modular.env.envThreshold.entity.EnvThreshold;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdModifyParam;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdSaveParam;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdSyncParam;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdUnitIdParam;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * 能耗阈值控制器
@@ -56,10 +51,10 @@ public class EnergyThresholdController {
      * @date  2023/12/26 10:20
      */
     @ApiOperationSupport(order = 1)
-    @ApiOperation("根据单元ID获取能耗阈值")
-    @GetMapping("/energy/energyThreshold/getThresholdByUnitId")
-    public CommonResult<EnergyThreshold> getThresholdByUnitId(EnergyThresholdUnitIdParam energyThresholdUnitIdParam) {
-        return CommonResult.data(energyThresholdService.getThresholdByUnitId(energyThresholdUnitIdParam));
+    @ApiOperation("获取能耗阈值")
+    @GetMapping("/energy/energyThreshold/getThreshold")
+    public CommonResult<List<EnergyThresholdListVo>> getThreshold(EnergyThresholdOrgIdParam energyThresholdOrgIdParam) {
+        return CommonResult.data(energyThresholdService.getThreshold(energyThresholdOrgIdParam));
     }
 
     /**
@@ -70,8 +65,8 @@ public class EnergyThresholdController {
      */
     @ApiOperationSupport(order = 1)
     @ApiOperation("编辑能耗阈值")
-    @GetMapping("/energy/energyThreshold/saveThreshold")
-    public CommonResult<String> saveThreshold(EnergyThresholdSaveParam energyThresholdSaveParam) {
+    @PostMapping("/energy/energyThreshold/saveThreshold")
+    public CommonResult<String> saveThreshold(@RequestBody EnergyThresholdSaveParam energyThresholdSaveParam) {
         energyThresholdService.saveThreshold(energyThresholdSaveParam);
         return CommonResult.ok();
     }
@@ -85,8 +80,8 @@ public class EnergyThresholdController {
      */
     @ApiOperationSupport(order = 2)
     @ApiOperation("修改能耗阈值状态")
-    @GetMapping("/energy/energyThreshold/modifyThresholdStatus")
-    public CommonResult<String> modifyThresholdStatus(EnergyThresholdModifyParam energyThresholdModifyParam) {
+    @PostMapping("/energy/energyThreshold/modifyThresholdStatus")
+    public CommonResult<String> modifyThresholdStatus(@RequestBody EnergyThresholdModifyParam energyThresholdModifyParam) {
         energyThresholdService.modifyThresholdStatus(energyThresholdModifyParam);
         return CommonResult.ok();
     }
@@ -99,8 +94,8 @@ public class EnergyThresholdController {
      */
     @ApiOperationSupport(order = 2)
     @ApiOperation("同步能耗阈值")
-    @GetMapping("/energy/energyThreshold/syncThreshold")
-    public CommonResult<String> syncThreshold(EnergyThresholdSyncParam energyThresholdSyncParam) {
+    @PostMapping("/energy/energyThreshold/syncThreshold")
+    public CommonResult<String> syncThreshold(@RequestBody EnergyThresholdSyncParam energyThresholdSyncParam) {
         energyThresholdService.syncThreshold(energyThresholdSyncParam);
         return CommonResult.ok();
     }

+ 3 - 27
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/entity/EnergyThreshold.java

@@ -16,6 +16,8 @@ import com.baomidou.mybatisplus.annotation.*;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
+import vip.xiaonuo.common.pojo.CommonEntity;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -28,7 +30,7 @@ import java.util.Date;
 @Getter
 @Setter
 @TableName("energy_threshold")
-public class EnergyThreshold {
+public class EnergyThreshold extends CommonEntity {
 
     /** id */
     @TableId
@@ -78,30 +80,4 @@ public class EnergyThreshold {
     /** 组织id */
     @ApiModelProperty(value = "组织id", position = 12)
     private String orgId;
-
-    /** 删除标志 */
-    @ApiModelProperty(value = "删除标志", position = 13)
-    @TableLogic
-    @TableField(fill = FieldFill.INSERT)
-    private String deleteFlag;
-
-    /** 创建时间 */
-    @ApiModelProperty(value = "创建时间", position = 14)
-    @TableField(fill = FieldFill.INSERT)
-    private Date createTime;
-
-    /** 创建用户 */
-    @ApiModelProperty(value = "创建用户", position = 15)
-    @TableField(fill = FieldFill.INSERT)
-    private String createUser;
-
-    /** 修改时间 */
-    @ApiModelProperty(value = "修改时间", position = 16)
-    @TableField(fill = FieldFill.UPDATE)
-    private Date updateTime;
-
-    /** 修改用户 */
-    @ApiModelProperty(value = "修改用户", position = 17)
-    @TableField(fill = FieldFill.UPDATE)
-    private String updateUser;
 }

+ 1 - 8
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/entity/vo/EnergyThresholdListVo.java

@@ -10,19 +10,12 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.entity.vo;
+package vip.xiaonuo.modular.energy.energyThreshold.entity.vo;
 
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fhs.core.trans.anno.Trans;
-import com.fhs.core.trans.constant.TransType;
-import com.fhs.core.trans.vo.TransPojo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
-import vip.xiaonuo.modular.base.pigpen.entity.BasePigpen;
-import vip.xiaonuo.modular.env.envThreshold.entity.vo.EnvThresholdVo;
 
-import java.math.BigDecimal;
 import java.util.List;
 
 /**

+ 1 - 3
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/entity/vo/EnergyThresholdVo.java

@@ -10,9 +10,8 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.entity.vo;
+package vip.xiaonuo.modular.energy.energyThreshold.entity.vo;
 
-import com.baomidou.mybatisplus.annotation.*;
 import com.fhs.core.trans.anno.Trans;
 import com.fhs.core.trans.constant.TransType;
 import com.fhs.core.trans.vo.TransPojo;
@@ -22,7 +21,6 @@ import lombok.Setter;
 import vip.xiaonuo.modular.base.pigpen.entity.BasePigpen;
 
 import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * 能耗阈值实体

+ 1 - 1
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/param/EnergyThresholdModifyParam.java

@@ -10,7 +10,7 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.param;
+package vip.xiaonuo.modular.energy.energyThreshold.param;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;

+ 1 - 1
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/param/EnergyThresholdOrgIdParam.java

@@ -10,7 +10,7 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.param;
+package vip.xiaonuo.modular.energy.energyThreshold.param;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;

+ 1 - 2
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/param/EnergyThresholdSaveParam.java

@@ -10,7 +10,7 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.param;
+package vip.xiaonuo.modular.energy.energyThreshold.param;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
@@ -19,7 +19,6 @@ import lombok.Setter;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * 能耗阈值添加参数

+ 1 - 1
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/param/EnergyThresholdSyncParam.java

@@ -10,7 +10,7 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.param;
+package vip.xiaonuo.modular.energy.energyThreshold.param;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;

+ 5 - 5
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/service/EnergyThresholdService.java

@@ -14,10 +14,10 @@ package vip.xiaonuo.modular.energy.energyThreshold.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import vip.xiaonuo.modular.energy.energyThreshold.entity.EnergyThreshold;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdModifyParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdSaveParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdSyncParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdUnitIdParam;
+import vip.xiaonuo.modular.energy.energyThreshold.entity.vo.EnergyThresholdListVo;
+import vip.xiaonuo.modular.energy.energyThreshold.param.*;
+
+import java.util.List;
 
 /**
  * 能耗阈值Service接口
@@ -33,7 +33,7 @@ public interface EnergyThresholdService extends IService<EnergyThreshold> {
      * @author newspaper
      * @date  2023/12/26 10:20
      */
-    EnergyThreshold getThresholdByUnitId(EnergyThresholdUnitIdParam energyThresholdUnitIdParam);
+    List<EnergyThresholdListVo> getThreshold(EnergyThresholdOrgIdParam energyThresholdOrgIdParam);
 
     /**
      * 编辑能耗阈值

+ 35 - 18
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energyThreshold/service/impl/EnergyThresholdServiceImpl.java

@@ -19,17 +19,14 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
 import vip.xiaonuo.modular.base.pigpen.entity.BasePigpen;
 import vip.xiaonuo.modular.base.pigpen.mapper.BasePigpenMapper;
 import vip.xiaonuo.modular.energy.energyThreshold.entity.EnergyThreshold;
+import vip.xiaonuo.modular.energy.energyThreshold.entity.vo.EnergyThresholdListVo;
+import vip.xiaonuo.modular.energy.energyThreshold.entity.vo.EnergyThresholdVo;
 import vip.xiaonuo.modular.energy.energyThreshold.mapper.EnergyThresholdMapper;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdModifyParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdSaveParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdSyncParam;
-import vip.xiaonuo.modular.energy.energyThreshold.param.EnergyThresholdUnitIdParam;
+import vip.xiaonuo.modular.energy.energyThreshold.param.*;
 import vip.xiaonuo.modular.energy.energyThreshold.service.EnergyThresholdService;
-import vip.xiaonuo.modular.env.envThreshold.entity.EnvThreshold;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -48,22 +45,42 @@ public class EnergyThresholdServiceImpl extends ServiceImpl<EnergyThresholdMappe
     private BasePigpenMapper basePigpenMapper;
 
     @Override
-    public EnergyThreshold getThresholdByUnitId(EnergyThresholdUnitIdParam energyThresholdUnitIdParam) {
-        String orgId = StpLoginUserUtil.getLoginUser().getOrgId();
-        String unitId = energyThresholdUnitIdParam.getUnitId();
-        EnergyThreshold energyThreshold = this.getOne(new QueryWrapper<EnergyThreshold>().lambda().eq(EnergyThreshold::getOrgId, orgId).eq(EnergyThreshold::getUnitId, unitId));
-        if (ObjectUtil.isEmpty(energyThreshold)){
-            energyThreshold = new EnergyThreshold();
-            energyThreshold.setOrgId(orgId);
-            energyThreshold.setUnitId(unitId);
-            this.save(energyThreshold);
+    public List<EnergyThresholdListVo> getThreshold(EnergyThresholdOrgIdParam energyThresholdOrgIdParam) {
+        String orgId = energyThresholdOrgIdParam.getOrgId();
+        List<EnergyThresholdListVo> resultList = new ArrayList<>();
+        List<BasePigpen> basePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().eq(BasePigpen::getOrgId, orgId).eq(BasePigpen::getType,0));
+        for (BasePigpen basePigpen : basePigpens) {
+            EnergyThresholdListVo energyThresholdListVo = new EnergyThresholdListVo();
+            energyThresholdListVo.setBuildingId(basePigpen.getId());
+            energyThresholdListVo.setBuildingName(basePigpen.getBuildName());
+            List<EnergyThresholdVo> energyThresholdVos = new ArrayList<>();
+            List<BasePigpen> floorBasePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().eq(BasePigpen::getParentId, basePigpen.getId()));
+            if (ObjectUtil.isNotEmpty(floorBasePigpens)){
+                List<String> floorIds = floorBasePigpens.stream().map(basePigpen1 -> basePigpen1.getId()).collect(Collectors.toList());
+                List<BasePigpen> basePigpens1 = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().in(BasePigpen::getParentId, floorIds));
+                for (BasePigpen pigpen : basePigpens1) {
+                    String unitId = pigpen.getId();
+                    EnergyThresholdVo energyThresholdVo = new EnergyThresholdVo();
+                    EnergyThreshold energyThreshold = this.getOne(new QueryWrapper<EnergyThreshold>().lambda().eq(EnergyThreshold::getOrgId, orgId).eq(EnergyThreshold::getUnitId, unitId));
+                    if (ObjectUtil.isEmpty(energyThreshold)){
+                        energyThreshold = new EnergyThreshold();
+                        energyThreshold.setOrgId(orgId);
+                        energyThreshold.setUnitId(unitId);
+                        this.save(energyThreshold);
+                    }
+                    BeanUtil.copyProperties(energyThreshold,energyThresholdVo);
+                    energyThresholdVos.add(energyThresholdVo);
+                }
+            }
+            energyThresholdListVo.setList(energyThresholdVos);
+            resultList.add(energyThresholdListVo);
         }
-        return energyThreshold;
+        return resultList;
     }
 
     @Override
     public void saveThreshold(EnergyThresholdSaveParam energyThresholdSaveParam) {
-        String orgId = StpLoginUserUtil.getLoginUser().getOrgId();
+        String orgId = energyThresholdSaveParam.getOrgId();
         EnergyThreshold energyThreshold = this.getOne(new QueryWrapper<EnergyThreshold>().lambda().eq(EnergyThreshold::getOrgId, orgId).eq(EnergyThreshold::getUnitId, energyThresholdSaveParam.getUnitId()));
         BeanUtil.copyProperties(energyThresholdSaveParam,energyThreshold);
         this.updateById(energyThreshold);
@@ -79,7 +96,7 @@ public class EnergyThresholdServiceImpl extends ServiceImpl<EnergyThresholdMappe
 
     @Override
     public void syncThreshold(EnergyThresholdSyncParam energyThresholdSyncParam) {
-        String orgId = StpLoginUserUtil.getLoginUser().getOrgId();
+        String orgId = energyThresholdSyncParam.getOrgId();
         List<BasePigpen> basePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda()
                 .like(BasePigpen::getPids, energyThresholdSyncParam.getUnitId())
                 .eq(BasePigpen::getOrgId, orgId)

+ 0 - 108
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/controller/EnergyThresholdController.java

@@ -1,108 +0,0 @@
-/*
- * Copyright [2022] [https://www.xiaonuo.vip]
- *
- * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
- *
- * 1.请不要删除和修改根目录下的LICENSE文件。
- * 2.请不要删除和修改Snowy源码头部的版权声明。
- * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
- * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
- * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
- * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
- */
-package vip.xiaonuo.modular.energy.energythreshold.controller;
-
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.github.xiaoymin.knife4j.annotations.ApiSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-import vip.xiaonuo.common.pojo.CommonResult;
-import vip.xiaonuo.modular.energy.energythreshold.entity.EnergyThreshold;
-import vip.xiaonuo.modular.energy.energythreshold.entity.vo.EnergyThresholdListVo;
-import vip.xiaonuo.modular.energy.energythreshold.param.*;
-import vip.xiaonuo.modular.energy.energythreshold.service.EnergyThresholdService;
-import vip.xiaonuo.modular.env.envThreshold.entity.EnvThreshold;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdModifyParam;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdSaveParam;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdSyncParam;
-import vip.xiaonuo.modular.env.envThreshold.param.EnvThresholdUnitIdParam;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * 能耗阈值控制器
- *
- * @author newspaper
- * @date  2023/12/26 09:32
- */
-@Api(tags = "能耗阈值控制器")
-@ApiSupport(author = "SNOWY_TEAM", order = 1)
-@RestController
-@Validated
-public class EnergyThresholdController {
-
-    @Resource
-    private EnergyThresholdService energyThresholdService;
-
-    /**
-     * 根据单元ID获取阈值
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    @ApiOperationSupport(order = 1)
-    @ApiOperation("获取能耗阈值")
-    @GetMapping("/energy/energyThreshold/getThreshold")
-    public CommonResult<List<EnergyThresholdListVo>> getThreshold(EnergyThresholdOrgIdParam energyThresholdOrgIdParam) {
-        return CommonResult.data(energyThresholdService.getThreshold(energyThresholdOrgIdParam));
-    }
-
-    /**
-     * 编辑能耗阈值
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    @ApiOperationSupport(order = 1)
-    @ApiOperation("编辑能耗阈值")
-    @PostMapping("/energy/energyThreshold/saveThreshold")
-    public CommonResult<String> saveThreshold(@RequestBody EnergyThresholdSaveParam energyThresholdSaveParam) {
-        energyThresholdService.saveThreshold(energyThresholdSaveParam);
-        return CommonResult.ok();
-    }
-
-
-    /**
-     * 修改能耗阈值状态
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    @ApiOperationSupport(order = 2)
-    @ApiOperation("修改能耗阈值状态")
-    @PostMapping("/energy/energyThreshold/modifyThresholdStatus")
-    public CommonResult<String> modifyThresholdStatus(@RequestBody EnergyThresholdModifyParam energyThresholdModifyParam) {
-        energyThresholdService.modifyThresholdStatus(energyThresholdModifyParam);
-        return CommonResult.ok();
-    }
-
-    /**
-     * 同步能耗阈值
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    @ApiOperationSupport(order = 2)
-    @ApiOperation("同步能耗阈值")
-    @PostMapping("/energy/energyThreshold/syncThreshold")
-    public CommonResult<String> syncThreshold(@RequestBody EnergyThresholdSyncParam energyThresholdSyncParam) {
-        energyThresholdService.syncThreshold(energyThresholdSyncParam);
-        return CommonResult.ok();
-    }
-}

+ 0 - 83
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/entity/EnergyThreshold.java

@@ -1,83 +0,0 @@
-/*
- * Copyright [2022] [https://www.xiaonuo.vip]
- *
- * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
- *
- * 1.请不要删除和修改根目录下的LICENSE文件。
- * 2.请不要删除和修改Snowy源码头部的版权声明。
- * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
- * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
- * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
- * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
- */
-package vip.xiaonuo.modular.energy.energythreshold.entity;
-
-import com.baomidou.mybatisplus.annotation.*;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-import vip.xiaonuo.common.pojo.CommonEntity;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * 能耗阈值实体
- *
- * @author newspaper
- * @date  2023/12/26 09:32
- **/
-@Getter
-@Setter
-@TableName("energy_threshold")
-public class EnergyThreshold extends CommonEntity {
-
-    /** id */
-    @TableId
-    @ApiModelProperty(value = "id", position = 1)
-    private String id;
-
-    /** 阈值对象 */
-    @ApiModelProperty(value = "阈值对象", position = 2)
-    private String unitId;
-
-    /** 0为不启用 1为启用 */
-    @ApiModelProperty(value = "0为不启用 1为启用", position = 3)
-    private Integer isEnable;
-
-    /** 用水下限 */
-    @ApiModelProperty(value = "用水下限", position = 4)
-    private BigDecimal waterLower;
-
-    /** 用水上限 */
-    @ApiModelProperty(value = "用水上限", position = 5)
-    private BigDecimal waterUpper;
-
-    /** 用电下限 */
-    @ApiModelProperty(value = "用电下限", position = 6)
-    private BigDecimal electricityLower;
-
-    /** 用电上限 */
-    @ApiModelProperty(value = "用电上限", position = 7)
-    private BigDecimal electricityUpper;
-
-    /** 七日用水下限 */
-    @ApiModelProperty(value = "七日用水下限", position = 8)
-    private BigDecimal sevenDayWaterLower;
-
-    /** 七日用水上限 */
-    @ApiModelProperty(value = "七日用水上限", position = 9)
-    private BigDecimal sevenDayWaterUpper;
-
-    /** 七日用电上限 */
-    @ApiModelProperty(value = "七日用电上限", position = 10)
-    private BigDecimal sevenDayElectricityLower;
-
-    /** 七日用电下限 */
-    @ApiModelProperty(value = "七日用电下限", position = 11)
-    private BigDecimal sevenDayElectricityUpper;
-
-    /** 组织id */
-    @ApiModelProperty(value = "组织id", position = 12)
-    private String orgId;
-}

+ 0 - 61
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/service/EnergyThresholdService.java

@@ -1,61 +0,0 @@
-/*
- * Copyright [2022] [https://www.xiaonuo.vip]
- *
- * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
- *
- * 1.请不要删除和修改根目录下的LICENSE文件。
- * 2.请不要删除和修改Snowy源码头部的版权声明。
- * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
- * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
- * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
- * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
- */
-package vip.xiaonuo.modular.energy.energythreshold.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import vip.xiaonuo.modular.energy.energythreshold.entity.EnergyThreshold;
-import vip.xiaonuo.modular.energy.energythreshold.entity.vo.EnergyThresholdListVo;
-import vip.xiaonuo.modular.energy.energythreshold.param.*;
-
-import java.util.List;
-
-/**
- * 能耗阈值Service接口
- *
- * @author newspaper
- * @date  2023/12/26 09:32
- **/
-public interface EnergyThresholdService extends IService<EnergyThreshold> {
-
-    /**
-     * 根据单元ID获取阈值
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    List<EnergyThresholdListVo> getThreshold(EnergyThresholdOrgIdParam energyThresholdOrgIdParam);
-
-    /**
-     * 编辑能耗阈值
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    void saveThreshold(EnergyThresholdSaveParam energyThresholdSaveParam);
-
-    /**
-     * 修改能耗阈值状态
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    void modifyThresholdStatus(EnergyThresholdModifyParam energyThresholdModifyParam);
-
-    /**
-     * 同步能耗阈值
-     *
-     * @author newspaper
-     * @date  2023/12/26 10:20
-     */
-    void syncThreshold(EnergyThresholdSyncParam energyThresholdSyncParam);
-}

+ 0 - 119
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/service/impl/EnergyThresholdServiceImpl.java

@@ -1,119 +0,0 @@
-/*
- * Copyright [2022] [https://www.xiaonuo.vip]
- *
- * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
- *
- * 1.请不要删除和修改根目录下的LICENSE文件。
- * 2.请不要删除和修改Snowy源码头部的版权声明。
- * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
- * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
- * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
- * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
- */
-package vip.xiaonuo.modular.energy.energythreshold.service.impl;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
-import vip.xiaonuo.modular.base.pigpen.entity.BasePigpen;
-import vip.xiaonuo.modular.base.pigpen.mapper.BasePigpenMapper;
-import vip.xiaonuo.modular.energy.energythreshold.entity.EnergyThreshold;
-import vip.xiaonuo.modular.energy.energythreshold.entity.vo.EnergyThresholdListVo;
-import vip.xiaonuo.modular.energy.energythreshold.entity.vo.EnergyThresholdVo;
-import vip.xiaonuo.modular.energy.energythreshold.mapper.EnergyThresholdMapper;
-import vip.xiaonuo.modular.energy.energythreshold.param.*;
-import vip.xiaonuo.modular.energy.energythreshold.service.EnergyThresholdService;
-import vip.xiaonuo.modular.env.envThreshold.entity.EnvThreshold;
-import vip.xiaonuo.modular.env.envThreshold.entity.vo.EnvThresholdVo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 能耗阈值Service接口实现类
- *
- * @author newspaper
- * @date  2023/12/26 09:32
- **/
-@Service
-public class EnergyThresholdServiceImpl extends ServiceImpl<EnergyThresholdMapper, EnergyThreshold> implements EnergyThresholdService {
-
-    @Autowired
-    private BasePigpenMapper basePigpenMapper;
-
-    @Override
-    public List<EnergyThresholdListVo> getThreshold(EnergyThresholdOrgIdParam energyThresholdOrgIdParam) {
-        String orgId = energyThresholdOrgIdParam.getOrgId();
-        List<EnergyThresholdListVo> resultList = new ArrayList<>();
-        List<BasePigpen> basePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().eq(BasePigpen::getOrgId, orgId).eq(BasePigpen::getType,0));
-        for (BasePigpen basePigpen : basePigpens) {
-            EnergyThresholdListVo energyThresholdListVo = new EnergyThresholdListVo();
-            energyThresholdListVo.setBuildingId(basePigpen.getId());
-            energyThresholdListVo.setBuildingName(basePigpen.getBuildName());
-            List<EnergyThresholdVo> energyThresholdVos = new ArrayList<>();
-            List<BasePigpen> floorBasePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().eq(BasePigpen::getParentId, basePigpen.getId()));
-            if (ObjectUtil.isNotEmpty(floorBasePigpens)){
-                List<String> floorIds = floorBasePigpens.stream().map(basePigpen1 -> basePigpen1.getId()).collect(Collectors.toList());
-                List<BasePigpen> basePigpens1 = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().in(BasePigpen::getParentId, floorIds));
-                for (BasePigpen pigpen : basePigpens1) {
-                    String unitId = pigpen.getId();
-                    EnergyThresholdVo energyThresholdVo = new EnergyThresholdVo();
-                    EnergyThreshold energyThreshold = this.getOne(new QueryWrapper<EnergyThreshold>().lambda().eq(EnergyThreshold::getOrgId, orgId).eq(EnergyThreshold::getUnitId, unitId));
-                    if (ObjectUtil.isEmpty(energyThreshold)){
-                        energyThreshold = new EnergyThreshold();
-                        energyThreshold.setOrgId(orgId);
-                        energyThreshold.setUnitId(unitId);
-                        this.save(energyThreshold);
-                    }
-                    BeanUtil.copyProperties(energyThreshold,energyThresholdVo);
-                    energyThresholdVos.add(energyThresholdVo);
-                }
-            }
-            energyThresholdListVo.setList(energyThresholdVos);
-            resultList.add(energyThresholdListVo);
-        }
-        return resultList;
-    }
-
-    @Override
-    public void saveThreshold(EnergyThresholdSaveParam energyThresholdSaveParam) {
-        String orgId = energyThresholdSaveParam.getOrgId();
-        EnergyThreshold energyThreshold = this.getOne(new QueryWrapper<EnergyThreshold>().lambda().eq(EnergyThreshold::getOrgId, orgId).eq(EnergyThreshold::getUnitId, energyThresholdSaveParam.getUnitId()));
-        BeanUtil.copyProperties(energyThresholdSaveParam,energyThreshold);
-        this.updateById(energyThreshold);
-    }
-
-    @Override
-    public void modifyThresholdStatus(EnergyThresholdModifyParam energyThresholdModifyParam) {
-        String unitId = energyThresholdModifyParam.getUnitId();
-        List<BasePigpen> basePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda().like(BasePigpen::getPids, unitId).eq(BasePigpen::getType, 2));
-        List<String> unitIdList = basePigpens.stream().map(basePigpen -> basePigpen.getId()).collect(Collectors.toList());
-        this.update(new UpdateWrapper<EnergyThreshold>().lambda().set(EnergyThreshold::getIsEnable,energyThresholdModifyParam.getIsEnable()).in(EnergyThreshold::getUnitId,unitIdList));
-    }
-
-    @Override
-    public void syncThreshold(EnergyThresholdSyncParam energyThresholdSyncParam) {
-        String orgId = energyThresholdSyncParam.getOrgId();
-        List<BasePigpen> basePigpens = basePigpenMapper.selectList(new QueryWrapper<BasePigpen>().lambda()
-                .like(BasePigpen::getPids, energyThresholdSyncParam.getUnitId())
-                .eq(BasePigpen::getOrgId, orgId)
-                .eq(BasePigpen::getType,2));
-        List<String> unitList = basePigpens.stream().map(basePigpen -> basePigpen.getId()).collect(Collectors.toList());
-        this.remove(new QueryWrapper<EnergyThreshold>().lambda().in(EnergyThreshold::getUnitId,unitList));
-        List<EnergyThreshold> energyThresholds = new ArrayList<>();
-        for (String s : unitList) {
-            EnergyThreshold energyThreshold = new EnergyThreshold();
-            BeanUtil.copyProperties(energyThresholdSyncParam,energyThreshold);
-            energyThreshold.setUnitId(s);
-            energyThreshold.setOrgId(orgId);
-            energyThresholds.add(energyThreshold);
-        }
-        this.saveBatch(energyThresholds);
-    }
-}

+ 101 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/controller/FeedingThresholdController.java

@@ -0,0 +1,101 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import vip.xiaonuo.common.annotation.CommonLog;
+import vip.xiaonuo.common.pojo.CommonResult;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.AddFeedingParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingEditParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingThresholdAddParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingThresholdIdParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.service.FeedingThresholdService;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo2;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 精准饲喂阈值控制器
+ *
+ * @author wang
+ * @date 2024/01/02 10:37
+ */
+@Api(tags = "精准饲喂阈值控制器")
+@ApiSupport(author = "SNOWY_TEAM", order = 1)
+@RestController
+@Validated
+public class FeedingThresholdController {
+
+    @Resource
+    private FeedingThresholdService feedingThresholdService;
+
+    /**
+     * 编辑精准饲喂阈值
+     *
+     * @author wang
+     * @date 2024/01/02 10:37
+     */
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("编辑精准饲喂猪只阈值")
+    @CommonLog("编辑精准饲喂猪只阈值")
+    @PostMapping("/feed/feedingthreshold/addAndEdit")
+    public CommonResult<String> addAndEdit(@RequestBody @Valid FeedingThresholdAddParam feedingThresholdAddParam) {
+        feedingThresholdService.addAndEdit(feedingThresholdAddParam);
+        return CommonResult.ok();
+    }
+
+    @ApiOperationSupport(order = 2)
+    @ApiOperation("展示精准饲喂猪只阈值")
+    @CommonLog("展示精准饲喂猪只阈值")
+    @PostMapping("/feed/feedingthreshold/listFat")
+    public CommonResult<FeedingThresholdVo> listFat(@RequestBody @Valid FeedingThresholdIdParam feedingThresholdIdParam) {
+        return CommonResult.data(feedingThresholdService.listFat(feedingThresholdIdParam.getOrgId()));
+    }
+
+    @ApiOperationSupport(order = 3)
+    @ApiOperation("同步精准饲喂料塔阈值")
+    @CommonLog("同步精准饲喂料塔阈值")
+    @PostMapping("/feed/feedingthreshold/addFeed")
+    public CommonResult<String> addFeed(@RequestBody @Valid AddFeedingParam feedingParam) {
+        feedingThresholdService.addFeed(feedingParam);
+        return CommonResult.ok();
+    }
+
+
+    @ApiOperationSupport(order = 4)
+    @ApiOperation("展示精准饲喂料塔阈值")
+    @CommonLog("展示精准饲喂料塔阈值")
+    @PostMapping("/feed/feedingthreshold/listFeeding")
+    public CommonResult<List<FeedingThresholdVo2>> listFeeding(@RequestBody @Valid AddFeedingParam feedingParam) {
+        return CommonResult.data(feedingThresholdService.listFeeding(feedingParam));
+    }
+
+    @ApiOperationSupport(order = 5)
+    @ApiOperation("修改精准饲喂料塔阈值")
+    @CommonLog("修改精准饲喂料塔阈值")
+    @PostMapping("/feed/feedingthreshold/editFeeding")
+    public CommonResult<String> editFeeding(@RequestBody @Valid FeedingEditParam feedingEditParam) {
+        feedingThresholdService.editFeeding(feedingEditParam);
+        return CommonResult.ok();
+    }
+}

+ 104 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/entity/FeedingThreshold.java

@@ -0,0 +1,104 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 精准饲喂阈值实体
+ *
+ * @author wang
+ * @date  2024/01/02 10:37
+ **/
+@Getter
+@Setter
+@TableName("feeding_threshold")
+public class FeedingThreshold {
+
+    /** ID */
+    @TableId(value = "id", type = IdType.AUTO)
+    @ApiModelProperty(value = "ID", position = 1)
+    private Integer id;
+
+    /** 阈值类型  1猪只 2为料塔 */
+    @ApiModelProperty(value = "阈值类型  1猪只 2为料塔 ", position = 2)
+    private Integer thresholdType;
+
+    /** 余料下限 */
+    @ApiModelProperty(value = "余料下限", position = 3)
+    private String marginValue;
+
+    /** 采食上限 */
+    @ApiModelProperty(value = "采食上限", position = 4)
+    private String feedUpper;
+
+    /** 采食下限 */
+    @ApiModelProperty(value = "采食下限", position = 5)
+    private String feedLower;
+
+    /** 饮水上限 */
+    @ApiModelProperty(value = "饮水上限", position = 6)
+    private String waterUpper;
+
+    /** 饮水下限 */
+    @ApiModelProperty(value = "饮水下限", position = 7)
+    private String waterLower;
+
+    /** 组织id */
+    @ApiModelProperty(value = "组织id", position = 8)
+    private String orgId;
+
+    /** 创建人 */
+    @ApiModelProperty(value = "创建人", position = 9)
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    /** 创建时间 */
+    @ApiModelProperty(value = "创建时间", position = 10)
+    private Date createDate;
+
+    /** 删除标志 */
+    @ApiModelProperty(value = "删除标志", position = 11)
+    @TableLogic
+    @TableField(fill = FieldFill.INSERT)
+    private String deleteFlag;
+
+    /** 肥猪采食上限 */
+    @ApiModelProperty(value = "肥猪采食上限", position = 12)
+    private String fatFeedUpper;
+
+    /** 肥猪采食下限 */
+    @ApiModelProperty(value = "肥猪采食下限", position = 13)
+    private String fatFeedLower;
+
+    /** 肥猪饮水上限 */
+    @ApiModelProperty(value = "肥猪饮水上限", position = 14)
+    private String fatWaterUpper;
+
+    /** 肥猪饮水下限 */
+    @ApiModelProperty(value = "肥猪饮水下限", position = 15)
+    private String fatWaterLower;
+
+    /** 料塔名称 */
+    @ApiModelProperty(value = "肥猪饮水下限", position = 16)
+    private String feedingName;
+
+    /** 料塔单元id */
+    @ApiModelProperty(value = "肥猪饮水下限", position = 17)
+    private String feedingUnitId;
+}

+ 6 - 6
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/enums/EnergyThresholdEnum.java

@@ -10,25 +10,25 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.enums;
+package vip.xiaonuo.modular.feed.feedingthreshold.enums;
 
 import lombok.Getter;
 
 /**
- * 能耗阈值枚举
+ * 精准饲喂阈值枚举
  *
- * @author newspaper
- * @date  2023/12/26 09:32
+ * @author wang
+ * @date  2024/01/02 10:37
  **/
 @Getter
-public enum EnergyThresholdEnum {
+public enum FeedingThresholdEnum {
 
     /** 测试 */
     TEST("TEST");
 
     private final String value;
 
-    EnergyThresholdEnum(String value) {
+    FeedingThresholdEnum(String value) {
         this.value = value;
     }
 }

+ 6 - 6
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/mapper/EnergyThresholdMapper.java

@@ -10,16 +10,16 @@
  * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
  * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
  */
-package vip.xiaonuo.modular.energy.energythreshold.mapper;
+package vip.xiaonuo.modular.feed.feedingthreshold.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import vip.xiaonuo.modular.energy.energythreshold.entity.EnergyThreshold;
+import vip.xiaonuo.modular.feed.feedingthreshold.entity.FeedingThreshold;
 
 /**
- * 能耗阈值Mapper接口
+ * 精准饲喂阈值Mapper接口
  *
- * @author newspaper
- * @date  2023/12/26 09:32
+ * @author wang
+ * @date  2024/01/02 10:37
  **/
-public interface EnergyThresholdMapper extends BaseMapper<EnergyThreshold> {
+public interface FeedingThresholdMapper extends BaseMapper<FeedingThreshold> {
 }

+ 1 - 1
snowy-web-app/src/main/java/vip/xiaonuo/modular/energy/energythreshold/mapper/mapping/EnergyThresholdMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="vip.xiaonuo.modular.energy.energythreshold.mapper.EnergyThresholdMapper">
+<mapper namespace="vip.xiaonuo.modular.feed.feedingthreshold.mapper.FeedingThresholdMapper">
 
 </mapper>

+ 39 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/AddFeedingParam.java

@@ -0,0 +1,39 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 精准饲喂阈值编辑参数
+ *
+ * @author wang
+ * @date  2024/01/02 10:37
+ **/
+@Getter
+@Setter
+public class AddFeedingParam {
+
+
+    /** 组织id */
+    @ApiModelProperty(value = "组织id", position = 8)
+    private String orgId;
+
+}

+ 37 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/FeedingEditParam.java

@@ -0,0 +1,37 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo2;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 精准饲喂阈值查询参数
+ *
+ * @author wang
+ * @date  2024/01/02 10:37
+ **/
+@Getter
+@Setter
+public class FeedingEditParam {
+
+    private List<FeedingThresholdVo2> list;
+
+    private String orgId;
+}

+ 73 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/FeedingThresholdAddParam.java

@@ -0,0 +1,73 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 精准饲喂阈值添加参数
+ *
+ * @author wang
+ * @date  2024/01/02 10:37
+ **/
+@Getter
+@Setter
+public class FeedingThresholdAddParam {
+
+    /** 阈值类型  1猪只 2为料塔 */
+    @ApiModelProperty(value = "阈值类型  1猪只 2为料塔", position = 2)
+    private Integer thresholdType;
+
+    /** 采食上限 */
+    @ApiModelProperty(value = "采食上限", position = 4)
+    private String feedUpper;
+
+    /** 采食下限 */
+    @ApiModelProperty(value = "采食下限", position = 5)
+    private String feedLower;
+
+    /** 饮水上限 */
+    @ApiModelProperty(value = "饮水上限", position = 6)
+    private String waterUpper;
+
+    /** 饮水下限 */
+    @ApiModelProperty(value = "饮水下限", position = 7)
+    private String waterLower;
+
+    /** 组织id */
+    @ApiModelProperty(value = "组织id", position = 8)
+    private String orgId;
+
+    /** 肥猪采食上限 */
+    @ApiModelProperty(value = "肥猪采食上限", position = 12)
+    private String fatFeedUpper;
+
+    /** 肥猪采食下限 */
+    @ApiModelProperty(value = "肥猪采食下限", position = 13)
+    private String fatFeedLower;
+
+    /** 肥猪饮水上限 */
+    @ApiModelProperty(value = "肥猪饮水上限", position = 14)
+    private String fatWaterUpper;
+
+    /** 肥猪饮水下限 */
+    @ApiModelProperty(value = "肥猪饮水下限", position = 15)
+    private String fatWaterLower;
+}

+ 35 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/param/FeedingThresholdIdParam.java

@@ -0,0 +1,35 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 精准饲喂阈值Id参数
+ *
+ * @author wang
+ * @date  2024/01/02 10:37
+ **/
+@Getter
+@Setter
+public class FeedingThresholdIdParam {
+
+    /** orgId */
+    @ApiModelProperty(value = "orgId", required = true)
+    @NotBlank(message = "orgId不能为空")
+    private String orgId;
+}

+ 62 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/service/FeedingThresholdService.java

@@ -0,0 +1,62 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import vip.xiaonuo.modular.feed.feedingthreshold.entity.FeedingThreshold;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.AddFeedingParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingEditParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingThresholdAddParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo2;
+
+import java.util.List;
+
+/**
+ * 精准饲喂阈值Service接口
+ *
+ * @author wang
+ * @date 2024/01/02 10:37
+ **/
+public interface FeedingThresholdService extends IService<FeedingThreshold> {
+
+    /**
+     * 添加精准饲喂阈值
+     *
+     * @author wang
+     * @date 2024/01/02 10:37
+     */
+    void addAndEdit(FeedingThresholdAddParam feedingThresholdAddParam);
+
+    /**
+     * 展示精准饲喂阈值
+     *
+     * @author wang
+     * @date 2024/01/02 10:37
+     */
+    FeedingThresholdVo listFat(String orgId);
+
+    /**
+     * 同步精准饲喂料塔阈值
+     *
+     * @author wang
+     * @date 2024/01/02 10:37
+     */
+    void addFeed(AddFeedingParam feedingParam);
+
+
+    List<FeedingThresholdVo2> listFeeding(AddFeedingParam feedingParam);
+
+    void editFeeding(FeedingEditParam feedingEditParam);
+
+}

+ 126 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/service/impl/FeedingThresholdServiceImpl.java

@@ -0,0 +1,126 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.modular.feed.feedingthreshold.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.modular.feed.feedinglist.entity.FeedingList;
+import vip.xiaonuo.modular.feed.feedinglist.mapper.FeedingListMapper;
+import vip.xiaonuo.modular.feed.feedinglist.vo.FeedingListVo;
+import vip.xiaonuo.modular.feed.feedingthreshold.entity.FeedingThreshold;
+import vip.xiaonuo.modular.feed.feedingthreshold.mapper.FeedingThresholdMapper;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.AddFeedingParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingEditParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.param.FeedingThresholdAddParam;
+import vip.xiaonuo.modular.feed.feedingthreshold.service.FeedingThresholdService;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo;
+import vip.xiaonuo.modular.feed.feedingthreshold.vo.FeedingThresholdVo2;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 精准饲喂阈值Service接口实现类
+ *
+ * @author wang
+ * @date  2024/01/02 10:37
+ **/
+@Service
+public class FeedingThresholdServiceImpl extends ServiceImpl<FeedingThresholdMapper, FeedingThreshold> implements FeedingThresholdService {
+    @Autowired
+    private FeedingThresholdMapper thresholdMapper;
+    @Autowired
+    private FeedingListMapper listMapper;
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void addAndEdit(FeedingThresholdAddParam feedingThresholdAddParam) {
+        FeedingThreshold feedingThreshold = BeanUtil.toBean(feedingThresholdAddParam, FeedingThreshold.class);
+        FeedingThreshold feedingThreshold1=thresholdMapper.selectOne(new QueryWrapper<FeedingThreshold>().eq("org_id",
+                feedingThreshold.getOrgId()).eq("threshold_type",1));
+        if (ObjectUtil.isEmpty(feedingThreshold1)) {
+            feedingThreshold.setCreateDate(new Date());
+            thresholdMapper.insert(feedingThreshold);
+        } else {
+            BeanUtil.copyProperties(feedingThreshold, feedingThreshold1);
+            thresholdMapper.updateById(feedingThreshold1);
+        }
+    }
+
+    @Override
+    public FeedingThresholdVo listFat(String orgId) {
+        QueryWrapper<FeedingThreshold> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("org_id", orgId);
+        FeedingThreshold threshold = thresholdMapper.selectOne(queryWrapper);
+        FeedingThresholdVo feedingThresholdVo = new FeedingThresholdVo();
+        BeanUtil.copyProperties(threshold, feedingThresholdVo);
+        return feedingThresholdVo;
+    }
+
+    @Override
+    public void addFeed(AddFeedingParam feedingParam) {
+        QueryWrapper<FeedingList> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("org_id", feedingParam.getOrgId());
+        List<FeedingListVo> feedingListVos = listMapper.listFeed(queryWrapper);
+        for (FeedingListVo feedingListVo : feedingListVos) {
+            QueryWrapper<FeedingThreshold> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("org_id", feedingParam.getOrgId()).eq("threshold_type", 2)
+                    .eq("feeding_unit_id", feedingListVo.getUnitId());
+            if (ObjectUtil.isEmpty(thresholdMapper.selectOne(queryWrapper1))) {
+                FeedingThreshold threshold = new FeedingThreshold();
+                threshold.setThresholdType(2);
+                threshold.setFeedingUnitId(feedingListVo.getUnitId());
+                threshold.setFeedingName(feedingListVo.getUnitName());
+                threshold.setMarginValue("0");
+                thresholdMapper.insert(threshold);
+            }
+        }
+    }
+
+    @Override
+    public List<FeedingThresholdVo2> listFeeding(AddFeedingParam feedingParam) {
+        QueryWrapper<FeedingThreshold> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("org_id", feedingParam.getOrgId()).eq("threshold_type", 2);
+        List<FeedingThreshold> thresholds = thresholdMapper.selectList(queryWrapper);
+        List<FeedingThresholdVo2> list = new ArrayList<>();
+        for (FeedingThreshold threshold : thresholds) {
+            FeedingThresholdVo2 thresholdVo2 = new FeedingThresholdVo2();
+            thresholdVo2.setFeedingName(threshold.getFeedingName());
+            thresholdVo2.setFeedingUnitId(threshold.getFeedingUnitId());
+            thresholdVo2.setMarginValue(threshold.getMarginValue());
+            list.add(thresholdVo2);
+        }
+        return list;
+    }
+
+    @Override
+    public void editFeeding(FeedingEditParam feedingEditParam) {
+        String orgId = feedingEditParam.getOrgId();
+        List<FeedingThresholdVo2> thresholdVo2s = feedingEditParam.getList();
+        for (FeedingThresholdVo2 thresholdVo2 : thresholdVo2s) {
+            QueryWrapper<FeedingThreshold> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("org_id", orgId).eq("feeding_unit_id", thresholdVo2.getFeedingUnitId());
+            FeedingThreshold threshold = thresholdMapper.selectOne(queryWrapper);
+            BeanUtil.copyProperties(thresholdVo2, threshold);
+            thresholdMapper.updateById(threshold);
+        }
+    }
+
+}

+ 48 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/vo/FeedingThresholdVo.java

@@ -0,0 +1,48 @@
+package vip.xiaonuo.modular.feed.feedingthreshold.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class FeedingThresholdVo {
+
+    /**
+     * 采食上限
+     */
+    private String feedUpper;
+
+    /**
+     * 采食下限
+     */
+    private String feedLower;
+
+    /**
+     * 饮水上限
+     */
+    private String waterUpper;
+
+    /**
+     * 饮水下限
+     */
+    private String waterLower;
+
+    /**
+     * 肥猪采食上限
+     */
+    private String fatFeedUpper;
+
+    /**
+     * 肥猪采食下限
+     */
+    private String fatFeedLower;
+
+    /**
+     * 肥猪饮水上限
+     */
+    private String fatWaterUpper;
+
+    /**
+     * 肥猪饮水下限
+     */
+    private String fatWaterLower;
+}

+ 23 - 0
snowy-web-app/src/main/java/vip/xiaonuo/modular/feed/feedingthreshold/vo/FeedingThresholdVo2.java

@@ -0,0 +1,23 @@
+package vip.xiaonuo.modular.feed.feedingthreshold.vo;
+
+import lombok.Data;
+
+@Data
+public class FeedingThresholdVo2 {
+
+    /**
+     * 料塔名称
+     */
+    private String feedingName;
+
+    /**
+     * 采食下限
+     */
+    private String marginValue;
+
+    /**
+     * 料塔名称id
+     */
+    private String feedingUnitId;
+
+}