|
@@ -35,13 +35,10 @@ public class ParttemperatureService {
|
|
|
SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
-
|
|
|
public void deleteParttemperaturemain(Date recodedate) {
|
|
|
proEconPartTemperatureMainService.deleteParttemperaturemain(recodedate);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public int insertParttemperaturemain(ProEconPartTemperatureMain po) {
|
|
|
|
|
|
return proEconPartTemperatureMainService.insertParttemperaturemain(po);
|
|
@@ -76,7 +73,6 @@ public class ParttemperatureService {
|
|
|
// 初始化当日数据
|
|
|
statticsData(cal,endDate, beginDate, wtls,codeParentmap, codenamemap);
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -99,29 +95,35 @@ public class ParttemperatureService {
|
|
|
Map<String, Double> wdmap = getWdValue(wt, ContantXk.AI074, endDate, beginDate, map);
|
|
|
|
|
|
|
|
|
- Map<String, Double> cLXSRZYW1map = getPartTargetValue(wt, ContantXk.AI042, endDate, beginDate, map,63,0);
|
|
|
- Map<String, Double> cLXSRZYW2map = getPartTargetValue(wt, ContantXk.AI043, endDate, beginDate, map,63,0);
|
|
|
- Map<String, Double> cLXRKYWmap = getPartTargetValue(wt, ContantXk.AI038, endDate, beginDate, map,63,0);
|
|
|
- Map<String, Double> cLXYWmap = getPartTargetValue(wt, ContantXk.AI039, endDate, beginDate, map,60,0);
|
|
|
+ Map<String, Double> cLXSRZYW1map = getPartTargetValue(wt, ContantXk.AI042, endDate, beginDate, map,72,0);
|
|
|
+ Map<String, Double> cLXSRZYW2map = getPartTargetValue(wt, ContantXk.AI043, endDate, beginDate, map,72,0);
|
|
|
+ Map<String, Double> cLXRKYWmap = getPartTargetValue(wt, ContantXk.AI038, endDate, beginDate, map,72,0);
|
|
|
+ Map<String, Double> cLXYWmap = getPartTargetValue(wt, ContantXk.AI039, endDate, beginDate, map,72,0);
|
|
|
|
|
|
- Map<String, Double> fDJZCWDAmap = getPartTargetValue(wt, ContantXk.AI092, endDate, beginDate, map,45,0);
|
|
|
- Map<String, Double> fDJZCWDBmap = getPartTargetValue(wt, ContantXk.AI062, endDate, beginDate, map,45,0);
|
|
|
+ Map<String, Double> fDJZCWDAmap = getPartTargetValue(wt, ContantXk.AI092, endDate, beginDate, map,60,0);
|
|
|
+ Map<String, Double> fDJZCWDBmap = getPartTargetValue(wt, ContantXk.AI062, endDate, beginDate, map,60,0);
|
|
|
Map<String, Double> fDJUXYZWDmap = getPartTargetValue(wt, ContantXk.AI004, endDate, beginDate, map,110,0);
|
|
|
Map<String, Double> fDJVXYZWDmap = getPartTargetValue(wt, ContantXk.AI006, endDate, beginDate, map,110,0);
|
|
|
Map<String, Double> fDJWXYZWDmap = getPartTargetValue(wt, ContantXk.AI008, endDate, beginDate, map,110,0);
|
|
|
- Map<String, Double> fDJLQFWDmap = getPartTargetValue(wt, ContantXk.AI059, endDate, beginDate, map,50,0);
|
|
|
+ Map<String, Double> fDJLQFWDmap = getPartTargetValue(wt, ContantXk.AI059, endDate, beginDate, map,60,0);
|
|
|
|
|
|
- Map<String, Double> bJDRQWDmap = getPartTargetValue(wt, ContantXk.AI050, endDate, beginDate, map,35,0);
|
|
|
- Map<String, Double> bJDRDYmap = getPartTargetValue(wt, ContantXk.AI076, endDate, beginDate, map,70,0);
|
|
|
- Map<String, Double> bJDLQWDmap = getPartTargetValue(wt, ContantXk.AI020, endDate, beginDate, map,50,0);
|
|
|
- Map<String, Double> bJDJWDmap = getPartTargetValue(wt, ContantXk.AI045, endDate, beginDate, map,50,0);
|
|
|
- Map<String, Double> bJKZGWDmap = getPartTargetValue(wt, ContantXk.AI029, endDate, beginDate, map,45,0);
|
|
|
+ Map<String, Double> bJDRQWDmap = getPartTargetValue(wt, ContantXk.AI050, endDate, beginDate, map,45,0);
|
|
|
+ Map<String, Double> bJDRDYmap = getPartTargetValue(wt, ContantXk.AI076, endDate, beginDate, map,81,0);
|
|
|
+ Map<String, Double> bJDLQWDmap = getPartTargetValue(wt, ContantXk.AI020, endDate, beginDate, map,60,0);
|
|
|
+ Map<String, Double> bJDJWDmap = getPartTargetValue(wt, ContantXk.AI045, endDate, beginDate, map,60,0);
|
|
|
+ Map<String, Double> bJKZGWDmap = getPartTargetValue(wt, ContantXk.AI029, endDate, beginDate, map,48,0);
|
|
|
|
|
|
- Map<String, Double> tDGWDmap = getPartTargetValue(wt, ContantXk.AI085, endDate, beginDate, map,35,0);
|
|
|
- Map<String, Double> tDJGWDmap = getPartTargetValue(wt, ContantXk.AI099, endDate, beginDate, map,35,0);
|
|
|
+ Map<String, Double> tDGWDmap = getPartTargetValue(wt, ContantXk.AI085, endDate, beginDate, map,45,0);
|
|
|
+ Map<String, Double> tDJGWDmap = getPartTargetValue(wt, ContantXk.AI099, endDate, beginDate, map,45,0);
|
|
|
|
|
|
+ Map<String, Map<String, Integer>> pointmap =new TreeMap<>();
|
|
|
+
|
|
|
+ intial(pointmap,"0-20");
|
|
|
+ intial(pointmap,"21-40");
|
|
|
+ intial(pointmap,"41-60");
|
|
|
+ intial(pointmap,"61-80");
|
|
|
+ intial(pointmap,"81-100");
|
|
|
|
|
|
- Map<String, Map<String, Integer>> pointmap =new HashMap<>();
|
|
|
if (!wdmap.isEmpty() ) {
|
|
|
|
|
|
Set<Map.Entry<String, Double>> wdset = wdmap.entrySet();
|
|
@@ -220,39 +222,66 @@ public class ParttemperatureService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static void intial(Map<String, Map<String, Integer>> pointmap,String trange) {
|
|
|
+ Map<String, Integer> initalmap=new HashMap<>();
|
|
|
+ initalmap.put(ContantXk.AI042,0);
|
|
|
+ initalmap.put(ContantXk.AI043,0);
|
|
|
+ initalmap.put(ContantXk.AI038,0);
|
|
|
+ initalmap.put(ContantXk.AI039,0);
|
|
|
+ initalmap.put(ContantXk.AI092,0);
|
|
|
+ initalmap.put(ContantXk.AI062,0);
|
|
|
+ initalmap.put(ContantXk.AI004,0);
|
|
|
+ initalmap.put(ContantXk.AI006,0);
|
|
|
+ initalmap.put(ContantXk.AI008,0);
|
|
|
+ initalmap.put(ContantXk.AI059,0);
|
|
|
+ initalmap.put(ContantXk.AI050,0);
|
|
|
+ initalmap.put(ContantXk.AI076,0);
|
|
|
+ initalmap.put(ContantXk.AI020,0);
|
|
|
+ initalmap.put(ContantXk.AI045,0);
|
|
|
+ initalmap.put(ContantXk.AI029,0);
|
|
|
+ initalmap.put(ContantXk.AI085,0);
|
|
|
+ initalmap.put(ContantXk.AI099,0);
|
|
|
+ pointmap.put(trange,initalmap);
|
|
|
+ }
|
|
|
+
|
|
|
private void setPointValues(String code,Map<String, Double> valuemap, Map<String, Map<String, Integer>> pointmap, Map.Entry<String, Double> wdentry) {
|
|
|
|
|
|
if(StringUtils.notEmp(valuemap))
|
|
|
{
|
|
|
- String wdkey=getPoStringInfo(wdentry.getValue());
|
|
|
|
|
|
- if(pointmap.containsKey(wdkey))
|
|
|
+ if(wdentry.getValue() <=100 && wdentry.getValue()>0)
|
|
|
{
|
|
|
- Map<String, Integer> pmap=pointmap.get(wdkey);
|
|
|
+ String wdkey=getPoStringInfo(wdentry.getValue());
|
|
|
|
|
|
- if(pmap.containsKey(code))
|
|
|
+ if(pointmap.containsKey(wdkey))
|
|
|
{
|
|
|
- int num=pmap.get(code);
|
|
|
+ Map<String, Integer> pmap=pointmap.get(wdkey);
|
|
|
+
|
|
|
+ if(pmap.containsKey(code))
|
|
|
+ {
|
|
|
+ int num=pmap.get(code);
|
|
|
+
|
|
|
+ num=num+setPointValue(wdentry.getKey(), valuemap);
|
|
|
+ pmap.put(code, num);
|
|
|
+ pointmap.put(wdkey, pmap);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ int num=0;
|
|
|
+ num=num+setPointValue(wdentry.getKey(), valuemap);
|
|
|
+ pmap.put(code, num);
|
|
|
+ pointmap.put(wdkey, pmap);
|
|
|
+ }
|
|
|
|
|
|
- num=num+setPointValue(wdentry.getKey(), valuemap);
|
|
|
- pmap.put(code, num);
|
|
|
- pointmap.put(wdkey, pmap);
|
|
|
}else
|
|
|
{
|
|
|
+ Map<String, Integer> pmap=new HashMap<>();
|
|
|
int num=0;
|
|
|
num=num+setPointValue(wdentry.getKey(), valuemap);
|
|
|
pmap.put(code, num);
|
|
|
pointmap.put(wdkey, pmap);
|
|
|
}
|
|
|
-
|
|
|
- }else
|
|
|
- {
|
|
|
- Map<String, Integer> pmap=new HashMap<>();
|
|
|
- int num=0;
|
|
|
- num=num+setPointValue(wdentry.getKey(), valuemap);
|
|
|
- pmap.put(code, num);
|
|
|
- pointmap.put(wdkey, pmap);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -261,13 +290,8 @@ public class ParttemperatureService {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
int num =0;
|
|
|
int WDSTEP = 20;
|
|
|
- if (value < 0) {
|
|
|
- num = (int) value / WDSTEP;
|
|
|
- sb.append((num - 1) * WDSTEP).append("-").append(num * WDSTEP);
|
|
|
- } else {
|
|
|
- num = (int) value / WDSTEP;
|
|
|
- sb.append(num * WDSTEP).append("-").append((num + 1) * WDSTEP);
|
|
|
- }
|
|
|
+ num = (int) value / WDSTEP;
|
|
|
+ sb.append(num * WDSTEP).append("-").append((num + 1) * WDSTEP);
|
|
|
return String.valueOf(sb);
|
|
|
}
|
|
|
|
|
@@ -391,7 +415,7 @@ public class ParttemperatureService {
|
|
|
|
|
|
private Map<String, Double> getWdValue(ProBasicEquipment wt, String code, Date endDate, Date beginDate, Map<String, ProBasicEquipmentPoint> map) throws Exception {
|
|
|
|
|
|
- Map<String, Double> resultmap = new TreeMap<String, Double>();
|
|
|
+ Map<String, Double> resultmap = new TreeMap<>();
|
|
|
|
|
|
if (map.containsKey(code)) {
|
|
|
ProBasicEquipmentPoint point = map.get(code);
|