package com.minpay.common.service.impl; import com.minpay.common.constant.Constant; import com.minpay.common.service.IReport95598Service; import com.minpay.common.service.IReportService; import com.minpay.common.util.*; import com.minpay.db.table.mapper.*; import com.minpay.db.table.model.*; import com.minpay.db.table.own.mapper.ICommMapper; import com.minpay.db.table.own.mapper.IReportBatchMapper; import com.minpay.db.table.own.mapper.IZb95598ReportMapper; import com.minpay.db.table.own.mapper.ReportServiceMapper; import com.minpay.reportManage.action.r95598.Util95598zb; import com.startup.minpay.frame.business.MINHttpServletRequestContext; import com.startup.minpay.frame.exception.MINBusinessException; import com.startup.minpay.frame.jdbc.MINRowBounds; import com.startup.minpay.frame.service.base.IMINDataBaseService; 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.fileupload.FileItem; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.text.ParseException; import java.util.*; @MINComponent public class Report95598ServiceImpl implements IReport95598Service { @Override public Map reportNeedDetail(Map param) throws MINBusinessException { String range = (String)param.get("range"); String timeRange = (String)param.get("timeRange"); String reportTypeId = (String)param.get("reportTypeId"); MINHttpServletRequestContext request = (MINHttpServletRequestContext)param.get("request"); Map resMap = new HashMap(); if(Constant.REPORT_TYPE_20.equals(reportTypeId)){//95598日报 Map mm = new HashMap(); mm.put("range",range); mm.put("timeRange",timeRange); mm.put("reportTypeId",reportTypeId); Map resList = reportType95598Zb(mm, request); resMap.put("resList", resList); }else if(Constant.REPORT_TYPE_21.equals(reportTypeId)){//95598日汇报 Map mm = new HashMap(); mm.put("range",range); mm.put("timeRange",timeRange); mm.put("reportTypeId",reportTypeId); Map resList = reportType95598Zb(mm, request); resMap.put("resList", resList); }else if(Constant.REPORT_TYPE_22.equals(reportTypeId)){//95598周报 Map mm = new HashMap(); mm.put("range",range); mm.put("timeRange",timeRange); mm.put("reportTypeId",reportTypeId); Map resList = reportType95598Zb(mm, request); resMap.put("resList", resList); }else if(Constant.REPORT_TYPE_23.equals(reportTypeId)){//95598日汇报 Map mm = new HashMap(); mm.put("range",range); mm.put("timeRange",timeRange); mm.put("reportTypeId",reportTypeId); Map resList = reportType95598Zb(mm, request); resMap.put("resList", resList); } return resMap; } /** * 95598周报 * @param mm * @param request * @return */ private Map reportType95598Zb(Map mm, MINHttpServletRequestContext request) throws MINBusinessException { IMINDataBaseService db = Service.lookup(IMINDataBaseService.class); String range = StringUtil.ObjectToString(mm.get("range")); String timeRange = StringUtil.ObjectToString(mm.get("timeRange")); String start = StringUtil.getStartAndEndDatetime(range,timeRange,"1"); String end = StringUtil.getStartAndEndDatetime(range,timeRange,"2"); mm.put("start",start); mm.put("end",end); //单位别名翻译 List> unitMapp = db.getMybatisMapper(ICommMapper.class).selectUnitMapps(mm); mm.put("DICT_GCODE","95598GDLX"); //查询工单业务类型 List> gdMapp = db.getMybatisMapper(ICommMapper.class).selectGdType(mm); //95598业务受理情况 //单位维度数据 List> list = db.getMybatisMapper(IZb95598ReportMapper.class).selectBeforeIndex(mm); //分类明细汇总数据 List> list2 = db.getMybatisMapper(IZb95598ReportMapper.class).selectFltjYwsl(mm); Map temp = new HashMap<>(); Map temp2 = 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 rstMap = new HashMap<>(); rstMap.put("list1",list); for (int i = 0; i < list.size(); i++) { System.out.println(list.get(i).toString()); } return rstMap; } @Override public void init() throws MINBusinessException { } }