|
@@ -10,6 +10,7 @@ import java.io.OutputStream;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -99,9 +100,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
public int compare(StatisticsBo o1, StatisticsBo o2) {
|
|
public int compare(StatisticsBo o1, StatisticsBo o2) {
|
|
|
if (o1.getCheck_all_score() > o2.getCheck_all_score()) {
|
|
if (o1.getCheck_all_score() > o2.getCheck_all_score()) {
|
|
|
return 1;
|
|
return 1;
|
|
|
- } else if(o1.getCheck_all_score()< o2.getCheck_all_score()){
|
|
|
|
|
- return -1 ;
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else if (o1.getCheck_all_score() < o2.getCheck_all_score()) {
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ } else {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -117,11 +118,11 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
|
|
Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
|
|
|
int i = 0;
|
|
int i = 0;
|
|
|
for (StatisticsBean sta : lists) {
|
|
for (StatisticsBean sta : lists) {
|
|
|
- if(i++ <7){
|
|
|
|
|
|
|
+ if (i++ < 7) {
|
|
|
sta.setId(1);
|
|
sta.setId(1);
|
|
|
- }else if(i++ < 13){
|
|
|
|
|
|
|
+ } else if (i++ < 13) {
|
|
|
sta.setId(2);
|
|
sta.setId(2);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
sta.setId(3);
|
|
sta.setId(3);
|
|
|
}
|
|
}
|
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
@@ -152,26 +153,26 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<StatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
|
|
List<StatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
sortList.sort(new Comparator<StatisticsBean>() {
|
|
sortList.sort(new Comparator<StatisticsBean>() {
|
|
|
@Override
|
|
@Override
|
|
|
public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
|
- if(o1.getId()> o2.getId()){
|
|
|
|
|
|
|
+ if (o1.getId() > o2.getId()) {
|
|
|
return 1;
|
|
return 1;
|
|
|
- }else if(o1.getId() == o2.getId()){
|
|
|
|
|
- if(o1.getAll_check_score() > o2.getAll_check_score()){
|
|
|
|
|
|
|
+ } else if (o1.getId() == o2.getId()) {
|
|
|
|
|
+ if (o1.getAll_check_score() > o2.getAll_check_score()) {
|
|
|
return 1;
|
|
return 1;
|
|
|
- }else if(o1.getAll_check_score() < o2.getAll_check_score()){
|
|
|
|
|
|
|
+ } else if (o1.getAll_check_score() < o2.getAll_check_score()) {
|
|
|
return -1;
|
|
return -1;
|
|
|
- }else{
|
|
|
|
|
- return 0 ;
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- return -1 ;
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return -1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return sortList;
|
|
return sortList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -183,11 +184,11 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
|
|
Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
|
|
|
int i = 0;
|
|
int i = 0;
|
|
|
for (StatisticsBean sta : lists) {
|
|
for (StatisticsBean sta : lists) {
|
|
|
- if(i++ <7){
|
|
|
|
|
|
|
+ if (i++ < 7) {
|
|
|
sta.setId(1);
|
|
sta.setId(1);
|
|
|
- }else if(i++ < 13){
|
|
|
|
|
|
|
+ } else if (i++ < 13) {
|
|
|
sta.setId(2);
|
|
sta.setId(2);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
sta.setId(3);
|
|
sta.setId(3);
|
|
|
}
|
|
}
|
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
@@ -216,104 +217,118 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
sortList.sort(new Comparator<StatisticsBean>() {
|
|
sortList.sort(new Comparator<StatisticsBean>() {
|
|
|
@Override
|
|
@Override
|
|
|
public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
|
- if(o1.getId()> o2.getId()){
|
|
|
|
|
|
|
+ if (o1.getId() > o2.getId()) {
|
|
|
return 1;
|
|
return 1;
|
|
|
- }else if(o1.getId() == o2.getId()){
|
|
|
|
|
- if(o1.getAll_check_score() > o2.getAll_check_score()){
|
|
|
|
|
|
|
+ } else if (o1.getId() == o2.getId()) {
|
|
|
|
|
+ if (o1.getAll_check_score() > o2.getAll_check_score()) {
|
|
|
return 1;
|
|
return 1;
|
|
|
- }else if(o1.getAll_check_score() < o2.getAll_check_score()){
|
|
|
|
|
|
|
+ } else if (o1.getAll_check_score() < o2.getAll_check_score()) {
|
|
|
return -1;
|
|
return -1;
|
|
|
- }else{
|
|
|
|
|
- return 0 ;
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- return -1 ;
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return -1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return sortList;
|
|
return sortList;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private Integer getItemScore(StatisticsBo obj ,String name){
|
|
|
|
|
|
|
+ private Integer getItemScore(StatisticsBo obj, String name) {
|
|
|
List<String> names = obj.getChecked_socre_name();
|
|
List<String> names = obj.getChecked_socre_name();
|
|
|
List<Integer> scores = obj.getChecked_score();
|
|
List<Integer> scores = obj.getChecked_score();
|
|
|
- for(int i=0;i<names.size();i++ ){
|
|
|
|
|
- if( names.get(i).indexOf(name)>-1){
|
|
|
|
|
|
|
+ for (int i = 0; i < names.size(); i++) {
|
|
|
|
|
+ if (names.get(i).indexOf(name) > -1) {
|
|
|
return scores.get(i);
|
|
return scores.get(i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return 0 ;
|
|
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- private Integer getItemScore2(StatisticsBean obj ,String name){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ private Integer getItemScore2(StatisticsBean obj, String name) {
|
|
|
List<String> names = obj.getChecked_socre_name();
|
|
List<String> names = obj.getChecked_socre_name();
|
|
|
List<Integer> scores = obj.getChecked_score();
|
|
List<Integer> scores = obj.getChecked_score();
|
|
|
- for(int i=0;i<names.size();i++ ){
|
|
|
|
|
- if( names.get(i).indexOf(name)>-1){
|
|
|
|
|
|
|
+ for (int i = 0; i < names.size(); i++) {
|
|
|
|
|
+ if (names.get(i).indexOf(name) > -1) {
|
|
|
return scores.get(i);
|
|
return scores.get(i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return 0 ;
|
|
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void getEmployeeCheckedInfo(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
public void getEmployeeCheckedInfo(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
// 检索数据
|
|
// 检索数据
|
|
|
List<StatisticsBo> listStatistic = getEmployeeCheckedInfo(obj);
|
|
List<StatisticsBo> listStatistic = getEmployeeCheckedInfo(obj);
|
|
|
|
|
+ double start_score = Double.parseDouble(obj.getStart_score());
|
|
|
|
|
+ double end_score = Double.parseDouble(obj.getEnd_score());
|
|
|
// 处理数据
|
|
// 处理数据
|
|
|
- for(int i=0;i<listStatistic.size();i++){
|
|
|
|
|
- StatisticsBo st = listStatistic.get(i) ;
|
|
|
|
|
- // id值设置
|
|
|
|
|
- st.setId(i+1);
|
|
|
|
|
- //平均值
|
|
|
|
|
- st.setCheck_score_avg((st.getChecked_num()!=0)?String.format("%.2f", st.getCheck_all_score()/(st.getChecked_num()+0.0)):"0.00");
|
|
|
|
|
- st.getEmp_item_score().add(getItemScore(st,"环境卫生"));
|
|
|
|
|
- st.getEmp_item_score().add(getItemScore(st,"仪容仪表"));
|
|
|
|
|
- st.getEmp_item_score().add(getItemScore(st,"表情"));
|
|
|
|
|
- st.getEmp_item_score().add(getItemScore(st,"动作"));
|
|
|
|
|
- st.getEmp_item_score().add(getItemScore(st,"文明用语"));
|
|
|
|
|
- st.getEmp_item_score().add(getItemScore(st,"工作纪律"));
|
|
|
|
|
- }
|
|
|
|
|
- exportExcel("温馨服务考核情况反馈表","employee_order",listStatistic,resp);
|
|
|
|
|
|
|
+ int j = 1;
|
|
|
|
|
+ for (Iterator<StatisticsBo> it = listStatistic.iterator(); it.hasNext(); ) {
|
|
|
|
|
+ StatisticsBo st = it.next();
|
|
|
|
|
+ double score = (st.getChecked_num() != 0) ? 1000 - (st.getCheck_all_score() / (st.getChecked_num())) : 1000;
|
|
|
|
|
+ if (score >= start_score && score <= end_score) {
|
|
|
|
|
+ // 得分
|
|
|
|
|
+ st.setCheck_score((st.getChecked_num() != 0) ? String.format("%.2f", score) : "1000.00");
|
|
|
|
|
+ // 平均值
|
|
|
|
|
+ st.setCheck_score_avg((st.getChecked_num() != 0)
|
|
|
|
|
+ ? String.format("%.2f", st.getCheck_all_score() / (st.getChecked_num() + 0.0)) : "0.00");
|
|
|
|
|
+ // id值设置
|
|
|
|
|
+ st.setId(j++);
|
|
|
|
|
+ st.getEmp_item_score().add(getItemScore(st, "环境卫生"));
|
|
|
|
|
+ st.getEmp_item_score().add(getItemScore(st, "仪容仪表"));
|
|
|
|
|
+ st.getEmp_item_score().add(getItemScore(st, "表情"));
|
|
|
|
|
+ st.getEmp_item_score().add(getItemScore(st, "动作"));
|
|
|
|
|
+ st.getEmp_item_score().add(getItemScore(st, "文明用语"));
|
|
|
|
|
+ st.getEmp_item_score().add(getItemScore(st, "工作纪律"));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ it.remove();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ exportExcel("温馨服务考核情况反馈表", "employee_order", listStatistic, resp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void getFeeStationCheckedScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
public void getFeeStationCheckedScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
List<StatisticsBean> list = getFeeStationCheckedScore(obj);
|
|
List<StatisticsBean> list = getFeeStationCheckedScore(obj);
|
|
|
- for(StatisticsBean st :list){
|
|
|
|
|
- st.setCheck_no_score(st.getPeople_num() - st.getScore_fifteen() -st.getScore_fifteen()-st.getScore_over_fifty() );
|
|
|
|
|
- st.setCheck_score_avg((st.getChecked_num()!=0)?st.getAll_check_score()/(st.getChecked_num()+0.0f):0.00f );
|
|
|
|
|
|
|
+ for (StatisticsBean st : list) {
|
|
|
|
|
+ st.setCheck_no_score(
|
|
|
|
|
+ st.getPeople_num() - st.getScore_fifteen() - st.getScore_fifteen() - st.getScore_over_fifty());
|
|
|
|
|
+ st.setCheck_score_avg(
|
|
|
|
|
+ (st.getChecked_num() != 0) ? st.getAll_check_score() / (st.getChecked_num() + 0.0f) : 0.00f);
|
|
|
st.setScore_avg(String.format("%.2f", 1000.0 - st.getCheck_score_avg()));
|
|
st.setScore_avg(String.format("%.2f", 1000.0 - st.getCheck_score_avg()));
|
|
|
}
|
|
}
|
|
|
// 处理数据
|
|
// 处理数据
|
|
|
- exportExcel("温馨服务检查千分考核扣分情况汇总表","checked_info",list,resp);
|
|
|
|
|
|
|
+ exportExcel("温馨服务检查千分考核扣分情况汇总表", "checked_info", list, resp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void getFeeStationCheckItemScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
public void getFeeStationCheckItemScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
List<StatisticsBean> list = getFeeStationCheckItemScore(obj);
|
|
List<StatisticsBean> list = getFeeStationCheckItemScore(obj);
|
|
|
// 处理数据
|
|
// 处理数据
|
|
|
- for(int i=0;i<list.size();i++){
|
|
|
|
|
- StatisticsBean st = list.get(i) ;
|
|
|
|
|
- // id值设置 seq_checked_score
|
|
|
|
|
- //平均值
|
|
|
|
|
- st.setCheck_score_avg((st.getChecked_num()!=0)? st.getAll_check_score()/(st.getChecked_num()+0.0f):0.00f);
|
|
|
|
|
- st.getSeq_checked_score().add(getItemScore2(st,"环境卫生"));
|
|
|
|
|
- st.getSeq_checked_score().add(getItemScore2(st,"仪容仪表"));
|
|
|
|
|
- st.getSeq_checked_score().add(getItemScore2(st,"表情"));
|
|
|
|
|
- st.getSeq_checked_score().add(getItemScore2(st,"动作"));
|
|
|
|
|
- st.getSeq_checked_score().add(getItemScore2(st,"文明用语"));
|
|
|
|
|
- st.getSeq_checked_score().add(getItemScore2(st,"工作纪律"));
|
|
|
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
|
+ StatisticsBean st = list.get(i);
|
|
|
|
|
+ // id值设置 seq_checked_score
|
|
|
|
|
+ // 平均值
|
|
|
|
|
+ st.setCheck_score_avg(
|
|
|
|
|
+ (st.getChecked_num() != 0) ? st.getAll_check_score() / (st.getChecked_num() + 0.0f) : 0.00f);
|
|
|
|
|
+ st.getSeq_checked_score().add(getItemScore2(st, "环境卫生"));
|
|
|
|
|
+ st.getSeq_checked_score().add(getItemScore2(st, "仪容仪表"));
|
|
|
|
|
+ st.getSeq_checked_score().add(getItemScore2(st, "表情"));
|
|
|
|
|
+ st.getSeq_checked_score().add(getItemScore2(st, "动作"));
|
|
|
|
|
+ st.getSeq_checked_score().add(getItemScore2(st, "文明用语"));
|
|
|
|
|
+ st.getSeq_checked_score().add(getItemScore2(st, "工作纪律"));
|
|
|
}
|
|
}
|
|
|
- exportExcel("温馨服务检查情况统计表","checked_item_info",list,resp);
|
|
|
|
|
|
|
+ exportExcel("温馨服务检查情况统计表", "checked_item_info", list, resp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- private void exportExcel(String fileName , String excelTemplateName,List<?> list,HttpServletResponse resp){
|
|
|
|
|
- String path = "./"+fileName+".xls";
|
|
|
|
|
- try (InputStream is = this.getClass().getResourceAsStream("/"+excelTemplateName+".xls")) {
|
|
|
|
|
|
|
+ private void exportExcel(String fileName, String excelTemplateName, List<?> list, HttpServletResponse resp) {
|
|
|
|
|
+ String path = "./" + fileName + ".xls";
|
|
|
|
|
+ try (InputStream is = this.getClass().getResourceAsStream("/" + excelTemplateName + ".xls")) {
|
|
|
try (OutputStream os = new FileOutputStream(path)) {
|
|
try (OutputStream os = new FileOutputStream(path)) {
|
|
|
Context context = new Context();
|
|
Context context = new Context();
|
|
|
context.putVar("list", list);
|
|
context.putVar("list", list);
|
|
@@ -341,10 +356,10 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
toClient.flush();
|
|
toClient.flush();
|
|
|
toClient.close();
|
|
toClient.close();
|
|
|
// 删除生成的临时文件
|
|
// 删除生成的临时文件
|
|
|
- if(file.exists()){
|
|
|
|
|
|
|
+ if (file.exists()) {
|
|
|
file.delete();
|
|
file.delete();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
logger.error(e.toString());
|
|
logger.error(e.toString());
|
|
|
}
|
|
}
|