温红权 8 лет назад
Родитель
Сommit
493f593a85

+ 152 - 40
VisualInspection/js/other_check/other_check.js

@@ -262,7 +262,8 @@ function queryTable() {
                 return obj;
             }
         },
-        { width: 50, text: '扣分类型', flex: false, colClass: '', field: 'check_item_name' },
+        { width: 50, text: '扣分类型', flex: false, colClass: '', field: 'pcheckname' },
+        { width: 50, text: '扣分项', flex: false, colClass: '', field: 'check_item_name' },
         { width: 30, text: '扣分值', flex: false, colClass: '', field: 'check_score' },
         { width: 120, text: '扣分描述', flex: false, colClass: '', field: 'remark' },
         { width: 30, text: '检查类型', flex: false, hide: hide, field: 'wrecker_check_type_name' },
@@ -748,78 +749,78 @@ function setCheckTypeSelect(div, selectId, codeFlag, hasAll) {
 
 
 function static() {
-    if (check_type == 1) {
+
+    var type = $("#speacial_type_select").val();
+
+    if (check_type == 1 || check_type == 4 || check_type == 3 || (type != "" && check_type == 2)) {
         var p = {
             "check_type": check_type,
-            "check_period": $("#month_date").val()
+            "check_period": $("#month_date").val(),
+            "special_check_type": type
         };
 
 
         post_common_service("/checkOther/getOtherCheckStatistics", p, function(data) {
 
-            var t1 = 0,
-                t2 = 0,
-                t3 = 0,
-                t4 = 0,
-                t5 = 0,
-                t6 = 0,
-                t7 = 0,
-                t8 = 0;
-
+            var names = new Array();
+            var totalnamesvalue = new HashMap();
+            var itemsname = "";
             var datas = '';
+            var t8 = 0;
+            var title = "第三方暗访情况";
+            if (check_type == 1) title = "第三方暗访情况";
+            if (check_type == 3) title = "现场检查情况";
+            if (check_type == 4) title = "数据平台应用情况";
+            if (check_type == 2 && type == "1") title = "公司特情稽查情况";
+            if (check_type == 2 && type == "1") title = "联网特情稽查情况";
             for (var key in data) {
                 for (var i in data[key]) {
-                    var d = data[key][i];
+                    itemsname = "";
+                    var itemvalue = "";
+                    names = new Array();
+                    for (var name in data[key][i].scoremap) {
+                        names.push(name);
+                        itemsname += '<td style="width:78px">' + name + '</td>';
+                        itemvalue += '<td>' + data[key][i].scoremap[name] + '</td>';
+
+                        var v = totalnamesvalue.get(name);
+                        if (v == null || v == undefined) v = 0;
+                        v += data[key][i].scoremap[name];
+                        totalnamesvalue.set(name, v);
+                    }
+
+
                     datas += '<tr>';
                     if (i == 0) {
                         datas += '<td rowspan=' + data[key].length + '>' + key + "</td>";
                     }
-                    datas += '<td>' + data[key][i].cranking + '</td>';
-                    datas += '<td>' + data[key][i].rranking + '</td>';
                     datas += '<td>' + data[key][i].deptname + "</td>";
-                    datas += '<td>' + data[key][i].scoremap["环境卫生"] + '</td>';
-                    datas += '<td>' + data[key][i].scoremap["仪容仪表"] + '</td>';
-                    datas += '<td>' + data[key][i].scoremap["动作规范"] + '</td>';
-                    datas += '<td>' + data[key][i].scoremap["表情"] + '</td>';
-                    datas += '<td>' + data[key][i].scoremap["礼貌用语"] + '</td>';
-                    datas += '<td>' + data[key][i].scoremap["行为举止"] + '</td>';
-                    datas += '<td>' + data[key][i].scoremap["便民服务"] + '</td>';
+                    datas += itemvalue;
                     datas += '<td>' + data[key][i].totalScore + '</td>';
                     datas += '<td>' + data[key][i].level + '</td>';
                     datas += '</tr>';
 
-                    t1 += data[key][i].scoremap["环境卫生"];
-                    t2 += data[key][i].scoremap["仪容仪表"];
-                    t3 += data[key][i].scoremap["动作规范"];
-                    t4 += data[key][i].scoremap["表情"];
-                    t5 += data[key][i].scoremap["礼貌用语"];
-                    t6 += data[key][i].scoremap["行为举止"];
-                    t7 += data[key][i].scoremap["便民服务"];
                     t8 += data[key][i].totalScore;
                 }
             }
 
-            datas += '<tr><td colspan=4>合计</td><td>' + t1 + '</td><td>' + t2 + '</td><td>' + t3 + '</td><td>' + t4 + '</td><td>' + t5 + '</td><td>' + t6 + '</td><td>' + t7 + '</td><td>' + t8 + '</td><td>-</td></tr>';
+            datas += '<tr><td colspan=2>合计</td>';
+            for (var i in names) {
+                datas += '<td>' + totalnamesvalue.get(names[i]) + '</td>';
+            }
+            datas += '<td>' + t8 + '</td><td> - </td></tr>';
 
             var html = ' <table class="statable">' +
                 '            <thead style="font-size:  20px;text-align:  center;border:  0px;">' +
                 '                <tr>' +
-                '                    <td colspan="13" style="padding:  10px;border:  0px;">' + $("#month_date").val() + '第三方暗访情况</td>' +
+                '                    <td colspan="13" style="padding:  10px;border:  0px;">' + $("#month_date").val().replace("/", "-") + '月份' + title + '</td>' +
                 '                </tr>' +
                 '            </thead>' +
                 '            <tbody>' +
                 '                <tr>' +
                 '                    <td style="width:40px">道管</td>' +
-                '                    <td style="width:40px">公司排名</td>' +
-                '                    <td style="width:40px">道管内排名</td>' +
                 '                    <td style="width:78px">站名</td>' +
-                '                    <td>环境<br>卫生<br>(230)</td>' +
-                '                    <td>仪容<br>仪表<br>(170)</td>' +
-                '                    <td>动作<br>规范<br>(100)</td>' +
-                '                    <td>表情<br>(100)</td>' +
-                '                    <td>礼貌<br>用语<br>(200)</td>' +
-                '                    <td>行为<br>举止<br>(120)</td>' +
-                '                    <td>便民<br>服务<br>(80)</td>' +
+                itemsname +
                 '                    <td>得分<br>(1000)</td>' +
                 '                    <td>服务<br>评价</td>' +
                 '                </tr>' +
@@ -839,9 +840,120 @@ function static() {
                 content: "<div style='width:100%;background: #fff;text-align: center;padding:10px'>   <button class=\"btn btn-info3\" type=\"button\" style=\"    position: absolute;right: 10px;top: 17px;\" onclick=\"exportThirds()\"> 导出Excel</button>" + html + "</div>"
             });
         });
+    }
+
+    if (check_type == 2 && type == "") {
 
+        var p = {
+            "check_type": check_type,
+            "check_period": $("#month_date").val()
+        };
 
 
+        post_common_service("/checkOther/getOtherCheckStatistics", p, function(data) {
 
+            var names = new Array();
+            var totalnamesvalue = new HashMap();
+            var itemsname = "";
+            var datas = '';
+            var t8 = 0;
+            var t1 = 0;
+            var t2 = 0;
+            var t3 = 0;
+
+            //key 盐城道管
+            for (var key in data) {
+                //i list 盐城
+                for (var i in data[key]) {
+
+                    var itemvalue = "";
+                    //type 1
+                    for (var j in data[key][i].scoretypemap) {
+                        var scoremap = data[key][i].scoretypemap[j];
+                        names = new Array();
+                        itemsname = "";
+                        var totalvalue = 0;
+                        for (var name in scoremap) {
+                            names.push(name);
+                            itemsname += '<td style="width:78px">' + name + '</td>';
+                            itemvalue += '<td>' + scoremap[name] + '</td>';
+
+                            totalvalue += scoremap[name];
+
+                            var v = totalnamesvalue.get(name + j);
+                            if (v == null || v == undefined) v = 0;
+                            v += scoremap[name];
+                            totalnamesvalue.set(name + j, v);
+                        }
+                        itemvalue += '<td>' + totalvalue + '</td>';
+
+                        if (j == "1") t2 += totalvalue;
+                        if (j == "2") t3 += totalvalue;
+
+                    }
+
+                    datas += '<tr>';
+                    if (i == 0) {
+                        datas += '<td rowspan=' + data[key].length + '>' + key + "</td>";
+                    }
+                    datas += '<td>' + data[key][i].deptname + "</td>";
+                    datas += '<td>' + data[key][i].totalcheck + "</td>";
+                    datas += itemvalue;
+                    datas += '<td>' + data[key][i].totalScore + '</td>';
+                    datas += '</tr>';
+
+                    t1 += data[key][i].totalcheck;
+                    t8 += data[key][i].totalScore;
+                }
+            }
+
+            datas += '<tr><td colspan=2>合计</td>';
+            datas += '<td>' + t1 + '</td>';
+            for (var i in names) {
+                datas += '<td>' + totalnamesvalue.get(names[i] + "1") + '</td>';
+            }
+            datas += '<td>' + t2 + '</td>';
+            for (var i in names) {
+                datas += '<td>' + totalnamesvalue.get(names[i] + "2") + '</td>';
+            }
+            datas += '<td>' + t3 + '</td>';
+            datas += '<td>' + t8 + '</td></tr>';
+
+            var html = ' <table class="statable">' +
+                '            <thead style="font-size:  20px;text-align:  center;border:  0px;">' +
+                '                <tr>' +
+                '                    <td colspan="13" style="padding:  10px;border:  0px;">' + $("#month_date").val().replace("/", "-") + '月份特情稽查情况汇总</td>' +
+                '                </tr>' +
+                '            </thead>' +
+                '            <tbody>' +
+                '                <tr>' +
+                '<td rowspan=2>道管</td>' +
+                '<td rowspan=2>站名</td>' +
+                '<td rowspan=2>存在问题特情数量</td>' +
+                '<td colspan=' + (names.length + 1) + '>联网中心特情稽查存在问题数量</td>' +
+                '<td colspan=' + (names.length + 1) + '>内部特情稽查存在问题数量</td>' +
+                '<td rowspan=2>合计扣分</td>' +
+                '                </tr>' +
+                '                <tr>' +
+                itemsname +
+                '<td >合计</td>' +
+                itemsname +
+                '<td >合计</td>' +
+                '                </tr>' +
+                datas +
+                '            </tbody>' +
+                '        </table>';
+            layer.open({
+                area: ["800px", "500px"],
+                type: 1,
+                title: '第三方暗访统计',
+                maxmin: true,
+                closeBtn: 1,
+                shadeClose: true,
+                skin: '#fff', //没有背景色
+                resize: true,
+                content: "<div style='width:100%;background: #fff;text-align: center;padding:10px'>   <button class=\"btn btn-info3\" type=\"button\" style=\"    position: absolute;right: 10px;top: 17px;\" onclick=\"exportThirds()\"> 导出Excel</button>" + html + "</div>"
+            });
+        });
     }
 }

+ 28 - 11
VisualInspection/view/other_check/data_platform_check.html

@@ -20,16 +20,19 @@
                 <select class="form-control" id="second"></select>
             </div>
 
-            <div class="col-xs-3">
+            <div class="col-xs-1">
                 <div class="input-group">
                     <button class="btn btn-primary " type="button" id="conditional_query">查询</button>
                 </div>
             </div>
 
             <div style="float:right;margin-right:30px;">
+
+                <button class="btn btn-info3" type="button" style="margin-right:30px;" onclick="static()">统计</button>
+
                 <button class="btn btn-primary" type="button" id="add_btn"><i class="icon icon-plus-sign"></i> 增加稽查记录</button>
 
-                <button class="btn btn-info3" type="button" style="margin-left:30px;" onclick="exportThird()" > 导出Excel</button>
+                <button class="btn btn-info3" type="button" style="margin-left:30px;" onclick="exportThird()"> 导出Excel</button>
             </div>
         </div>
     </div>
@@ -140,17 +143,31 @@
             init();
         });
 
