|
@@ -52,8 +52,9 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
|
return foldTheValuesMapper;
|
|
|
}
|
|
|
|
|
|
- public void getDate() throws ScriptException {
|
|
|
- List<FoldTheValues> newDate = foldTheValuesMapper.getNewDate();
|
|
|
+ // 获取每日得动力折标值
|
|
|
+ public void getData() throws ScriptException {
|
|
|
+ List<FoldTheValues> newDate = foldTheValuesMapper.getNewData();
|
|
|
DecimalFormat df = new DecimalFormat("0.000");
|
|
|
FoldTheValues foldTheValue = new FoldTheValues();
|
|
|
for (FoldTheValues foldTheValues : newDate) {
|
|
@@ -75,7 +76,6 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- this.insertNewDate();
|
|
|
}
|
|
|
public void insertNewDate(){
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
@@ -112,8 +112,8 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- //获取每月的日数据
|
|
|
- public void getMonthDate() throws ParseException, ScriptException {
|
|
|
+ //获取动力每月的得折标值
|
|
|
+ public void getMonthData() throws ParseException, ScriptException {
|
|
|
HashMap<String,Object> hashMap = new HashMap<>();
|
|
|
//SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Calendar cal_1=Calendar.getInstance();//获取当前日期
|
|
@@ -129,14 +129,19 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
|
int days = DateUtils.getDaysOfMonth(cal_1.getTime());
|
|
|
hashMap.put("startTime",startTime);
|
|
|
hashMap.put("endTime",endTime);
|
|
|
- List<FoldTheValues> dateForMoth = foldTheValuesMapper.getDateForMoth(hashMap);
|
|
|
+ List<FoldTheValues> dateForMoth = foldTheValuesMapper.getDataForMoth(hashMap);
|
|
|
ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript");
|
|
|
DecimalFormat df = new DecimalFormat("0.000");
|
|
|
FoldTheValues foldTheValue = new FoldTheValues();
|
|
|
for (FoldTheValues foldTheValues : dateForMoth) {
|
|
|
foldTheValue.setId(month+foldTheValues.getMaterialno());
|
|
|
foldTheValue.setClock(clock);
|
|
|
- foldTheValue.setCode(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days+"*0.03412/100")).toString());
|
|
|
+ if(foldTheValues.getMaterialsource().equals("三电厂")){
|
|
|
+ foldTheValue.setCode(df.format(jse.eval(foldTheValues.getEstimatedvalue()+"/"+days+"*0.03412/100")).toString());
|
|
|
+ }
|
|
|
+ if(foldTheValues.getMaterialsource().equals("机焦厂")){
|
|
|
+ foldTheValue.setCode(df.format(jse.eval("(29727 + (10 - "+foldTheValues.getEstimatedvalue()+") * 334) / 29307.6")).toString());
|
|
|
+ }
|
|
|
foldTheValue.setIsavailable("0");
|
|
|
foldTheValue.setUnitid("032");
|
|
|
foldTheValue.setDescription("低热值");
|
|
@@ -149,6 +154,39 @@ public class FoldTheValuesServiceImpl extends BaseServiceImpl<FoldTheValues, Str
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+// //对于不同能介给不同的计算方式
|
|
|
+// public String getjsz(FoldTheValues foldTheValues){
|
|
|
+// String str = "";
|
|
|
+// if(foldTheValues.getMaterialsource().equals("三电厂")){
|
|
|
+// str = ""
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ //获取物料每日得折标值
|
|
|
+ public void getDataForwl(){
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.add(Calendar.DATE, -1);
|
|
|
+ String clock = DateUtils.dateStr(calendar.getTime(),"yyyy-MM-dd");
|
|
|
+ HashMap<String,Object> hashMap = new HashMap<>();
|
|
|
+ hashMap.put("clock",clock);
|
|
|
+ List<FoldTheValues> dateForwl = foldTheValuesMapper.getDateForwl(null);
|
|
|
+ FoldTheValues foldTheValue = new FoldTheValues();
|
|
|
+ for (FoldTheValues foldTheValues : dateForwl) {
|
|
|
+ foldTheValue.setId(foldTheValues.getId());
|
|
|
+ foldTheValue.setMaterialsource(foldTheValues.getMaterialsource());
|
|
|
+ foldTheValue.setMaterialno(foldTheValues.getMaterialno());
|
|
|
+ foldTheValue.setCode(foldTheValues.getCode());
|
|
|
+ foldTheValue.setClock(foldTheValues.getClock());
|
|
|
+ foldTheValue.setEstimatedvalue(foldTheValues.getEstimatedvalue());
|
|
|
+ foldTheValue.setTimegranid("DAY");
|
|
|
+ foldTheValue.setUnitid("032");
|
|
|
+ foldTheValue.setDescription("低热值");
|
|
|
+ foldTheValue.setBz("采用当天热值进行换算,当天无检测结果,则取最近热值进行换算");
|
|
|
+ foldTheValuesMapper.insert(foldTheValue);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
//获取折标值
|
|
|
public String getzbz(EmsCalorificValue emsCalorificValue) throws ScriptException {
|
|
|
ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript");
|