温红权 vor 8 Jahren
Ursprung
Commit
654ce08a35

+ 73 - 52
VisualInspection/js/other_check/other_check.js

@@ -747,60 +747,81 @@ function setCheckTypeSelect(div, selectId, codeFlag, hasAll) {
 
 
 
-function static(type) {
-    if (type == 1) {
-        var html = ' <table class="statable">' +
-            '            <thead style="font-size:  20px;text-align:  center;border:  0px;">' +
-            '                <tr>' +
-            '                    <td colspan="13" style="padding:  10px;border:  0px;">各站第三方暗访情况</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>' +
-            '                    <td>得分<br>(1000)</td>' +
-            '                    <td>服务<br>评价</td>' +
-            '                </tr>' +
-            '                <tr>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                    <td>1</td>' +
-            '                </tr>' +
-            '            </tbody>' +
-            '        </table>';
-
-        layer.open({
-            area: ["800px"],
-            type: 1,
-            title: '第三方暗访统计',
-            maxmin: true,
-            closeBtn: 1,
-            shadeClose: true,
-            skin: 'layui-layer-nobg', //没有背景色
-            resize: true,
-            content: "<div style='width:100%;height:100%;background: #fff;text-align: center;padding:10px'>   <button class=\"btn btn-info3\" type=\"button\" style=\"    position: absolute;right: 10px;top: 17px;\" onclick=\"exportThird()\"> 导出Excel</button>" + html + "</div>"
+function static() {
+    if (check_type == 1) {
+        var p = {
+            "check_type": check_type,
+            "check_period": $("#month_date").val()
+        };
+
+
+        post_common_service("/checkOther/getOtherCheckStatistics", p, function(data) {
+
+            var datas = '';
+            for (var key in data) {
+                for (var i in data[key]) {
+                    var d = data[key][i];
+                    datas += '<tr>';
+                    if (i == 0) {
+                        datas += '<td rowspan=' + data[key].length + '>' + key + "</td>";
+                    }
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td>' + data[key][i].deptname + "</td>";
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '<td></td>';
+                    datas += '</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;">各站第三方暗访情况</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>' +
+                '                    <td>得分<br>(1000)</td>' +
+                '                    <td>服务<br>评价</td>' +
+                '                </tr>' +
+                datas +
+                '            </tbody>' +
+                '        </table>';
+
+            layer.open({
+                area: ["800px", "500px"],
+                type: 1,
+                title: '第三方暗访统计',
+                maxmin: true,
+                closeBtn: 1,
+                shadeClose: true,
+                skin: 'layui-layer-nobg', //没有背景色
+                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=\"exportThird()\"> 导出Excel</button>" + html + "</div>"
+            });
         });
 
 
+
+
     }
 }

+ 1 - 1
VisualInspection/view/other_check/third_unannounced_check.html

@@ -33,7 +33,7 @@
             </div>
 
             <div class="col-xs-4" style="float:right;margin-right:30px;">
-                <button class="btn btn-info3" type="button" style="margin-right:30px;" onclick="static(1)">统计</button>
+                <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>
 

+ 3 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckOther.java

@@ -58,4 +58,7 @@ public class CheckOther {
     private Integer special_check_type;
     // 特情稽查类型名称
     private String special_check_type_name;
+
+
+    private String check_period;
 }

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

@@ -1,10 +1,12 @@
 package com.xintong.visualinspection.controller;
 
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 
+import com.xintong.visualinspection.pojo.OtherCheckStatistics;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -58,6 +60,16 @@ public class CheckOtherController extends BaseController {
     	checkOtherService.update(checkOther);
     	return super.returnSuccessResult("修改成功");
     }
+
+    @RequestMapping(value = "/getOtherCheckStatistics")
+    public String getOtherCheckStatistics(@RequestBody CheckOther checkOther){
+        Map<String,Object> checkStatistics = checkOtherService.getOtherCheckStatistics(checkOther.getCheck_period(),checkOther.getCheck_type());
+        return super.returnSuccessResult(checkStatistics);
+    }
+
+
+
+
 	/**根据id获取稽查记录
 	 * @param checkOther
 	 * @return
@@ -67,7 +79,7 @@ public class CheckOtherController extends BaseController {
     	CheckOther check =checkOtherService.getCheckById(checkOther.getId());
     	return super.returnSuccessResult(check);
     }
-	
+
 	/**根据dept_id 获取稽查记录
 	 * @param checkOther
 	 * @param page

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

@@ -0,0 +1,19 @@
+package com.xintong.visualinspection.pojo;
+
+import lombok.Data;
+
+import java.util.HashMap;
+
+/**
+ * 文件名:OtherCheckStatistics
+ * 版本信息:日期:2017/12/20 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class OtherCheckStatistics {
+    private String deptid;
+    private String pdeptid;
+    private String deptname;
+    private String pdeptname;
+    private HashMap<String,Integer> scoremap;
+
+}

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

@@ -1,12 +1,15 @@
 package com.xintong.visualinspection.service;
 
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.xintong.visualinspection.bean.CheckOther;
 import com.xintong.visualinspection.bean.StatisticsBean;
+import com.xintong.visualinspection.pojo.OtherCheckStatistics;
 
 public interface CheckOtherService {
 
@@ -40,4 +43,7 @@ public interface CheckOtherService {
 	 */
 	void update(CheckOther checkOther);
 
+
+	public Map<String,Object> getOtherCheckStatistics(String checktime, int checktype);
+
 }

+ 47 - 5
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckOtherServiceImpl.java

@@ -7,14 +7,15 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import javax.servlet.http.HttpServletRequest;
 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.pojo.OtherCheckStatistics;
 import org.jxls.common.Context;
 import org.jxls.util.JxlsHelper;
 import org.slf4j.LoggerFactory;
@@ -40,6 +41,10 @@ public class CheckOtherServiceImpl  extends BaseService implements CheckOtherSer
 
 	@Autowired
 	private CheckOtherDao checkOtherDao;
+    @Autowired
+    private DepartmentDao departmentDao;
+
+
 	@Override
 	public void insert(CheckOther checkOther) {
 		checkOtherDao.insert(checkOther);
@@ -140,5 +145,42 @@ public class CheckOtherServiceImpl  extends BaseService implements CheckOtherSer
 	public void update(CheckOther checkOther) {
 		checkOtherDao.update(checkOther);
 	}
-	
+
+    @Override
+    public Map<String,Object> getOtherCheckStatistics(String checktime, int checktype) {
+
+	    Map<String,Object> datas = new HashMap<>();
+
+        List<OtherCheckStatistics> otherCheckStatistics = new ArrayList<>();
+
+        List<FeeStation> liststation = departmentDao.getAllFS();
+        List<FeeStation> list = departmentDao.getAllRM();
+	    if(checktype==1){
+            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());
+                otherCheckStatistics.add(otherCheckStatistics1);
+            }
+
+            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);
+            }
+        }
+
+        return datas;
+    }
+
 }