-        function exportThird(){
-             var param = '';
-             var month_date = $("#month_date").val();
-             var first =  $("#first").val(); 
-             var second = $("#second").val();
-            if( month_date != '' ){
-                param = "&check_time_name="+month_date ;
+        function exportThird() {
+            var param = '';
+            var month_date = $("#month_date").val();
+            var first = $("#first").val();
+            var second = $("#second").val();
+            if (month_date != '') {
+                param = "&check_time_name=" + month_date;
             }
-            if( second != '' ){
-                param += "&dept_id="+ second ;
+            if (second != '') {
+                param += "&dept_id=" + second;
             }
             window.open(getserveraddr() + "/file/other/check/excel?check_type=4" + param);
         }
+
+        function exportThirds() {
+            var param = '';
+            var month_date = $("#month_date").val();
+            var first = $("#first").val();
+            var second = $("#second").val();
+            if (month_date != '') {
+                param = "&check_time_name=" + month_date;
+            }
+            if (second != '') {
+                param += "&dept_id=" + second;
+            }
+            window.open(getserveraddr() + "/file/other/check/static/excel?check_type=4" + param);
+        }
     </script>

+ 29 - 11
VisualInspection/view/other_check/onsite_check.html

@@ -20,16 +20,19 @@
                 <select class="form-control" id="second"></select>
             </div>
 
-            <div class="col-xs-3">
+            <div class="col-xs-1">
                 <div class="input-group">
                     <button class="btn btn-primary " type="button" id="conditional_query">查询</button>
                 </div>
             </div>
 
             <div style="float:right;margin-right:30px;">
+
+                <button class="btn btn-info3" type="button" style="margin-right:30px;" onclick="static()">统计</button>
+
                 <button class="btn btn-primary" type="button" id="add_btn"><i class="icon icon-plus-sign"></i> 增加稽查记录</button>
 
-                <button class="btn btn-info3" type="button" style="margin-left:30px;" onclick="exportThird()" > 导出Excel</button>
+                <button class="btn btn-info3" type="button" style="margin-left:30px;" onclick="exportThird()"> 导出Excel</button>
             </div>
         </div>
     </div>
@@ -139,17 +142,32 @@
             check_type = 3;
             init();
         });
-        function exportThird(){
-             var param = '';
-             var month_date = $("#month_date").val();
-             var first =  $("#first").val(); 
-             var second = $("#second").val();
-            if( month_date != '' ){
-                param = "&check_time_name="+month_date ;
+
+        function exportThird() {
+            var param = '';
+            var month_date = $("#month_date").val();
+            var first = $("#first").val();
+            var second = $("#second").val();
+            if (month_date != '') {
+                param = "&check_time_name=" + month_date;
             }
-            if( second != '' ){
-                param += "&dept_id="+ second ;
+            if (second != '') {
+                param += "&dept_id=" + second;
             }
             window.open(getserveraddr() + "/file/other/check/excel?check_type=3" + param);
         }
+
+        function exportThirds() {
+            var param = '';
+            var month_date = $("#month_date").val();
+            var first = $("#first").val();
+            var second = $("#second").val();
+            if (month_date != '') {
+                param = "&check_time_name=" + month_date;
+            }
+            if (second != '') {
+                param += "&dept_id=" + second;
+            }
+            window.open(getserveraddr() + "/file/other/check/static/excel?check_type=3" + param);
+        }
     </script>

+ 35 - 14
VisualInspection/view/other_check/special_check.html

@@ -24,16 +24,19 @@
             <div class="col-xs-1">
                 <select class="form-control" id="speacial_type_select"></select>
             </div>
-            <div class="col-xs-3">
+            <div class="col-xs-1">
                 <div class="input-group">
                     <button class="btn btn-primary " type="button" id="conditional_query">查询</button>
                 </div>
             </div>
 
             <div style="float:right;margin-right:30px;">
+
+                <button class="btn btn-info3" type="button" style="margin-right:30px;" onclick="static()">统计</button>
+
                 <button class="btn btn-primary" type="button" id="add_btn"><i class="icon icon-plus-sign"></i> 增加稽查记录</button>
 
-                <button class="btn btn-info3" type="button" style="margin-left:30px;" onclick="exportThird()" > 导出Excel</button>
+                <button class="btn btn-info3" type="button" style="margin-left:30px;" onclick="exportThird()"> 导出Excel</button>
             </div>
         </div>
     </div>
@@ -152,21 +155,39 @@
             init();
         });
 
-        function exportThird(){
-             var param = '';
-             var month_date = $("#month_date").val();
-             var first =  $("#first").val(); 
-             var second = $("#second").val();
-             var special_check_type_name = $("#speacial_type_select").val() ;
-            if( month_date != '' ){
-                param = "&check_time_name="+month_date ;
+        function exportThird() {
+            var param = '';
+            var month_date = $("#month_date").val();
+            var first = $("#first").val();
+            var second = $("#second").val();
+            var special_check_type_name = $("#speacial_type_select").val();
+            if (month_date != '') {
+                param = "&check_time_name=" + month_date;
             }
-            if( second != '' ){
-                param += "&dept_id="+ second ;
+            if (second != '') {
+                param += "&dept_id=" + second;
             }
-            if( special_check_type_name !=''){
-                param += "&special_check_type=" + special_check_type_name ;
+            if (special_check_type_name != '') {
+                param += "&special_check_type=" + special_check_type_name;
             }
             window.open(getserveraddr() + "/file/other/check/excel?check_type=2" + param);
         }
+
+        function exportThirds() {
+            var param = '';
+            var month_date = $("#month_date").val();
+            var first = $("#first").val();
+            var second = $("#second").val();
+            var special_check_type_name = $("#speacial_type_select").val();
+            if (month_date != '') {
+                param = "&check_time_name=" + month_date;
+            }
+            if (second != '') {
+                param += "&dept_id=" + second;
+            }
+            if (special_check_type_name != '') {
+                param += "&special_check_type=" + special_check_type_name;
+            }
+            window.open(getserveraddr() + "/file/other/check/static/excel?check_type=2" + param);
+        }
     </script>

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/CheckOtherController.java

@@ -63,7 +63,7 @@ public class CheckOtherController extends BaseController {
 
     @RequestMapping(value = "/getOtherCheckStatistics")
     public String getOtherCheckStatistics(@RequestBody CheckOther checkOther){
-        Map<String,Object> checkStatistics = checkOtherService.getOtherCheckStatistics(checkOther.getCheck_period(),checkOther.getCheck_type());
+        Map<String,Object> checkStatistics = checkOtherService.getOtherCheckStatistics(checkOther.getCheck_period(),checkOther.getCheck_type(),checkOther.getSpecial_check_type());
         return super.returnSuccessResult(checkStatistics);
     }
 

+ 4 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/CheckOtherDao.java

@@ -39,5 +39,9 @@ public interface CheckOtherDao  {
 	 * @param id
 	 */
 	void update(CheckOther checkOther);
+
+    List<String> getcheckitemnames(Long id);
+
+
     
 }

+ 5 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckOtherMapper.xml

@@ -63,4 +63,9 @@
         WHERE
         id =#{id}
     </delete>
+
+    <select id="getcheckitemnames" parameterType="java.lang.Long" resultType="java.lang.String">
+        select if(p.score is NULL,p.name,(select name from check_item where id = p.parent_id)) itemname from check_item p where p.id in (select item_id from check_rule_item where rule_id=#{id}) GROUP BY itemname
+    </select>
+
 </mapper>

+ 4 - 4
VisualInspection_server/src/main/java/com/xintong/visualinspection/pojo/OtherCheckStatistics.java

@@ -15,20 +15,20 @@ public class OtherCheckStatistics {
     private String deptname;
     private String pdeptname;
     private HashMap<String,Integer> scoremap;
+    private Integer totalcheck;
+    private HashMap<String,HashMap<String,Integer>> scoretypemap;
     private Integer totalScore;
     private String level;
-    private Integer cranking;
-    private Integer rranking;
 
 
 
     public void setScoremap(HashMap<String, Integer> scoremap) {
         this.scoremap = scoremap;
 
-        this.totalScore = 0;
+        this.totalScore = 1000;
         for (Integer i:scoremap.values()
              ) {
-            this.totalScore+=i;
+            this.totalScore-=i;
         }
         this.level="优秀";
         if(this.totalScore<1000 && this.totalScore>=985 ){ this.level="优秀";}

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/CheckOtherService.java

@@ -46,6 +46,6 @@ public interface CheckOtherService {
     public void getexcel(CheckOther checkOther, HttpServletRequest req, HttpServletResponse resp);
 
 
-	public Map<String,Object> getOtherCheckStatistics(String checktime, int checktype);
+	public Map<String,Object> getOtherCheckStatistics(String checktime, int checktype,Integer type);
 
 }

+ 107 - 60
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckOtherServiceImpl.java

@@ -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;
-    }
 
 }

BIN
VisualInspection_server/src/main/resources/other_check_info_anfang.xls


BIN
VisualInspection_server/src/main/resources/other_check_info_teqing.xls