|
@@ -140,12 +140,13 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
foldTheValue.setCode(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days+"*0.03412/100")).toString());
|
|
foldTheValue.setCode(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days+"*0.03412/100")).toString());
|
|
}
|
|
}
|
|
if(foldTheValues.getMaterialsource().equals("机焦厂")){
|
|
if(foldTheValues.getMaterialsource().equals("机焦厂")){
|
|
- foldTheValue.setCode(df.format(jse.eval("(29727 + (10 - "+foldTheValues.getEstimatedvalue()+") * 334) / 29307.6")).toString());
|
|
|
|
|
|
+ foldTheValue.setCode(df.format(jse.eval("(29727+(10-"+foldTheValues.getEstimatedvalue()+"/"+days+")*334)/29307.6")));
|
|
}
|
|
}
|
|
foldTheValue.setIsavailable("0");
|
|
foldTheValue.setIsavailable("0");
|
|
foldTheValue.setUnitid("032");
|
|
foldTheValue.setUnitid("032");
|
|
- foldTheValue.setDescription("低热值");
|
|
|
|
- foldTheValue.setBz("取本月热值检测结果平均值进行热值换算");
|
|
|
|
|
|
+ foldTheValue.setDescription("灰分");
|
|
|
|
+ hashMap.put("materialno",foldTheValues.getMaterialno());
|
|
|
|
+ foldTheValue.setBz("取本月热值检测结果平均值("+foldTheValuesMapper.getavgDate(hashMap)+")进行热值换算");
|
|
foldTheValue.setMaterialno(foldTheValues.getMaterialno());
|
|
foldTheValue.setMaterialno(foldTheValues.getMaterialno());
|
|
foldTheValue.setMaterialsource(foldTheValues.getMaterialsource());
|
|
foldTheValue.setMaterialsource(foldTheValues.getMaterialsource());
|
|
foldTheValue.setTimegranid("MONTH");
|
|
foldTheValue.setTimegranid("MONTH");
|
|
@@ -170,7 +171,7 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
String clock = DateUtils.dateStr(calendar.getTime(),"yyyy-MM-dd");
|
|
String clock = DateUtils.dateStr(calendar.getTime(),"yyyy-MM-dd");
|
|
HashMap<String,Object> hashMap = new HashMap<>();
|
|
HashMap<String,Object> hashMap = new HashMap<>();
|
|
hashMap.put("clock",clock);
|
|
hashMap.put("clock",clock);
|
|
- List<FoldTheValues> dateForwl = foldTheValuesMapper.getDateForwl(null);
|
|
|
|
|
|
+ List<FoldTheValues> dateForwl = foldTheValuesMapper.getDateForwl(hashMap);
|
|
FoldTheValues foldTheValue = new FoldTheValues();
|
|
FoldTheValues foldTheValue = new FoldTheValues();
|
|
for (FoldTheValues foldTheValues : dateForwl) {
|
|
for (FoldTheValues foldTheValues : dateForwl) {
|
|
foldTheValue.setId(foldTheValues.getId());
|
|
foldTheValue.setId(foldTheValues.getId());
|
|
@@ -181,44 +182,44 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
foldTheValue.setEstimatedvalue(foldTheValues.getEstimatedvalue());
|
|
foldTheValue.setEstimatedvalue(foldTheValues.getEstimatedvalue());
|
|
foldTheValue.setTimegranid("DAY");
|
|
foldTheValue.setTimegranid("DAY");
|
|
foldTheValue.setUnitid("032");
|
|
foldTheValue.setUnitid("032");
|
|
- foldTheValue.setDescription("低热值");
|
|
|
|
|
|
+ foldTheValue.setDescription("灰分");
|
|
foldTheValue.setBz("采用当天热值进行换算,当天无检测结果,则取最近热值进行换算");
|
|
foldTheValue.setBz("采用当天热值进行换算,当天无检测结果,则取最近热值进行换算");
|
|
foldTheValuesMapper.insert(foldTheValue);
|
|
foldTheValuesMapper.insert(foldTheValue);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- //获取折标值
|
|
|
|
- public String getzbz(EmsCalorificValue emsCalorificValue) throws ScriptException {
|
|
|
|
- ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript");
|
|
|
|
- //首先获取公式
|
|
|
|
- NjFormula njFormula = njFormulaMapper.getByMateralNo(emsCalorificValue.getMaterialno());
|
|
|
|
- String formula = njFormula.getCode();
|
|
|
|
- if (null == formula ){
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- HashMap map = new HashMap();
|
|
|
|
- map.put("wtbh",emsCalorificValue.getWtbh());
|
|
|
|
- if(formula.contains("CO") == true){
|
|
|
|
- map.put("item","CO");
|
|
|
|
- String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" : emsCalorificValueMapper.getValue(map);
|
|
|
|
- formula = formula.replace("CO", value);
|
|
|
|
- }
|
|
|
|
- if (formula.contains("H2") == true){
|
|
|
|
- map.put("item","H2");
|
|
|
|
- String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" : emsCalorificValueMapper.getValue(map);
|
|
|
|
- formula = formula.replace("H2", value);
|
|
|
|
- }
|
|
|
|
- if (formula.contains("CH4") == true){
|
|
|
|
- map.put("item","CH4");
|
|
|
|
- String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" : emsCalorificValueMapper.getValue(map);
|
|
|
|
- formula = formula.replace("CH4", value);
|
|
|
|
- }
|
|
|
|
- if (formula.contains("N2") == true){
|
|
|
|
- map.put("item","N2");
|
|
|
|
- String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" :emsCalorificValueMapper.getValue(map);
|
|
|
|
- formula = formula.replace("N2", value);
|
|
|
|
- }
|
|
|
|
- DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
- return df.format(jse.eval(formula)).toString();
|
|
|
|
- }
|
|
|
|
|
|
+// //获取折标值 (该方法已经弃用)
|
|
|
|
+// public String getzbz(EmsCalorificValue emsCalorificValue) throws ScriptException {
|
|
|
|
+// ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript");
|
|
|
|
+// //首先获取公式
|
|
|
|
+// NjFormula njFormula = njFormulaMapper.getByMateralNo(emsCalorificValue.getMaterialno());
|
|
|
|
+// String formula = njFormula.getCode();
|
|
|
|
+// if (null == formula ){
|
|
|
|
+// return null;
|
|
|
|
+// }
|
|
|
|
+// HashMap map = new HashMap();
|
|
|
|
+// map.put("wtbh",emsCalorificValue.getWtbh());
|
|
|
|
+// if(formula.contains("CO") == true){
|
|
|
|
+// map.put("item","CO");
|
|
|
|
+// String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" : emsCalorificValueMapper.getValue(map);
|
|
|
|
+// formula = formula.replace("CO", value);
|
|
|
|
+// }
|
|
|
|
+// if (formula.contains("H2") == true){
|
|
|
|
+// map.put("item","H2");
|
|
|
|
+// String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" : emsCalorificValueMapper.getValue(map);
|
|
|
|
+// formula = formula.replace("H2", value);
|
|
|
|
+// }
|
|
|
|
+// if (formula.contains("CH4") == true){
|
|
|
|
+// map.put("item","CH4");
|
|
|
|
+// String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" : emsCalorificValueMapper.getValue(map);
|
|
|
|
+// formula = formula.replace("CH4", value);
|
|
|
|
+// }
|
|
|
|
+// if (formula.contains("N2") == true){
|
|
|
|
+// map.put("item","N2");
|
|
|
|
+// String value = emsCalorificValueMapper.getValue(map) == null ? "0.00" :emsCalorificValueMapper.getValue(map);
|
|
|
|
+// formula = formula.replace("N2", value);
|
|
|
|
+// }
|
|
|
|
+// DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
+// return df.format(jse.eval(formula)).toString();
|
|
|
|
+// }
|
|
}
|
|
}
|