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
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
package cn.ksource.web.controller.wechat.uwyw;
 
import java.util.ArrayList;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
 
import cn.ksource.beans.CUSTOMER_CONTACTS;
import cn.ksource.core.page.PageInfo;
import cn.ksource.core.util.ConvertUtil;
import cn.ksource.core.util.ParamsMapUtil;
import cn.ksource.core.util.StringUtil;
import cn.ksource.core.web.WebUtil;
import cn.ksource.web.facade.uc.login.UcFacade;
import cn.ksource.web.facade.wechat.uwyw.UknowledgeFacade;
 
/**
 * 用户微运维控制器
 * @author jxl
 *
 */
@Controller
@RequestMapping("/uwyw")
public class UwywController {
    
    @Resource(name="ucFacade")
    private UcFacade ucFacade;
 
    @Autowired
    private UknowledgeFacade uknowledgeFacade;
    
    @RequestMapping("uhome.html")
    public ModelAndView uhome(HttpServletRequest request) {
        String ciId = ConvertUtil.obj2StrBlank(request.getSession().getAttribute("ciId"));
        if(StringUtil.notEmpty(ciId)) {
            ModelAndView modelAndView = new ModelAndView("redirect:/uwyw/uconfig/uconfigInfo.html?id="+ciId);
            request.getSession().removeAttribute("ciId");
            return modelAndView;
        }
        
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uhome");
        
        return modelAndView;
    }
    
    /**
     * 跳转到驻场服务分类信息页面
     */
    @RequestMapping("uzcyw.html")
    public ModelAndView eZcyw(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uzcyw");
        return modelAndView;
    }
    
    /**
     * 跳转到配置管理分类信息页面
     */
    @RequestMapping("uconfig.html")
    public ModelAndView uconfig(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uconfig");
        return modelAndView;
    }
    
    /**
     * 跳转到信息查询分类信息页面
     */
    @RequestMapping("umsgQuery.html")
    public ModelAndView emsgQuery(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/umsgQuery");
        return modelAndView;
    }
    
    
    /**
     * 跳转到统计分析信息查询页面
     */
    @RequestMapping("ustatis.html")
    public ModelAndView estatis(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/ustatis");
        return modelAndView;
    }
    
    
    /**
     * 跳转到运维管理分类信息页面
     */
    @RequestMapping("uywgl.html")
    public ModelAndView eywgl(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uywgl");
        return modelAndView;
    }
    
    /**
     * 跳转到我的资料页面
     */
    @RequestMapping("umymsg.html")
    public ModelAndView umymsg(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/umymsg");
        String userId = WebUtil.getUserWywId(request);;
        Map user = new CUSTOMER_CONTACTS(userId).getBeanMapById();
        modelAndView.addObject("user", user);
        return modelAndView;
    }
    
    /**
     * 跳转到设置页面
     */
    @RequestMapping("umyset.html")
    public ModelAndView umyset(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/umyset");
        String userId = WebUtil.getUserWywId(request);
        CUSTOMER_CONTACTS user = new CUSTOMER_CONTACTS(userId).getInstanceById();
        modelAndView.addObject("openId", user.getWechat_open_id());
        /*---客户端--开始-*/
        String isclient = ConvertUtil.obj2StrBlank(request.getSession().getAttribute("isclient"));
        modelAndView.addObject("isclient", isclient);
        /*---客户端--结束-*/
        return modelAndView;
    }
    
    /**
     * 跳转到作业计划分类信息页面
     */
    @RequestMapping("uworkplan.html")
    public ModelAndView eWorkplan(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uworkplan");
        return modelAndView;
    }
    
    /**
     * 跳转到知识库页面
     */
    @RequestMapping("uknow.html")
    public ModelAndView eKnow(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uknow");
        return modelAndView;
    }
    
    /**
     * 项目最新知识
     */
    @RequestMapping("uknowData.html")
    public ModelAndView uknowData(HttpServletRequest request,PageInfo pageInfo) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uKnowledge/uknownewData");
        Map<String, String> params = ParamsMapUtil.getParameterMap(request);
        params.put("userId", WebUtil.getUserWywCusId(request));
        PageInfo info = uknowledgeFacade.queryProNewKwData(pageInfo,params);
        List<Map> knowList = info.getDatas();
        for(Map map:knowList){
            String tag = ConvertUtil.obj2StrBlank(map.get("TAG"));
            String[] tags = tag.split("\\s");
            List<String> tagList = new ArrayList();
            for(int i=0;i<tags.length;i++){
                if(!StringUtil.isEmpty(tags[i])){
                    tagList.add(tags[i]);
                }
            }
            map.put("tagList", tagList);
        }
        info.setDatas(knowList);
        modelAndView.addObject("info", info);
        return modelAndView;
    }
    
    /**
     * 项目最新知识数量
     */
    @RequestMapping("uknowCount.html")
    public void uknowCount(HttpServletRequest request,HttpServletResponse response) {
        Map<String, String> params = ParamsMapUtil.getParameterMap(request);
        params.put("userId", WebUtil.getUserWywCusId(request));
        Integer result = uknowledgeFacade.queryProNewKwCount(params);
        WebUtil.write(response, ConvertUtil.obj2StrBlank(result));
    }
    
    /**
     * 跳转到工作报告分类信息页面
     */
    @RequestMapping("uworkReport.html")
    public ModelAndView workReport(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/uworkReport");
        String cusId = WebUtil.getUserWywCusId(request);
        modelAndView.addObject("cusId", cusId);
        return modelAndView;
    }
    /**
     * 一键报修页面
     * @param request
     * @return
     */
    @RequestMapping("ucYjbx.html")
    public ModelAndView ucYjbx(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/ucYjbx");
        return modelAndView;
    }
    /**
     * 一键报修保存
     * @param request
     * @param response
     */
    @RequestMapping("saveYjbx.html")
    public ModelAndView saveYjbx(HttpServletRequest request,HttpServletResponse response){
        String cusId = WebUtil.getUserWywCusId(request);
        String userId = WebUtil.getUserWywId(request);
        CUSTOMER_CONTACTS user = new CUSTOMER_CONTACTS(userId).getInstanceById();
        Map<String, String> params = ParamsMapUtil.getParameterMap(request);
        params.put("cusId", cusId);
        params.put("userId", userId);
        params.put("userName", user.getContact_name());
        params.put("lx_phone", user.getContacts_type());
        ucFacade.doSubRepair(params);
        return new ModelAndView("redirect:/uwyw/uhome.html");
    }
    /**
     * 一键报修
     * @param request
     * @param response
     */
    @RequestMapping("usendrepair.html")
    public void usendrepair(HttpServletRequest request,HttpServletResponse response){
        String cusId = WebUtil.getUserWywCusId(request);
        String userId = WebUtil.getUserWywId(request);
        CUSTOMER_CONTACTS user = new CUSTOMER_CONTACTS(userId).getInstanceById();
        Map<String, String> params = ParamsMapUtil.getParameterMap(request);
        params.put("cusId", cusId);
        params.put("userId", userId);
        params.put("userName", user.getContact_name());
        ucFacade.doSubRepair(params);
        WebUtil.write(response, "1");
    }
    
    /**
     * 跳转到报修页面
     */
    @RequestMapping("urepair.html")
    public ModelAndView urepair(HttpServletRequest request) {
        ModelAndView modelAndView = new ModelAndView("/business/wechat/uwyw/urepair");
        return modelAndView;
    }
    
}