|
@@ -1,11 +1,13 @@
|
|
|
package com.gyee.frame.service;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.gyee.frame.common.base.BaseService;
|
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
|
import com.gyee.frame.common.support.Convert;
|
|
|
import com.gyee.frame.mapper.auto.WarningInfoDayMapper;
|
|
|
import com.gyee.frame.model.auto.*;
|
|
|
-import com.gyee.frame.model.custom.StatisticalAnalysisWarningTopVo;
|
|
|
+import com.gyee.frame.model.custom.SawVo;
|
|
|
import com.gyee.frame.model.custom.Tablepar;
|
|
|
import com.gyee.frame.util.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -20,240 +22,135 @@ import java.util.*;
|
|
|
public class WarningInfoDayService implements BaseService<WarningInfoDay, WarningInfoDayExample> {
|
|
|
@Autowired
|
|
|
private WarningInfoDayMapper warningInfoDayMapper;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public int deleteByPrimaryKey(String ids) {
|
|
|
-
|
|
|
- List<Integer> lista=Convert.toIntArrayList(ids);
|
|
|
- WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
- example.createCriteria().andIdIn(lista);
|
|
|
- return warningInfoDayMapper.deleteByExample(example);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ List<Integer> lista=Convert.toIntArrayList(ids);
|
|
|
+ WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
+ example.createCriteria().andIdIn(lista);
|
|
|
+ return warningInfoDayMapper.deleteByExample(example);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public WarningInfoDay selectByPrimaryKey(String id) {
|
|
|
-
|
|
|
- return warningInfoDayMapper.selectByPrimaryKey(Integer.valueOf(id));
|
|
|
-
|
|
|
+
|
|
|
+ return warningInfoDayMapper.selectByPrimaryKey(Integer.valueOf(id));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public int updateByPrimaryKeySelective(WarningInfoDay record) {
|
|
|
return warningInfoDayMapper.updateByPrimaryKeySelective(record);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
*/
|
|
|
@Override
|
|
|
public int insertSelective(WarningInfoDay record) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return warningInfoDayMapper.insertSelective(record);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public int updateByExampleSelective(WarningInfoDay record, WarningInfoDayExample example) {
|
|
|
-
|
|
|
+
|
|
|
return warningInfoDayMapper.updateByExampleSelective(record, example);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public int updateByExample(WarningInfoDay record, WarningInfoDayExample example) {
|
|
|
-
|
|
|
+
|
|
|
return warningInfoDayMapper.updateByExample(record, example);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<WarningInfoDay> selectByExample(WarningInfoDayExample example) {
|
|
|
-
|
|
|
+
|
|
|
return warningInfoDayMapper.selectByExample(example);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public long countByExample(WarningInfoDayExample example) {
|
|
|
-
|
|
|
+
|
|
|
return warningInfoDayMapper.countByExample(example);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public int deleteByExample(WarningInfoDayExample example) {
|
|
|
-
|
|
|
+
|
|
|
return warningInfoDayMapper.deleteByExample(example);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningid(Tablepar tablepar,Date beginDate, Date endDate) {
|
|
|
-
|
|
|
- List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
|
|
|
+ public List<SawVo> getWarningInfoDayByWarningid(Tablepar tablepar, Date beginDate, Date endDate) {
|
|
|
|
|
|
- WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
- example.setOrderByClause(" frequencyday desc");
|
|
|
-
|
|
|
-
|
|
|
- WarningInfoDayExample.Criteria criteria =example.createCriteria();
|
|
|
-
|
|
|
- criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
|
|
|
-
|
|
|
- List<WarningInfoDay> wils=warningInfoDayMapper.selectByExample(example);
|
|
|
-
|
|
|
- Map<String, List<WarningInfoDay>> lsMap = new LinkedHashMap<>();
|
|
|
- if(!wils.isEmpty())
|
|
|
+ List<SawVo> list =new ArrayList<>();;
|
|
|
+ String order =null;
|
|
|
+ if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
|
|
|
{
|
|
|
- for(WarningInfoDay ap:wils)
|
|
|
+ StringBuilder sb=new StringBuilder();
|
|
|
+ sb.append(" ").append(tablepar.getOrderByColumn());
|
|
|
+ if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
|
|
|
{
|
|
|
- List<WarningInfoDay> items=null;
|
|
|
- if (lsMap.containsKey(ap.getWarningid())) {
|
|
|
- items = lsMap.get(ap.getWarningid());
|
|
|
- items.add(ap);
|
|
|
- lsMap.put(ap.getWarningid(), items);
|
|
|
- } else {
|
|
|
- items = new ArrayList<>();
|
|
|
- items.add(ap);
|
|
|
- lsMap.put(ap.getWarningid(), items);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- Set<Map.Entry<String, List<WarningInfoDay>>> set = lsMap.entrySet();
|
|
|
- int i=0;
|
|
|
- for (Iterator<Map.Entry<String, List<WarningInfoDay>>> it = set.iterator(); it.hasNext();) {
|
|
|
- Map.Entry<String, List<WarningInfoDay>> entry = (Map.Entry<String, List<WarningInfoDay>>) it.next();
|
|
|
- System.out.println(entry.getKey() + "--->" + entry.getValue());
|
|
|
-
|
|
|
- List<WarningInfoDay> ls=entry.getValue();
|
|
|
-
|
|
|
- Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
|
|
|
-
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
- item.setNum(i++);
|
|
|
- item.setName(warning.getChinesetext());
|
|
|
- int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
|
|
|
- double totalhoursday=ls.stream().mapToDouble(WarningInfoDay::getTotalhoursday).sum();//合计
|
|
|
- item.setFrequency(frequencyday);
|
|
|
- item.setFrequencyday(frequencyday);
|
|
|
- item.setTotalhours(totalhoursday);
|
|
|
-
|
|
|
- if(i<10)
|
|
|
- {
|
|
|
- list.add(item);
|
|
|
- }else
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
+ sb.append(" ").append(tablepar.getIsAsc());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ sb.append(" asc ");
|
|
|
}
|
|
|
-
|
|
|
- list=sortStatisticalAnalysisWarningTopVoList(tablepar,list);
|
|
|
+ order=String.valueOf(sb);
|
|
|
+ }else {
|
|
|
+ order=" frequencyday desc";
|
|
|
}
|
|
|
+ PageHelper.startPage(0, 10);
|
|
|
+ list =warningInfoDayMapper.getWarningInfoDayByWarningid(beginDate, endDate,order);
|
|
|
+ PageInfo<SawVo> pageInfo = new PageInfo<SawVo>(list);
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningClassify(Tablepar tablepar,Date beginDate, Date endDate) {
|
|
|
+ public List<SawVo> getWarningInfoDayByWarningClassify(Tablepar tablepar, Date beginDate, Date endDate) {
|
|
|
|
|
|
- List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
|
|
|
-
|
|
|
- WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
- example.setOrderByClause("frequencyday desc");
|
|
|
-
|
|
|
-
|
|
|
- WarningInfoDayExample.Criteria criteria =example.createCriteria();
|
|
|
-
|
|
|
- criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
|
|
|
-
|
|
|
- List<WarningInfoDay> wils=warningInfoDayMapper.selectByExample(example);
|
|
|
-
|
|
|
- Map<String, List<WarningInfoDay>> lsMap = new LinkedHashMap<String, List<WarningInfoDay>>();
|
|
|
- if(!wils.isEmpty())
|
|
|
+ List<SawVo> list =new ArrayList<>();;
|
|
|
+ String order =null;
|
|
|
+ if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
|
|
|
{
|
|
|
- for(WarningInfoDay ap:wils)
|
|
|
+ StringBuilder sb=new StringBuilder();
|
|
|
+ sb.append(" ").append(tablepar.getOrderByColumn());
|
|
|
+ if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
|
|
|
{
|
|
|
- Warning2 warning=null;
|
|
|
- if(InitialRunner.warningmap.containsKey(ap.getWarningid()))
|
|
|
- {
|
|
|
- warning=InitialRunner.warningmap.get(ap.getWarningid());
|
|
|
- }
|
|
|
-
|
|
|
- List<WarningInfoDay> items=null;
|
|
|
- if(StringUtils.notEmp(warning) && StringUtils.notEmp(warning.getWarningclassifyid()) && !warning.getWarningclassifyid().equals(""))
|
|
|
- {
|
|
|
- WarningClassify warningClassify=null;
|
|
|
- if(InitialRunner.warningClassifymap.containsKey(warning.getWarningclassifyid()))
|
|
|
- {
|
|
|
- warningClassify=InitialRunner.warningClassifymap.get(warning.getWarningclassifyid());
|
|
|
- }
|
|
|
- if(StringUtils.notEmp(warningClassify))
|
|
|
- {
|
|
|
- if (lsMap.containsKey(warningClassify.getName())) {
|
|
|
- items = lsMap.get(warningClassify.getName());
|
|
|
- items.add(ap);
|
|
|
- lsMap.put(warningClassify.getName(), items);
|
|
|
- } else {
|
|
|
- items = new ArrayList<>();
|
|
|
- items.add(ap);
|
|
|
- lsMap.put(warningClassify.getName(), items);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- Set<Map.Entry<String, List<WarningInfoDay>>> set = lsMap.entrySet();
|
|
|
- int i=0;
|
|
|
- for (Iterator<Map.Entry<String, List<WarningInfoDay>>> it = set.iterator(); it.hasNext();) {
|
|
|
- Map.Entry<String, List<WarningInfoDay>> entry = (Map.Entry<String, List<WarningInfoDay>>) it.next();
|
|
|
- System.out.println(entry.getKey() + "--->" + entry.getValue());
|
|
|
-
|
|
|
- List<WarningInfoDay> ls=entry.getValue();
|
|
|
-
|
|
|
- Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
|
|
|
-
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
- item.setNum(i++);
|
|
|
- item.setName(entry.getKey());
|
|
|
- int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
|
|
|
- double totalhoursday=ls.stream().mapToDouble(WarningInfoDay::getTotalhoursday).sum();//合计
|
|
|
- item.setFrequency(frequencyday);
|
|
|
- item.setFrequencyday(frequencyday);
|
|
|
- item.setTotalhours(totalhoursday);
|
|
|
-
|
|
|
- if(i<10)
|
|
|
- {
|
|
|
- list.add(item);
|
|
|
- }else
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
+ sb.append(" ").append(tablepar.getIsAsc());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ sb.append(" asc ");
|
|
|
}
|
|
|
- list=sortStatisticalAnalysisWarningTopVoList(tablepar,list);
|
|
|
+ order=String.valueOf(sb);
|
|
|
+ }else {
|
|
|
+ order=" frequencyday desc";
|
|
|
}
|
|
|
+ PageHelper.startPage(0, 10);
|
|
|
+ list =warningInfoDayMapper.getWarningInfoDayByWarningid(beginDate, endDate,order);
|
|
|
+ PageInfo<SawVo> pageInfo = new PageInfo<SawVo>(list);
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> sortStatisticalAnalysisWarningTopVoList(Tablepar tablepar,List<StatisticalAnalysisWarningTopVo> ls)
|
|
|
+ public List<SawVo> sortStatisticalAnalysisWarningTopVoList(Tablepar tablepar, List<SawVo> ls)
|
|
|
{
|
|
|
|
|
|
if (null !=tablepar && StringUtils.notEmp(tablepar.getOrderByColumn())) {
|
|
@@ -262,17 +159,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
case "name":
|
|
|
if (tablepar.getIsAsc().equals("asc")) {
|
|
|
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o1.getName().compareTo(o2.getName());
|
|
|
}
|
|
|
|
|
|
});
|
|
|
} else {
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o2.getName().compareTo(o1.getName());
|
|
|
}
|
|
|
|
|
@@ -282,17 +179,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
case "frequency":
|
|
|
if (tablepar.getIsAsc().equals("asc")) {
|
|
|
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o1.getFrequency().compareTo(o2.getFrequency());
|
|
|
}
|
|
|
|
|
|
});
|
|
|
} else {
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o2.getFrequency().compareTo(o1.getFrequency());
|
|
|
}
|
|
|
|
|
@@ -302,17 +199,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
case "frequencyday":
|
|
|
if (tablepar.getIsAsc().equals("asc")) {
|
|
|
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o1.getFrequencyday().compareTo(o2.getFrequencyday());
|
|
|
}
|
|
|
|
|
|
});
|
|
|
} else {
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o2.getFrequencyday().compareTo(o1.getFrequencyday());
|
|
|
}
|
|
|
|
|
@@ -322,17 +219,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
case "totalhours":
|
|
|
if (tablepar.getIsAsc().equals("asc")) {
|
|
|
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o1.getTotalhours().compareTo(o2.getTotalhours());
|
|
|
}
|
|
|
|
|
|
});
|
|
|
} else {
|
|
|
- Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
|
|
|
+ Collections.sort(ls, new Comparator<SawVo>() {
|
|
|
// 升序排序
|
|
|
- public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
|
|
|
+ public int compare(SawVo o1, SawVo o2) {
|
|
|
return o2.getTotalhours().compareTo(o1.getTotalhours());
|
|
|
}
|
|
|
|
|
@@ -349,82 +246,29 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByManufacturer(Tablepar tablepar,Date beginDate, Date endDate) {
|
|
|
-
|
|
|
- List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
|
|
|
+ public List<SawVo> getWarningInfoDayByManufacturer(Tablepar tablepar, Date beginDate, Date endDate) {
|
|
|
|
|
|
- WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
- example.setOrderByClause("frequencyday desc");
|
|
|
-
|
|
|
-
|
|
|
- WarningInfoDayExample.Criteria criteria =example.createCriteria();
|
|
|
-
|
|
|
- criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
|
|
|
|
|
|
- List<WarningInfoDay> wils=warningInfoDayMapper.selectByExample(example);
|
|
|
-
|
|
|
- Map<String, List<WarningInfoDay>> lsMap = new LinkedHashMap<String, List<WarningInfoDay>>();
|
|
|
- if(!wils.isEmpty())
|
|
|
+ List<SawVo> list =new ArrayList<>();;
|
|
|
+ String order =null;
|
|
|
+ if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
|
|
|
{
|
|
|
- for(WarningInfoDay ap:wils)
|
|
|
+ StringBuilder sb=new StringBuilder();
|
|
|
+ sb.append(" ").append(tablepar.getOrderByColumn());
|
|
|
+ if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
|
|
|
{
|
|
|
- Manufacturer manufacturer=null;
|
|
|
-
|
|
|
- if(InitialRunner.manufacturermap.containsKey(ap.getManufacturerid()))
|
|
|
- {
|
|
|
- manufacturer=InitialRunner.manufacturermap.get(ap.getManufacturerid());
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- List<WarningInfoDay> items=null;
|
|
|
-
|
|
|
- if(null!=manufacturer)
|
|
|
- {
|
|
|
- if (lsMap.containsKey(manufacturer.getName())) {
|
|
|
- items = lsMap.get(manufacturer.getName());
|
|
|
- items.add(ap);
|
|
|
- lsMap.put(manufacturer.getName(), items);
|
|
|
- } else {
|
|
|
- items = new ArrayList<>();
|
|
|
- items.add(ap);
|
|
|
- lsMap.put(manufacturer.getName(), items);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- Set<Map.Entry<String, List<WarningInfoDay>>> set = lsMap.entrySet();
|
|
|
- int i=0;
|
|
|
- for (Iterator<Map.Entry<String, List<WarningInfoDay>>> it = set.iterator(); it.hasNext();) {
|
|
|
- Map.Entry<String, List<WarningInfoDay>> entry = (Map.Entry<String, List<WarningInfoDay>>) it.next();
|
|
|
- System.out.println(entry.getKey() + "--->" + entry.getValue());
|
|
|
-
|
|
|
- List<WarningInfoDay> ls=entry.getValue();
|
|
|
-
|
|
|
- Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
|
|
|
-
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
- item.setNum(i++);
|
|
|
- item.setName(entry.getKey());
|
|
|
- int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
|
|
|
- double totalhoursday=ls.stream().mapToDouble(WarningInfoDay::getTotalhoursday).sum();//合计
|
|
|
- item.setFrequency(frequencyday);
|
|
|
- item.setFrequencyday(frequencyday);
|
|
|
- item.setTotalhours(totalhoursday);
|
|
|
-
|
|
|
- if(i<10)
|
|
|
- {
|
|
|
- list.add(item);
|
|
|
- }else
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
+ sb.append(" ").append(tablepar.getIsAsc());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ sb.append(" asc ");
|
|
|
}
|
|
|
-
|
|
|
- list=sortStatisticalAnalysisWarningTopVoList(tablepar,list);
|
|
|
+ order=String.valueOf(sb);
|
|
|
+ }else {
|
|
|
+ order=" frequencyday desc";
|
|
|
}
|
|
|
+ PageHelper.startPage(0, 10);
|
|
|
+ list =warningInfoDayMapper.getWarningInfoDayByManufacturer(beginDate, endDate,order);
|
|
|
+ PageInfo<SawVo> pageInfo = new PageInfo<SawVo>(list);
|
|
|
return list;
|
|
|
|
|
|
}
|
|
@@ -433,9 +277,9 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningidPercentage(Date beginDate, Date endDate) {
|
|
|
+ public List<SawVo> getWarningInfoDayByWarningidPercentage(Date beginDate, Date endDate) {
|
|
|
|
|
|
- List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
|
|
|
+ List<SawVo> list =new ArrayList<>();
|
|
|
|
|
|
WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
example.setOrderByClause("frequencyday desc");
|
|
@@ -478,7 +322,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
|
|
|
Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
|
|
|
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
+ SawVo item = new SawVo();
|
|
|
item.setNum(i++);
|
|
|
item.setName(warning.getChinesetext());
|
|
|
int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
|
|
@@ -497,7 +341,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
int sum = 0;
|
|
|
- for (StatisticalAnalysisWarningTopVo item : list) {
|
|
|
+ for (SawVo item : list) {
|
|
|
sum += item.getFrequency();
|
|
|
if (total != 0) {
|
|
|
BigDecimal b1 = new BigDecimal(item.getFrequency());
|
|
@@ -510,7 +354,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
if (sum != total) {
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
+ SawVo item = new SawVo();
|
|
|
item.setNum(i++);
|
|
|
item.setName("其他");
|
|
|
item.setFrequency(sum);
|
|
@@ -529,9 +373,9 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningClassifyPercentage(Date beginDate, Date endDate) {
|
|
|
+ public List<SawVo> getWarningInfoDayByWarningClassifyPercentage(Date beginDate, Date endDate) {
|
|
|
|
|
|
- List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
|
|
|
+ List<SawVo> list =new ArrayList<>();
|
|
|
|
|
|
WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
example.setOrderByClause("frequencyday desc");
|
|
@@ -591,7 +435,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
|
|
|
Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
|
|
|
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
+ SawVo item = new SawVo();
|
|
|
item.setNum(i++);
|
|
|
item.setName(entry.getKey());
|
|
|
int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
|
|
@@ -610,7 +454,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
int sum = 0;
|
|
|
- for (StatisticalAnalysisWarningTopVo item : list) {
|
|
|
+ for (SawVo item : list) {
|
|
|
sum += item.getFrequency();
|
|
|
if (total != 0) {
|
|
|
BigDecimal b1 = new BigDecimal(item.getFrequency());
|
|
@@ -623,7 +467,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
if (sum != total) {
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
+ SawVo item = new SawVo();
|
|
|
item.setNum(i++);
|
|
|
item.setName("其他");
|
|
|
item.setFrequency(sum);
|
|
@@ -644,9 +488,9 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
|
|
|
|
|
|
|
|
|
- public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByManufacturerPercentage(Date beginDate, Date endDate) {
|
|
|
+ public List<SawVo> getWarningInfoDayByManufacturerPercentage(Date beginDate, Date endDate) {
|
|
|
|
|
|
- List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
|
|
|
+ List<SawVo> list =new ArrayList<>();
|
|
|
|
|
|
WarningInfoDayExample example=new WarningInfoDayExample();
|
|
|
example.setOrderByClause("frequencyday desc");
|
|
@@ -699,7 +543,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
|
|
|
Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
|
|
|
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
+ SawVo item = new SawVo();
|
|
|
item.setNum(i++);
|
|
|
item.setName(entry.getKey());
|
|
|
int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
|
|
@@ -719,7 +563,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
int sum = 0;
|
|
|
- for (StatisticalAnalysisWarningTopVo item : list) {
|
|
|
+ for (SawVo item : list) {
|
|
|
sum += item.getFrequency();
|
|
|
if (total != 0) {
|
|
|
BigDecimal b1 = new BigDecimal(item.getFrequency());
|
|
@@ -732,7 +576,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
|
|
|
}
|
|
|
|
|
|
if (sum != total) {
|
|
|
- StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
|
|
|
+ SawVo item = new SawVo();
|
|
|
item.setNum(i++);
|
|
|
item.setName("其他");
|
|
|
item.setFrequency(sum);
|