zhangy 2 년 전
부모
커밋
54670cadff
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      src/main/java/com/steerinfo/ems/trmcalpoint/service/impl/TRmCalpointServiceImpl.java

+ 9 - 3
src/main/java/com/steerinfo/ems/trmcalpoint/service/impl/TRmCalpointServiceImpl.java

@@ -943,10 +943,16 @@ public class TRmCalpointServiceImpl extends BaseServiceImpl<TRmCalpoint, String>
                 EmsPAiHourSumTab1 po = new EmsPAiHourSumTab1();
                 po.setClock(clock1);
                 po.setVal(hval.doubleValue(), tag);
-                if (emsPAiHourSumTab1Mapper.updateByPrimaryKeySelective(po) == 0) {
-                    po.setInsertTime(new Date());
-                    emsPAiHourSumTab1Mapper.insert(po);
+                try{
+                    if (emsPAiHourSumTab1Mapper.updateByPrimaryKeySelective(po) == 0) {
+                        po.setInsertTime(new Date());
+                        emsPAiHourSumTab1Mapper.insert(po);
+                    }
+                }catch (Exception e){
+                    logger.info("小时数据出错:" + itemid);
+                    e.printStackTrace();
                 }
+
             } else {
                 EmsWAiHourSumTab1 wo = new EmsWAiHourSumTab1();
                 wo.setClock(clock1);