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