Ver Fonte

化验室数据 和 日报数据更新到大宽表的小时2维度数据中

wangmiaomiao há 9 meses atrás
pai
commit
9ff1751b98

+ 45 - 0
slibra-quartz/src/main/java/com/slibra/quartz/task/AsyncTask.java

@@ -1745,4 +1745,49 @@ public class AsyncTask {
         }
 
     }
+
+    /**
+     *
+     * 大宽表的数据处理
+     * @param tXinyiRobot
+     */
+    public void updateBigTableHourByRobot(TXinyiRobot tXinyiRobot) {
+        List<TXinyiBigTableHour> tXinyiBigTableHours = this.xinyiBigTableHourMapper.selectTXinyiBigTableHourList(TXinyiBigTableHour.builder().testHour(tXinyiRobot.getTestHour()).build());
+        if(!CollectionUtils.isEmpty(tXinyiBigTableHours)){
+            for (TXinyiBigTableHour tXinyiBigTableHour : tXinyiBigTableHours) {
+                this.updateBigTableByRobot(tXinyiBigTableHour, tXinyiRobot);
+            }
+        }
+    }
+
+    private void updateBigTableByRobot(TXinyiBigTableHour tXinyiBigTableHour, TXinyiRobot tXinyiRobot) {
+        tXinyiBigTableHour.setHyCodYb(tXinyiRobot.getCodYb());
+        tXinyiBigTableHour.setHyCodJqr(tXinyiRobot.getCodJqr());
+        tXinyiBigTableHour.setHyCodYz(tXinyiRobot.getCodYz());
+        tXinyiBigTableHour.setHyTpHl1Jqr(tXinyiRobot.getTpHl1Jqr());
+        tXinyiBigTableHour.setHyTpHl2Jqr(tXinyiRobot.getTpHl2Jqr());
+        tXinyiBigTableHour.setHyTpRccJqr(tXinyiRobot.getTpRccJqr());
+        tXinyiBigTableHour.setHyTp1Yz(tXinyiRobot.getTp1Yz());
+        tXinyiBigTableHour.setHyTp2Yz(tXinyiRobot.getTp2Yz());
+        tXinyiBigTableHour.setHyTpRccYz(tXinyiRobot.getTpRccYz());
+        tXinyiBigTableHour.setHyNh31Jqr(tXinyiRobot.getNh31Jqr());
+        tXinyiBigTableHour.setHyNh32Jqr(tXinyiRobot.getNh32Jqr());
+        tXinyiBigTableHour.setHyNh31Yz(tXinyiRobot.getNh31Yz());
+        tXinyiBigTableHour.setHyNh32Yz(tXinyiRobot.getNh32Yz());
+        tXinyiBigTableHour.setHyNo3Hlc2Yz(tXinyiRobot.getNo3Hlc2Yz());
+        tXinyiBigTableHour.setHyNo3Hlj1Jqr(tXinyiRobot.getNo3Hlj1Jqr());
+        tXinyiBigTableHour.setHyNo3Hlj2Jqr(tXinyiRobot.getNo3Hlj2Jqr());
+        tXinyiBigTableHour.setHyTyll(tXinyiRobot.getTYLL());
+        tXinyiBigTableHour.setHyNo3Qyc1Jqr(tXinyiRobot.getNo3Qyc1Jqr());
+        tXinyiBigTableHour.setHyNo3Qyc2Jqr(tXinyiRobot.getNo3Qyc2Jqr());
+        tXinyiBigTableHour.setHyNo3Qyc1Yz(tXinyiRobot.getNo3Qyc1Yz());
+        tXinyiBigTableHour.setHyNo3Qyc2Yz(tXinyiRobot.getNo3Qyc2Yz());
+        tXinyiBigTableHour.setHyJsll(tXinyiRobot.getJSLL());
+        tXinyiBigTableHour.setHyHycxsyAll(tXinyiRobot.getHycxsyAll());
+        tXinyiBigTableHour.setHyQyanAll(tXinyiRobot.getQyanAll());
+        tXinyiBigTableHour.setHyQyckxsyAll(tXinyiRobot.getQyckxsyAll());
+        tXinyiBigTableHour.setHyHyzlsyAll(tXinyiRobot.getHyzlsyAll());
+        //更新数据库
+        this.xinyiBigTableHourMapper.updateTXinyiBigTableHour(tXinyiBigTableHour);
+    }
 }

+ 3 - 0
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -615,6 +615,9 @@ public class RyTask
                     this.xinyiRobotMapper.insertTXinyiRobot(tXinyiRobot);
                     //2024年6月18日10:45:20 额外计算一下预测的准确度
                     asyncTask.updateForecastComparisonByRobot(tXinyiRobot);
+
+                    //2024年7月6日10:32:36  大宽表的数据处理
+                    asyncTask.updateBigTableHourByRobot(tXinyiRobot);
                 }
                 else
                     log.info("{}已经吧保存过了,无需重复保存***&&&···", testHour);

