cy
2022-06-22 6e06bba1c89f8077e29d0fbf0ce12f89f027d8d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
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<String,String> 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<String, String> 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<String, String> 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<String,String> 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<String,String> 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<Map> 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<String,String> 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<String,String> 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<String,String> params = ParamsMapUtil.getParameterMap(request);
        params.put("customerId", WebUtil.getWebLoginUserCusId(request));
        List<Map> 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;
    }
}