|
@@ -38,7 +38,7 @@ import java.util.*;
|
|
|
|
|
|
import static com.slibra.common.constant.MyConstants.*;
|
|
|
import static com.slibra.common.constant.MyConstants.BigDecimal_100;
|
|
|
-import static com.slibra.common.enums.BusinessEnum.WarningCategoryEnum.CS_TP_YC;
|
|
|
+import static com.slibra.common.enums.BusinessEnum.WarningCategoryEnum.*;
|
|
|
|
|
|
/**
|
|
|
* 参数配置 信息操作处理
|
|
@@ -891,6 +891,7 @@ public class HandleDataController extends BaseController
|
|
|
BigDecimal fcxbsjll = normConfig.getFCXBSJLL();
|
|
|
BigDecimal fclbsl = normConfig.getFCLBSL();
|
|
|
BigDecimal fcxbgzxl = normConfig.getFCXBGZXL();
|
|
|
+ BigDecimal jsslSjz = normConfig.getJsslSjz();
|
|
|
|
|
|
//结算结果
|
|
|
TXinyiCalculate tXinyiCalculate = new TXinyiCalculate();
|
|
@@ -980,6 +981,26 @@ public class HandleDataController extends BaseController
|
|
|
tXinyiCalculate.setWhlRN(DECIMAL_1200.divide(divide, NUMBER_SCALE_4, RoundingMode.HALF_UP).multiply(BigDecimal_100));
|
|
|
else
|
|
|
tXinyiCalculate.setWhlRN(DECIMAL_1620.divide(divide, NUMBER_SCALE_4, RoundingMode.HALF_UP).multiply(BigDecimal_100));
|
|
|
+ //2025年03月19日19:05:07 新增超污染物限制 和 超污染物负荷 进出水五大指标相关计算
|
|
|
+ if(!Objects.isNull(jsslSjz) && jsslSjz.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ tXinyiCalculate.setJsCodCwrwfh(getCwrwfhzByDetail(jsSlq, tXinyiIndustry.getJsCod(), jsslSjz, normConfig.getJscodSjz()));
|
|
|
+ tXinyiCalculate.setJsSsCwrwfh(getCwrwfhzByDetail(jsSlq, tXinyiIndustry.getJsSs(), jsslSjz, normConfig.getJsssSjz()));
|
|
|
+ tXinyiCalculate.setJsZdCwrwfh(getCwrwfhzByDetail(jsSlq, tXinyiIndustry.getJsTn(), jsslSjz, normConfig.getJszdSjz()));
|
|
|
+ tXinyiCalculate.setJsZlCwrwfh(getCwrwfhzByDetail(jsSlq, tXinyiIndustry.getJsTp(), jsslSjz, normConfig.getJszlSjz()));
|
|
|
+ tXinyiCalculate.setJsAdCwrwfh(getCwrwfhzByDetail(jsSlq, tXinyiIndustry.getJsNh3(), jsslSjz, normConfig.getJsadSjz()));
|
|
|
+ }
|
|
|
+
|
|
|
+ tXinyiCalculate.setCsCodCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getCsCod(), normConfig, CS_COD.getCode(), false));
|
|
|
+ tXinyiCalculate.setCsSsCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getCsSs(), normConfig, CS_SS.getCode(), false));
|
|
|
+ tXinyiCalculate.setCsZdCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getCsTn(), normConfig, CS_ZD.getCode(), false));
|
|
|
+ tXinyiCalculate.setCsZlCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getCsTp(), normConfig, CS_ZL.getCode(), false));
|
|
|
+ tXinyiCalculate.setCsAdCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getCsNh3(), normConfig, CS_AD.getCode(), false));
|
|
|
+
|
|
|
+ tXinyiCalculate.setJsCodCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getJsCod(), normConfig, JS_COD.getCode(), false));
|
|
|
+ tXinyiCalculate.setJsSsCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getJsSs(), normConfig, JS_SS.getCode(), false));
|
|
|
+ tXinyiCalculate.setJsZdCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getJsTn(), normConfig, JS_ZD.getCode(), false));
|
|
|
+ tXinyiCalculate.setJsZlCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getJsTp(), normConfig, JS_ZL.getCode(), false));
|
|
|
+ tXinyiCalculate.setJsAdCwrwxz(getCwrwxzByDetail(tXinyiIndustry.getJsNh3(), normConfig, JS_AD.getCode(), false));
|
|
|
}
|
|
|
|
|
|
tempInsertData.add(tXinyiCalculate);
|
|
@@ -995,6 +1016,66 @@ public class HandleDataController extends BaseController
|
|
|
return "ok;耗时:" + (end - begin) /1000 + "秒。";
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 2025年02月14日10:26:03 因为超污染物负荷值 要根据具体的指标计算
|
|
|
+ * @param itemVal
|
|
|
+ * @param jsslSjz
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private BigDecimal getCwrwfhzByDetail(BigDecimal jsSlq, BigDecimal itemVal, BigDecimal jsslSjz, BigDecimal itemConfigVal) {
|
|
|
+ return (jsSlq.multiply(itemVal)).divide((jsslSjz.multiply(itemConfigVal)), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算超污染物限制的值: 需要判断进水还是出水;是超标准还是超管控 出水的标准值=进水的设计值
|
|
|
+ * 2025年03月19日10:25:45:逻辑调整:这里和以前不一样,以前是需要区分超标准还是超管控,现在全部都是超管控制。 不修改上层调用,这里默认都是false即可,防止以后再次修改回来。
|
|
|
+ * @param currentVal
|
|
|
+ * @param normConfig
|
|
|
+ * @param code
|
|
|
+ * @param isBzz
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private BigDecimal getCwrwxzByDetail(BigDecimal currentVal, TXinyiNormConfig normConfig, String code, boolean isBzz) {
|
|
|
+ isBzz = false;
|
|
|
+ if(BusinessEnum.WarningCategoryEnum.CS_COD.getCode().equals(code)){
|
|
|
+ if(isBzz)
|
|
|
+ return currentVal.divide(normConfig.getCscodBzz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ return currentVal.divide(normConfig.getCscodGkz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.CS_ZL.getCode().equals(code) || ROBOT_ECCZLSY.getCode().equals(code)){
|
|
|
+ if(isBzz)
|
|
|
+ return currentVal.divide(normConfig.getCszlBzz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ return currentVal.divide(normConfig.getCszlGkz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.CS_ZD.getCode().equals(code) || ROBOT_XSY_1.getCode().equals(code) || ROBOT_XSY_2.getCode().equals(code)){
|
|
|
+ if(isBzz)
|
|
|
+ return currentVal.divide(normConfig.getCszzBzz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ return currentVal.divide(normConfig.getCszzGkz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.CS_AD.getCode().equals(code) || ROBOT_CS_AD.getCode().equals(code)){
|
|
|
+ if(isBzz)
|
|
|
+ return currentVal.divide(normConfig.getCsadBzz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ return currentVal.divide(normConfig.getCsadGkz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.CS_SS.getCode().equals(code)){
|
|
|
+ if(isBzz)
|
|
|
+ return currentVal.divide(normConfig.getCsssBzz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ return currentVal.divide(normConfig.getCsssGkz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.JS_ZL.getCode().equals(code)){
|
|
|
+ return currentVal.divide(normConfig.getJszlSjz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.JS_COD.getCode().equals(code)){
|
|
|
+ return currentVal.divide(normConfig.getJscodSjz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.JS_ZD.getCode().equals(code)){
|
|
|
+ return currentVal.divide(normConfig.getJszdSjz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.JS_AD.getCode().equals(code)){
|
|
|
+ return currentVal.divide(normConfig.getJsadSjz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else if(BusinessEnum.WarningCategoryEnum.JS_SS.getCode().equals(code)){
|
|
|
+ return currentVal.divide(normConfig.getJsssSjz(), NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ }else{
|
|
|
+ log.error("暂时不支持的类型,返回null");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public void main(String[] args) {
|
|
|
|
|
|
// handleBigTableDayHistoryData();
|