cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
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.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.SC_WORKFLOW_CI_REMIND;
import cn.ksource.core.page.PageInfo;
import cn.ksource.core.util.ParamsMapUtil;
import cn.ksource.core.util.StringUtil;
import cn.ksource.core.web.WebUtil;
import cn.ksource.web.facade.uc.order.UcCiRemindFacade;
import cn.ksource.web.service.file.FileService;
import cn.ksource.web.service.workFlowSupport.WorkFlowSupportService;
/**
 * 用户中心--例行维护管理控制器
 * @note:
 * @version
 * @author sxj
 * @date July 18, 2016 10:35:44 AM
 */
@Controller
@RequestMapping("/uc/ucciremind")
public class UcCiRemindController {
    
    @Resource(name="ucCiRemindFacade")
    private UcCiRemindFacade ucCiRemindFacade;
    
    @Resource
    private WorkFlowSupportService workFlowSupportService;
    
    @Resource
    private FileService fileService;
    
    /**
     * 所有例行维保页面
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value="ucremindList.html", method=RequestMethod.GET)
    public ModelAndView incidentList(HttpServletRequest request, HttpServletResponse response) {
        ModelAndView view = new ModelAndView("/uc/ciremind/ucremindList");
        return view;
    }
    
    /**
     * 查询例行维保工单列表
     */
    @RequestMapping(value="ucremindData.html",method=RequestMethod.POST)
    public ModelAndView qdata(HttpServletRequest request,PageInfo pageInfo) {
        ModelAndView modelAndView = new ModelAndView("/uc/ciremind/ucremindData");
        Map<String,String> params = ParamsMapUtil.getParameterMap(request);
        String cusId = WebUtil.getWebLoginUserCusId(request);
        params.put("cusId", cusId);
        PageInfo list = ucCiRemindFacade.queryRemindOrderList(pageInfo,params);
        modelAndView.addObject("orders", list);
        return modelAndView;
    }
    
    /**
     * 查询例行维保工单总数量
     */
    @RequestMapping(value="ucremindCount.html",method=RequestMethod.POST)
    public void qcount(HttpServletRequest request,HttpServletResponse response) {
        Map<String,String> params = ParamsMapUtil.getParameterMap(request);
        String cusId = WebUtil.getWebLoginUserCusId(request);
        params.put("cusId", cusId);
        int count = ucCiRemindFacade.queryRemindOrderCount(params);
        WebUtil.write(response, String.valueOf(count));
    }
    
    /**
     * 详情页面
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value="ucciRemindDetail.html",method=RequestMethod.GET)
    public ModelAndView ciRemindDetail(HttpServletRequest request, HttpServletResponse response){
        ModelAndView view = new ModelAndView("/uc/ciremind/ucciRemindDetail");
        String orderId = request.getParameter("orderId");
        String flowId = request.getParameter("flowId");
        SC_WORKFLOW_CI_REMIND remind = new SC_WORKFLOW_CI_REMIND(orderId).getInstanceById();
        if(!StringUtil.notEmpty(flowId)) {
            flowId = remind.getFlow_id();
        }
        Map orderFlowInfo = workFlowSupportService.getOrderFlowInfo(flowId);
        return view.addObject("orderId",orderId)
                .addObject("orderFlowInfo",orderFlowInfo)
                .addObject("flowId",flowId)
                .addObject("remind",remind);
    }
    
    /**
     * 信息
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value="ucremindReadInfo.html",method=RequestMethod.GET)
    public ModelAndView remindReadInfo(HttpServletRequest request, HttpServletResponse response){
        ModelAndView view = new ModelAndView("/uc/ciremind/ucremindReadInfo");
        String orderId = request.getParameter("orderId");
        List<Map> ciList =  ucCiRemindFacade.getRemindCiList(orderId);
        SC_WORKFLOW_CI_REMIND info = new SC_WORKFLOW_CI_REMIND(orderId).getInstanceById();
        return view.addObject("orderId",orderId)
                .addObject("info",info)
                .addObject("ciList",ciList);
    }
    
    /**
     * 例行维护服务报告
     * @param request
     * @return
     */
    @RequestMapping("ucremindItemInfo.html")
    public ModelAndView remindItemInfo(HttpServletRequest request){
        ModelAndView view = new ModelAndView("/uc/ciremind/ucremindItemInfo");
        String flowId = request.getParameter("flowId");
        Map map=ucCiRemindFacade.getRemindeItem(flowId);
        view.addObject("remindMap", map.get("remindMap"));
        view.addObject("dealerMap", map.get("dealerMap"));
        view.addObject("detailCount", map.get("detailCount"));
        view.addObject("detailStateCount", map.get("detailStateCount"));
        view.addObject("fileList", map.get("fileList"));
        view.addObject("orderList", map.get("orderList"));
        view.addObject("node", map.get("node"));
        return view;
    }
    
    /**
     *工程师巡检信息
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value="ucremindPatrolInfo.html",method=RequestMethod.GET)
    public String remindPatrolInfo(Model model,HttpServletRequest request, HttpServletResponse response) {
        String patrolId = request.getParameter("patrolId");
        Map info = ucCiRemindFacade.getPatrolInfo(patrolId);
        List fileList = fileService.getFileList(patrolId);
        model.addAttribute("info", info);
        model.addAttribute("fileList", fileList);
        return "/uc/ciremind/ucremindPatrolInfo";
    }
    
    /**
     * 例行维护执行记录
     * @param request
     * @return
     */
    @RequestMapping("ucremindRecord.html")
    public ModelAndView remindRecord(HttpServletRequest request){
        ModelAndView view = new ModelAndView("/uc/ciremind/ucremindRecord");
        String orderId = request.getParameter("orderId");
        Map map=ucCiRemindFacade.getRemindDetail(orderId);
        view.addObject("detailList", map.get("detailList"));
        view.addObject("remind", map.get("remind"));
        return view;
    }
 
}