85 lines
2.6 KiB
Plaintext
85 lines
2.6 KiB
Plaintext
|
|
package com.sercurityControl.proteam.util;
|
||
|
|
|
||
|
|
import com.google.common.collect.Maps;
|
||
|
|
import com.securityControl.common.core.utils.aes.DateTimeHelper;
|
||
|
|
import com.securityControl.common.core.utils.aes.ListHelper;
|
||
|
|
import com.securityControl.common.core.utils.aes.StringHelper;
|
||
|
|
import com.sercurityControl.proteam.domain.vo.MapsVo;
|
||
|
|
|
||
|
|
import java.util.ArrayList;
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
public class ListEntityUtil {
|
||
|
|
|
||
|
|
|
||
|
|
public static List<String> getPeopleTypeList(int type){
|
||
|
|
List<String> list=new ArrayList<>();
|
||
|
|
if(type==1){
|
||
|
|
list.add("班组负责人");
|
||
|
|
list.add("班组安全员");
|
||
|
|
list.add("班组技术员");
|
||
|
|
list.add("副班长");
|
||
|
|
}else if(type ==2){
|
||
|
|
list.add("特种作业人员");
|
||
|
|
}else{
|
||
|
|
list.add("班组负责人");
|
||
|
|
list.add("班组安全员");
|
||
|
|
list.add("班组技术员");
|
||
|
|
list.add("特种作业人员");
|
||
|
|
list.add("一般作业人员");
|
||
|
|
list.add("副班长");
|
||
|
|
list.add("其他技术人员");
|
||
|
|
}
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static void pushList(String date,List<String> list, Map<String,String> maps ){
|
||
|
|
String value=maps.get(date);
|
||
|
|
if(StringHelper.isNotEmpty(value)){
|
||
|
|
list.add(value);
|
||
|
|
}else{
|
||
|
|
list.add("0");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
public static void pushList(String date,List<String> list, Map<String,String> maps,int riskLeve){
|
||
|
|
String value=maps.get(date.trim()+"-"+riskLeve);
|
||
|
|
if(StringHelper.isNotEmpty(value)){
|
||
|
|
list.add(value);
|
||
|
|
}else{
|
||
|
|
list.add("0");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//list
|
||
|
|
public static Map<String,String> listTransMap( List<MapsVo> list){
|
||
|
|
Map<String, String> map= Maps.newHashMap();
|
||
|
|
if(ListHelper.isNotEmpty(list)){
|
||
|
|
for (MapsVo vo : list) {
|
||
|
|
String status = vo.getStatus().trim();
|
||
|
|
String num = vo.getNum();
|
||
|
|
String riskLevel=vo.getRiskLevel();
|
||
|
|
if(StringHelper.isEmpty(riskLevel)){
|
||
|
|
map.put(status,num);
|
||
|
|
}else{
|
||
|
|
map.put(status+"-"+riskLevel,num);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return map;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
public static List<String> get7dayList(){
|
||
|
|
String date= com.securityControl.common.core.utils.aes.DateTimeHelper.getNowDate();
|
||
|
|
List<String> list=new ArrayList<>();
|
||
|
|
for (int i = 1; i <7 ; i++) {
|
||
|
|
int j=7-i;
|
||
|
|
String time= DateTimeHelper.getDayADDorReduce(date,-j);
|
||
|
|
list.add(time);
|
||
|
|
}
|
||
|
|
list.add(date);
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
}
|