package cn.ksource.web.controller.wechat.ewyw;
|
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
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.bind.annotation.RequestMethod;
|
import org.springframework.web.servlet.ModelAndView;
|
|
import cn.ksource.beans.SC_WORKFLOW_INCIDENT;
|
import cn.ksource.beans.SC_WORKFLOW_INCIDENT_LOCAL;
|
import cn.ksource.core.dao.SqlParameter;
|
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.SysInfo;
|
import cn.ksource.core.web.SysInfoMsg;
|
import cn.ksource.core.web.WebUtil;
|
import cn.ksource.web.Constants;
|
import cn.ksource.web.SysConstants;
|
import cn.ksource.web.facade.wechat.ewyw.EwZcFacade;
|
import cn.ksource.web.facade.zc.ZcywFacade;
|
import cn.ksource.web.service.DataDictionaryService;
|
|
@Controller
|
@RequestMapping("/ewyw/ewzc")
|
public class EwZcController {
|
|
@Resource(name="ewZcFacade")
|
private EwZcFacade ewZcFacade;
|
|
@Autowired
|
private DataDictionaryService dataDictionaryService;
|
|
@Resource(name="zcywFacade")
|
private ZcywFacade zcywFacade;
|
|
@RequestMapping("ewMyzc.html")
|
public ModelAndView ewMyzc(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewMyzc");
|
|
//查询工单状态
|
Map<String, String> state = Constants.mapWORKFLOW_BASE_WFSTATE;
|
List status = new ArrayList();
|
for (Map.Entry<String, String> entry : state.entrySet()) {
|
String key = entry.getKey();
|
String value = entry.getValue();
|
Map map = new HashMap();
|
map.put("state", key);
|
map.put("stateName", value);
|
status.add(map);
|
}
|
|
modelAndView.addObject("status", status);
|
return modelAndView;
|
}
|
|
/**
|
* 查询我的事件工单列表
|
*/
|
@RequestMapping(value="ewMyZcData.html",method=RequestMethod.POST)
|
public ModelAndView ewMyZcData(HttpServletRequest request,PageInfo pageInfo) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewMyZcData");
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
params.put("userId", WebUtil.getEngineerUserId(request));
|
String flowstate = params.get("flowstate");
|
if("end".equals(flowstate)||"close".equals(flowstate)){
|
if("end".equals(flowstate)){
|
params.put("status", "2");
|
}else{
|
params.put("status", "3");
|
}
|
}
|
PageInfo list = zcywFacade.queryMyZcywData(pageInfo,params);
|
modelAndView.addObject("orderList", list);
|
|
modelAndView.addObject("flowstate", flowstate);
|
return modelAndView;
|
}
|
|
/**
|
* 查询我的事件工单总数量
|
*/
|
@RequestMapping(value="ewMyZcCount.html",method=RequestMethod.POST)
|
public void ewMyZcCount(HttpServletRequest request,HttpServletResponse response) {
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
params.put("userId", WebUtil.getEngineerUserId(request));
|
String flowstate = params.get("flowstate");
|
if("end".equals(flowstate)||"close".equals(flowstate)){
|
if("end".equals(flowstate)){
|
params.put("status", "2");
|
}else{
|
params.put("status", "3");
|
}
|
}
|
int count = zcywFacade.queryMyZcywCount(params);
|
WebUtil.write(response, String.valueOf(count));
|
}
|
|
/**
|
* 驻场事件工单响应
|
* @param request
|
* @param response
|
*/
|
@RequestMapping("answerZc.html")
|
public void answerZc(HttpServletRequest request,HttpServletResponse response) {
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
Map user = WebUtil.getEngineerMsg(request);
|
params.put("ID", ConvertUtil.obj2StrBlank(user.get("ID")));
|
params.put("ZSXM", ConvertUtil.obj2StrBlank(user.get("ZSXM")));
|
String result = ewZcFacade.doOrderConfirm(params);
|
WebUtil.write(response, result);
|
}
|
/**
|
* 事件工单详情
|
*/
|
@RequestMapping("ewZcInfoCl.html")
|
public ModelAndView ewZcInfoCl(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewZcInfoCl");
|
|
//查询事件基本信息
|
String orderId = request.getParameter("orderId");
|
String flowId = new String();
|
if(StringUtil.notEmpty(orderId)) {
|
SC_WORKFLOW_INCIDENT_LOCAL incident = new SC_WORKFLOW_INCIDENT_LOCAL(orderId).getInstanceById();
|
flowId = incident.getFlow_id();
|
}
|
|
//通过工单编号查询工单基本信息
|
Map baseMsg = zcywFacade.queryIncidentLocalBaseMsg(orderId);
|
|
modelAndView.addObject("baseMsg", baseMsg);
|
modelAndView.addObject("orderId", orderId);
|
modelAndView.addObject("flowId", flowId);
|
|
return modelAndView;
|
}
|
|
/**
|
* 事件工单详情
|
*/
|
@RequestMapping("ewZcInfo.html")
|
public ModelAndView ewZcInfo(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewZcInfo");
|
|
//查询事件基本信息
|
String orderId = request.getParameter("orderId");
|
String flowId = new String();
|
if(StringUtil.notEmpty(orderId)) {
|
SC_WORKFLOW_INCIDENT_LOCAL incident = new SC_WORKFLOW_INCIDENT_LOCAL(orderId).getInstanceById();
|
flowId = incident.getFlow_id();
|
}
|
|
//通过工单编号查询工单基本信息
|
Map baseMsg = zcywFacade.queryIncidentLocalBaseMsg(orderId);
|
|
modelAndView.addObject("baseMsg", baseMsg);
|
modelAndView.addObject("orderId", orderId);
|
modelAndView.addObject("flowId", flowId);
|
|
return modelAndView;
|
}
|
|
/**
|
* 跳转到所有事件工单页面
|
*/
|
@RequestMapping("ewzc.html")
|
public ModelAndView ewzc(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewzc");
|
//查询工单状态
|
Map<String, String> state = Constants.mapWORKFLOW_BASE_WFSTATE;
|
List status = new ArrayList();
|
for (Map.Entry<String, String> entry : state.entrySet()) {
|
String key = entry.getKey();
|
String value = entry.getValue();
|
Map map = new HashMap();
|
map.put("state", key);
|
map.put("stateName", value);
|
status.add(map);
|
}
|
|
modelAndView.addObject("status", status);
|
|
//查询该加盟商的事件优先级
|
List<Map> eventPri = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.EVENT_PRI);
|
modelAndView.addObject("eventPri", eventPri);
|
return modelAndView;
|
}
|
|
/**
|
* 查询我的事件工单列表
|
*/
|
@RequestMapping(value="ewZcData.html",method=RequestMethod.POST)
|
public ModelAndView ewZcData(HttpServletRequest request,PageInfo pageInfo) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewZcData");
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
PageInfo list = ewZcFacade.eZcData(pageInfo,params);
|
modelAndView.addObject("orderList", list);
|
String flowstate = request.getParameter("flowstate");
|
modelAndView.addObject("flowstate", flowstate);
|
return modelAndView;
|
}
|
|
/**
|
* 查询我的事件工单总数量
|
*/
|
@RequestMapping(value="ewZcCount.html",method=RequestMethod.POST)
|
public void ewZcCount(HttpServletRequest request,HttpServletResponse response) {
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
int count = ewZcFacade.eZcCount(params);
|
WebUtil.write(response, String.valueOf(count));
|
}
|
|
/**
|
* 工单完成时的驻场运维事件处理报告
|
*/
|
@RequestMapping("ewzcywFinishReport.html")
|
public ModelAndView wcReport(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewzcywFinishReport");
|
String orderId = request.getParameter("orderId");
|
Map report = zcywFacade.queryWcReport(orderId);
|
modelAndView.addObject("report", report);
|
return modelAndView;
|
}
|
|
|
/**
|
* 工单关闭时的驻场运维事件处理报告
|
*/
|
@RequestMapping("ewzcywCloseReport.html")
|
public ModelAndView closeReport(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewzcywFinishReport");
|
String orderId = request.getParameter("orderId");
|
Map report = zcywFacade.queryCloseReport(orderId);
|
modelAndView.addObject("report", report);
|
return modelAndView;
|
}
|
@RequestMapping("ewzcUsers.html")
|
public ModelAndView ewzcUsers(HttpServletRequest request){
|
ModelAndView view=new ModelAndView("/business/wechat/ewyw/ewzc/ewzcUsers");
|
List users = zcywFacade.queryAllZcry(request);
|
view.addObject("users", users);
|
view.addObject("flowId", request.getParameter("flowId"));
|
view.addObject("seltype", request.getParameter("seltype"));
|
return view;
|
}
|
/**
|
* 分派任务
|
*/
|
@RequestMapping("zcDispatchTask.html")
|
public void zcDispatchTask(HttpServletRequest request,HttpServletResponse response) {
|
Map map = zcywFacade.saveDispatchTask(request);
|
request.getSession().setAttribute(SysConstants.SJTIPSESSION, map);
|
WebUtil.write(response, "1");
|
}
|
/**
|
* 跳转到提示页面
|
*/
|
@RequestMapping("ewZcoption.html")
|
public ModelAndView ewZcoption(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewzc/ewZcoption");
|
Map resultMap = new HashMap();
|
Object obj = request.getSession().getAttribute(SysConstants.SJTIPSESSION);
|
if(null!=obj) {
|
resultMap = (Map)obj;
|
String result = ConvertUtil.obj2StrBlank(resultMap.get("result"));
|
String nouser = ConvertUtil.obj2StrBlank(resultMap.get("nouser"));
|
|
view.addObject("result", result);
|
view.addObject("nouser", nouser);
|
SysInfoMsg msg = (SysInfoMsg)resultMap.get("msg");
|
view.addObject("msg", msg);
|
request.getSession().removeAttribute(SysConstants.SJTIPSESSION);
|
}
|
|
return view;
|
}
|
/**
|
* 关闭事件
|
* 跳转到结束任务页面
|
* */
|
@RequestMapping(value="ewZcEndTask.html",method=RequestMethod.GET)
|
public ModelAndView ewEndTask(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewZcEndTask");
|
String orderId = request.getParameter("orderId");
|
//查询解决方式数据字典
|
List reasons = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.RESOLVE_WAY);
|
modelAndView.addObject("reasons", reasons);
|
modelAndView.addObject("incidentId", orderId);
|
return modelAndView;
|
}
|
/**
|
* 结束任务
|
* */
|
@RequestMapping(value="ewZcEndTask.html",method=RequestMethod.POST)
|
public void ewZcEndTask(HttpServletRequest request,HttpServletResponse response) {
|
zcywFacade.doEndTask(request);
|
String orderId = request.getParameter("incidentId");
|
SqlParameter map = new SqlParameter("orderId",orderId).addValue("bustype", Constants.WORKFLOW_BASE_BUSINESS_TYPE_INCIDENT_LOCAL);
|
/*ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewIncident/ewEndTaskLink");
|
modelAndView.addObject("orderId", orderId);
|
modelAndView.addObject("bustype", Constants.WORKFLOW_BASE_BUSINESS_TYPE_INCIDENT);*/
|
map.addValue("result", "1");
|
WebUtil.write(response, JsonUtil.map2Json(map));
|
}
|
/**
|
* 跳转到关闭原因界面
|
*/
|
@RequestMapping("ewzcCloseReason.html")
|
public ModelAndView ewzcCloseReason(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewzcCloseReason");
|
String orderId = request.getParameter("orderId");
|
//查询关闭原因数据字典
|
List reasons = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.CLOSE_REASON);
|
modelAndView.addObject("reasons", reasons);
|
modelAndView.addObject("incidentId", orderId);
|
return modelAndView;
|
}
|
|
/**
|
* 关闭事件提交
|
*/
|
@RequestMapping(value="ewzcCloseReason.html",method=RequestMethod.POST)
|
public void doCloseReason(HttpServletRequest request,HttpServletResponse response) {
|
zcywFacade.doCloseReason(request);
|
WebUtil.write(response, "1");
|
}
|
/**
|
* 创建事件
|
*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@RequestMapping("ewzcAdd.html")
|
public ModelAndView ewAddIncident(HttpServletRequest request) {
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewzc/ewzcAdd");
|
String add = request.getParameter("add");
|
if("1".equals(add)){
|
request.getSession().removeAttribute(SysConstants.LOCALSESSION);
|
}
|
|
//查询出该驻场人员的总客户,和下级客户,项目
|
Map result = ewZcFacade.queryZcMsg(request);
|
view.addObject("msg", result);
|
|
//查询事件类型数据字典
|
List<Map> types = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.INCIDENT_TYPE);
|
//取得事件类型的第一条数据
|
if(null!=types && types.size()>0) {
|
Map type = types.get(0);
|
view.addObject("typeId", type.get("DATAKEY"));
|
view.addObject("typeName", type.get("DATAVALUE"));
|
}
|
//查询申报方式数据字典
|
List<Map> ways = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.INCIDENT_APPLY_TYPE);
|
//取得申报方式的第一条数据
|
if(null!=ways && ways.size()>0) {
|
Map way = ways.get(0);
|
view.addObject("wayId", way.get("DATAKEY"));
|
view.addObject("wayName", way.get("DATAVALUE"));
|
}
|
//查询事件来源数据字典
|
List<Map> froms = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.INCIDENT_SOURCE);
|
//取得事件来源的第一条数据
|
if(null!=froms && froms.size()>0) {
|
Map from = froms.get(0);
|
view.addObject("fromId", from.get("DATAKEY"));
|
view.addObject("fromName", from.get("DATAVALUE"));
|
}
|
|
|
//查询事件影响力
|
view.addObject("types", types);
|
view.addObject("ways", ways);
|
view.addObject("froms", froms);
|
Map resultMap = new HashMap();
|
resultMap.put("happen_time", DateUtil.getCurrentDate14());
|
Object obj = request.getSession().getAttribute(SysConstants.LOCALSESSION);
|
if(null!=obj) {
|
resultMap = (Map)obj;
|
}
|
|
String customerId=ConvertUtil.obj2Str(result.get("customerId"));
|
String customerName=ConvertUtil.obj2Str(result.get("customerName"));
|
String subCustomerId=ConvertUtil.obj2Str(result.get("subCustomerId"));
|
String subCustomerName=ConvertUtil.obj2Str(result.get("subCustomerName"));
|
resultMap.put("customer_id", customerId);
|
resultMap.put("customer_name", customerName);
|
if(StringUtil.isEmpty(subCustomerId)){
|
resultMap.put("sub_customer_id", customerId);
|
resultMap.put("sub_customer_name", customerName);
|
}else{
|
resultMap.put("sub_customer_id", subCustomerId);
|
resultMap.put("sub_customer_name", subCustomerName);
|
}
|
|
view.addObject("resultMap", resultMap);
|
Map selectMap = new HashMap();
|
Object obj1 = request.getSession().getAttribute(SysConstants.SELECTUSERSESSION);
|
if(null!=obj) {
|
selectMap = (Map)obj1;
|
}
|
view.addObject("selectMap", selectMap);
|
return view;
|
}
|
/**
|
* 保存事件信息
|
*/
|
@SuppressWarnings("unchecked")
|
@RequestMapping("savetempLocal.html")
|
public void savetempincident(HttpServletRequest request,HttpServletResponse response) {
|
String name = request.getParameter("name");
|
String repair = request.getParameter("repair");
|
String descrip = request.getParameter("descrip");
|
String contact_phone = request.getParameter("contact_phone");
|
String contact_name = request.getParameter("contact_name");
|
String keshi = request.getParameter("keshi");
|
String apply_type_id = request.getParameter("apply_type_id");
|
String type_id = request.getParameter("type_id");
|
String source_id = request.getParameter("source_id");
|
String happen_time = request.getParameter("happen_time");
|
String[] devices = request.getParameterValues("devices");
|
List<Map> deviceList = new ArrayList<Map>();
|
if(devices != null){
|
if(devices.length > 0){
|
for(int i=0;i<devices.length;i++){
|
if(!StringUtil.isEmpty(devices[i])){
|
String[] devicemap = devices[i].split("&");
|
Map map = new HashMap();
|
map.put("deivceId", devicemap[0]);
|
map.put("searchcode", devicemap[1]);
|
map.put("ciname", devicemap[2]);
|
map.put("position", devicemap[3]);
|
map.put("lv_name", devicemap[4]);
|
deviceList.add(map);
|
}
|
|
}
|
}
|
}
|
|
|
String[] orders = request.getParameterValues("orders");
|
List<Map> orderList = new ArrayList<Map>();
|
if(orders != null){
|
if(orders.length > 0){
|
for(int i=0;i<orders.length;i++){
|
if(!StringUtil.isEmpty(orders[i])){
|
String[] ordermap = orders[i].split("&");
|
Map map = new HashMap();
|
map.put("orderId", ordermap[0]);
|
map.put("businesstype", ordermap[1]);
|
map.put("order_code", ordermap[2]);
|
map.put("wfname", ordermap[3]);
|
map.put("customer_name", ordermap[4]);
|
map.put("createtime", ordermap[5]);
|
map.put("creatername", ordermap[6]);
|
orderList.add(map);
|
}
|
|
}
|
}
|
}
|
|
Map resultMap = new HashMap();
|
Object obj = request.getSession().getAttribute(SysConstants.LOCALSESSION);
|
if(null!=obj) {
|
resultMap = (Map)obj;
|
resultMap.put("name", name);
|
resultMap.put("descrip", descrip);
|
resultMap.put("contact_phone", contact_phone);
|
resultMap.put("contact_name", contact_name);
|
resultMap.put("keshi", keshi);
|
resultMap.put("apply_type_id", apply_type_id);
|
resultMap.put("apply_type_name", dataDictionaryService.getDataDictionaryByKey(apply_type_id).get("DATAVALUE"));
|
|
resultMap.put("type_id", type_id);
|
resultMap.put("type_name", dataDictionaryService.getDataDictionaryByKey(type_id).get("DATAVALUE"));
|
resultMap.put("source_id", source_id);
|
resultMap.put("source_name", dataDictionaryService.getDataDictionaryByKey(source_id).get("DATAVALUE"));
|
resultMap.put("happen_time", happen_time);
|
resultMap.put("repair", repair);
|
|
resultMap.put("deviceList", deviceList);
|
resultMap.put("orderList", orderList);
|
request.getSession().setAttribute(SysConstants.LOCALSESSION, resultMap);
|
}else{
|
resultMap.put("name", name);
|
resultMap.put("descrip", descrip);
|
resultMap.put("contact_phone", contact_phone);
|
resultMap.put("contact_name", contact_name);
|
resultMap.put("keshi", keshi);
|
resultMap.put("apply_type_id", apply_type_id);
|
resultMap.put("apply_type_name", dataDictionaryService.getDataDictionaryByKey(apply_type_id).get("DATAVALUE"));
|
|
resultMap.put("type_id", type_id);
|
resultMap.put("type_name", dataDictionaryService.getDataDictionaryByKey(type_id).get("DATAVALUE"));
|
resultMap.put("source_id", source_id);
|
resultMap.put("source_name", dataDictionaryService.getDataDictionaryByKey(source_id).get("DATAVALUE"));
|
resultMap.put("happen_time", happen_time);
|
resultMap.put("repair", repair);
|
resultMap.put("deviceList", deviceList);
|
resultMap.put("orderList", orderList);
|
request.getSession().setAttribute(SysConstants.LOCALSESSION, resultMap);
|
}
|
WebUtil.write(response, "1");
|
}
|
/**
|
* 驻场创建事件提交
|
* @param request
|
* @param response
|
* @return
|
*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@RequestMapping(value="saveLocal.html", method=RequestMethod.POST)
|
public void saveLocal(HttpServletRequest request, HttpServletResponse response,SC_WORKFLOW_INCIDENT_LOCAL sc_workflow_incident_local) {
|
Object obj = request.getSession().getAttribute(SysConstants.LOCALSESSION);
|
if(null!=obj){
|
Map map=(Map)obj;
|
sc_workflow_incident_local=localEntity(map, sc_workflow_incident_local);
|
// resultMap.put("deviceList", deviceList);
|
String deviceLists=ConvertUtil.obj2Str(map.get("deviceList"));
|
if(StringUtil.notEmpty(deviceLists)){
|
List<Map> deviceList=(List<Map>)(map.get("deviceList"));
|
String str="";
|
for(Map mapa:deviceList){
|
str+=ConvertUtil.obj2Str(mapa.get("deivceId"))+",";
|
}
|
map.put("deviceId", str);
|
}else{
|
map.put("deviceId", "");
|
}
|
|
String orderLists=ConvertUtil.obj2Str(map.get("orderList"));
|
if(StringUtil.notEmpty(orderLists)){
|
List<Map> orderList=(List<Map>)(map.get("orderList"));
|
String str="";
|
for(Map mapb:orderList){
|
str+=ConvertUtil.obj2Str(mapb.get("orderId"))+",";
|
}
|
map.put("orderId", str);
|
}else{
|
map.put("orderId", "");
|
}
|
// resultMap.put("orderList", orderList);
|
Map resulta = ewZcFacade.queryZcMsg(request);
|
String customerId=ConvertUtil.obj2Str(resulta.get("customerId"));
|
String customerName=ConvertUtil.obj2Str(resulta.get("customerName"));
|
String subCustomerId=ConvertUtil.obj2Str(resulta.get("subCustomerId"));
|
String subCustomerName=ConvertUtil.obj2Str(resulta.get("subCustomerName"));
|
sc_workflow_incident_local.setCustomer_id(customerId);
|
sc_workflow_incident_local.setCustomer_name(customerName);
|
if(StringUtil.isEmpty(subCustomerId)){
|
sc_workflow_incident_local.setSub_customer_id(customerId);
|
sc_workflow_incident_local.setSub_customer_name(customerName);
|
}else{
|
sc_workflow_incident_local.setSub_customer_id(subCustomerId);
|
sc_workflow_incident_local.setSub_customer_name(subCustomerName);
|
}
|
|
map.put("type", "1");
|
|
Map result = ewZcFacade.saveZcyw(map, request, sc_workflow_incident_local);
|
String incidentId = ConvertUtil.obj2StrBlank(result.get("incidentId"));
|
SysInfoMsg mapc=new SysInfoMsg();
|
String selectUser = request.getParameter("userMsg");
|
if(StringUtil.notEmpty(selectUser)) {
|
String[] userMsg = selectUser.split("-");
|
if(userMsg.length==2) {
|
mapc.setDealUserName(userMsg[1]);
|
}
|
}
|
result.put("msg", mapc);
|
request.getSession().setAttribute(SysConstants.SJTIPSESSION, result);
|
request.getSession().removeAttribute(SysConstants.LOCALSESSION);
|
request.getSession().removeAttribute(SysConstants.SELECTUSERSESSION);
|
WebUtil.write(response, incidentId);
|
}else{
|
WebUtil.write(response, "");
|
}
|
}
|
|
/**
|
* 关闭事件
|
* 跳转到结束任务页面
|
* */
|
@RequestMapping(value="ewzcSolution.html",method=RequestMethod.GET)
|
public ModelAndView ewzcSolution(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewzcSolution");
|
List reasons = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.RESOLVE_WAY);
|
modelAndView.addObject("reasons", reasons);
|
return modelAndView;
|
}
|
/**
|
* 驻场创建事件提交并解决
|
* @param request
|
* @param response
|
* @return
|
*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@RequestMapping(value="saveLocalSolution.html", method=RequestMethod.POST)
|
public void saveLocalSolution(HttpServletRequest request, HttpServletResponse response,SC_WORKFLOW_INCIDENT_LOCAL sc_workflow_incident_local) {
|
Object obj = request.getSession().getAttribute(SysConstants.LOCALSESSION);
|
if(null!=obj){
|
Map map=(Map)obj;
|
sc_workflow_incident_local=localEntity(map, sc_workflow_incident_local);
|
// resultMap.put("deviceList", deviceList);
|
String deviceLists=ConvertUtil.obj2Str(map.get("deviceList"));
|
if(StringUtil.notEmpty(deviceLists)){
|
List<Map> deviceList=(List<Map>)(map.get("deviceList"));
|
String str="";
|
for(Map mapa:deviceList){
|
str+=ConvertUtil.obj2Str(mapa.get("deivceId"))+",";
|
}
|
map.put("deviceId", str);
|
}else{
|
map.put("deviceId", "");
|
}
|
|
String orderLists=ConvertUtil.obj2Str(map.get("orderList"));
|
if(StringUtil.notEmpty(orderLists)){
|
List<Map> orderList=(List<Map>)(map.get("orderList"));
|
String str="";
|
for(Map mapb:orderList){
|
str+=ConvertUtil.obj2Str(mapb.get("orderId"))+",";
|
}
|
map.put("orderId", str);
|
}else{
|
map.put("orderId", "");
|
}
|
// resultMap.put("orderList", orderList);
|
Map resulta = ewZcFacade.queryZcMsg(request);
|
String customerId=ConvertUtil.obj2Str(resulta.get("customerId"));
|
String customerName=ConvertUtil.obj2Str(resulta.get("customerName"));
|
String subCustomerId=ConvertUtil.obj2Str(resulta.get("subCustomerId"));
|
String subCustomerName=ConvertUtil.obj2Str(resulta.get("subCustomerName"));
|
sc_workflow_incident_local.setCustomer_id(customerId);
|
sc_workflow_incident_local.setCustomer_name(customerName);
|
if(StringUtil.isEmpty(subCustomerId)){
|
sc_workflow_incident_local.setSub_customer_id(customerId);
|
sc_workflow_incident_local.setSub_customer_name(customerName);
|
}else{
|
sc_workflow_incident_local.setSub_customer_id(subCustomerId);
|
sc_workflow_incident_local.setSub_customer_name(subCustomerName);
|
}
|
|
map.put("type", "2");
|
|
Map result = ewZcFacade.saveZcyw(map, request, sc_workflow_incident_local);
|
String incidentId = ConvertUtil.obj2StrBlank(result.get("incidentId"));
|
request.getSession().removeAttribute(SysConstants.LOCALSESSION);
|
request.getSession().removeAttribute(SysConstants.SELECTUSERSESSION);
|
ewZcFacade.doEndTask(request, incidentId);
|
SqlParameter mapg = new SqlParameter("orderId",incidentId).addValue("bustype", Constants.WORKFLOW_BASE_BUSINESS_TYPE_INCIDENT_LOCAL);
|
mapg.addValue("result", "1");
|
WebUtil.write(response, JsonUtil.map2Json(mapg));
|
}else{
|
WebUtil.write(response, "");
|
}
|
}
|
/**
|
* 跳转到关闭原因界面
|
*/
|
@RequestMapping("ewzcClose.html")
|
public ModelAndView ewzcClose(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewzc/ewzcClose");
|
//查询关闭原因数据字典
|
List reasons = dataDictionaryService.getDataDictionaryByCategoryKey(Constants.CLOSE_REASON);
|
modelAndView.addObject("reasons", reasons);
|
return modelAndView;
|
}
|
/**
|
* 驻场创建事件提交并解决
|
* @param request
|
* @param response
|
* @return
|
*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@RequestMapping(value="saveLocalClose.html", method=RequestMethod.POST)
|
public void saveLocalClose(HttpServletRequest request, HttpServletResponse response,SC_WORKFLOW_INCIDENT_LOCAL sc_workflow_incident_local) {
|
Object obj = request.getSession().getAttribute(SysConstants.LOCALSESSION);
|
if(null!=obj){
|
Map map=(Map)obj;
|
sc_workflow_incident_local=localEntity(map, sc_workflow_incident_local);
|
// resultMap.put("deviceList", deviceList);
|
String deviceLists=ConvertUtil.obj2Str(map.get("deviceList"));
|
if(StringUtil.notEmpty(deviceLists)){
|
List<Map> deviceList=(List<Map>)(map.get("deviceList"));
|
String str="";
|
for(Map mapa:deviceList){
|
str+=ConvertUtil.obj2Str(mapa.get("deivceId"))+",";
|
}
|
map.put("deviceId", str);
|
}else{
|
map.put("deviceId", "");
|
}
|
|
String orderLists=ConvertUtil.obj2Str(map.get("orderList"));
|
if(StringUtil.notEmpty(orderLists)){
|
List<Map> orderList=(List<Map>)(map.get("orderList"));
|
String str="";
|
for(Map mapb:orderList){
|
str+=ConvertUtil.obj2Str(mapb.get("orderId"))+",";
|
}
|
map.put("orderId", str);
|
}else{
|
map.put("orderId", "");
|
}
|
// resultMap.put("orderList", orderList);
|
Map resulta = ewZcFacade.queryZcMsg(request);
|
String customerId=ConvertUtil.obj2Str(resulta.get("customerId"));
|
String customerName=ConvertUtil.obj2Str(resulta.get("customerName"));
|
String subCustomerId=ConvertUtil.obj2Str(resulta.get("subCustomerId"));
|
String subCustomerName=ConvertUtil.obj2Str(resulta.get("subCustomerName"));
|
sc_workflow_incident_local.setCustomer_id(customerId);
|
sc_workflow_incident_local.setCustomer_name(customerName);
|
if(StringUtil.isEmpty(subCustomerId)){
|
sc_workflow_incident_local.setSub_customer_id(customerId);
|
sc_workflow_incident_local.setSub_customer_name(customerName);
|
}else{
|
sc_workflow_incident_local.setSub_customer_id(subCustomerId);
|
sc_workflow_incident_local.setSub_customer_name(subCustomerName);
|
}
|
|
map.put("type", "3");
|
|
Map result = ewZcFacade.saveZcyw(map, request, sc_workflow_incident_local);
|
String incidentId = ConvertUtil.obj2StrBlank(result.get("incidentId"));
|
request.getSession().removeAttribute(SysConstants.LOCALSESSION);
|
request.getSession().removeAttribute(SysConstants.SELECTUSERSESSION);
|
ewZcFacade.doCloseReason(request, incidentId);
|
WebUtil.write(response, "1");
|
}else{
|
WebUtil.write(response, "");
|
}
|
}
|
@SuppressWarnings({ "rawtypes" })
|
private SC_WORKFLOW_INCIDENT_LOCAL localEntity(Map map,SC_WORKFLOW_INCIDENT_LOCAL sc_workflow_incident_local){
|
sc_workflow_incident_local.setName(ConvertUtil.obj2Str(map.get("name")));
|
sc_workflow_incident_local.setDescrip(ConvertUtil.obj2Str(map.get("descrip")));
|
sc_workflow_incident_local.setContact_phone(ConvertUtil.obj2Str(map.get("contact_phone")));
|
sc_workflow_incident_local.setContact_name(ConvertUtil.obj2Str(map.get("contact_name")));
|
sc_workflow_incident_local.setKeshi(ConvertUtil.obj2Str(map.get("keshi")));
|
sc_workflow_incident_local.setApply_type_id(ConvertUtil.obj2Str(map.get("apply_type_id")));
|
sc_workflow_incident_local.setApply_type_name(ConvertUtil.obj2Str(map.get("apply_type_name")));
|
sc_workflow_incident_local.setType_id(ConvertUtil.obj2Str(map.get("type_id")));
|
sc_workflow_incident_local.setType_name(ConvertUtil.obj2Str(map.get("type_name")));
|
sc_workflow_incident_local.setSource_id(ConvertUtil.obj2Str(map.get("source_id")));
|
sc_workflow_incident_local.setSource_name(ConvertUtil.obj2Str(map.get("source_name")));
|
String happen_time = ConvertUtil.obj2Str(map.get("happen_time")).replaceAll("\\s*", "");;
|
happen_time = happen_time.replace("-", "").replace(" ", "").replace(":", "");
|
sc_workflow_incident_local.setHappen_time(ConvertUtil.obj2Long(happen_time+"00"));
|
sc_workflow_incident_local.setSla_id(ConvertUtil.obj2Str(map.get("slaId")));
|
sc_workflow_incident_local.setSla_name(ConvertUtil.obj2Str(map.get("slaName")));
|
sc_workflow_incident_local.setPriority_id(ConvertUtil.obj2Str(map.get("priority_id")));
|
sc_workflow_incident_local.setPriority_name(ConvertUtil.obj2Str(dataDictionaryService.getDataDictionaryByKey(ConvertUtil.obj2Str(map.get("priority_id"))).get("DATAVALUE")));
|
sc_workflow_incident_local.setInfluence_id(ConvertUtil.obj2Str(map.get("influence_id")));
|
sc_workflow_incident_local.setInfluence_name(ConvertUtil.obj2Str(dataDictionaryService.getDataDictionaryByKey(ConvertUtil.obj2Str(map.get("influence_id"))).get("DATAVALUE")));
|
sc_workflow_incident_local.setRequest_answer_time(ConvertUtil.obj2Long(map.get("request_answer_time")));
|
sc_workflow_incident_local.setRequest_deal_time(ConvertUtil.obj2Long(map.get("request_deal_time")));
|
return sc_workflow_incident_local;
|
}
|
}
|