|
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -193,20 +194,43 @@ public class HealthReportService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ QueryWrapper<ProEconHealthReportMain> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("record_date",recordDate);
|
|
|
|
+ //判断是否有重复记录,先删除重复记录
|
|
|
|
+ List<String> idls = proEconHealthReportMainService.list(queryWrapper).stream()
|
|
|
|
+ .map(ProEconHealthReportMain::getId)
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ if (idls.size() > 0) {
|
|
|
|
+
|
|
|
|
+ proEconHealthReportMainService.removeByIds(idls);
|
|
|
|
+ }
|
|
List<ProEconHealthReportMain> templs=new ArrayList<>();
|
|
List<ProEconHealthReportMain> templs=new ArrayList<>();
|
|
for(ProEconHealthReportMain vo:hrmls)
|
|
for(ProEconHealthReportMain vo:hrmls)
|
|
{
|
|
{
|
|
templs.add(vo);
|
|
templs.add(vo);
|
|
if(templs.size()==100)
|
|
if(templs.size()==100)
|
|
{
|
|
{
|
|
- proEconHealthReportMainService.saveOrUpdateBatch(templs);
|
|
|
|
|
|
+ proEconHealthReportMainService.saveBatch(templs);
|
|
templs=new ArrayList<>();
|
|
templs=new ArrayList<>();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(!templs.isEmpty())
|
|
if(!templs.isEmpty())
|
|
{
|
|
{
|
|
- proEconHealthReportMainService.saveOrUpdateBatch(templs);
|
|
|
|
|
|
+ proEconHealthReportMainService.saveBatch(templs);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ QueryWrapper<ProEconHealthReportTarget> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
+ queryWrapper2.eq("record_date",recordDate);
|
|
|
|
+ //判断是否有重复记录,先删除重复记录
|
|
|
|
+ idls = proEconHealthReportTargetService.list(queryWrapper2).stream()
|
|
|
|
+ .map(ProEconHealthReportTarget::getId)
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (idls.size() > 0) {
|
|
|
|
+
|
|
|
|
+ proEconHealthReportTargetService.removeByIds(idls);
|
|
}
|
|
}
|
|
|
|
|
|
List<ProEconHealthReportTarget> temp2ls=new ArrayList<>();
|
|
List<ProEconHealthReportTarget> temp2ls=new ArrayList<>();
|
|
@@ -215,17 +239,17 @@ public class HealthReportService {
|
|
temp2ls.add(vo);
|
|
temp2ls.add(vo);
|
|
if(temp2ls.size()==100)
|
|
if(temp2ls.size()==100)
|
|
{
|
|
{
|
|
- proEconHealthReportTargetService.saveOrUpdateBatch(temp2ls);
|
|
|
|
|
|
+ proEconHealthReportTargetService.saveBatch(temp2ls);
|
|
temp2ls=new ArrayList<>();
|
|
temp2ls=new ArrayList<>();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(!temp2ls.isEmpty())
|
|
if(!temp2ls.isEmpty())
|
|
{
|
|
{
|
|
- proEconHealthReportTargetService.saveOrUpdateBatch(temp2ls);
|
|
|
|
|
|
+ proEconHealthReportTargetService.saveBatch(temp2ls);
|
|
}
|
|
}
|
|
-// proEconHealthReportMainService.saveOrUpdateBatch(hrmls);
|
|
|
|
-// proEconHealthReportTargetService.saveOrUpdateBatch(hrtls);
|
|
|
|
|
|
+// proEconHealthReportMainService.saveBatch(hrmls);
|
|
|
|
+// proEconHealthReportTargetService.saveBatch(hrtls);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -820,6 +844,7 @@ public class HealthReportService {
|
|
po.setWtId(wt.getId());
|
|
po.setWtId(wt.getId());
|
|
po.setRecordDate(recordDate);
|
|
po.setRecordDate(recordDate);
|
|
po.setReportCreatedate(new Date());
|
|
po.setReportCreatedate(new Date());
|
|
|
|
+ po.setName(wt.getName());
|
|
//健康总分
|
|
//健康总分
|
|
PointData jkzpd = realApiUtil.getRealData(ContantXk.JKZT100);
|
|
PointData jkzpd = realApiUtil.getRealData(ContantXk.JKZT100);
|
|
if (StringUtils.notEmp(jkzpd)) {
|
|
if (StringUtils.notEmp(jkzpd)) {
|
|
@@ -860,6 +885,7 @@ public class HealthReportService {
|
|
int daysDiff = DateUtils.daysDiff(recordDate, firstIntegratedTime);
|
|
int daysDiff = DateUtils.daysDiff(recordDate, firstIntegratedTime);
|
|
po.setRunningDays(daysDiff);
|
|
po.setRunningDays(daysDiff);
|
|
|
|
|
|
|
|
+ po.setFirstIntegratedTime(firstIntegratedTime);
|
|
|
|
|
|
//检修间隔月份
|
|
//检修间隔月份
|
|
if (whmap.containsKey(wt.getId())) {
|
|
if (whmap.containsKey(wt.getId())) {
|
|
@@ -1412,6 +1438,11 @@ public class HealthReportService {
|
|
xdxspo.setName("限电小时");
|
|
xdxspo.setName("限电小时");
|
|
xdxspo.setMonthValue(xdxs);
|
|
xdxspo.setMonthValue(xdxs);
|
|
|
|
|
|
|
|
+ double slxs = eid2.getYxdxs();
|
|
|
|
+ ProEconHealthReportTarget slxspo = hrmap.get("slxs");
|
|
|
|
+ slxspo.setName("受累小时");
|
|
|
|
+ slxspo.setMonthValue(slxs);
|
|
|
|
+
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
double ygzxsmx = 0.0;
|
|
double ygzxsmx = 0.0;
|
|
@@ -1446,6 +1477,11 @@ public class HealthReportService {
|
|
ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
|
|
ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
|
|
xdxspo.setName("限电小时");
|
|
xdxspo.setName("限电小时");
|
|
xdxspo.setMonthValue(xdxs);
|
|
xdxspo.setMonthValue(xdxs);
|
|
|
|
+
|
|
|
|
+ double slxs = 0.0;
|
|
|
|
+ ProEconHealthReportTarget slxspo = hrmap.get("slxs");
|
|
|
|
+ slxspo.setName("受累小时");
|
|
|
|
+ slxspo.setMonthValue(slxs);
|
|
}
|
|
}
|
|
|
|
|
|
if (eid2LastMonth1map.containsKey(wt.getId())) {
|
|
if (eid2LastMonth1map.containsKey(wt.getId())) {
|