|
|
@@ -15,6 +15,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import com.xintong.visualinspection.bean.FeeStation;
|
|
|
import com.xintong.visualinspection.bean.Organ;
|
|
|
import com.xintong.visualinspection.dao.cluster.DepartmentDao;
|
|
|
+import com.xintong.visualinspection.dao.master.CheckItemDao;
|
|
|
+import com.xintong.visualinspection.dao.master.CheckRuleDao;
|
|
|
import com.xintong.visualinspection.pojo.OtherCheckStatistics;
|
|
|
import org.jxls.common.Context;
|
|
|
import org.jxls.util.JxlsHelper;
|
|
|
@@ -45,6 +47,7 @@ public class CheckOtherServiceImpl extends BaseService implements CheckOtherSer
|
|
|
private DepartmentDao departmentDao;
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void insert(CheckOther checkOther) {
|
|
|
checkOtherDao.insert(checkOther);
|
|
|
@@ -147,7 +150,7 @@ public class CheckOtherServiceImpl extends BaseService implements CheckOtherSer
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String,Object> getOtherCheckStatistics(String checktime, int checktype) {
|
|
|
+ public Map<String,Object> getOtherCheckStatistics(String checktime, int checktype,Integer type) {
|
|
|
|
|
|
Map<String,Object> datas = new HashMap<>();
|
|
|
|
|
|
@@ -160,60 +163,110 @@ public class CheckOtherServiceImpl extends BaseService implements CheckOtherSer
|
|
|
CheckOther checkOther = new CheckOther();
|
|
|
checkOther.setCheck_time_name(checktime);
|
|
|
checkOther.setCheck_type(checktype);
|
|
|
+ if(type!=null){checkOther.setSpecial_check_type(type);}
|
|
|
List<CheckOther> checkOthers = checkOtherDao.getCheckByDeptId(checkOther);
|
|
|
|
|
|
- if(checktype==1){
|
|
|
+ if(checktype==2&&type==null){
|
|
|
+ List<String> itemname = checkOtherDao.getcheckitemnames(22L);
|
|
|
+
|
|
|
for (FeeStation station:liststation
|
|
|
- ) {
|
|
|
+ ) {
|
|
|
OtherCheckStatistics otherCheckStatistics1 = new OtherCheckStatistics();
|
|
|
otherCheckStatistics1.setDeptid(station.getDeptid());
|
|
|
otherCheckStatistics1.setDeptname(station.getName().replaceAll("收费站",""));
|
|
|
otherCheckStatistics1.setPdeptid(station.getParentid());
|
|
|
// otherCheckStatistics1.setPdeptname(pstation.getName());
|
|
|
- HashMap<String,Integer> s = new HashMap<>();
|
|
|
+ HashMap<String,Integer> s1 = new HashMap<>();
|
|
|
+ for (String i:itemname
|
|
|
+ ) {
|
|
|
+ s1.put(i,0);
|
|
|
+ }
|
|
|
+ HashMap<String,Integer> s2 = new HashMap<>();
|
|
|
+ for (String i:itemname
|
|
|
+ ) {
|
|
|
+ s2.put(i,0);
|
|
|
+ }
|
|
|
+ int totalcheck=0;
|
|
|
+ int totalscore=0;
|
|
|
+
|
|
|
for (CheckOther c :checkOthers){
|
|
|
if((c.getDept_id()+"").equals(station.getDeptid())){
|
|
|
- Integer i = s.get(getItemName(c.getPcheckname()));
|
|
|
- if(i==null){i=0;}
|
|
|
- s.put(getItemName(c.getPcheckname()), Integer.valueOf((int) (i+c.getCheck_score())));
|
|
|
+ if(c.getSpecial_check_type()!=null && c.getSpecial_check_type().intValue()==1){
|
|
|
+ Integer i = s1.get(c.getPcheckname());
|
|
|
+ if(i==null){i=0;}
|
|
|
+ s1.put(c.getPcheckname(), Integer.valueOf((int) (i+c.getCheck_score())));
|
|
|
+ totalcheck+=1;
|
|
|
+ totalscore+=c.getCheck_score();
|
|
|
+ }
|
|
|
+ if(c.getSpecial_check_type()!=null && c.getSpecial_check_type().intValue()==2){
|
|
|
+ Integer i = s2.get(c.getPcheckname());
|
|
|
+ if(i==null){i=0;}
|
|
|
+ s2.put(c.getPcheckname(), Integer.valueOf((int) (i+c.getCheck_score())));
|
|
|
+ totalcheck+=1;
|
|
|
+ totalscore+=c.getCheck_score();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ HashMap<String,HashMap<String,Integer>> map = new HashMap<>();
|
|
|
+ map.put("1",s1);
|
|
|
+ map.put("2",s2);
|
|
|
+ otherCheckStatistics1.setScoretypemap(map);
|
|
|
+ otherCheckStatistics1.setTotalScore(totalscore);
|
|
|
+ otherCheckStatistics1.setTotalcheck(totalcheck);
|
|
|
+ otherCheckStatistics.add(otherCheckStatistics1);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- s.put("环境卫生",s.get("环境卫生")==null?230:230-s.get("环境卫生"));
|
|
|
- s.put("仪容仪表",s.get("仪容仪表")==null?170:170-s.get("仪容仪表"));
|
|
|
- s.put("表情",s.get("表情")==null?100:100-s.get("表情"));
|
|
|
- s.put("动作规范",s.get("动作规范")==null?100:100-s.get("动作规范"));
|
|
|
- s.put("礼貌用语",s.get("礼貌用语")==null?200:200-s.get("礼貌用语"));
|
|
|
- s.put("行为举止",s.get("行为举止")==null?120:120-s.get("行为举止"));
|
|
|
- s.put("便民服务",s.get("便民服务")==null?80:80-s.get("便民服务"));
|
|
|
+ for (FeeStation a:list
|
|
|
+ ) {
|
|
|
+ List<OtherCheckStatistics> s=new ArrayList<>();
|
|
|
+ for (OtherCheckStatistics o:otherCheckStatistics
|
|
|
+ ) {
|
|
|
+ if(o.getPdeptid().equals(a.getDeptid())){
|
|
|
+ o.setPdeptname(a.getName());
|
|
|
+ s.add(o);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ datas.put(a.getName().replaceAll("道管中心",""),s);
|
|
|
+ }
|
|
|
|
|
|
- otherCheckStatistics1.setScoremap(s);
|
|
|
- otherCheckStatistics.add(otherCheckStatistics1);
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- otherCheckStatistics.sort(new Comparator<OtherCheckStatistics>() {
|
|
|
- @Override
|
|
|
- public int compare(OtherCheckStatistics o1, OtherCheckStatistics o2) {
|
|
|
- return o1.getTotalScore()>o2.getTotalScore()?-1:1;
|
|
|
- }
|
|
|
- });
|
|
|
+ if(checktype==1||checktype==4||checktype == 3 ||(type!=null&&checktype == 2)){
|
|
|
|
|
|
-// 公司排名
|
|
|
- int scount = 1;
|
|
|
- for (int i=0;i<otherCheckStatistics.size();i++
|
|
|
+ Long id = 21L;
|
|
|
+ if(checktype==1){id = 21L;}
|
|
|
+ if(checktype==3){id = 23L;}
|
|
|
+ if(checktype==4){id = 24L;}
|
|
|
+ if(checktype==2){id = 22L;}
|
|
|
+ //获取考核办法对应的考核项
|
|
|
+ List<String> itemname = checkOtherDao.getcheckitemnames(id);
|
|
|
+
|
|
|
+ for (FeeStation station:liststation
|
|
|
) {
|
|
|
- if(i>0){
|
|
|
- if(otherCheckStatistics.get(i).getTotalScore()<otherCheckStatistics.get(i-1).getTotalScore()){
|
|
|
- scount = i+1;
|
|
|
+ OtherCheckStatistics otherCheckStatistics1 = new OtherCheckStatistics();
|
|
|
+ otherCheckStatistics1.setDeptid(station.getDeptid());
|
|
|
+ otherCheckStatistics1.setDeptname(station.getName().replaceAll("收费站",""));
|
|
|
+ otherCheckStatistics1.setPdeptid(station.getParentid());
|
|
|
+// otherCheckStatistics1.setPdeptname(pstation.getName());
|
|
|
+ HashMap<String,Integer> s = new HashMap<>();
|
|
|
+ for (String i:itemname
|
|
|
+ ) {
|
|
|
+ s.put(i,0);
|
|
|
+ }
|
|
|
+ for (CheckOther c :checkOthers){
|
|
|
+ if((c.getDept_id()+"").equals(station.getDeptid())){
|
|
|
+ Integer i = s.get(c.getPcheckname());
|
|
|
+ if(i==null){i=0;}
|
|
|
+ s.put(c.getPcheckname(), Integer.valueOf((int) (i+c.getCheck_score())));
|
|
|
}
|
|
|
}
|
|
|
- otherCheckStatistics.get(i).setCranking(scount);
|
|
|
+ otherCheckStatistics1.setScoremap(s);
|
|
|
+ otherCheckStatistics.add(otherCheckStatistics1);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
for (FeeStation a:list
|
|
|
) {
|
|
|
List<OtherCheckStatistics> s=new ArrayList<>();
|
|
|
@@ -225,18 +278,6 @@ public class CheckOtherServiceImpl extends BaseService implements CheckOtherSer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //道管排名
|
|
|
- scount = 1;
|
|
|
- for (int i=0;i<s.size();i++
|
|
|
- ) {
|
|
|
- if(i>0){
|
|
|
- if(s.get(i).getTotalScore()<s.get(i-1).getTotalScore()){
|
|
|
- scount = i+1;
|
|
|
- }
|
|
|
- }
|
|
|
- s.get(i).setRranking(scount);
|
|
|
- }
|
|
|
-
|
|
|
datas.put(a.getName().replaceAll("道管中心",""),s);
|
|
|
}
|
|
|
}
|
|
|
@@ -246,28 +287,34 @@ public class CheckOtherServiceImpl extends BaseService implements CheckOtherSer
|
|
|
|
|
|
@Override
|
|
|
public void getexcel(CheckOther checkOther, HttpServletRequest req, HttpServletResponse resp){
|
|
|
- if(checkOther.getCheck_type() == 1){
|
|
|
- Map<String,Object> m= getOtherCheckStatistics(checkOther.getCheck_time_name(),checkOther.getCheck_type());
|
|
|
+ String title = checkOther.getCheck_time_name();
|
|
|
+
|
|
|
+ if(checkOther.getCheck_type()==2&&checkOther.getSpecial_check_type()==null){
|
|
|
+ Map<String,Object> m= getOtherCheckStatistics(checkOther.getCheck_time_name(),checkOther.getCheck_type(),checkOther.getSpecial_check_type());
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("datas",m);
|
|
|
+
|
|
|
+ title+="月份特情稽查情况汇总";
|
|
|
+ map.put("title",title.replaceAll("/","-"));
|
|
|
+ exportExcel(title.replaceAll("/","-"), "other_check_info_teqing", map, resp);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(checkOther.getCheck_type() == 1||checkOther.getCheck_type() == 4||checkOther.getCheck_type() == 3||(checkOther.getCheck_type() == 2&&checkOther.getSpecial_check_type()!=null)){
|
|
|
+ Map<String,Object> m= getOtherCheckStatistics(checkOther.getCheck_time_name(),checkOther.getCheck_type(),checkOther.getSpecial_check_type());
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
map.put("datas",m);
|
|
|
- String a = (String) map.keySet().toArray()[0];
|
|
|
- exportExcel("第三方暗访情况" , "other_check_info_anfang", map, resp);
|
|
|
+
|
|
|
+ if(checkOther.getCheck_type() == 1){title+="月份第三方暗访情况";}
|
|
|
+ if(checkOther.getCheck_type() == 4){title+="月份数据平台应用情况";}
|
|
|
+ if(checkOther.getCheck_type() == 3){title+="月份现场检查情况";}
|
|
|
+ if(checkOther.getCheck_type() == 2 && (checkOther.getSpecial_check_type().intValue()==1)){title+="公司特情稽查情况";}
|
|
|
+ if(checkOther.getCheck_type() == 2 && (checkOther.getSpecial_check_type().intValue()==2)){title+="联网特情稽查情况";}
|
|
|
+ map.put("title",title.replaceAll("/","-"));
|
|
|
+
|
|
|
+ exportExcel(title.replaceAll("/","-"), "other_check_info_anfang", map, resp);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- private String getItemName(String n){
|
|
|
- if(n.contains("环境卫生")){ return "环境卫生";}
|
|
|
- if(n.contains("表情")){ return "表情";}
|
|
|
- if(n.contains("仪容仪表")){ return "仪容仪表";}
|
|
|
- if(n.contains("行为举止")){ return "行为举止";}
|
|
|
- if(n.contains("便民服务")){ return "便民服务";}
|
|
|
- if(n.contains("用语")){ return "礼貌用语";}
|
|
|
- if(n.contains("动作")){ return "动作规范";}
|
|
|
-
|
|
|
- if(n.contains("站容站貌")){ return "环境卫生";}
|
|
|
- if(n.contains("安全管理")){ return "环境卫生";}
|
|
|
- return n;
|
|
|
- }
|
|
|
|
|
|
}
|