ソースを参照

95598工单周报

张茂营 4 年 前
コミット
a209070c89

+ 143 - 31
src/main/java/com/minpay/common/service/impl/Report95598ServiceImpl.java

@@ -20,6 +20,7 @@ import com.startup.minpay.frame.service.base.Service;
 import com.startup.minpay.frame.target.MINComponent;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 
@@ -31,42 +32,34 @@ import java.util.*;
 
 @MINComponent
 public class Report95598ServiceImpl implements IReport95598Service {
-
+	private static final Map<String,String> MAP = new HashMap();
+	static {
+		MAP.put("370902000003","供电公司");
+		MAP.put("370902000004","其他");
+	}
 	@Override
 	public Map<String, Object> reportNeedDetail(Map<String, Object> param) throws MINBusinessException {
 		String range = (String)param.get("range");
+		String range2 = (String)param.get("range2");
 		String timeRange = (String)param.get("timeRange");
 		String reportTypeId = (String)param.get("reportTypeId");
-
 		MINHttpServletRequestContext request = (MINHttpServletRequestContext)param.get("request");
-
+		Map<String,Object> mm = new HashMap<String,Object>();
+		mm.put("range",range);
+		mm.put("range2",range2);
+		mm.put("timeRange",timeRange);
+		mm.put("reportTypeId",reportTypeId);
 		Map<String, Object> resMap = new HashMap<String, Object>();
 		if(Constant.REPORT_TYPE_20.equals(reportTypeId)){//95598日报
-			Map<String,Object> mm = new HashMap<String,Object>();
-			mm.put("range",range);
-			mm.put("timeRange",timeRange);
-			mm.put("reportTypeId",reportTypeId);
 			Map<String,Object> resList = reportType95598Zb(mm, request);
 			resMap.put("resList", resList);
 		}else if(Constant.REPORT_TYPE_21.equals(reportTypeId)){//95598日汇报
-			Map<String,Object> mm = new HashMap<String,Object>();
-			mm.put("range",range);
-			mm.put("timeRange",timeRange);
-			mm.put("reportTypeId",reportTypeId);
 			Map<String,Object> resList = reportType95598Zb(mm, request);
 			resMap.put("resList", resList);
 		}else if(Constant.REPORT_TYPE_22.equals(reportTypeId)){//95598周报
-			Map<String,Object> mm = new HashMap<String,Object>();
-			mm.put("range",range);
-			mm.put("timeRange",timeRange);
-			mm.put("reportTypeId",reportTypeId);
 			Map<String,Object> resList = reportType95598Zb(mm, request);
 			resMap.put("resList", resList);
-		}else if(Constant.REPORT_TYPE_23.equals(reportTypeId)){//95598日汇报
-			Map<String,Object> mm = new HashMap<String,Object>();
-			mm.put("range",range);
-			mm.put("timeRange",timeRange);
-			mm.put("reportTypeId",reportTypeId);
+		}else if(Constant.REPORT_TYPE_23.equals(reportTypeId)){//95598周汇报
 			Map<String,Object> resList = reportType95598Zb(mm, request);
 			resMap.put("resList", resList);
 		}
@@ -82,40 +75,159 @@ public class Report95598ServiceImpl implements IReport95598Service {
 	private Map<String, Object> reportType95598Zb(Map<String, Object> mm, MINHttpServletRequestContext request) throws MINBusinessException {
 		IMINDataBaseService db = Service.lookup(IMINDataBaseService.class);
 		String range = StringUtil.ObjectToString(mm.get("range"));
+		String range2 = StringUtil.ObjectToString(mm.get("range2"));
 		String timeRange = StringUtil.ObjectToString(mm.get("timeRange"));
+		//本周
 		String start = StringUtil.getStartAndEndDatetime(range,timeRange,"1");
 		String end = StringUtil.getStartAndEndDatetime(range,timeRange,"2");
+		//上周
+		String start2 = StringUtil.getStartAndEndDatetime(range2,timeRange,"1");
+		String end2 = StringUtil.getStartAndEndDatetime(range2,timeRange,"2");
+		//当年时间范围
+		Calendar calendar =  Calendar.getInstance();
+		Integer year = calendar.get(Calendar.YEAR);
+		String range3 = year + "-01-01~" + year + "-12-31";
+
+		String start3 = StringUtil.getStartAndEndDatetime(range3,timeRange,"1");
+		String end3 = StringUtil.getStartAndEndDatetime(range3,timeRange,"2");
 		mm.put("start",start);
 		mm.put("end",end);
+		mm.put("start2",start2);
+		mm.put("end2",end2);
+		mm.put("start3",start3);
+		mm.put("end3",end3);
 		//单位别名翻译
 		List<Map<String,String>> unitMapp = db.getMybatisMapper(ICommMapper.class).selectUnitMapps(mm);
-		mm.put("DICT_GCODE","95598GDLX");
 		//查询工单业务类型
+		mm.put("DICT_GCODE","95598GDLX");
 		List<Map<String,String>> gdMapp = db.getMybatisMapper(ICommMapper.class).selectGdType(mm);
-		//95598业务受理情况
+		//查询意见工单提及类型
+		mm.put("DICT_GCODE","95598TJLX");
+		List<Map<String,String>> gdMapp2 = db.getMybatisMapper(ICommMapper.class).selectGdType(mm);
+		//***********************************************95598业务受理情况********************************************//
 		//单位维度数据
 		List<Map<String,String>> list = db.getMybatisMapper(IZb95598ReportMapper.class).selectBeforeIndex(mm);
+		List<Map<String,String>> list22 = db.getMybatisMapper(IZb95598ReportMapper.class).selectBeforeIndex(mm);
+		List<Map<String,String>> indexList6 = db.getMybatisMapper(IZb95598ReportMapper.class).selectBeforeIndex(mm);
+
+//		List<Map<String,String>> list22 = new ArrayList<>();
+//		CollectionUtils.addAll(list22, new Object[list.size()]);
+//		Collections.copy(list22, list);
 		//分类明细汇总数据
 		List<Map<String,String>> list2 = db.getMybatisMapper(IZb95598ReportMapper.class).selectFltjYwsl(mm);
-		Map<String,String> temp = new HashMap<>();
-		Map<String,String> temp2 = new HashMap<>();
-
+		Map<String,String> temp;
+		Map<String,String> descMap1 = new HashMap<>();
+		//统计报表展示-受理情况
 		if(list != null){
 			for (int i = 0; i < list.size(); i++) {
 				temp = list.get(i);
 				Util95598zb.operateData(temp,list2,unitMapp,gdMapp);//按单位统计
 			}
-		}
-		if(list != null){
-			for (int i = 0; i < list.size(); i++) {
-				Util95598zb.operateDescData(temp2,list2,unitMapp,gdMapp);//按单位统计
+			Map<String,String> mapHjSlqk = new HashMap<>();
+			Map<String,String> mapHjSlqkTemp;
+			//追加合计行
+			for (int j = 0; j < list.size(); j++) {
+				mapHjSlqkTemp = list.get(j);
+				mapHjSlqk.put("ORZ_NAME","合计");
+				for (int i = 0; i < gdMapp.size(); i++) {
+					String key = gdMapp.get(i).get("DICT_CODE");
+					mapHjSlqk.put(key,ArithUtils.addToInt(mapHjSlqk.get(key),mapHjSlqkTemp.get(key)) + "");
+				}
+				mapHjSlqk.put("TOTAL",ArithUtils.addToInt(mapHjSlqk.get("TOTAL"),mapHjSlqkTemp.get("TOTAL")) + "");
+				mapHjSlqk.put("HS_NUM",ArithUtils.addToInt(mapHjSlqk.get("HS_NUM"),mapHjSlqkTemp.get("HS_NUM")) + "");
 			}
+			list.add(mapHjSlqk);
+			//描述信息-受理情况
+			Util95598zb.operateYwslDescData(descMap1,list,list2,unitMapp,gdMapp);//按单位统计
 		}
 		Map<String,Object> rstMap = new HashMap<>();
 		rstMap.put("list1",list);
-		for (int i = 0; i < list.size(); i++) {
-			System.out.println(list.get(i).toString());
+		rstMap.put("desc1",descMap1.get("desc1"));
+		//***********************************************投诉受理情况-暂无********************************************//
+
+		//***********************************************意见敏感督办情况********************************************//
+		List<Map<String,String>> yjgdList = db.getMybatisMapper(IZb95598ReportMapper.class).selectFltjYjgd(mm);
+		Map<String,String> temp3;
+		Map<String,String> descMap3 = new HashMap<>();
+
+		if(yjgdList != null){
+			for (int i = 0; i < list22.size(); i++) {
+				temp3 = list22.get(i);
+				Util95598zb.operateYjData(temp3,yjgdList,unitMapp,gdMapp2);//按单位统计
+			}
+			//追加合计行
+			Map<String,String> mapHjSlqk = new HashMap<>();
+			Map<String,String> mapHjSlqkTemp;
+			for (int j = 0; j < list22.size(); j++) {
+				mapHjSlqkTemp = list22.get(j);
+				mapHjSlqk.put("ORZ_NAME","合计");
+				for (int i = 0; i < gdMapp2.size(); i++) {
+					String key = gdMapp2.get(i).get("DICT_CODE");
+					if("A000105".equals(key)) {
+						mapHjSlqk.put("ND_"+key,ArithUtils.addToInt(mapHjSlqk.get("ND_"+key),mapHjSlqkTemp.get("ND_"+key)) + "");
+						mapHjSlqk.put("ZD_"+key,ArithUtils.addToInt(mapHjSlqk.get("ZD_"+key),mapHjSlqkTemp.get("ZD_"+key)) + "");
+						mapHjSlqk.put("SZD_"+key,ArithUtils.addToInt(mapHjSlqk.get("SZD_"+key),mapHjSlqkTemp.get("SZD_"+key)) + "");
+					}else{
+						mapHjSlqk.put("ND_"+key,ArithUtils.addToInt(mapHjSlqk.get("ND_"+key),mapHjSlqkTemp.get("ND_"+key)) + "");
+						mapHjSlqk.put("ZD_"+key,ArithUtils.addToInt(mapHjSlqk.get("ZD_"+key),mapHjSlqkTemp.get("ZD_"+key)) + "");
+					}
+				}
+				//追加户数统计
+				mapHjSlqk.put("HS_NUM",ArithUtils.addToInt(mapHjSlqk.get("HS_NUM"),mapHjSlqkTemp.get("HS_NUM")) + "");
+				//追加万户量统计
+				mapHjSlqk.put("WHSYJ",ArithUtils.div(ArithUtils.mul(mapHjSlqk.get("ND_A000105"),"1000"),mapHjSlqk.get("HS_NUM"))+"");
+			}
+			list22.add(mapHjSlqk);
+			//描述信息-受理情况
+			Util95598zb.operateYjDescData(descMap3,list22,null,unitMapp,gdMapp2);//按单位统计
+		}
+		rstMap.put("list3",list22);
+		rstMap.put("desc3",descMap3.get("desc3"));
+		//***********************************************12398受理情况-暂无********************************************//
+		//***********************************************客户常态走访情况-暂无********************************************//
+		//***********************************************95598业务处理满意度********************************************//
+		List<Map<String,String>> mydList = db.getMybatisMapper(IZb95598ReportMapper.class).selectMydgdk(mm);
+		Map<String,String> temp6;
+		Map<String,String> tempDesc6 = new HashMap<>();
+		String tempOrz = "";
+		if(mydList != null){
+			for (int i = 0; i < indexList6.size(); i++) {
+				temp6 = indexList6.get(i);
+				tempOrz = temp6.get("ORZ_ID");
+				if(MAP.containsKey(tempOrz)){
+					indexList6.remove(i);
+					i --;
+					continue;
+				}
+				Util95598zb.operateMydData(temp6,mydList,unitMapp,gdMapp);
+			}
+			//追加合计行
+			Map<String,String> mapHjMyd = new HashMap<>();
+			Map<String,String> mapHjMydTemp;
+			for (int j = 0; j < indexList6.size(); j++) {
+				mapHjMydTemp = indexList6.get(j);
+				mapHjMyd.put("ORZ_NAME","合计");
+				mapHjMyd.put("BDWHZ",ArithUtils.addToInt(mapHjMydTemp.get("BDWHZ"),mapHjMyd.get("BDWHZ"))+"");
+				mapHjMyd.put("CPGDS",ArithUtils.add(mapHjMydTemp.get("CPGDS"),mapHjMyd.get("CPGDS"))+"");
+				mapHjMyd.put("QXLZB",ArithUtils.add(mapHjMydTemp.get("QXMYS"),mapHjMyd.get("QXLZB")) + "");
+				mapHjMyd.put("FQXLZB",ArithUtils.add(StringUtil.ObjectToString(mapHjMydTemp.get("FQXLSL")),StringUtil.ObjectToString(mapHjMyd.get("FQXLSL"))) + "");
+				mapHjMyd.put("CPLHJ",ArithUtils.div(ArithUtils.mul(mapHjMyd.get("CPGDS"),"100"),mapHjMyd.get("BDWHZ")) + "%");
+				mapHjMyd.put("BDWBMYHZ",ArithUtils.add(StringUtil.ObjectToString(mapHjMydTemp.get("BDWBMYHZ")),StringUtil.ObjectToString(mapHjMyd.get("BDWBMYHZ"))) + "");
+
+				mapHjMyd.put("QXMYS",ArithUtils.add(StringUtil.ObjectToString(mapHjMydTemp.get("QXMYS")),StringUtil.ObjectToString(mapHjMyd.get("QXMYS"))) + "");
+				mapHjMyd.put("QXBMYS",ArithUtils.add(StringUtil.ObjectToString(mapHjMydTemp.get("QXBMYS")),StringUtil.ObjectToString(mapHjMyd.get("QXBMYS"))) + "");
+				mapHjMyd.put("FQXMYS",ArithUtils.add(StringUtil.ObjectToString(mapHjMydTemp.get("FQXMYS")),StringUtil.ObjectToString(mapHjMyd.get("FQXMYS"))) + "");
+				mapHjMyd.put("FQXBMYS",ArithUtils.add(StringUtil.ObjectToString(mapHjMydTemp.get("FQXBMYS")),StringUtil.ObjectToString(mapHjMyd.get("FQXBMYS"))) + "");
+
+				mapHjMyd.put("QXLMYD",ArithUtils.div(ArithUtils.mul(mapHjMyd.get("QXMYS"),100),ArithUtils.add(mapHjMyd.get("QXMYS"),mapHjMyd.get("QXBMYS")))+"");
+				mapHjMyd.put("FQXLMYD",ArithUtils.div(ArithUtils.mul(mapHjMyd.get("FQXMYS"),100),ArithUtils.add(mapHjMyd.get("QXMYS"),mapHjMyd.get("QXBMYS")))+"");
+				mapHjMyd.put("BDWBMYHZHJ",ArithUtils.div(ArithUtils.mul(ArithUtils.add(mapHjMyd.get("QXMYS"),mapHjMyd.get("FQXMYS")),100),mapHjMyd.get("CPGDS")) + "%");
+			}
+			indexList6.add(mapHjMyd);
+			//描述信息-满意度
+			Util95598zb.operateYjDescData(descMap3,list22,null,unitMapp,gdMapp2);//按单位统计
 		}
+		rstMap.put("list6",indexList6);
 		return rstMap;
 	}
 

+ 29 - 13
src/main/java/com/minpay/common/util/ArithUtils.java

@@ -36,7 +36,7 @@ public class ArithUtils {
         if("".equals(v2) || v2 == null){
             v2 = "0";
         }
-        return Integer.valueOf(v1.toString()) + Integer.valueOf(v2.toString());
+        return Integer.valueOf(StringUtil.ObjectToString(v1)) + Integer.valueOf(StringUtil.ObjectToString(v2));
     }
     /**
      * 减法
@@ -44,11 +44,17 @@ public class ArithUtils {
      * @param v2
      * @return
      */
-    public static float sub(String v1,String v2) {
-        BigDecimal b1 = new BigDecimal(v1);
-
-        BigDecimal b2 = new BigDecimal(v2);
-
+    public static float sub(Object v1,Object v2) {
+        if(v1 == null ){
+            v1 = 0;
+        }
+        if(v2 == null ){
+            v2 = 0;
+        }
+        String vv1 = StringUtil.ObjectToString(v1);
+        String vv2 =  StringUtil.ObjectToString(v2);
+        BigDecimal b1 = new BigDecimal(vv1);
+        BigDecimal b2 = new BigDecimal(vv2);
         return b1.subtract(b2).floatValue();
     }
     /**
@@ -57,9 +63,14 @@ public class ArithUtils {
      * @param v2
      * @return
      */
-    public static float mul(String v1,String v2){
-        BigDecimal b1 = new BigDecimal(v1);
-        BigDecimal b2 = new BigDecimal(v2);
+    public static float mul(Object v1,Object v2){
+        if(v1 == null || v2 == null){
+            return 0f;
+        }
+        String vv1 = StringUtil.ObjectToString(v1);
+        String vv2 = StringUtil.ObjectToString(v2);
+        BigDecimal b1 = new BigDecimal(vv1);
+        BigDecimal b2 = new BigDecimal(vv2);
         return b1.multiply(b2).floatValue();
     }
     /**
@@ -81,12 +92,14 @@ public class ArithUtils {
      * @param v2
      * @return
      */
-    public static float div(String v1,String v2){
-        if( "".equals(v1) ||"".equals(v2)){
+    public static float div(Object v1,Object v2){
+        if( v1 == null || v2 == null){
             return 0f;
         }
-        BigDecimal b1 = new BigDecimal(v1);
-        BigDecimal b2 = new BigDecimal(v2);
+        String v11 = StringUtil.ObjectToString(v1);
+        String v22 = StringUtil.ObjectToString(v2);
+        BigDecimal b1 = new BigDecimal(v11);
+        BigDecimal b2 = new BigDecimal(v22);
         BigDecimal b0 = new BigDecimal(0) ;//把 0 转为 BigDecimal
         if("".equals(b2) || b2.compareTo(b0) == 0 ){
             return 0f;
@@ -94,6 +107,9 @@ public class ArithUtils {
         return b1.divide(b2, DEF_DIV_SCALE, BigDecimal.ROUND_HALF_UP).floatValue();
     }
 
+    public static void main(String[] args) {
+        System.out.println(ArithUtils.div("12","232233"));
+    }
     /**
      * 获取0.9~1.1之间的随机数
      * @return

+ 63 - 6
src/main/java/com/minpay/common/util/StringUtil.java

@@ -6,8 +6,7 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.Map;
+import java.util.*;
 
 
 /**
@@ -227,9 +226,9 @@ public class StringUtil extends StringUtils {
     }
     /**
      * 时间计算
-     * @param range
-     * @param timeRange = 000000 - 235959
-     * @return
+     * @param range 2021-05-01 ~ 2021-05-30
+     * @param timeRange = 00:00:00 ~ 23:59:59
+     * @return 2021-05-01 00:00:00 ~ 2021-05-30 23:59:59
      */
     public static String getStartAndEndDatetime(Object range, Object timeRange,String type){
         String str1 =  StringUtil.ObjectToString(range);
@@ -241,9 +240,67 @@ public class StringUtil extends StringUtils {
         }
         return "";
     }
-
+    public static String dateCalculate(Object range,int days ,String type){
+        try {
+            String rangeTemp = StringUtil.ObjectToString(range).replaceAll(" ","");
+            Calendar calendar = Calendar.getInstance();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Date date = sdf.parse(rangeTemp);
+            calendar.setTime(date);
+            calendar.add(Calendar.DATE,days);
+            Integer year = calendar.get(Calendar.YEAR);
+            Integer month = calendar.get(Calendar.MONTH)+1; //第一个月从0开始,所以得到月份+1
+            Integer day = calendar.get(calendar.DAY_OF_MONTH);
+            return  year + "-" + (month > 10 ? month:("0"+month)) + "-" + (day>= 10 ? day:("0" + day));//数据日期
+        }catch (Exception e){
+            return "";
+        }
+    }
+    public static String getTopMsg(List<Map<String,String>> list,String key,String key2,int max){
+        StringBuffer rstStr = new StringBuffer();
+        if(list == null || list.size() <= 0){
+            return "";
+        }
+        if(max < list.size()){
+            Map<String,String> map;
+            Map<String,String> map2;
+            for (int i = 0; i < list.size() - 1; i++) {
+                for (int j = 0; j < list.size() - i - 1 ; j++) {
+                    map = list.get(j);
+                    map2 = list.get(j+1);
+                    int num = StringUtil.ObjToInt(map.get(key));
+                    int num2 =  StringUtil.ObjToInt(map2.get(key));
+                    if(num > num2){
+                        list.set(j,map2);
+                        list.set(j+1,map);
+                    }
+                }
+            }
+        }else{
+            max = list.size();
+        }
+        for (int i = list.size() - max; i < list.size(); i++) {
+            if(i == (list.size() - 1)){
+                rstStr.append(list.get(i).get(key2).split("_")[1]);
+            }else{
+                rstStr.append(list.get(i).get(key2).split("_")[1]).append("、");
+            }
+        }
+        return rstStr.toString();
+    }
     public static void main(String[] args) {
         String a = "2021-2-25 10:43:11";
         String b = "2021-2-25 10:57:00";
     }
+
+    public static String replaceAll(String fontRedLabel, String key, Object value) {
+        try {
+            if(fontRedLabel != null){
+                return fontRedLabel.replaceAll(key,StringUtil.ObjectToString(value));
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return "";
+    }
 }

+ 14 - 0
src/main/java/com/minpay/db/table/own/mapper/IZb95598ReportMapper.java

@@ -18,4 +18,18 @@ public interface IZb95598ReportMapper extends IMINMybatisMapper {
      * @return
      */
     List<Map<String, String>> selectFltjYwsl(Map<String, Object> mm);
+
+    /**
+     * 分类统计-意见工单
+     * @param mm
+     * @return
+     */
+    List<Map<String, String>> selectFltjYjgd(Map<String, Object> mm);
+
+    /**
+     * 业务处理满意度
+     * @param mm
+     * @return
+     */
+    List<Map<String, String>> selectMydgdk(Map<String, Object> mm);
 }

+ 268 - 13
src/main/java/com/minpay/reportManage/action/r95598/Util95598zb.java

@@ -3,6 +3,7 @@ package com.minpay.reportManage.action.r95598;
 import com.minpay.common.util.ArithUtils;
 import com.minpay.common.util.StringUtil;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -11,9 +12,13 @@ import java.util.Map;
  * 95598工单周报工具类
  */
 public class Util95598zb {
+    public static final String FONT_RED_LABEL = "<font color='red'>value</font>";
+    public static final String YWLX_QXL = "故障报修";
+    public static final String[] MYD_MY = new String[]{"非常满意","满意"};
+    public static final String[] MYD_BMY = new String[]{"非常不满意","不满意","一般"};
 
     /**
-     * 统计某单位下数据
+     * 受理情况统计
      * @param temp      维度数据
      * @param list2     明细汇总数据
      * @param unitMapp  单位名称映射关系表
@@ -21,44 +26,294 @@ public class Util95598zb {
      */
     public static void operateData(Map<String, String> temp, List<Map<String, String>> list2, List<Map<String, String>> unitMapp, List<Map<String, String>> gdMapp) {
         String unitName = temp.get("ORZ_NAME");
-        Map<String,String> tempList = new HashMap<>();
+        Map<String,String> tempList;
         int sum = 0;
         for (int j = 0; j < gdMapp.size(); j++) {
             for (int i = 0; i < list2.size(); i++) {
-                Map<String,String> tempRank = new HashMap<>();
                 tempList = list2.get(i);
                 if(unitName.equals(getUnitName(tempList.get("DFD33_GDDW"),unitMapp))){
                     if(gdMapp.get(j).get("DICT_CNAME").equals(tempList.get("DFD33_YWLX"))){//业务类型相同
                         sum = StringUtil.ObjToInt(tempList.get("COU2"));
-                        temp.put(gdMapp.get(j).get("DICT_CODE"), tempList.get("COU1"));
+                        temp.put(gdMapp.get(j).get("DICT_CODE"), ArithUtils.addToInt(temp.get(gdMapp.get(j).get("DICT_CODE")),tempList.get("COU1")) + "");
                     }
                 }
             }
         }
         temp.put("TOTAL",sum + "");
     }
-
     private static String getUnitName(String gddw, List<Map<String, String>> unitMapp) {
         for (int i = 0; i < unitMapp.size(); i++) {
-            if(gddw.equals(unitMapp.get(i).get("SUB_NAME"))){
+            if(gddw != null && gddw.equals(unitMapp.get(i).get("SUB_NAME"))){
                 return unitMapp.get(i).get("MAIN_NAME");
             }
         }
         return "其他";
     }
 
-    public static void operateDescData(Map<String, String> temp, List<Map<String, String>> list2, List<Map<String, String>> unitMapp, List<Map<String, String>> gdMapp) {
-        Map<String,String> tempList = new HashMap<>();
-        int sum = 0;
-        for (int j = 0; j < gdMapp.size(); j++) {
+    /**
+     * 受理情况描述
+     * @param rstMap
+     * @param list
+     * @param list2
+     * @param unitMapp
+     * @param gdMapp
+     */
+    public static void operateYwslDescData(Map<String, String> rstMap, List<Map<String, String>> list, List<Map<String, String>> list2, List<Map<String, String>> unitMapp, List<Map<String, String>> gdMapp) {
+        Map<String,String> temp = new HashMap<>();
+        Map<String,String> tempList;
+        int sum3 = 0;
+        //各类型数据汇总
+        for (int j = 0; j < gdMapp.size(); j++) {//业务类型
+            String code = gdMapp.get(j).get("DICT_CODE");
+//
+            Map<String,String> tempZlhz = new HashMap<>();//业务子类分类汇总
+            String key = "";
+            int sum = 0;//本周各服务类型总数
+            int sum2 = 0;//上周各服务类型总数
             for (int i = 0; i < list2.size(); i++) {
-                Map<String,String> tempRank = new HashMap<>();
                 tempList = list2.get(i);
                 if(gdMapp.get(j).get("DICT_CNAME").equals(tempList.get("DFD33_YWLX"))){//业务类型相同
-                    sum = StringUtil.ObjToInt(tempList.get("COU2"));
-                    temp.put(gdMapp.get(j).get("DICT_CODE"), tempList.get("COU1"));
+                    sum = ArithUtils.addToInt(sum,tempList.get("COU1"));
+                    sum2 = StringUtil.ObjToInt(tempList.get("COU4"));
+                    key = gdMapp.get(j).get("DICT_CNAME")+"_"+tempList.get("DFD33_YWZL");
+                    //获取各服务前三
+                    tempZlhz.put(key,ArithUtils.addToInt(tempZlhz.get(key),tempList.get("COU1")) + "");
+                }
+            }
+            sum3 += sum;
+            temp.put(code+"_TOTAL",sum + "");
+            temp.put(code+"_TOTAL2",sum2 + "");
+            temp.put("sum3",sum3 + "");
+            String mainType = "";
+
+            List<Map<String, String>> ywzl = new ArrayList<>();
+            for (Map.Entry<String, String> entry : tempZlhz.entrySet()) {
+                Map<String,String> temp2 = new HashMap<>();
+                temp2.put("key",entry.getKey());
+                temp2.put("value",entry.getValue());
+                ywzl.add(temp2);
+            }
+            mainType = StringUtil.getTopMsg(ywzl,"value","key",3);
+            if(!"".equals(mainType)){
+                temp.put(code+"_DESC",mainType);
+            }else{
+                temp.put(code+"_DESC","");
+            }
+        }
+        StringBuffer desc = new StringBuffer();
+        desc.append("本周受理95598客户诉求").append(temp.get("sum3")).append("件。");
+        desc.append("其中");
+        Map<String,String> tempGdlx;
+        String code = "",value="";
+        //计算占比-环比-各类型主要内容
+        for (int i = 0; i < gdMapp.size(); i++) {
+            tempGdlx = gdMapp.get(i);
+            code = tempGdlx.get("DICT_CODE");
+            value = tempGdlx.get("DICT_CNAME");
+            float  perc = ArithUtils.div(temp.get(code+"_TOTAL"),temp.get("sum3")) * 100;
+            int hb = Integer.parseInt(temp.get(code+"_TOTAL") )- Integer.parseInt(temp.get(code+"_TOTAL2"));
+            desc.append(value).append(temp.get(code+"_TOTAL"))
+                    .append("件,")
+                    .append("占比").append(perc).append("%,")
+                    .append("环比").append(hb >= 0 ? "增加"+hb : "减少"+hb).append("件,");
+            if(!"".equals(temp.get(code+"_DESC"))){
+                desc.append("主要为").append(temp.get(code+"_DESC")).append("等。");
+            }
+        }
+
+        //计算主要单位
+        float max = 0f,min = 0f,total = 0f;
+        String maxDw = "",minDw = "";
+        Map<String,String> temp3;
+        for (int i = 0; i < list.size(); i++) {
+            temp3 = list.get(i);
+            if("0".equals(temp3.get("HS_NUM")) || StringUtil.isEmpty(temp3.get("HS_NUM"))){
+                continue;
+            }
+            total = ArithUtils.div(ArithUtils.mul(temp3.get("TOTAL"),"10000"),temp3.get("HS_NUM"));
+            temp3.put("WHS",total + "");
+            if(i  == 0){
+                max = min =  total * 100;
+            }
+            if( total > max){
+                max = total;
+                maxDw = temp3.get("ORZ_NAME") + "、";
+            } else if (total == max){
+                maxDw  += temp3.get("ORZ_NAME") + "、";
+            }
+            if(total < min){
+                min = total;
+                minDw = temp3.get("ORZ_NAME") + "、";
+            }else if(total == min){
+                minDw += temp3.get("ORZ_NAME") + "、";
+            }
+        }
+        if(!"".equals(maxDw)){
+            maxDw = maxDw.substring(0,maxDw.lastIndexOf("、"));
+        }
+        if(!"".equals(minDw)){
+            minDw = minDw.substring(0,minDw.lastIndexOf("、"));
+        }
+        desc.append("万户工单数较多的为").append(maxDw).append(",").append("较少的为").append(minDw).append("。");
+        rstMap.put("desc1",desc.toString());
+
+    }
+
+    /**
+     *
+     * @param temp      维度数据
+     * @param list2     明细数据
+     * @param unitMapp  单位对着
+     * @param gdMapp2   提级类型
+     */
+    public static void operateYjData(Map<String, String> temp, List<Map<String, String>> list2, List<Map<String, String>> unitMapp, List<Map<String, String>> gdMapp2) {
+        String unitName = temp.get("ORZ_NAME");
+        Map<String,String> tempList;
+        String indexCode = "";
+        for (int j = 0; j < gdMapp2.size(); j++) {//指标维度
+            indexCode = gdMapp2.get(j).get("DICT_CODE");
+            for (int i = 0; i < list2.size(); i++) {
+                tempList = list2.get(i);
+                if(unitName.equals(getUnitName(tempList.get("DFD18_GDDW"),unitMapp))){//单位相同
+                    if("A000105".equals(indexCode)){
+                        temp.put("ND_"+indexCode, tempList.get("COUBNHZ"));
+                        temp.put("ZD_"+indexCode, tempList.get("COUBZHZ"));
+                        temp.put("SZD_"+indexCode, tempList.get("COUSZHZ"));
+                    }else{
+                        if(gdMapp2.get(j).get("DICT_CNAME").equals(tempList.get("DFD18_TJLX"))) {//提级类型相同
+                            temp.put("ND_" + indexCode, tempList.get("COUN"));
+                            temp.put("ZD_" + indexCode, tempList.get("COUZ"));
+                        }
+                    }
+                }
+            }
+        }
+        temp.put("WHSYJ",ArithUtils.div(ArithUtils.mul(temp.get("ND_A000105"),"1000"),temp.get("HS_NUM"))+"");
+    }
+
+    /**
+     *
+     * @param rstMap 返回值Map
+     * @param list22    明细数据
+     * @param yjgdList
+     * @param unitMapp
+     * @param gdMapp2
+     */
+    public static void operateYjDescData(Map<String, String> rstMap, List<Map<String, String>> list22,
+                                         List<Map<String, String>> yjgdList, List<Map<String, String>> unitMapp,
+                                         List<Map<String, String>> gdMapp2) {
+        StringBuffer desc = new StringBuffer();
+        StringBuffer desc2 = new StringBuffer();
+        Map<String,String> temp;
+        int total = 0, szTotal = 0;//最大值,本周工单数,上周工单数,总数
+        float bzgds = 0f,szgds = 0f,max = 0f;
+        String orzName = "";
+        if(list22 != null){
+            for (int i = 0; i < list22.size(); i++) {
+                temp = list22.get(i);
+                bzgds = ArithUtils.div(ArithUtils.mul(temp.get("ZD_A000105"),10000),temp.get("HS_NUM"));
+                szgds = ArithUtils.div(ArithUtils.mul(temp.get("SZD_A000105"),10000),temp.get("HS_NUM"));
+                if("合计".equals(temp.get("ORZ_NAME"))){
+                    total = StringUtil.ObjToInt(temp.get("ZD_A000105"));
+                    szTotal =  StringUtil.ObjToInt(temp.get("SZD_A000105"));
+                    for (int j = 0; j < gdMapp2.size(); j++) {
+                        if("A000105".equals(temp.get(gdMapp2.get(j).get("DICT_CODE")))){
+                            continue;
+                        }
+                        desc2.append(gdMapp2.get(j).get("DICT_CNAME")+"工单")
+                                .append(StringUtil.replaceAll(FONT_RED_LABEL,"value",temp.get("ZD_" + gdMapp2.get(j).get("DICT_CODE"))))
+                                .append("件,");
+                    }
+                }else{
+                   if(i == 0){
+                       orzName = temp.get("ORZ_NAME");
+                       max = bzgds - szgds;
+                   }
+                    if( (bzgds - szgds)  > max){
+                        orzName = temp.get("ORZ_NAME");
+                        max = (bzgds - szgds);
+                    }
+                }
+            }
+        }
+
+        desc.append("本周,受理意见工单")
+        .append(StringUtil.replaceAll(FONT_RED_LABEL,"value",total))
+        .append("件,")
+        .append("环比")
+        .append(total - szTotal >= 0 ?"增加"+StringUtil.replaceAll(FONT_RED_LABEL,"value",total - szTotal)+"件,":"减少"+StringUtil.replaceAll(FONT_RED_LABEL,"value",szTotal - total)+"件,")
+        .append("其中")
+        .append(StringUtil.replaceAll(FONT_RED_LABEL,"value",orzName)).append("万户意见工单数增幅较大,较上周")
+        .append(max >= 0 ?"增加"+StringUtil.replaceAll(FONT_RED_LABEL,"value",max)
+                +"件。":"减少"+StringUtil.replaceAll(FONT_RED_LABEL,"value",max)+"件。")
+        .append(desc2);
+        rstMap.put("desc3",desc.toString());
+    }
+
+    /**
+     *
+     * @param temp6         indexMap
+     * @param mydList       明细
+     * @param unitMapp      单位翻译
+     * @param gdMapp        indexMap
+     */
+    public static void operateMydData(Map<String, String> temp6, List<Map<String, String>> mydList,
+                                      List<Map<String, String>> unitMapp, List<Map<String, String>> gdMapp) {
+        String unitName = temp6.get("ORZ_NAME");
+        Map<String,String> tempList;
+        String ywlx = "",myd = "";
+        Map<String,String> otherUnitName = new HashMap<>();
+        for (int i = 0; i < mydList.size(); i++) {
+            tempList = mydList.get(i);
+            if(unitName.equals(getUnitName(tempList.get("DFD20_DWXZ"),unitMapp))){//单位相同
+                temp6.put("BDWHZ",tempList.get("COU2"));//本单位归档工单数
+                temp6.put("CPGDS",ArithUtils.sub(tempList.get("COU2") ,tempList.get("COU3")) + "");//参评数=各单位汇总-不评价数
+                temp6.put("BDWBMYHZ",tempList.get("COU4"));//不满意
+                ywlx = tempList.get("DFD20_YWLX");
+                myd = tempList.get("DFD20_CLMYD");
+                if(YWLX_QXL.equals(ywlx)){//抢修类
+                    temp6.put("QXLSL",ArithUtils.addToInt(temp6.get("QXLSL"),tempList.get("COU1"))+"");
+                    if("1".equals(isMy(myd))){//满意
+                        temp6.put("QXMYS",ArithUtils.addToInt(temp6.get("QXMYS"),tempList.get("COU1")) + "");
+                    }else if("2".equals(isMy(myd))){//不满意
+                        temp6.put("QXBMYS",ArithUtils.addToInt(temp6.get("QXBMYS"),tempList.get("COU1")) + "");
+                    }
+                }else{
+                    temp6.put("FQXLSL",ArithUtils.addToInt(temp6.get("FQXLSL"),tempList.get("COU1")) +" ");
+                    if("1".equals(isMy(myd))){//满意
+                        temp6.put("FQXMYS",ArithUtils.addToInt(temp6.get("FQXMYS"),tempList.get("COU1")) + "");
+                    }else if("2".equals(isMy(myd))){//不满意
+                        temp6.put("FQXBMYS",ArithUtils.addToInt(temp6.get("FQXBMYS"),tempList.get("COU1")) + "");
+                    }
+                }
+            }
+        }
+        temp6.put("QXLZB",(ArithUtils.div(ArithUtils.mul(temp6.get("QXLSL"),100),temp6.get("BDWHZ"))) + "%");//抢修类占比
+        temp6.put("FQXLZB",(ArithUtils.div(ArithUtils.mul(temp6.get("FQXLSL"),100),temp6.get("BDWHZ"))  ) + "%");//非抢修类占比
+        temp6.put("CPLHJ",(ArithUtils.div(ArithUtils.mul(temp6.get("CPGDS"),100),temp6.get("BDWHZ"))  ) + "%");//参评率
+
+        temp6.put("BDWBMYHZHJ",ArithUtils.div(ArithUtils.mul(ArithUtils.addToInt(temp6.get("QXMYS"),temp6.get("FQXMYS")),100),temp6.get("CPGDS")) + "%");//满意度合计(抢修类+非抢修类)
+
+        temp6.put("QXLMYD",(ArithUtils.div(ArithUtils.mul(temp6.get("QXMYS"),100),ArithUtils.addToInt(temp6.get("QXMYS"),temp6.get("QXBMYS"))) ) + "%");//抢修满意度占比
+        temp6.put("FQXLMYD",(ArithUtils.div(ArithUtils.mul(temp6.get("FQXMYS"),100),ArithUtils.addToInt(temp6.get("FQXMYS"),temp6.get("FQXBMYS"))) ) + "%");//非抢修满意度占比
+
+    }
+
+    private static String isMy(String myd) {
+        if(myd == null || "".equals(myd)){
+            return "3";
+        }else{
+            for (int i = 0; i < MYD_MY.length; i++) {
+                if(myd.equals(MYD_MY[i])){
+                    return "1";
+                }
+            }
+            for (int i = 0; i < MYD_BMY.length; i++) {
+                if(myd.equals(MYD_BMY[i])){
+                    return "2";
                 }
             }
         }
+        return "3";
     }
 }

+ 13 - 5
src/main/java/com/minpay/reportManage/action/r95598/Zb95598ReportAction.java

@@ -7,6 +7,7 @@ import com.minpay.common.service.IReport95598Service;
 import com.minpay.common.service.IReportService;
 import com.minpay.common.util.DateUtil;
 import com.minpay.common.util.ExportUtils;
+import com.minpay.common.util.StringUtil;
 import com.minpay.db.table.mapper.DwReportInfMapper;
 import com.minpay.db.table.model.DwReportInf;
 import com.minpay.db.table.own.mapper.IReportBatchMapper;
@@ -62,6 +63,7 @@ public class Zb95598ReportAction implements IMINAction {
             @MINParam(key = "reportInf") String reportInf,
             @MINParam(key = "fileName") String fileName,
             @MINParam(key = "range") String range,
+            @MINParam(key = "range2") String range2,
             @MINParam(key = "timeRange") String timeRange,
             MINSession session
     ) throws MINBusinessException {
@@ -90,6 +92,7 @@ public class Zb95598ReportAction implements IMINAction {
     @MINAction(value = REPORT_NEED_DATA_DETAIL)
     public MINActionResult reportNeedDataDetail(
             @MINParam(key = "range") String range,
+            @MINParam(key = "range2") String range2,
             @MINParam(key = "timeRange") String timeRange,
             @MINParam(key = "reportInf") String reportInf
     ) throws MINBusinessException,
@@ -99,6 +102,7 @@ public class Zb95598ReportAction implements IMINAction {
         String reportTypeId = reportInf.split("_")[0];
         Map<String, Object> param = new HashMap<String, Object>();
         param.put("range", range);
+        param.put("range2", range2);
         param.put("timeRange", timeRange);
         param.put("reportTypeId", reportTypeId);
         Map<String, Object> resMap = Service.lookup(IReport95598Service.class).reportNeedDetail(param);
@@ -118,7 +122,7 @@ public class Zb95598ReportAction implements IMINAction {
         Map<String, Object> param = new HashMap<String, Object>();
         param.put("reportId", reportId);
         param.put("reportTypeId",reportType);
-        if("XLGZZRB".equals(reportType)){
+        if("N95598RB".equals(reportType) || "N95598RHB".equals(reportType)){
             param.put("timeType","00");
         }else{
             param.put("timeType","01");
@@ -126,14 +130,18 @@ public class Zb95598ReportAction implements IMINAction {
         String fileName = "";
         List<Map<String,String>> list = db.getMybatisMapper(IReportBatchMapper.class).selectReportInfo(param);
         if(list != null && !list.isEmpty()){
-            param.put("range",list.get(0).get("DAYINTERVAL")) ;
+            String dayinterval = list.get(0).get("DAYINTERVAL");
+            param.put("range",dayinterval) ;
+            param.put("range2", StringUtil.dateCalculate(dayinterval.split("~")[0],-7,"1")
+                    +"~"+StringUtil.dateCalculate(dayinterval.split("~")[1],-7,"1"));
             param.put("timeRange",list.get(0).get("TIMEINTERVAL"));
             fileName = list.get(0).get("FILENAME");
         }else{
-            param.put("range","19000101-19000101") ;
-            param.put("timeRange","000000-235959");
+            param.put("range","1900-01-01~1900-01-01") ;
+            param.put("range2","1900-01-01~1900-01-01") ;
+            param.put("timeRange","00:00:00~23:59:59");
         }
-        Map<String, Object> resMap = Service.lookup(IReportService.class).reportNeedDetail(param);
+        Map<String, Object> resMap = Service.lookup(IReport95598Service.class).reportNeedDetail(param);
         resMap.put("fileName",fileName);
         res.set(IMINBusinessConstant.F_PAGING_LAY, resMap);
         return res;

+ 92 - 2
src/main/resources/com/minpay/db/table/own/mapper/IZb95598ReportMapper.xml

@@ -4,6 +4,7 @@
 	<!--维度-->
 	<select id="selectBeforeIndex" parameterType="map" resultType="map">
 		SELECT
+			A.ORZ_ID,
 			A.ORZ_NAME,
 			A.ORZ_SHORT_NAME,
 			A.ORZ_SORT,
@@ -24,7 +25,8 @@
 			A.DFD33_YWZL,
 			A.COU COU1,
 			B.COU COU2,
-			C.MAIN_NAME
+			C.MAIN_NAME,
+			D.COU COU3
 		FROM
 			(SELECT DFD33_GDDW, DFD33_YWLX,DFD33_YWZL, COUNT(1) COU FROM DW_FILE_DETAIL_33
 			WHERE 1=1
@@ -35,8 +37,53 @@
 			<include refid="sqlWhere"></include>
 			GROUP BY DFD33_GDDW ) B ON A.DFD33_GDDW = B.DFD33_GDDW
 			LEFT JOIN (SELECT MAIN_CODE,MAIN_NAME,SUB_NAME FROM PUB_BASE_ORZNAMES_MAPP) C ON  C.SUB_NAME = A.DFD33_GDDW
+		LEFT JOIN ( SELECT DFD33_YWLX, COUNT( 1 ) COU FROM DW_FILE_DETAIL_33 WHERE 1 = 1
+			<include refid="sqlWhere2"></include>
+		GROUP BY DFD33_YWLX ) D ON A.DFD33_YWLX = D.DFD33_YWLX
 		ORDER BY
-			A.DFD33_GDDW
+			A.DFD33_GDDW,A.DFD33_YWLX,A.COU DESC
+	</select>
+	<select id="selectFltjYjgd" parameterType="map" resultType="map">
+	SELECT
+		A.DFD18_GDDW,
+		A.DFD18_TJLX,
+		A.COU COUN,
+		B.COU COUZ,
+		C.COU COUBNHZ,
+		D.COU COUSZHZ,
+		E.COU COUBZHZ
+		FROM
+	( SELECT DFD18_GDDW, DFD18_TJLX, count( 1 ) COU FROM dw_file_detail_18 WHERE 1=1
+	<include refid="sqlWhere5"/>  GROUP BY DFD18_GDDW, DFD18_TJLX ) A
+	LEFT JOIN ( SELECT DFD18_GDDW, DFD18_TJLX, count( 1 ) COU FROM dw_file_detail_18 WHERE 1=1
+	<include refid="sqlWhere3"/>  GROUP BY DFD18_GDDW, DFD18_TJLX ) B ON A.DFD18_GDDW = B.DFD18_GDDW
+	LEFT JOIN ( SELECT DFD18_GDDW, count( 1 ) COU FROM dw_file_detail_18 WHERE 1=1
+	<include refid="sqlWhere5"/>  AND DFD18_YWLX = '意见' GROUP BY DFD18_GDDW ) C ON A.DFD18_GDDW = C.DFD18_GDDW
+	LEFT JOIN ( SELECT DFD18_GDDW, count( 1 ) COU FROM dw_file_detail_18 WHERE 1=1
+	<include refid="sqlWhere4"/>  AND DFD18_YWLX = '意见' GROUP BY DFD18_GDDW ) D ON A.DFD18_GDDW = D.DFD18_GDDW
+	LEFT JOIN ( SELECT DFD18_GDDW, count( 1 ) COU FROM dw_file_detail_18 WHERE 1=1
+	<include refid="sqlWhere3"/>  AND DFD18_YWLX = '意见' GROUP BY DFD18_GDDW ) E ON A.DFD18_GDDW = E.DFD18_GDDW
+	</select>
+	<select id="selectMydgdk" parameterType="map" resultType="map">
+		SELECT
+		A.DFD20_DWXZ,A.DFD20_YWLX,A.DFD20_CLMYD,A.COU COU1,B.COU COU2,C.COU COU3,D.COU COU4
+		FROM
+		(SELECT DFD20_DWXZ, DFD20_YWLX, DFD20_CLMYD, COUNT( 1 ) COU
+		FROM DW_FILE_DETAIL_20 WHERE 1 = 1 <include refid="sqlWhere6"></include>
+		GROUP BY DFD20_DWXZ, DFD20_YWLX, DFD20_CLMYD ) A
+		LEFT JOIN (
+		SELECT DFD20_DWXZ, COUNT( 1 ) COU FROM DW_FILE_DETAIL_20 WHERE 1 = 1 <include refid="sqlWhere6"></include>
+		GROUP BY DFD20_DWXZ ) B ON A.DFD20_DWXZ = B.DFD20_DWXZ
+		LEFT JOIN (
+		SELECT DFD20_DWXZ, COUNT( 1 ) COU FROM DW_FILE_DETAIL_20 WHERE 1 = 1
+		<include refid="sqlWhere6"></include> AND  IFNULL(DFD20_CLMYD,'') IN ( '不评价', '',null)
+		GROUP BY DFD20_DWXZ
+		) C ON A.DFD20_DWXZ = C.DFD20_DWXZ
+		LEFT JOIN (
+		SELECT DFD20_DWXZ, COUNT( 1 ) COU FROM DW_FILE_DETAIL_20 WHERE 1 = 1
+		<include refid="sqlWhere6"></include> AND  IFNULL(DFD20_CLMYD,'') IN ( '非常不满意', '不满意','一般')
+		GROUP BY DFD20_DWXZ
+		) D ON A.DFD20_DWXZ = D.DFD20_DWXZ
 	</select>
 	<sql id="sqlWhere">
 		<if test="start != null and start != ''">
@@ -45,6 +92,49 @@
 		<if test="end != null and end != ''">
 			AND DFD33_SLSJ &lt;= #{end}
 		</if>
+	</sql>
+	<sql id="sqlWhere2">
+		<if test="start2 != null and start2 != ''">
+			AND DFD33_SLSJ &gt;= #{start2}
+		</if>
+		<if test="end != null and end != ''">
+			AND DFD33_SLSJ &lt;= #{end2}
+		</if>
+	</sql>
+	<!--本周时间范围-->
+	<sql id="sqlWhere3">
+		<if test="start != null and start != ''">
+			AND DFD18_SLSJ &gt;= #{start}
+		</if>
+		<if test="end != null and end != ''">
+			AND DFD18_SLSJ &lt;= #{end}
+		</if>
+	</sql>
+	<!--上周时间范围-->
+	<sql id="sqlWhere4">
+		<if test="start2 != null and start2 != ''">
+			AND DFD18_SLSJ &gt;= #{start2}
+		</if>
+		<if test="end2 != null and end2 != ''">
+			AND DFD18_SLSJ &lt;= #{end2}
+		</if>
+	</sql>
+	<!--本年时间-->
+	<sql id="sqlWhere5">
+		<if test="start3 != null and start3 != ''">
+			AND DFD18_SLSJ &gt;= #{start3}
+		</if>
+		<if test="end3 != null and end3 != ''">
+			AND DFD18_SLSJ &lt;= #{end3}
+		</if>
+	</sql>
 
+	<sql id="sqlWhere6">
+		<if test="start != null and start != ''">
+			AND DFD20_SLSJ &gt;= #{start}
+		</if>
+		<if test="end != null and end != ''">
+			AND DFD20_SLSJ &lt;= #{end}
+		</if>
 	</sql>
 </mapper>

+ 1 - 2
src/main/webapp/admin/95598/zb/report95598Zb.html

@@ -159,8 +159,7 @@
 
 	function showDetail(data){
 		var openPageId = pageId + "-02";
-		openMainTabPage(openPageId, "详情查看",
-				"xlgzz/reportManageDetailXlgzz.html?pageId="+openPageId+"&reportId="
+		openMainTabPage(openPageId, "详情查看", "95598/zb/reportDetail95598.html?pageId="+openPageId+"&reportId="
 				+data.id+"&type="+data.type+"&typeId="+data.typeId
 				+"&fileName="+chineseUrlEncode(data.fileName)+"&reportType="+reportType, '', pageId, null);
 	}

+ 7 - 3
src/main/webapp/admin/95598/zb/report95598zbProduce.html

@@ -292,11 +292,13 @@
 				} else {//周报
 					range = dateRange;
 				}
-
+				var rangs = range.replaceAll(" ","").split("~");
+				range2 = getThisWeekDate({nowdate:rangs[0]},-7,2)+"~"+getThisWeekDate({nowdate:rangs[1]},-7,2);
 				$.request({
 					action : 'Zb95598ReportAction/fileInfReportSubmit',
 					data : {
 						range : range,//日报时间
+						range2:range2,
 						timeRange : timeRange,//日报时间
 						reportInf : reportInf,//报表名称
 						timeType: timeType,//报告类型
@@ -364,13 +366,16 @@
 			} else {
 				range = dateRange;
 			}
+			var rangs = range.replaceAll(" ","").split("~");
+			range2 = getThisWeekDate({nowdate:rangs[0]},-7,2)+"~"+getThisWeekDate({nowdate:rangs[1]},-7,2);
 			// 查询符合条件的明细数据,生成预览数据
 			$.request({
 				action : 'Zb95598ReportAction/reportNeedDataDetail',
 				data : {
 					range : range,//日报时间-日期
 					timeRange : timeRange,//日报时间-时间点
-					reportInf : reportInf,//报表名称
+					range2: range2,
+					reportInf : reportInf//报表名称
 				},
 				success : function(data) {
 					if (data.code == 0) {//查询结果集成功
@@ -382,7 +387,6 @@
 							$("#gongjubiao").hide();
 
 						}
-						console.log(data)
 						$table.render({
 							elem: '#demo1'
 							,limit:100

+ 188 - 0
src/main/webapp/admin/95598/zb/reportDetail95598.html

@@ -0,0 +1,188 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+	<meta charset="utf-8">
+	<title>95598周报详情</title>
+	<script src="../../../js/min-loader-next2.js"></script>
+	<script src="../../../js/customcomm.js"></script>
+	<style>
+		.desc_label {
+			font-size: 2rem;
+			line-height: 3rem;
+		}
+	</style>
+</head>
+<body class="content">
+<div style = "width: 100%; margin-left : 0px;" class = "layui-upload-drag" >
+	<p id = "fileName" contenteditable="true">国网泰安供电公司2020年8月份配网运行分析月报</p>
+	<div class="layui-tab" lay-filter="demo"  style="min-height: 400px;">
+		<ul class="layui-tab-title">
+			<li class="layui-this" lay-id="11">95598业务受理情况</li>
+			<li lay-id="11x">投诉受理情况</li>
+			<li lay-id="22">意见敏感督办情况</li>
+			<li lay-id="22">12398受理情况</li>
+			<li lay-id="33">客户常态走访情况</li>
+			<li lay-id="33">95598业务处理满意度</li>
+		</ul>
+		<div class="layui-tab-content">
+			<!--95598业务受理情况-->
+			<div class="layui-tab-item layui-show">
+				<p id ="desc1" class="desc_label"></p>
+				<br>
+				<table id="demo1" lay-filter="test"></table>
+			</div>
+			<!--投诉受理情况-->
+			<div class="layui-tab-item">
+				<p id ="desc2"  class="desc_label"></p>
+				<table id="demo2" lay-filter="test"></table>
+			</div>
+			<!--意见敏感督办情况-->
+			<div class="layui-tab-item">
+				<p id ="desc3"  class="desc_label"></p>
+				<table id="demo3" lay-filter="test"></table>
+			</div>
+			<!--12398受理情况-->
+			<div class="layui-tab-item">
+				<p  id ="desc4"  class="desc_label"></p>
+				<table id="demo4" lay-filter="test"></table>
+			</div>
+			<!--客户常态走访情况-->
+			<div class="layui-tab-item">
+                <p  id ="desc5"  class="desc_label"></p>
+                <table id="demo5" lay-filter="test"></table>
+            </div>
+			<!--95598业务处理满意度(归档口径)-->
+			<div class="layui-tab-item">
+				<p  id ="desc6"  class="desc_label"></p>
+				<table id="demo6" lay-filter="test"></table>
+			</div>
+		</div>
+	</div>
+</div>
+<script>
+	$(function(){
+		var pageId = getQueryString("pageId");
+		var reportId = getQueryString("reportId");		//报告id---100000150
+		var fileName = chineseUrlDecodeURI(getQueryString("fileName"));	//报告名称
+		var type = getQueryString("type");				//报告类型00:excel 01:word
+		var typeId = getQueryString("typeId");			//报告类型id XLGZZRB
+		var reportType = getQueryString("reportType");	//报告类型 XLGZZRB
+		var $element,$table;
+		$("#fileName").text(fileName);
+		layui.use(['element','table'], function(){
+			$element= layui.element;
+			$table = layui.table;
+			tableYulan();
+		});
+
+		// 预览
+		function tableYulan() {
+			// 查询符合条件的明细数据,生成预览数据
+			$.request({
+				action : 'Zb95598ReportAction/reportNeedDataDetail2',
+				data : {
+					reportId : reportId,
+					reportType:reportType//日报 or  周报
+				},
+				success : function(data) {
+					if (data.code == 0) {//查询结果集成功
+						// $element.tabDelete('demo', '22');
+						//渲染表格
+						$table.render({
+							elem: '#demo1'
+							,limit:100
+							,cols: [
+									[ //表头
+										{field: 'ORZ_NAME',title:'单位',width:150,rowspan:2}
+										,{field: 'TOTAL', title: '工单数',rowspan:2}
+										,{field: 'WHS', title: '万户工单数',width:150,rowspan:2}
+										,{field: '', title: '其中',colspan:8}
+									],
+									[
+										{field: 'A000001', title: '投诉'}
+										,{field: 'A000002', title: '举报'}
+										,{field: 'A000003', title: '意见'}
+										,{field: 'A000004', title: '建议'}
+										,{field: 'A000005', title: '表扬'}
+										,{field: 'A000006', title: '咨询'}
+										,{field: 'A000008', title: '故障报修'}
+										,{field: 'A000007', title: '服务申请'}
+									]
+							],
+							data:data.data.resList.list1
+						});
+						$table.render({
+							elem: '#demo3'
+							,limit:100
+							,cols: [
+								[ //表头
+									{field: 'ORZ_NAME',title:'单位',width:150,rowspan:2}
+									,{field: '', title: '年度累计情况',colspan:6}
+									,{field: '', title: '本周受理情况',colspan:5}
+								],
+								[
+									{field: 'WHSYJ', title: '万户量'}
+									,{field: 'ND_A000105', title: '意见工单数'}
+									,{field: 'ND_A000101', title: '预警'}
+									,{field: 'ND_A000102', title: '督办'}
+									,{field: 'ND_A000103', title: '重复督办'}
+									,{field: 'ND_A000104', title: '督办(预警升级)'}
+
+									,{field: 'ZD_A000105', title: '意见工单数'}
+									,{field: 'ZD_A000101', title: '预警'}
+									,{field: 'ZD_A000102', title: '督办'}
+									,{field: 'ZD_A000103', title: '重复督办'}
+									,{field: 'ZD_A000104', title: '督办(预警升级)'}
+								]
+							],
+							data:data.data.resList.list3
+						});
+						$table.render({
+							elem: '#demo6'
+							,limit:100
+							,cols: [
+								[ //表头
+									{field: 'ORZ_NAME',title:'单位',width:150,rowspan:2}
+									,{field: '', title: '工单参评率',colspan:5}
+									,{field: '', title: '回访满意率',colspan:4}
+
+								],
+								[
+									{field: 'BDWHZ', title: '归档工单数'}
+									,{field: 'CPGDS', title: '参评工单数'}
+									,{field: 'QXLZB', title: '抢修类'}
+									,{field: 'FQXLZB', title: '非抢类'}
+									,{field: 'CPLHJ', title: '合计'}
+
+									,{field: 'BDWBMYHZ', title: '不满意工单数'}
+									,{field: 'QXLMYD', title: '抢修类'}
+									,{field: 'FQXLMYD', title: '非抢类'}
+									,{field: 'BDWBMYHZHJ', title: '合计'}
+								]
+							],
+							data:data.data.resList.list6
+						});
+						$("#desc1").html("&nbsp;&nbsp;&nbsp;"+data.data.resList.desc1)
+						$("#desc2").html("&nbsp;&nbsp;&nbsp;本周,受理95598客户投诉X件,为YYYY投诉。\n" +
+								"截至A月B日,A月受理投诉C件,万户投诉数全省排名第D。全年累计受理投诉E件,万户投诉数F,全省排名第G。")
+						$("#desc3").html("&nbsp;&nbsp;&nbsp;"+data.data.resList.desc3);
+
+						$("#desc4").html("&nbsp;&nbsp;&nbsp;本周未受理12398能监办投诉举报事项转办工单。");
+						$("#desc5").html("&nbsp;&nbsp;&nbsp;本周各单位共走访客户X户,其中政府部门Y户、重点项目及重要客户A户、普通高压户B户、低压客户C户。共收集网上国网、供电设施位置等意见D条,均已及时答复处理。");
+
+					} else {
+						$.ErrorAlert(res.MINErrorMessage);
+					}
+				},
+				error : function(data2) {
+					$.ErrorAlert(data2.MINErrorMessage);
+				}
+			});
+		}
+	})
+
+</script>
+</body>
+
+</html>

+ 1 - 1
src/main/webapp/admin/xlgzz/reportManageDetailXlgzz.html

@@ -7,7 +7,7 @@
     <script src="../../js/min-loader-next.js"></script>
     <script src="../../js/customcomm.js"></script>
     <style>
-        .desc_label{
+        .desc_label {
             font-size: 2rem;
             line-height: 3rem;
         }

+ 13 - 4
src/main/webapp/js/commutils.js

@@ -15,11 +15,12 @@ function Trim(str,is_global) {
 }
 
 /**
- * 获取起始日期一周时间范围
+ * 获取起始日期一周时间范围-当前日期+7天
  * @param obj
  * @returns {string}
  */
-function getThisWeekDate(obj){
+function getThisWeekDate(obj,days,type){
+    debugger
     if(!obj){
         return "";
     }
@@ -44,8 +45,16 @@ function getThisWeekDate(obj){
         var temp = year + "-" + month + "-" + day;
         if(Trim(nowdate,"g") == Trim(temp,"g")){
             var myDate = new Date(nowdate);
-            myDate.setDate(myDate.getDate() + 7);
-            return nowdate + "~" + myDate.getFullYear()+"-" + (myDate.getMonth()+1)+"-" + myDate.getDate()
+            myDate.setDate(myDate.getDate() + days);
+            if(type == 1){
+                if(days > 0){
+                    return nowdate + "~" + myDate.getFullYear()+"-" + (myDate.getMonth()+1)+"-" + myDate.getDate()
+                }else{
+                    return myDate.getFullYear()+"-" + (myDate.getMonth()+1)+"-" + myDate.getDate()+ "~" + nowdate
+                }
+            }else{
+                return myDate.getFullYear()+"-" + (myDate.getMonth()+1)+"-" + myDate.getDate()
+            }
         }else{
             return nowdate + "日期不合法";
         }