Browse Source

计算碳源投加的时候, 后反馈设定和控制系数都从创哥那里获取

王苗苗 1 month ago
parent
commit
0426436610

+ 9 - 7
slibra-system/src/main/java/com/slibra/business/domain/AutoFeedback.java

@@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 import com.slibra.common.annotation.Excel;
 import com.slibra.common.core.domain.BaseEntity;
 
+import java.math.BigDecimal;
+
 /**
  * 【请填写功能名称】对象 auto_feedback
  * 
@@ -28,7 +30,7 @@ public class AutoFeedback
 
     /** 硝酸盐后反馈设置目标 */
     @Excel(name = "硝酸盐后反馈设置目标")
-    private Long basePara;
+    private BigDecimal basePara;
 
     /** 反馈默认基础控制系数 */
     @Excel(name = "反馈默认基础控制系数")
@@ -44,7 +46,7 @@ public class AutoFeedback
 
     /** 当前反馈系数 */
     @Excel(name = "当前反馈系数")
-    private Long coef;
+    private BigDecimal coef;
 
     /** 基础调参配置信息 */
     @Excel(name = "基础调参配置信息")
@@ -85,12 +87,12 @@ public class AutoFeedback
     {
         return feedbackType;
     }
-    public void setBasePara(Long basePara) 
+    public void setBasePara(BigDecimal basePara)
     {
         this.basePara = basePara;
     }
 
-    public Long getBasePara() 
+    public BigDecimal getBasePara()
     {
         return basePara;
     }
@@ -117,16 +119,16 @@ public class AutoFeedback
         this.subcate = subcate;
     }
 
-    public Long getSubcate() 
+    public Long getSubcate()
     {
         return subcate;
     }
-    public void setCoef(Long coef) 
+    public void setCoef(BigDecimal coef)
     {
         this.coef = coef;
     }
 
-    public Long getCoef() 
+    public BigDecimal getCoef()
     {
         return coef;
     }

+ 9 - 0
slibra-system/src/main/java/com/slibra/business/mapper/AutoFeedbackMapper.java

@@ -1,5 +1,6 @@
 package com.slibra.business.mapper;
 
+import java.math.BigDecimal;
 import java.util.List;
 import com.slibra.business.domain.AutoFeedback;
 
@@ -60,4 +61,12 @@ public interface AutoFeedbackMapper
     public int deleteAutoFeedbackByIds(Long[] ids);
 
     public int deleteAll();
+
+    /**
+     *
+     * 根据不同池子 获取不同的结果
+     * @param type
+     * @return
+     */
+    AutoFeedback selectAutoFeedbackLatestByPool(int type);
 }

+ 21 - 4
slibra-system/src/main/java/com/slibra/business/service/impl/TXinyiMedicineParamServiceImpl.java

@@ -6,7 +6,9 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
+import com.slibra.business.domain.AutoFeedback;
 import com.slibra.business.domain.TXinyiIndustry;
+import com.slibra.business.mapper.AutoFeedbackMapper;
 import com.slibra.business.mapper.TXinyiIndustryMapper;
 import com.slibra.business.res.SmartAdd;
 import com.slibra.business.service.IFrontService;
@@ -41,6 +43,9 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
     @Autowired
     private IFrontService frontService;
 
+    @Autowired
+    private AutoFeedbackMapper autoFeedbackMapper;
+
     /**
      * 查询智能投药参数设置
      * 
@@ -208,12 +213,22 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
         if (Objects.isNull(param)) {
             return null;
         }
+
+        //2025年04月24日17:21:58 控制系数获取创哥预测的值,不再由用户主动输入
+        AutoFeedback autoFeedback1 = autoFeedbackMapper.selectAutoFeedbackLatestByPool(1);
+        AutoFeedback autoFeedback2 = autoFeedbackMapper.selectAutoFeedbackLatestByPool(2);
+        if(Objects.isNull(autoFeedback1) || Objects.isNull(autoFeedback2)){
+            log.error("获取创哥推荐的系数失败,无法计算");
+            return null;
+        }
+
         //计算用到的值
         Integer hycXsyType = param.getHycXsyType();
         BigDecimal hycXsyOne = param.getHycXsyOne();
         BigDecimal hycXsyTwo = param.getHycXsyTwo();
 
-        BigDecimal htfksd = param.getHtfksd();
+        //2025年04月24日17:21:58 控制系数获取创哥预测的值,不再由用户主动输入
+//        BigDecimal htfksd = param.getHtfksd();
 
         Integer qycAdType = param.getQycAdType();
         BigDecimal qycAdOne = param.getQycAdOne();
@@ -233,7 +248,9 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
 
         BigDecimal slfpxs = param.getSlfpxs();
 
-        BigDecimal kzxs = param.getKzxs();
+        //2025年04月24日17:21:58 控制系数获取创哥预测的值,不再由用户主动输入
+//        BigDecimal kzxs = param.getKzxs();
+
 
         Integer jsCodType = param.getJsCodType();
         BigDecimal jsCodOne = param.getJsCodOne();
@@ -257,9 +274,9 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
                 return medicineAmount;
             }
             //计算1号池的值
-            BigDecimal oneResult = this.getResultByDiff(hycXsyType, hycXsyOne, htfksd, qycAdType, qycAdOne, qycYxyType, qycYxyOne, xzxs, jzxs, jsLlType, jsLlOne, slfpxs, kzxs, jsCodType, jsCodOne, zhxs, tydl, "one", yymd, sxps);
+            BigDecimal oneResult = this.getResultByDiff(hycXsyType, hycXsyOne, autoFeedback1.getBasePara(), qycAdType, qycAdOne, qycYxyType, qycYxyOne, xzxs, jzxs, jsLlType, jsLlOne, slfpxs, autoFeedback1.getCoef(), jsCodType, jsCodOne, zhxs, tydl, "one", yymd, sxps);
             //计算二号池的值
-            BigDecimal twoResult = this.getResultByDiff(hycXsyType, hycXsyTwo, htfksd, qycAdType, qycAdTwo, qycYxyType, qycYxyTwo, xzxs, jzxs, jsLlType, jsLlTwo, slfpxs, kzxs, jsCodType, jsCodTwo, zhxs, tydl, "two", yymd, sxps);
+            BigDecimal twoResult = this.getResultByDiff(hycXsyType, hycXsyTwo, autoFeedback2.getBasePara(), qycAdType, qycAdTwo, qycYxyType, qycYxyTwo, xzxs, jzxs, jsLlType, jsLlTwo, slfpxs, autoFeedback2.getCoef(), jsCodType, jsCodTwo, zhxs, tydl, "two", yymd, sxps);
             //判断,返回值
             if(0 == type){
                 if(!Objects.isNull(oneResult) && !Objects.isNull(twoResult)){