zhangym 9 ay önce
ebeveyn
işleme
8e6f802e8a

+ 24 - 18
src/main/java/com/steerinfo/ems/foldthevalues/service/impl/FoldTheValuesServiceImpl.java

@@ -145,25 +145,31 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
         DecimalFormat df   = new DecimalFormat("0.000");
         FoldTheValues foldTheValue =  new FoldTheValues();
         for (FoldTheValues foldTheValues : dateForMoth) {
-            foldTheValue.setId(month+foldTheValues.getMaterialno());
-            foldTheValue.setClock(clock);
-            if(foldTheValues.getMaterialsource().equals("三电厂")){
-                foldTheValue.setDescription("热值");
-                foldTheValue.setCode(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days+"*0.03412/100")).toString());
-            }
-            if(foldTheValues.getMaterialsource().equals("机焦厂")){
-                foldTheValue.setDescription("灰分");
-                foldTheValue.setCode(df.format(jse.eval("(29727+(10-"+foldTheValues.getEstimatedvalue()+"/"+days+")*334)/29307.6")));
+            try{
+                foldTheValue.setId(month+foldTheValues.getMaterialno());
+                foldTheValue.setClock(clock);
+                if(foldTheValues.getMaterialsource().equals("三电厂")){
+                    foldTheValue.setDescription("热值");
+                    foldTheValue.setCode(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days+"*0.03412/100")).toString());
+                }
+                if(foldTheValues.getMaterialsource().equals("机焦厂")){
+                    foldTheValue.setDescription("灰分");
+                    foldTheValue.setCode(df.format(jse.eval("(29727+(10-"+foldTheValues.getEstimatedvalue()+"/"+days+")*334)/29307.6")));
+                }
+                foldTheValue.setIsavailable("0");
+                foldTheValue.setUnitid("032");
+                hashMap.put("materialno",foldTheValues.getMaterialno());
+                foldTheValue.setBz("取本月热值检测结果平均值("+foldTheValuesMapper.getavgDate(hashMap)+")进行热值换算");
+                foldTheValue.setMaterialno(foldTheValues.getMaterialno());
+                foldTheValue.setMaterialsource(foldTheValues.getMaterialsource());
+                foldTheValue.setTimegranid("MONTH");
+                foldTheValue.setEstimatedvalue(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days)));
+                foldTheValuesMapper.insert(foldTheValue);
+            }catch (Exception e){
+                logger.info("取本月热值检测结果平均值出错:" + JSONObject.toJSONString(foldTheValue));
+                e.printStackTrace();
             }
-            foldTheValue.setIsavailable("0");
-            foldTheValue.setUnitid("032");
-            hashMap.put("materialno",foldTheValues.getMaterialno());
-            foldTheValue.setBz("取本月热值检测结果平均值("+foldTheValuesMapper.getavgDate(hashMap)+")进行热值换算");
-            foldTheValue.setMaterialno(foldTheValues.getMaterialno());
-            foldTheValue.setMaterialsource(foldTheValues.getMaterialsource());
-            foldTheValue.setTimegranid("MONTH");
-            foldTheValue.setEstimatedvalue(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days)));
-            foldTheValuesMapper.insert(foldTheValue);
+
         }
 
     }

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

@@ -970,7 +970,7 @@ public class TRmCalpointServiceImpl extends BaseServiceImpl<TRmCalpoint, String>
                 sql = "select " + tenCol + " from " + tenTab + " where to_char(tim, 'YYYY-MM-DD HH24:mi') = '" + clock + ":10'";
             } else {
                 // 当前小时准点值
-                sql = "select " + tenCol + " from " + tenTab + " where to_char(tim, 'YYYY-MM-DD HH24:mi') = '" + clock + ":00'";
+                sql = "select " + tenCol + " from " + tenTab + " where to_char(TMSTMP, 'YYYY-MM-DD HH24:mi') = '" + clock + ":00'";
             }
             try {
                 BigDecimal val = jdbcTemplate.queryForObject(sql, BigDecimal.class);