package cn.ksource.web.controller.uc; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import cn.ksource.beans.AUDITING_SATIS_INFO; import cn.ksource.beans.SC_PARTNER_CUSTOMER_INFO; import cn.ksource.core.page.PageInfo; import cn.ksource.core.util.ConvertUtil; import cn.ksource.core.util.DateUtil; import cn.ksource.core.util.JsonUtil; import cn.ksource.core.util.ParamsMapUtil; import cn.ksource.core.util.StringUtil; import cn.ksource.core.web.WebUtil; import cn.ksource.web.facade.uc.satis.UcSatisFacade; import cn.ksource.web.service.file.FileService; /** * 用户中心--满意度管理 控制器 * */ @Controller @RequestMapping("/uc/ucsatis") public class UcSatisController { @Resource(name="ucSatisFacade") private UcSatisFacade ucSatisFacade; @Autowired private FileService fileService; /** * 满意度服务台首页 * @param model * @param request * @param response * @return */ @RequestMapping(value="ucSatisfactionManageIndex.html") public String ucSatisfactionManageIndex(Model model,HttpServletRequest request){ return "/uc/satis/ucSatisfactionManageIndex"; } /** * 满意度服务台首页明细加载 * @param model * @param request * @param response * @return */ @RequestMapping(value="ucSatisfactionManageIndexLoad.html") public String satisfactionManageIndexLoad(Model model,HttpServletRequest request,HttpServletResponse response){ Map params = ParamsMapUtil.getParameterMap(request); params.put("cusId", WebUtil.getWebLoginUserCusId(request)); Map info = ucSatisFacade.getCurMonthSatisSurvey(params); model.addAttribute("info", info); return "/uc/satis/ucSatisfactionManageIndexLoad"; } /** * 查询最近一年满意度混合图 * @param request * @param response */ @RequestMapping(value="getSatisfactionMixChart.html") public void getSatisfactionMixChart(HttpServletRequest request,HttpServletResponse response){ Map info = ucSatisFacade.getLastYearSatisfactionMix(request); WebUtil.write(response, JsonUtil.map2Json(info)); } /** * 查询最近一年满意度级别分析 * @param request * @param response */ @RequestMapping(value="getSatisfactionCoverageChart.html") public void getSatisfactionCoverageChart(HttpServletRequest request,HttpServletResponse response){ Map info = ucSatisFacade.getLastYearSatisfactionCoverage(request); WebUtil.write(response, JsonUtil.map2Json(info)); } /** * 跳转到响应支持类满意度调查列表页面 * @param request * */ @RequestMapping(value = "ucincisatisList.html",method=RequestMethod.GET) public ModelAndView incisatisList(HttpServletRequest request,HttpServletResponse response){ ModelAndView view = new ModelAndView("/uc/satis/ucincisatisList"); String customer_id = WebUtil.getWebLoginUserCusId(request); Map msgMap = ucSatisFacade.gettjmsg(customer_id,"1"); view.addObject("msg", msgMap); view.addObject("customer_id", customer_id); return view; } /** * 获取统计数据 */ @RequestMapping(value="ucgettjmsg.html",method=RequestMethod.POST) public void gettjmsg(HttpServletRequest request,HttpServletResponse response) { String customer_id = request.getParameter("customer_id"); String type = request.getParameter("type"); Map msg = ucSatisFacade.gettjmsg(customer_id,type); WebUtil.write(response, JsonUtil.map2Json(msg)); } /** * 查询响应支持类满意度调查列表 */ @RequestMapping(value="ucincisatisData.html",method=RequestMethod.POST) public ModelAndView incisatisData(HttpServletRequest request,PageInfo pageInfo) { ModelAndView modelAndView = new ModelAndView("/uc/satis/ucincisatisData"); Map params = ParamsMapUtil.getParameterMap(request); PageInfo orderList = ucSatisFacade.queryIncisatisData(params,pageInfo); modelAndView.addObject("orderList", orderList); return modelAndView; } /** * 查询响应支持类满意度调查总数量 */ @RequestMapping(value="ucincisatiscount.html",method=RequestMethod.POST) public void incidentsatiscount(HttpServletRequest request,HttpServletResponse response) { Map params = ParamsMapUtil.getParameterMap(request); int count = ucSatisFacade.queryIncisatisCount(params); WebUtil.write(response, String.valueOf(count)); } /** * 响应支持类满意度调查报表模板 */ @RequestMapping(value="ucorderreportview.html",method=RequestMethod.GET) public ModelAndView reporttemplate(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/ucorderreportview"); Map list = ucSatisFacade.querysatisitemData("1",""); modelAndView.addObject("orderitem", list); return modelAndView; } /** * 响应支持类满意度调查报表详情 */ @RequestMapping(value="ucordersatisDetail.html",method=RequestMethod.GET) public ModelAndView ordersatisDetail(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/ucordersatisDetail"); String busId = request.getParameter("busId"); //type等于1为响应支持类满意度调查,2为预防性维护类调查 String type = request.getParameter("type"); Map report = ucSatisFacade.getReportDetail(busId,type); modelAndView.addObject("customerMap", report.get("customerMap")); modelAndView.addObject("orderitem", report); modelAndView.addObject("busId", busId); String printName = "响应支持类满意度调查表"; modelAndView.addObject("printName", printName); return modelAndView; } /** * 响应支持类满意度调查电子报表(影印版) */ @RequestMapping(value="ucorderImage.html",method=RequestMethod.GET) public ModelAndView orderImage(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/ucorderImage"); String busId = request.getParameter("busId"); String file_path = ucSatisFacade.getImageMsg(busId); modelAndView.addObject("file_path", file_path); return modelAndView; } /** * 跳转到驻场满意度调查列表页面 * @param request * */ @RequestMapping(value = "uczcsatisList.html",method=RequestMethod.GET) public ModelAndView zcsatisList(HttpServletRequest request,HttpServletResponse response){ ModelAndView view = new ModelAndView("/uc/satis/uczcsatisList"); view.addObject("shenpi", "1"); String customer_id = WebUtil.getWebLoginUserCusId(request); Map msgMap = ucSatisFacade.gettjmsg(customer_id,"3"); view.addObject("msg", msgMap); view.addObject("customer_id", customer_id); return view; } /** * 查询驻场满意度调查列表 */ @RequestMapping(value="uczcsatisData.html",method=RequestMethod.POST) public ModelAndView zcsatisData(HttpServletRequest request,PageInfo pageInfo) { ModelAndView modelAndView = new ModelAndView("/uc/satis/uczcsatisData"); //定义参数Map Map params = ParamsMapUtil.getParameterMap(request); params.put("userId", WebUtil.getWebLoginUserId(request)); PageInfo list = ucSatisFacade.queryZcsatisData(pageInfo,params); modelAndView.addObject("zclist", list); modelAndView.addObject("ismy", params.get("ismy")); modelAndView.addObject("shenpi", params.get("shenpi")); return modelAndView; } /** * 查询驻场满意度调查总数量 */ @RequestMapping(value="uczcsatiscount.html",method=RequestMethod.POST) public void qcount(HttpServletRequest request,HttpServletResponse response) { //定义参数Map Map params = ParamsMapUtil.getParameterMap(request); params.put("userId", WebUtil.getWebLoginUserId(request)); int count = ucSatisFacade.queryZcsatisCount(params); WebUtil.write(response, String.valueOf(count)); } /** * 驻场服务监督卡报表详情 */ @RequestMapping(value="uczcsatisDetail.html",method=RequestMethod.GET) public ModelAndView zcsatisDetail(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/uczcsatisDetail"); String busId = request.getParameter("busId"); Map report = ucSatisFacade.getZcReportDetail(busId); modelAndView.addObject("customerMap", new AUDITING_SATIS_INFO(busId).getBeanMapById()); modelAndView.addObject("zcitem", report); modelAndView.addObject("busId", busId); return modelAndView; } /** * 驻场服务监督卡报表模板 */ @RequestMapping(value="uczcreportview.html",method=RequestMethod.GET) public ModelAndView zcreportview(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/uczcreportview"); Map list = ucSatisFacade.querysatisitemData("3",""); modelAndView.addObject("zcitem", list); return modelAndView; } /** * 驻场服务监督卡影印 */ @RequestMapping(value="uczcImage.html",method=RequestMethod.GET) public ModelAndView zcImage(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/uczcImage"); String busId = request.getParameter("busId"); List fileList = fileService.getFileList(busId); String path=""; if(fileList.size() > 0){ path = ConvertUtil.obj2Str(fileList.get(0).get("FILE_PATH")); } modelAndView.addObject("file_path", path); return modelAndView; } /** * 月度服务电子报表 */ @RequestMapping(value="ucmonthsatisreport.html",method=RequestMethod.GET) public ModelAndView monthsatisreport(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/ucmonthsatisreport"); //定义参数Map Map params = ParamsMapUtil.getParameterMap(request); params.put("customer_id", WebUtil.getWebLoginUserCusId(request)); Map report = ucSatisFacade.getMonthSatisReport(params); if(!StringUtil.isEmpty(ConvertUtil.obj2StrBlank(report.get("CUSTOMER_ID")))){ SC_PARTNER_CUSTOMER_INFO customer = new SC_PARTNER_CUSTOMER_INFO(ConvertUtil.obj2StrBlank(report.get("CUSTOMER_ID"))).getInstanceById(); report.put("CUSTOMER_NAME", customer.getCustomer_name()); } modelAndView.addObject("report", report); modelAndView.addObject("detail", report.get("detail")); String beginMonth = request.getParameter("begin_month"); String endMonth = request.getParameter("end_month"); if(!StringUtil.notEmpty(beginMonth)) { beginMonth = DateUtil.getCurrentDate6().toString(); } if(!StringUtil.notEmpty(endMonth)) { endMonth = DateUtil.getCurrentDate6().toString(); } if(beginMonth.equals(endMonth)) { modelAndView.addObject("type", "1"); } modelAndView.addObject("beginMonth", beginMonth); modelAndView.addObject("endMonth", endMonth); return modelAndView; } /** * 月度服务电子报表 */ @RequestMapping("ucmonthsatisreportData.html") public ModelAndView monthsatisreportData(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/ucmonthsatisreportData"); //定义参数Map Map params = ParamsMapUtil.getParameterMap(request); params.put("customer_id", WebUtil.getWebLoginUserCusId(request)); Map report = ucSatisFacade.getMonthSatisReport(params); if(!StringUtil.isEmpty(ConvertUtil.obj2StrBlank(report.get("CUSTOMER_ID")))){ SC_PARTNER_CUSTOMER_INFO customer = new SC_PARTNER_CUSTOMER_INFO(ConvertUtil.obj2StrBlank(report.get("CUSTOMER_ID"))).getInstanceById(); report.put("CUSTOMER_NAME", customer.getCustomer_name()); } modelAndView.addObject("report", report); modelAndView.addObject("detail", report.get("detail")); String beginMonth = request.getParameter("begin_month"); String endMonth = request.getParameter("end_month"); if(!StringUtil.notEmpty(beginMonth)) { beginMonth = DateUtil.getCurrentDate6().toString(); } if(!StringUtil.notEmpty(endMonth)) { endMonth = DateUtil.getCurrentDate6().toString(); } if(beginMonth.equals(endMonth)) { modelAndView.addObject("type", "1"); } modelAndView.addObject("beginMonth", beginMonth); modelAndView.addObject("endMonth", endMonth); return modelAndView; } /** * 总体满意度电子报表 */ @RequestMapping(value="uctotalmonthsatisreport.html",method=RequestMethod.GET) public ModelAndView totalmonthsatisreport(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/uctotalmonthsatisreport"); String nowMonth = DateUtil.getCurrentDate6().toString(); modelAndView.addObject("nowmonth", nowMonth); return modelAndView; } /** * 总体满意度电子报表 */ @RequestMapping("uctotalmonthReport.html") public ModelAndView totalmonthReport(HttpServletRequest request) { ModelAndView modelAndView = new ModelAndView("/uc/satis/uctotalmonthReport"); String beginMonth = request.getParameter("begin_month"); String endMonth = request.getParameter("end_month"); if(!StringUtil.notEmpty(beginMonth)) { beginMonth = DateUtil.getCurrentDate6().toString(); } if(!StringUtil.notEmpty(endMonth)) { endMonth = DateUtil.getCurrentDate6().toString(); } //定义参数Map Map params = ParamsMapUtil.getParameterMap(request); params.put("customerId", WebUtil.getWebLoginUserCusId(request)); List report = ucSatisFacade.getTotalMonthSatisReport(params); if(beginMonth.equals(endMonth)) { modelAndView.addObject("type", "1"); } modelAndView.addObject("beginMonth", beginMonth); modelAndView.addObject("endMonth", endMonth); modelAndView.addObject("report", report); return modelAndView; } }