|
|
@@ -66,6 +66,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
user.setOrganid(obj.getDept_id().intValue());
|
|
|
List<User> listUserts = userInfoDao.getUsers(user);
|
|
|
for (User u : listUserts) {
|
|
|
+ u.setPassword(null);
|
|
|
if (u.getFee_station_name() != null) {
|
|
|
StatisticsBo tmp = new StatisticsBo();
|
|
|
tmp.setUser(u);
|
|
|
@@ -73,16 +74,6 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // for(User user:CacheUtil.userMap.values()){
|
|
|
- // if(user.getPositionid() ==1){
|
|
|
- // if(organId ==null || user.getOrganid()+0L == organId+0L ){
|
|
|
- // StatisticsBo tmp = new StatisticsBo();
|
|
|
- // tmp.setUser(user);
|
|
|
- // statisticBoMap.put(user.getId()+0L,tmp);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
for (StatisticsBean statisticsBean : list) {
|
|
|
if (statisticBoMap.containsKey(statisticsBean.getUser_id())) {
|
|
|
StatisticsBo tmp = statisticBoMap.get(statisticsBean.getUser_id());
|
|
|
@@ -106,10 +97,12 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
lists.sort(new Comparator<StatisticsBo>() {
|
|
|
@Override
|
|
|
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;
|
|
|
- } else {
|
|
|
- return -1;
|
|
|
+ } else if(o1.getCheck_all_score()< o2.getCheck_all_score()){
|
|
|
+ return -1 ;
|
|
|
+ }else {
|
|
|
+ return 0;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -186,32 +179,87 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private Integer getItemScore(StatisticsBo obj ,String name){
|
|
|
+ List<String> names = obj.getChecked_socre_name();
|
|
|
+ List<Integer> scores = obj.getChecked_score();
|
|
|
+ for(int i=0;i<names.size();i++ ){
|
|
|
+ if( names.get(i).indexOf(name)>-1){
|
|
|
+ return scores.get(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0 ;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Integer getItemScore2(StatisticsBean obj ,String name){
|
|
|
+ List<String> names = obj.getChecked_socre_name();
|
|
|
+ List<Integer> scores = obj.getChecked_score();
|
|
|
+ for(int i=0;i<names.size();i++ ){
|
|
|
+ if( names.get(i).indexOf(name)>-1){
|
|
|
+ return scores.get(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0 ;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void getEmployeeCheckedInfo(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
// 检索数据
|
|
|
List<StatisticsBo> listStatistic = getEmployeeCheckedInfo(obj);
|
|
|
// 处理数据
|
|
|
- //Integer[] emp_assess = new Integer[listStatistic.size()];
|
|
|
- for (int i = 0; i < listStatistic.size(); i++) {
|
|
|
- StatisticsBo st = new StatisticsBo();
|
|
|
- st = listStatistic.get(i);
|
|
|
- try {
|
|
|
- st.setCheck_score_avg(listStatistic.get(i).getCheck_all_score()
|
|
|
- / listStatistic.get(i).getChecked_num());
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- /*List<Integer> checked_score_list = st.getChecked_score();
|
|
|
- for (int j = 0; j < checked_score_list.size(); i++) {
|
|
|
- emp_assess[j] = checked_score_list.get(i);
|
|
|
- }*/
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getFeeStationCheckedScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
+ 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 );
|
|
|
+ st.setScore_avg(String.format("%.2f", 1000.0 - st.getCheck_score_avg()));
|
|
|
+ }
|
|
|
+ // 处理数据
|
|
|
+ exportExcel("温馨服务检查千分考核扣分情况汇总表","checked_info",list,resp);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getFeeStationCheckItemScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
+ 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,"工作纪律"));
|
|
|
}
|
|
|
+ exportExcel("温馨服务检查情况统计表","checked_item_info",list,resp);
|
|
|
+ }
|
|
|
|
|
|
- String path = "D:/file20170606.xls";
|
|
|
- try (InputStream is = this.getClass().getResourceAsStream("/employee_order.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)) {
|
|
|
Context context = new Context();
|
|
|
- context.putVar("list", listStatistic);
|
|
|
+ context.putVar("list", list);
|
|
|
JxlsHelper.getInstance().processTemplate(is, os, context);
|
|
|
}
|
|
|
Thread.sleep(1000);
|
|
|
@@ -235,21 +283,13 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
toClient.write(buffer);
|
|
|
toClient.flush();
|
|
|
toClient.close();
|
|
|
+ // 删除生成的临时文件
|
|
|
+ if(file.exists()){
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.toString());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public void getFeeStationCheckedScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void getFeeStationCheckItemScore(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
}
|