+ 88 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TXinyiDailyServiceImpl.java

@@ -9,7 +9,9 @@ import java.util.List;
 import java.util.Objects;
 
 import com.alibaba.fastjson2.JSON;
+import com.slibra.business.domain.TXinyiBigTableHour;
 import com.slibra.business.domain.TXinyiDaily;
+import com.slibra.business.mapper.TXinyiBigTableHourMapper;
 import com.slibra.business.mapper.TXinyiDailyMapper;
 import com.slibra.business.res.XinyiDailySimple;
 import com.slibra.business.service.ITXinyiDailyService;
@@ -19,6 +21,7 @@ import com.slibra.common.utils.SecurityUtils;
 import com.slibra.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import static com.slibra.common.constant.MyConstants.DAILY_RECORDS_TOTAL;
 import static com.slibra.common.utils.DateUtils.getAllDatesBetween;
@@ -35,6 +38,9 @@ public class TXinyiDailyServiceImpl implements ITXinyiDailyService
     @Autowired
     private TXinyiDailyMapper tXinyiDailyMapper;
 
+    @Autowired
+    private TXinyiBigTableHourMapper xinyiBigTableHourMapper;
+
     /**
      * 查询信义日报数据
      * 
@@ -72,11 +78,93 @@ public class TXinyiDailyServiceImpl implements ITXinyiDailyService
         //2024年6月9日11:11:49 编辑和新增接口改成一个
         Long id = tXinyiDaily.getID();
         this.addExtra(tXinyiDaily, id);
+        //2024年7月6日11:13:35 大宽表的数据处理
+        this.updateBigTableHourByDaily(tXinyiDaily);
         if(Objects.isNull(id))//新增
             return tXinyiDailyMapper.insertTXinyiDaily(tXinyiDaily);
         return tXinyiDailyMapper.updateTXinyiDaily(tXinyiDaily);
     }
 
+    private void updateBigTableHourByDaily(TXinyiDaily tXinyiDaily) {
+        List<TXinyiBigTableHour> tXinyiBigTableHours = this.xinyiBigTableHourMapper.selectTXinyiBigTableHourList(TXinyiBigTableHour.builder().testDate(tXinyiDaily.getTestDate()).build());
+        if(!CollectionUtils.isEmpty(tXinyiBigTableHours)){
+            for (TXinyiBigTableHour tXinyiBigTableHour : tXinyiBigTableHours) {
+                //更新数据
+                tXinyiBigTableHour.setRbJsCod(tXinyiDaily.getJsCod());
+                tXinyiBigTableHour.setRbJsPh(tXinyiDaily.getJsPh());
+                tXinyiBigTableHour.setRbJsBod5(tXinyiDaily.getJsBod5());
+                tXinyiBigTableHour.setRbJsSs(tXinyiDaily.getJsSs());
+                tXinyiBigTableHour.setRbJsNh3(tXinyiDaily.getJsNh3());
+                tXinyiBigTableHour.setRbJsTn(tXinyiDaily.getJsTn());
+                tXinyiBigTableHour.setRbJsTp(tXinyiDaily.getJsTp());
+                tXinyiBigTableHour.setRbJsDcgj(tXinyiDaily.getJsDcgj());
+                tXinyiBigTableHour.setRbCsCod(tXinyiDaily.getCsCod());
+                tXinyiBigTableHour.setRbCsPh(tXinyiDaily.getCsPh());
+                tXinyiBigTableHour.setRbCsBod5(tXinyiDaily.getCsBod5());
+                tXinyiBigTableHour.setRbCsSs(tXinyiDaily.getCsSs());
+                tXinyiBigTableHour.setRbCsNh3(tXinyiDaily.getCsNh3());
+                tXinyiBigTableHour.setRbCsTn(tXinyiDaily.getCsTn());
+                tXinyiBigTableHour.setRbCsTp(tXinyiDaily.getCsTp());
+                tXinyiBigTableHour.setRbCsDcgj(tXinyiDaily.getCsDcgj());
+                tXinyiBigTableHour.setRbJsSw(tXinyiDaily.getJsSw());
+                tXinyiBigTableHour.setRbCsSw(tXinyiDaily.getCsSw());
+                tXinyiBigTableHour.setRbShcOnePh(tXinyiDaily.getShcOnePh());
+                tXinyiBigTableHour.setRbShcTwoPh(tXinyiDaily.getShcTwoPh());
+                tXinyiBigTableHour.setRbShcHyOneSv(tXinyiDaily.getShcHyOneSv());
+                tXinyiBigTableHour.setRbShcHyTwoSv(tXinyiDaily.getShcHyTwoSv());
+                tXinyiBigTableHour.setRbShcHyOneSvi(tXinyiDaily.getShcHyOneSvi());
+                tXinyiBigTableHour.setRbShcHyTwoSvi(tXinyiDaily.getShcHyTwoSvi());
+                tXinyiBigTableHour.setRbShcHyOneMlss(tXinyiDaily.getShcHyOneMlss());
+                tXinyiBigTableHour.setRbShcHyTwoMlss(tXinyiDaily.getShcHyTwoMlss());
+                tXinyiBigTableHour.setRbShcHyOneMlvss(tXinyiDaily.getShcHyOneMlvss());
+                tXinyiBigTableHour.setRbShcHyTwoMlvss(tXinyiDaily.getShcHyTwoMlvss());
+                tXinyiBigTableHour.setRbShcYyOneDo(tXinyiDaily.getShcYyOneDo());
+                tXinyiBigTableHour.setRbShcYyTwoDo(tXinyiDaily.getShcYyTwoDo());
+                tXinyiBigTableHour.setRbShcQyOneDo(tXinyiDaily.getShcQyOneDo());
+                tXinyiBigTableHour.setRbShcQyTwoDo(tXinyiDaily.getShcQyTwoDo());
+                tXinyiBigTableHour.setRbShcHyOneDo(tXinyiDaily.getShcHyOneDo());
+                tXinyiBigTableHour.setRbShcHyTwoDo(tXinyiDaily.getShcHyTwoDo());
+                tXinyiBigTableHour.setRbJsl(tXinyiDaily.getJSL());
+                tXinyiBigTableHour.setRbCsl(tXinyiDaily.getCSL());
+                tXinyiBigTableHour.setRbSdclcxsl(tXinyiDaily.getSDCLCXSL());
+                tXinyiBigTableHour.setRbQsb(tXinyiDaily.getQSB());
+                tXinyiBigTableHour.setRbFM(tXinyiDaily.getFM());
+                tXinyiBigTableHour.setRbYyHrt(tXinyiDaily.getYyHrt());
+                tXinyiBigTableHour.setRbHyHrt(tXinyiDaily.getHyHrt());
+                tXinyiBigTableHour.setRbQyHrt(tXinyiDaily.getQyHrt());
+                tXinyiBigTableHour.setRbNhlR(tXinyiDaily.getNhlR());
+                tXinyiBigTableHour.setRbWhlR(tXinyiDaily.getWhlR());
+                tXinyiBigTableHour.setRbSrt(tXinyiDaily.getSRT());
+                tXinyiBigTableHour.setRbCnl(tXinyiDaily.getCNL());
+                tXinyiBigTableHour.setRbTyqBod5Tn(tXinyiDaily.getTyqBod5Tn());
+                tXinyiBigTableHour.setRbTyhBod5Tn(tXinyiDaily.getTyhBod5Tn());
+                tXinyiBigTableHour.setRbHycRjyAll(tXinyiDaily.getHycRjyAll());
+                tXinyiBigTableHour.setRbHycWnndAll(tXinyiDaily.getHycWnndAll());
+                tXinyiBigTableHour.setRbYycRjyAll(tXinyiDaily.getYycRjyAll());
+                tXinyiBigTableHour.setRbQycRjyAll(tXinyiDaily.getQycRjyAll());
+                tXinyiBigTableHour.setRbWncjbAll(tXinyiDaily.getWncjbAll());
+                tXinyiBigTableHour.setRbWntjzsAll(tXinyiDaily.getWntjzsAll());
+                tXinyiBigTableHour.setRbHfxwnndAll(tXinyiDaily.getHfxwnndAll());
+                tXinyiBigTableHour.setRbChuniliang(tXinyiDaily.getCHUNILIANG());
+                tXinyiBigTableHour.setRbCnhsl(tXinyiDaily.getCNHSL());
+                tXinyiBigTableHour.setRbGwnl(tXinyiDaily.getGWNL());
+                tXinyiBigTableHour.setRbDf(tXinyiDaily.getDF());
+                tXinyiBigTableHour.setRbXnjf(tXinyiDaily.getXNJF());
+                tXinyiBigTableHour.setRbClf(tXinyiDaily.getCLF());
+                tXinyiBigTableHour.setRbTyf(tXinyiDaily.getTYF());
+                tXinyiBigTableHour.setRbXdjf(tXinyiDaily.getXDJF());
+                tXinyiBigTableHour.setRbQtyjf(tXinyiDaily.getQTYJF());
+                tXinyiBigTableHour.setRbCnf(tXinyiDaily.getCNF());
+                tXinyiBigTableHour.setRbZlsf(tXinyiDaily.getZLSF());
+                tXinyiBigTableHour.setRbZjcb(tXinyiDaily.getZJCB());
+                tXinyiBigTableHour.setRbDwcb(tXinyiDaily.getDWCB());
+
+                //更新数据库
+                this.xinyiBigTableHourMapper.updateTXinyiBigTableHour(tXinyiBigTableHour);
+            }
+        }
+    }
+
     private void addExtra(TXinyiDaily tXinyiDaily, Long id) {
 
         String testDate = tXinyiDaily.getTestDate();