huangchengzdm 8 лет назад
Родитель
Сommit
7935856550
14 измененных файлов с 688 добавлено и 309 удалено
  1. 152 157
      VisualInspection/fwq/js/other_check/other_check.js
  2. 3 3
      VisualInspection/fwq/view/other_check/onsite_check.html
  3. 3 3
      VisualInspection/fwq/view/other_check/third_unannounced_check.html
  4. 17 0
      VisualInspection/js/config.js
  5. 180 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/controller/BaseController.java
  6. 6 9
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/controller/FileExcelController_F.java
  7. 35 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/CheckOtherService_F.java
  8. 6 114
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/CheckOtherServiceImpl.java
  9. 283 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/CheckOtherService_FImpl.java
  10. BIN
      Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_duty_check.xls
  11. BIN
      Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_other_check_info_anfang.xls
  12. BIN
      Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_third_check.xls
  13. 0 18
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/service/CheckOtherService_F.java
  14. 3 5
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/util/CacheUtil.java

+ 152 - 157
VisualInspection/fwq/js/other_check/other_check.js

@@ -212,12 +212,11 @@ $("#add_btn").click(function() {
     layerUpdateTeam('form-div', '稽查记录新增', '550px');
     $("#save-check").html("保存");
 
-    if (check_type == 2) {
-        //特情稽查处理
-        $("#confirmC").prop('checked', false);
-        isconfirmC = false;
-    }
-
+    // if (check_type == 2) {
+    //     //特情稽查处理
+    //     $("#confirmC").prop('checked', false);
+    //     isconfirmC = false;
+    // }
 
     //debugger;
     var nodedata;
@@ -248,18 +247,18 @@ function queryTable() {
         "special_check_type": $("#speacial_type_select").val()
     }
     var hide = true;
-    if (check_type == 5) {
-        hide = false;
-    }
+    // if (check_type == 5) {
+    //     hide = false;
+    // }
     operation = true;
     var hide1 = true;
-    if (check_type == 2) {
-        hide1 = false;
-    }
+    // if (check_type == 2) {
+    //     hide1 = false;
+    // }
 
-    if (check_type == 4) {
-        data["scoretype"] = $("#scoretype").val();
-    }
+    // if (check_type == 4) {
+    //     data["scoretype"] = $("#scoretype").val();
+    // }
 
     var cols = [
         { width: 30, text: '序号', flex: false, colClass: 'text-center', field: 'num' },
@@ -423,17 +422,17 @@ $(".div-roadManage select").change(function() {
 function getOrganList(select_road) {
     var organList;
     if (select_road) {
-        if (check_type == 5) {
-            organList = cache_road_manager_wrecker_group_map.get(select_road);
-        } else {
+        // if (check_type == 5) {
+        //     organList = cache_road_manager_wrecker_group_map.get(select_road);
+        // } else {
             organList = cache_service_area_map.get(select_road);
-        }
+        // }
     } else {
-        if (check_type == 5) {
-            organList = $.zui.store.get("cache_wrecker_group_list");
-        } else {
+        // if (check_type == 5) {
+        //     organList = $.zui.store.get("cache_wrecker_group_list");
+        // } else {
             organList = $.zui.store.get("cache_service_area_list");
-        }
+        // }
     }
     return organList;
 }
@@ -705,16 +704,12 @@ function getOtherCheckItems() {
     };
 
     var param = {};
-    if (check_type == 1) {
-        param.rule_type = 2;
-    } else if (check_type == 2) {
-        param.rule_type = 3;
-    } else if (check_type == 3) {
-        param.rule_type = 4;
-    } else if (check_type == 4) {
-        param.rule_type = 5;
-    } else if (check_type == 5) {
-        param.rule_type = 6;
+    // rule_type=8,服务区暗访考核办法.rule_type=9,服务区现场考核办法
+    // check_type=8,服务区第三方暗访,check_type=9,服务区现场稽查
+    if (check_type == 8) {
+        param.rule_type = 8;
+    } else if (check_type == 9) {
+        param.rule_type = 9;
     }
     post_common_service('checkRule/getItemListByRuleType', param, function(data) {
         all_data = [];
@@ -735,9 +730,9 @@ function getOtherCheckItems() {
             }
             check_item_tree = $.fn.zTree.init($("#check_rule_tree2"), setting, all_data)
 
-            if (check_type == 4) {
-                setscoretype();
-            }
+            // if (check_type == 4) {
+            //     setscoretype();
+            // }
         }
     }, function(error) {})
 }
@@ -793,7 +788,7 @@ function static() {
 
     var type = $("#speacial_type_select").val();
 
-    if (check_type == 1 || check_type == 4 || check_type == 3 || (type != "" && check_type == 2)) {
+    if (check_type == 8 || check_type == 9) {
         var p = {
             "check_type": check_type,
             "check_period": $("#month_date").val(),
@@ -808,12 +803,12 @@ function static() {
             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 == "2") title = "联网特情稽查情况";
+            var title = "";
+            if (check_type == 8) title = "服务区第三方暗访情况";
+            if (check_type == 9) title = "服务区现场检查情况";
+            // if (check_type == 4) title = "数据平台应用情况";
+            // if (check_type == 2 && type == "1") title = "公司特情稽查情况";
+            // if (check_type == 2 && type == "2") title = "联网特情稽查情况";
             for (var key in data) {
                 for (var i in data[key]) {
                     itemsname = "";
@@ -883,118 +878,118 @@ function static() {
         });
     }
 
-    if (check_type == 2 && type == "") {
-
-        var p = {
-            "check_type": check_type,
-            "check_period": $("#month_date").val()
-        };
-
-
-        post_common_service("/f/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>"
-            });
-        });
-    }
+    // if (check_type == 2 && type == "") {
+
+    //     var p = {
+    //         "check_type": check_type,
+    //         "check_period": $("#month_date").val()
+    //     };
+
+
+    //     post_common_service("/f/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>"
+    //         });
+    //     });
+    // }
 }

+ 3 - 3
VisualInspection/fwq/view/other_check/onsite_check.html

@@ -140,7 +140,7 @@
     </div>
     <script>
         $(document).ready(function() {
-            check_type = 3;
+            check_type = 9;
             init();
         });
 
@@ -155,7 +155,7 @@
             if (second != '') {
                 param += "&dept_id=" + second;
             }
-            window.open(getserveraddr() + "/f/file/other/check/excel?check_type=3" + param);
+            window.open(getExcelServeraddr() + "f/file/other/check/excel?check_type=9" + param);
         }
 
         function exportThirds() {
@@ -169,6 +169,6 @@
             if (second != '') {
                 param += "&dept_id=" + second;
             }
-            window.open(getserveraddr() + "/f/file/other/check/static/excel?check_type=3" + param);
+            window.open(getExcelServeraddr() + "f/file/other/check/static/excel?check_type=9" + param);
         }
     </script>

+ 3 - 3
VisualInspection/fwq/view/other_check/third_unannounced_check.html

@@ -144,7 +144,7 @@
     </div>
     <script>
         $(document).ready(function() {
-            check_type = 1;
+            check_type = 8;
             init();
         });
 
@@ -159,7 +159,7 @@
             if (second != '') {
                 param += "&dept_id=" + second;
             }
-            window.open(getserveraddr() + "/f/file/other/check/excel?check_type=1" + param);
+            window.open(getExcelServeraddr() + "f/file/other/check/excel?check_type=8" + param);
         }
 
         function exportThirds() {
@@ -173,6 +173,6 @@
             if (second != '') {
                 param += "&dept_id=" + second;
             }
-            window.open(getserveraddr() + "/f/file/other/check/static/excel?check_type=1" + param);
+            window.open(getExcelServeraddr() + "f/file/other/check/static/excel?check_type=8" + param);
         }
     </script>

+ 17 - 0
VisualInspection/js/config.js

@@ -29,6 +29,23 @@ function getserveraddr() {
     }
 }
 
+function getExcelServeraddr() {
+    if (base_ui_url.indexOf("file_yanhai.jsxt.jsjtyxt.com") != -1) {
+        return "http://server_yanhai.jsxt.jsjtyxt.com/";
+    } else if (base_ui_url.indexOf("file_release_yanhai") != -1) {
+        return "http://server_release_yanhai.jsxt.jsjtyxt.com/";
+    } else if (base_ui_url.indexOf("localhost") != -1) {
+        // return "http://server_release_yanhai.jsxt.jsjtyxt.com/"
+        return "http://localhost:9000/"
+    } else if (base_ui_url.indexOf("192.168.31.233") != -1) {
+        return "http://192.168.31.233:9000/"
+    } else if (base_ui_url.indexOf("192.168.8.236") != -1) {
+        return "http://192.168.8.236:9000/"
+    } else {
+        return "http://10.112.0.199:9000s/"
+    }
+}
+
 function getImageaddr() {
     if (base_ui_url.indexOf("file_yanhai.jsxt.jsjtyxt.com") != -1) {
         return "http://file_release_yanhai.jsxt.jsjtyxt.com/";

+ 180 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/controller/BaseController.java

@@ -0,0 +1,180 @@
+package com.xintong.visualinspection.visuallnspection_fjq.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.github.pagehelper.PageInfo;
+import org.slf4j.LoggerFactory;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 文件名:TestController
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@ControllerAdvice
+public class BaseController {
+	
+	private static final org.slf4j.Logger logger = LoggerFactory.getLogger(BaseController.class);
+
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnResult(int result_code,String result_desc, Object o){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", result_code);
+    	result.put("result_desc", result_desc);
+    	result.put("result_data", o);
+        return JSON.toJSON(result).toString();
+    }
+    
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResult(String result_desc){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", result_desc);
+        return JSON.toJSON(result).toString();
+    }
+    
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResult(){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", "success");
+        return JSON.toJSONStringWithDateFormat(result,"yyyy-MM-dd HH:mm");
+    }
+    
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResult(Object o){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", "success");
+    	result.put("result_data", o);
+        return JSON.toJSONStringWithDateFormat(result,"yyyy-MM-dd HH:mm");
+    }
+    
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResultTime(Object o){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", "success");
+    	result.put("result_data", o);
+        return JSON.toJSONStringWithDateFormat(result,"yyyy-MM-dd HH:mm:00");
+    }
+    
+    /**
+     * 返回前台结果分页结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessPageResult(Object o){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", "success");
+    	result.put("result_data", new PageInfo((List)o));
+        return JSON.toJSONStringWithDateFormat(result,"yyyy-MM-dd HH:mm");
+    }
+    
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResult(String result_desc, Object o){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", result_desc);
+    	result.put("result_data", o);
+        return JSON.toJSONStringWithDateFormat(result,"yyyy-MM-dd HH:mm");
+    }
+    
+    /**
+     * 返回前台结果结构体
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    public String returnSuccessResult(String result_desc, Object o, String dateFormat){
+    	Map<String,Object> result = new HashMap<>();
+    	result.put("result_code", 0);
+    	result.put("result_desc", result_desc);
+    	result.put("result_data", o);
+        return JSON.toJSONStringWithDateFormat(result,dateFormat);
+    }
+    /** 基于@ExceptionHandler异常处理 *//*
+    @ExceptionHandler  
+    public String exp(HttpServletRequest request, Exception ex) {  
+        // 根据不同错误提示不同的错误  
+    	ErrorCode code;
+        if(ex instanceof NullPointerException) {  
+        	code = new ErrorCode(10001);
+        } else if (ex instanceof NumberFormatException) {  
+        	code = new ErrorCode(10002);
+        } else if (ex instanceof IndexOutOfBoundsException) {  
+        	code = new ErrorCode(10003);  
+        } else if (ex instanceof ArithmeticException) {  
+        	code = new ErrorCode(10004);  
+        } else if (ex instanceof FileNotFoundException) {  
+        	code = new ErrorCode(10005);  
+        } else if (ex instanceof IllegalArgumentException) {  
+        	code = new ErrorCode(10006); 
+        } else if (ex instanceof HttpMessageNotReadableException) {
+        	code = new ErrorCode(10007); 
+        } else if (ex instanceof BusinessException) {
+        	code = ((BusinessException) ex).getErrCode();
+        } else if(ex.getCause() instanceof TooManyResultsException){
+        	code = new ErrorCode(10008);
+        } else if (ex instanceof MethodArgumentNotValidException) {
+        	BindingResult bindingResult = ((MethodArgumentNotValidException) ex).getBindingResult();
+        	code = new ErrorCode(20001,getValidatorErrors(bindingResult)); 
+        } else{
+        	code = new ErrorCode(11000);  
+        }
+        logger.error(code.getDesc(), ex);
+        return returnResult(code.getCode(),code.getDesc(),null);
+    }*/
+    
+    public static String getValidatorErrors(BindingResult bindingResult){
+    	StringBuffer sb = new StringBuffer();
+    	for(ObjectError err:bindingResult.getAllErrors()){
+   		 	sb.append("["+err.getDefaultMessage()+"]");
+       	}
+       	return sb.toString();
+    }
+}

+ 6 - 9
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/FileExcelController_F.java → Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/controller/FileExcelController_F.java

@@ -1,9 +1,8 @@
-package com.xintong.visualinspection.controller.gettway;
+package com.xintong.visualinspection.visuallnspection_fjq.controller;
 
-import com.alibaba.dubbo.config.annotation.Reference;
 import com.xintong.visualinspection.bean.FwqCheckOther;
-import com.xintong.visualinspection.controller.BaseController;
-import com.xintong.visualinspection.service.CheckOtherService_F;
+import com.xintong.visualinspection.visuallnspection_fjq.service.CheckOtherService_F;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -15,13 +14,11 @@ import javax.servlet.http.HttpServletResponse;
 @RequestMapping("/f/file")
 public class FileExcelController_F extends BaseController {
 
-    @Reference(version = "1.0.0",
-            application = "${dubbo.application.id}",
-            registry = "${dubbo.registry.address}")
+    @Autowired
     private CheckOtherService_F checkOtherService_f;
 
     /**
-     * 第三方暗访稽查导出
+     * 稽查管理导出
      * @param req
      * @param resp
      * @param fwqCheckOther
@@ -35,7 +32,7 @@ public class FileExcelController_F extends BaseController {
     }
 
     /**
-     * 第三方暗访稽查统计-导出
+     * 稽查统计-导出
      * @param req
      * @param resp
      * @param fwqCheckOther

+ 35 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/CheckOtherService_F.java

@@ -0,0 +1,35 @@
+package com.xintong.visualinspection.visuallnspection_fjq.service;
+
+import com.xintong.visualinspection.bean.FwqCheckOther;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+public interface CheckOtherService_F {
+
+    /**
+     * 统计数据
+     *
+     * @param fwqOtherCheck
+     * @return
+     */
+    Map<String, Object> getCheckOtherStatistics(FwqCheckOther fwqOtherCheck);
+
+    /**
+     * 统计数据导出
+     *
+     * @param fwqOtherCheck
+     * @param req
+     * @param resp
+     */
+    void getExcel(FwqCheckOther fwqOtherCheck, HttpServletRequest req, HttpServletResponse resp);
+
+    /**
+     * 第三方暗访稽查导出excel
+     * @param fwqOtherCheck
+     * @param req
+     * @param resp
+     */
+    void getOtherCheckExcel(FwqCheckOther fwqOtherCheck, HttpServletRequest req, HttpServletResponse resp);
+}

+ 6 - 114
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/CheckOtherServiceImpl.java

@@ -12,21 +12,10 @@ import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.service.CheckOtherService_F;
 import com.xintong.visualinspection.service.CommonService;
 import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqCheckOtherDao;
-import org.jxls.common.Context;
-import org.jxls.util.JxlsHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -211,19 +200,13 @@ public class CheckOtherServiceImpl implements CheckOtherService_F {
         List<FeeStation> rmList = commonService.getAllDeptByLayer("RM");
 
         int checkType = fwqCheckOther.getCheck_type();
-        if (checkType == 1 || checkType == 3 || checkType == 4 || (checkType == 2 && fwqCheckOther.getSpecial_check_type() != null)) {
-            Long id = 21L;
-            if (checkType == 1) {
-                id = 21L;
+        if (checkType == 8 || checkType == 9) {
+            Long id = 26L;
+            if (checkType == 8) {
+                id = 26L;
             }
-            if (checkType == 3) {
-                id = 23L;
-            }
-            if (checkType == 4) {
-                id = 24L;
-            }
-            if (checkType == 2) {
-                id = 22L;
+            if (checkType == 9) {
+                id = 27L;
             }
             //获取考核办法对应的考核项
             List<String> itemName = commonService.getCheckItemName(id);
@@ -280,95 +263,4 @@ public class CheckOtherServiceImpl implements CheckOtherService_F {
         return datas;
     }
 
-    @Override
-    public void getExcel(FwqCheckOther fwqCheckOther, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
-        String title = fwqCheckOther.getCheck_time_name();
-        int checkType = fwqCheckOther.getCheck_type();
-        if (checkType == 1 || checkType == 4 || checkType == 3 || (checkType == 2 && fwqCheckOther.getSpecial_check_type() != null)) {
-            Map<String, Object> m = getCheckOtherStatistics(fwqCheckOther);
-            Map<String, Object> map = new HashMap<>();
-            map.put("datas", m);
-
-            if (checkType == 1) {
-                title += "月份第三方暗访情况";
-            }
-            if (checkType == 4) {
-                title += "月份数据平台应用情况";
-            }
-            if (checkType == 3) {
-                title += "月份现场检查情况";
-            }
-            if (checkType == 2 && (fwqCheckOther.getSpecial_check_type().intValue() == 1)) {
-                title += "公司特情稽查情况";
-            }
-            if (checkType == 2 && (fwqCheckOther.getSpecial_check_type().intValue() == 2)) {
-                title += "联网特情稽查情况";
-            }
-            map.put("title", title.replaceAll("/", "-"));
-
-            exportExcel(title.replaceAll("/", "-"), "fwq_other_check_info_anfang", map, httpServletResponse);
-        }
-    }
-
-    @Override
-    public void getOtherCheckExcel(FwqCheckOther fwqCheckOther, HttpServletRequest req, HttpServletResponse resp) {
-        List<FwqCheckOther> checkOtherList = (List<FwqCheckOther>) getAllCheckOther(fwqCheckOther);
-        Map<String, Object> map = new HashMap<>();
-        map.put("list", checkOtherList);
-        if(fwqCheckOther.getCheck_type() == 1){
-            exportExcel("第三方暗访稽查" , "fwq_third_check", map, resp);
-        }else if(fwqCheckOther.getCheck_type() == 2){
-            exportExcel("特情稽查" , "fwq_special_check", map, resp);
-        }else if(fwqCheckOther.getCheck_type() == 3){
-            exportExcel("现场稽查" , "fwq_duty_check", map, resp);
-        }else if(fwqCheckOther.getCheck_type() == 4){
-            exportExcel("数据平台应用稽查" , "fwq_data_platform", map, resp);
-        }else if(fwqCheckOther.getCheck_type() == 5){
-            exportExcel("清排障稽查" , "fwq_solve_traffic", map, resp);
-        }
-    }
-
-    private void exportExcel(String fileName, String excelTemplateName, Map<String, Object> map,
-                             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", map.get("list"));
-                // context.putVar("totalMan", map.get("totalMan"));
-                for (String key : map.keySet()) {
-                    context.putVar(key, map.get(key));
-                }
-                JxlsHelper.getInstance().processTemplate(is, os, context);
-            }
-            Thread.sleep(1000);
-            // path是指欲下载的文件的路径。
-            File file = new File(path);
-            // 取得文件名。
-            String filename = file.getName();
-            // 以流的形式下载文件。
-            InputStream bis = new BufferedInputStream(new FileInputStream(file));
-            byte[] buffer = new byte[bis.available()];
-            bis.read(buffer);
-            bis.close();
-            // 清空response
-            resp.reset();
-            // 设置response的Header
-            resp.addHeader("Content-Disposition",
-                    "attachment;filename=" + new String(filename.getBytes("gb2312"), "ISO8859-1"));
-            resp.addHeader("Content-Length", "" + file.length());
-            OutputStream toClient = new BufferedOutputStream(resp.getOutputStream());
-            resp.setContentType("application/vnd.ms-excel;charset=gb2312");
-            toClient.write(buffer);
-            toClient.flush();
-            toClient.close();
-            // 删除生成的临时文件
-            if (file.exists()) {
-                file.delete();
-            }
-
-        } catch (Exception e) {
-            logger.error(e.toString());
-        }
-    }
 }

+ 283 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/CheckOtherService_FImpl.java

@@ -0,0 +1,283 @@
+package com.xintong.visualinspection.visuallnspection_fjq.service.impl;
+
+import com.alibaba.dubbo.config.annotation.Reference;
+import com.xintong.visualinspection.bean.Constant;
+import com.xintong.visualinspection.bean.FeeStation;
+import com.xintong.visualinspection.bean.FwqCheckOther;
+import com.xintong.visualinspection.bean.FwqCheckOtherStatistics;
+import com.xintong.visualinspection.bean.Item;
+import com.xintong.visualinspection.bean.Organ;
+import com.xintong.visualinspection.service.CommonService;
+import com.xintong.visualinspection.util.DateUtil;
+import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqCheckOtherDao;
+import com.xintong.visualinspection.visuallnspection_fjq.service.CheckOtherService_F;
+import org.jxls.common.Context;
+import org.jxls.util.JxlsHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 文件名:OtherCheckServiceImpl_F
+ * 版本信息:日期:2017/4/7 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ *
+ * @author wenhongquan
+ * @date 2018/05/02
+ */
+@Service
+public class CheckOtherService_FImpl implements CheckOtherService_F {
+
+    private static final Logger logger = LoggerFactory.getLogger(CheckOtherService_FImpl.class);
+
+    @Autowired
+    private FwqCheckOtherDao fwqCheckOtherDao;
+
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private CommonService commonService;
+
+    /**
+     * 第三方暗访稽查查询(查询条件:时间,道管,服务区),<无分页>
+     *
+     * @param fwqCheckOther
+     * @return
+     */
+    private Object getAllCheckOther(FwqCheckOther fwqCheckOther) {
+
+        List<FwqCheckOther> checkOtherList = fwqCheckOtherDao.getAllCheckOther(fwqCheckOther == null ? new FwqCheckOther() : fwqCheckOther);
+        Map<Long, Organ> deptMap = commonService.getDeptMap();
+        Map<Long, Item> itemMap = commonService.getItemMap();
+        Map<String, Constant> codeMap = commonService.getCodeMap();
+        for (FwqCheckOther data : checkOtherList) {
+            if (deptMap.get(data.getDept_id()) != null) {
+                data.setOrgan_name(deptMap.get(data.getDept_id()).getOrganname());
+            }
+            if (itemMap.get(data.getCheck_item_id()) != null) {
+                data.setCheck_item_name(itemMap.get(data.getCheck_item_id()).getName());
+                if (itemMap.get(data.getCheck_item_id()).getParent_id() != null) {
+                    if (itemMap.get(data.getCheck_item_id()).getScore() == null) {
+                        data.setPcheckname(itemMap.get(data.getCheck_item_id()).getName());
+                    } else {
+                        data.setPcheckname(itemMap.get(itemMap.get(data.getCheck_item_id()).getParent_id()).getName());
+                    }
+                }
+            }
+            if (codeMap.get(data.getWrecker_check_type()) != null) {
+                data.setWrecker_check_type_name(codeMap.get(data.getWrecker_check_type()).getCode_name());
+            }
+            if (codeMap.get(data.getSpecial_check_type()) != null) {
+                data.setSpecial_check_type_name(codeMap.get(data.getSpecial_check_type()).getCode_name());
+            }
+        }
+        return checkOtherList;
+    }
+
+    /**
+     * 统计数据
+     *
+     * @param fwqCheckOther
+     * @return
+     */
+    @Override
+    public Map<String, Object> getCheckOtherStatistics(FwqCheckOther fwqCheckOther) {
+
+        Map<String, Object> datas = new HashMap<>();
+        List<FwqCheckOtherStatistics> fwqCheckOtherStatisticses = new ArrayList<>();
+
+        fwqCheckOther.setCheck_time_name(fwqCheckOther.getCheck_period());
+        List<FwqCheckOther> checkOtherList = fwqCheckOtherDao.getAllCheckOther(fwqCheckOther);
+        Map<Long, Organ> deptMap = commonService.getDeptMap();
+        Map<Long, Item> itemMap = commonService.getItemMap();
+        Map<String, Constant> codeMap = commonService.getCodeMap();
+        for (FwqCheckOther data : checkOtherList) {
+            if (deptMap.get(data.getDept_id()) != null) {
+                data.setOrgan_name(deptMap.get(data.getDept_id()).getOrganname());
+            }
+            if (itemMap.get(data.getCheck_item_id()) != null) {
+                data.setCheck_item_name(itemMap.get(data.getCheck_item_id()).getName());
+                if (itemMap.get(data.getCheck_item_id()).getParent_id() != null) {
+                    if (itemMap.get(data.getCheck_item_id()).getScore() == null) {
+                        data.setPcheckname(itemMap.get(data.getCheck_item_id()).getName());
+                    } else {
+                        data.setPcheckname(itemMap.get(itemMap.get(data.getCheck_item_id()).getParent_id()).getName());
+                    }
+                }
+            }
+            if (codeMap.get(data.getWrecker_check_type()) != null) {
+                data.setWrecker_check_type_name(codeMap.get(data.getWrecker_check_type()).getCode_name());
+            }
+            if (codeMap.get(data.getSpecial_check_type()) != null) {
+                data.setSpecial_check_type_name(codeMap.get(data.getSpecial_check_type()).getCode_name());
+            }
+        }
+
+        // 获得所有服务区数据
+        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        // 获得所有道管中心数据
+        List<FeeStation> rmList = commonService.getAllDeptByLayer("RM");
+
+        int checkType = fwqCheckOther.getCheck_type();
+        if (checkType == 8 || checkType == 9) {
+            Long id = 26L;
+            if (checkType == 8) {
+                id = 26L;
+            }
+            if (checkType == 9) {
+                id = 27L;
+            }
+            //获取考核办法对应的考核项
+            List<String> itemName = commonService.getCheckItemName(id);
+
+            for (FwqCheckOther c : checkOtherList) {
+                if (!itemName.contains(c.getPcheckname())) {
+                    itemName.add(c.getPcheckname());
+                }
+            }
+
+            for (FeeStation station : saList) {
+                FwqCheckOtherStatistics fwqCheckOtherStatistics = new FwqCheckOtherStatistics();
+                fwqCheckOtherStatistics.setDeptid(station.getDeptid());
+                fwqCheckOtherStatistics.setDeptname(station.getName().replaceAll("服务区", ""));
+                fwqCheckOtherStatistics.setPdeptid(station.getParentid());
+                HashMap<String, Integer> s = new HashMap<>();
+                for (String i : itemName) {
+                    s.put(i, 0);
+                }
+                for (FwqCheckOther c : checkOtherList) {
+                    if (c.getDept_id().toString().equals(station.getDeptid())) {
+                        Integer i = s.get(c.getPcheckname());
+                        if (i == null) {
+                            i = 0;
+                        }
+//                        if (checkType == 2) {
+                        s.put(c.getPcheckname(), Integer.valueOf((int) (i + c.getCheck_score())));
+//                        } else {
+//                            if (c.getOrgan_name() == null || "".equals(c.getOrgan_name())) {
+//                                s.put(c.getPcheckname(), Integer.valueOf((int) (i + c.getCheck_score())));
+//                            } else {
+//                                s.put(c.getPcheckname(), i);
+//                            }
+//                        }
+                    }
+                }
+                fwqCheckOtherStatistics.setScoremap(s);
+                fwqCheckOtherStatisticses.add(fwqCheckOtherStatistics);
+            }
+
+            for (FeeStation a : rmList) {
+                List<FwqCheckOtherStatistics> s = new ArrayList<>();
+                for (FwqCheckOtherStatistics o : fwqCheckOtherStatisticses) {
+                    if (o.getPdeptid().equals(a.getDeptid())) {
+                        o.setPdeptname(a.getName());
+                        s.add(o);
+                    }
+                }
+                datas.put(a.getName().replaceAll("道管中心", ""), s);
+            }
+
+        }
+
+        return datas;
+    }
+
+    @Override
+    public void getExcel(FwqCheckOther fwqCheckOther, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
+        String title = fwqCheckOther.getCheck_time_name();
+        int checkType = fwqCheckOther.getCheck_type();
+        fwqCheckOther.setCheck_period(title);
+        if (checkType == 8 || checkType == 9) {
+            Map<String, Object> m = getCheckOtherStatistics(fwqCheckOther);
+            Map<String, Object> map = new HashMap<>();
+            map.put("datas", m);
+
+            if (checkType == 8) {
+                title += "月份服务区第三方暗访情况";
+            }
+            if (checkType == 9) {
+                title += "月份服务区现场检查情况";
+            }
+            map.put("title", title.replaceAll("/", "-"));
+
+            exportExcel(title.replaceAll("/", "-"), "fwq_other_check_info_anfang", map, httpServletResponse);
+        }
+    }
+
+    @Override
+    public void getOtherCheckExcel(FwqCheckOther fwqCheckOther, HttpServletRequest req, HttpServletResponse resp) {
+        List<FwqCheckOther> checkOtherList = (List<FwqCheckOther>) getAllCheckOther(fwqCheckOther);
+
+        Long id = 1L;
+        for (FwqCheckOther co : checkOtherList) {
+            co.setId(id++);
+            co.setCheck_time_name(DateUtil.DateFormatStr(co.getCheck_time()));
+        }
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("list", checkOtherList);
+        if (fwqCheckOther.getCheck_type() == 8) {
+            exportExcel("服务区第三方暗访稽查", "fwq_third_check", map, resp);
+        } else if (fwqCheckOther.getCheck_type() == 9) {
+            exportExcel("服务区现场稽查", "fwq_duty_check", map, resp);
+        }
+    }
+
+    private void exportExcel(String fileName, String excelTemplateName, Map<String, Object> map,
+                             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", map.get("list"));
+                // context.putVar("totalMan", map.get("totalMan"));
+                for (String key : map.keySet()) {
+                    context.putVar(key, map.get(key));
+                }
+                JxlsHelper.getInstance().processTemplate(is, os, context);
+            }
+            Thread.sleep(1000);
+            // path是指欲下载的文件的路径。
+            File file = new File(path);
+            // 取得文件名。
+            String filename = file.getName();
+            // 以流的形式下载文件。
+            InputStream bis = new BufferedInputStream(new FileInputStream(file));
+            byte[] buffer = new byte[bis.available()];
+            bis.read(buffer);
+            bis.close();
+            // 清空response
+            resp.reset();
+            // 设置response的Header
+            resp.addHeader("Content-Disposition",
+                    "attachment;filename=" + new String(filename.getBytes("gb2312"), "ISO8859-1"));
+            resp.addHeader("Content-Length", "" + file.length());
+            OutputStream toClient = new BufferedOutputStream(resp.getOutputStream());
+            resp.setContentType("application/vnd.ms-excel;charset=gb2312");
+            toClient.write(buffer);
+            toClient.flush();
+            toClient.close();
+            // 删除生成的临时文件
+            if (file.exists()) {
+                file.delete();
+            }
+
+        } catch (Exception e) {
+            logger.error(e.toString());
+        }
+    }
+}

BIN
Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_duty_check.xls


BIN
Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_other_check_info_anfang.xls


BIN
Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_third_check.xls


+ 0 - 18
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/service/CheckOtherService_F.java

@@ -2,8 +2,6 @@ package com.xintong.visualinspection.service;
 
 import com.xintong.visualinspection.bean.FwqCheckOther;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
 public interface CheckOtherService_F {
@@ -55,20 +53,4 @@ public interface CheckOtherService_F {
      */
     Map<String, Object> getCheckOtherStatistics(FwqCheckOther fwqOtherCheck);
 
-    /**
-     * 统计数据导出
-     *
-     * @param fwqOtherCheck
-     * @param req
-     * @param resp
-     */
-    void getExcel(FwqCheckOther fwqOtherCheck, HttpServletRequest req, HttpServletResponse resp);
-
-    /**
-     * 第三方暗访稽查导出excel
-     * @param fwqOtherCheck
-     * @param req
-     * @param resp
-     */
-    void getOtherCheckExcel(FwqCheckOther fwqOtherCheck, HttpServletRequest req, HttpServletResponse resp);
 }

+ 3 - 5
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/util/CacheUtil.java

@@ -95,14 +95,12 @@ public class CacheUtil {
 
     public static void refreshItemNameMap(ItemService itemService) {
         List<Long> list = new ArrayList<Long>();
-        list.add(21L);// 第三方暗访
-        list.add(22L);// 特情稽查
-        list.add(23L);// 现场检查
-        list.add(24L);// 数据平台应用
+        list.add(26L);// 第三方暗访
+        list.add(27L);// 现场检查
         for (Long id : list) {
             List<String> itemList = itemService.getCheckItemName(id);
             CacheUtil.itemNameMap.put(id, itemList);
-            logger.info("加载ruleId={},查询考核项信息成功,数据数:{}", id, CacheUtil.itemNameMap.size());
+            logger.info("加载ruleId={},查询服务区考核项信息成功,数据数:{}", id, CacheUtil.itemNameMap.size());
         }
     }