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.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpSession;
|
|
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.GG_RECORD;
|
import cn.ksource.beans.SC_WORKFLOW_CI_HEALTH;
|
import cn.ksource.beans.SC_WORKFLOW_CI_HEALTH_CIDETAIL;
|
import cn.ksource.beans.SC_WORKFLOW_CI_REMIND;
|
import cn.ksource.beans.SC_WORKFLOW_ITEM_HEALTH_CIDETAIL;
|
import cn.ksource.beans.WORKFLOW_BASE;
|
import cn.ksource.beans.WORKFLOW_NODE;
|
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.util.TreeUtil;
|
import cn.ksource.core.web.SysInfo;
|
import cn.ksource.core.web.SysInfoMsg;
|
import cn.ksource.core.web.WebUtil;
|
import cn.ksource.core.workflow.WorkflowCoreService;
|
import cn.ksource.web.Constants;
|
import cn.ksource.web.SysConstants;
|
import cn.ksource.web.facade.health.HealthFacade;
|
import cn.ksource.web.facade.health.HealthFacadeImpl;
|
import cn.ksource.web.facade.incident.IncidentFacade;
|
import cn.ksource.web.facade.wechat.ewyw.EwHealthFacade;
|
import cn.ksource.web.service.record.RecordService;
|
import cn.ksource.web.service.workFlowSupport.WorkFlowSupportService;
|
|
@Controller
|
@RequestMapping("/ewyw/ewHealth")
|
public class EwHealthController {
|
@Autowired
|
EwHealthFacade ewHealthFacade;
|
@Autowired
|
HealthFacade healthFacade;
|
@Autowired
|
IncidentFacade incidentFacade;
|
@Autowired
|
WorkFlowSupportService workFlowSupportService;
|
@Autowired
|
RecordService recordService;
|
@Autowired
|
WorkflowCoreService workflowCoreService;
|
/**
|
* 跳转到我的健康检查工单页面
|
*/
|
@RequestMapping("ewMyHealth.html")
|
public ModelAndView ewMyHealth(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewHealth/ewMyHealth");
|
//查询工单状态
|
Map<String, String> state = Constants.mapWORKFLOW_BASE_WFSTATE_PART;
|
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="ewMyHealthData.html",method=RequestMethod.POST)
|
public ModelAndView eMyHealthData(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewHealth/ewMyHealthData");
|
List list = ewHealthFacade.ewMyHealthData(request);
|
modelAndView.addObject("orderList", list);
|
String flowstate = request.getParameter("flowstate");
|
modelAndView.addObject("flowstate", flowstate);
|
return modelAndView;
|
}
|
|
/**
|
* 查询我的健康检查工单总数量
|
*/
|
@RequestMapping(value="ewMyHealthCount.html",method=RequestMethod.POST)
|
public void worderCount(HttpServletRequest request,HttpServletResponse response) {
|
int count = ewHealthFacade.ewMyHealthCount(request);
|
WebUtil.write(response, String.valueOf(count));
|
}
|
|
/**
|
* 健康检查工单详情
|
*/
|
@RequestMapping("ewHealthInfo.html")
|
public ModelAndView ewHealthInfo(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealthInfo");
|
//查询健康检查基本信息
|
String orderId = request.getParameter("orderId");
|
String flowId = new String();
|
if(StringUtil.notEmpty(orderId)) {
|
SC_WORKFLOW_CI_HEALTH health = new SC_WORKFLOW_CI_HEALTH(orderId).getInstanceById();
|
flowId = health.getFlow_id();
|
}
|
|
//通过工单编号查询工单基本信息
|
Map baseMsg = healthFacade.getHealthInfo(orderId);
|
|
modelAndView.addObject("baseMsg", baseMsg);
|
modelAndView.addObject("orderId", orderId);
|
modelAndView.addObject("flowId", flowId);
|
|
return modelAndView;
|
}
|
|
/**
|
* 健康检查工单详情(进行中)
|
*/
|
@RequestMapping("ewHealthInfoCl.html")
|
public ModelAndView ewHealthInfoCl(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealthInfoCl");
|
//查询健康检查基本信息
|
String orderId = request.getParameter("orderId");
|
String flowId = new String();
|
if(StringUtil.notEmpty(orderId)) {
|
SC_WORKFLOW_CI_HEALTH health = new SC_WORKFLOW_CI_HEALTH(orderId).getInstanceById();
|
flowId = health.getFlow_id();
|
}
|
|
//通过工单编号查询工单基本信息
|
Map baseMsg = healthFacade.getHealthInfo(orderId);
|
|
//得到当前节点
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
String userId = ConvertUtil.obj2StrBlank(user.get("ID"));
|
String nodeId=healthFacade.queryNodeidByFlowId(flowId,userId);
|
WORKFLOW_NODE node = new WORKFLOW_NODE(nodeId).getInstanceById();
|
String nodeTemplateId = node.getNode_template_id();
|
modelAndView.addObject("nodeTemplateId", nodeTemplateId);
|
modelAndView.addObject("nodeId", nodeId);
|
modelAndView.addObject("baseMsg", baseMsg);
|
modelAndView.addObject("orderId", orderId);
|
modelAndView.addObject("flowId", flowId);
|
|
//判断如果是当前是工程师处理节点,
|
if(nodeTemplateId.equals(Constants.HEALTH_PATROL)){
|
|
if(!StringUtil.notEmpty(flowId)) {
|
SC_WORKFLOW_CI_HEALTH health = new SC_WORKFLOW_CI_HEALTH(orderId).getInstanceById();
|
flowId = health.getFlow_id();
|
}
|
|
//是否已响应
|
if(StringUtil.isNotBlank(nodeId)){
|
modelAndView.addObject("isAdmin",node.getIs_admin());
|
if(node.getFlowstate()==1){
|
modelAndView.addObject("isAnswer","true");
|
}
|
//是否可发送到下一环节
|
WORKFLOW_BASE base = new WORKFLOW_BASE(flowId).getInstanceById();
|
boolean isCanFinish = workflowCoreService.isCanToNextNode(base, new WORKFLOW_NODE(nodeId).getInstanceById());
|
modelAndView.addObject("isCanFinish",isCanFinish);
|
}
|
|
}
|
|
return modelAndView;
|
}
|
|
/**
|
* 跳转到基本信息(健康检查-人员指派)
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewDispatchHealthInfo.html",method=RequestMethod.GET)
|
public String ewDispatchHealthInfo(Model model,HttpServletRequest request,HttpServletResponse response) {
|
String orderId = request.getParameter("orderId");
|
//基本信息
|
if(StringUtil.isNotBlank(orderId)){
|
Map health = healthFacade.getHealthInfo(orderId);
|
model.addAttribute("info",health);
|
}
|
/*
|
//需要查询设备peikezhan
|
List<Map> ciList = healthFacade.getPatrolCiList(orderId);
|
//查询该工单下的指标list
|
List<Map> itemList = healthFacade.getPatrolIteamsList(orderId);
|
//拼装设备和指标tree
|
TreeUtil treeUtil = new TreeUtil();
|
List treelist=treeUtil.createTreeByCate(ciList, itemList);
|
model.addAttribute("ciList",treelist);
|
*/
|
model.addAttribute("flowId", request.getParameter("flowId"));
|
model.addAttribute("nodeId", request.getParameter("nodeId"));
|
//得到缓存数据
|
Map tempData = (Map) request.getSession().getAttribute(SysConstants.JKJCRYFPSESSIONTEMP);
|
model.addAttribute("tempData", tempData);
|
return "/business/wechat/ewyw/ewHealth/ewDispatchHealthInfo";
|
}
|
|
/**
|
* 跳转到基本信息(健康检查-人员指派),提交信息
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewDispatchHealthInfo.html",method=RequestMethod.POST)
|
public void ewDispatchHealthSubmit(HttpServletRequest request,HttpServletResponse response) {
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
request.getSession().setAttribute(SysConstants.JKJCRYFPSESSION, params);
|
WebUtil.write(response, "1");
|
}
|
/**
|
* 离开基本信息页面,保存临时数据
|
* @author lixiang
|
* */
|
@RequestMapping(value="saveTempData.html",method=RequestMethod.POST)
|
public void saveTempData(HttpServletRequest request,HttpServletResponse response) {
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
request.getSession().setAttribute(SysConstants.JKJCRYFPSESSIONTEMP, params);
|
System.out.println("离开页面缓存数据:"+params);
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
* 跳转到人员分派界面
|
* @author lx
|
* */
|
@RequestMapping("ryfpSelectJkjc.html")
|
public ModelAndView ryfpSelectJkjc(HttpServletRequest request){
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ryfpSelectJkjc");
|
List<Map> resList = workFlowSupportService.getAllExecutors();
|
view.addObject("resList",resList);
|
return view;
|
|
}
|
|
|
|
/**
|
* 人员分派
|
* @author lx
|
* */
|
@RequestMapping("saveRyfp.html")
|
public void saveRyfp(HttpServletRequest request,HttpServletResponse response){
|
String[] ciIdAry = request.getParameterValues("ciId");
|
Map<String, String> param = ParamsMapUtil.getParameterMap(request);
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
|
//得到session中缓存的信息
|
HttpSession session = request.getSession();
|
Map<String, String> info = (Map<String, String>) session.getAttribute(SysConstants.JKJCRYFPSESSION);
|
//清除这个session信息
|
session.removeAttribute(SysConstants.JKJCRYFPSESSION);
|
//清除缓存session
|
session.removeAttribute(SysConstants.JKJCRYFPSESSIONTEMP);
|
|
SC_WORKFLOW_CI_HEALTH health = new SC_WORKFLOW_CI_HEALTH();
|
//需要转换时间的格式
|
String plan_time = info.get("plan_time").replaceAll("-", "");
|
health.setPlan_time(ConvertUtil.obj2Long(plan_time)).setContacts_name(ConvertUtil.obj2Str(info.get("contacts_name")))
|
.setContacts_tel(ConvertUtil.obj2Str(info.get("contacts_tel")));
|
//将剩余参数放入param中
|
param.put("nodeId", info.get("nodeId"));
|
param.put("orderId", info.get("orderId"));
|
param.put("flowId", info.get("flowId"));
|
|
Map msg = ewHealthFacade.doDispatch(health,param,request);
|
String flowId = info.get("flowId");
|
String nodeId = info.get("nodeId");
|
String userId = ConvertUtil.obj2Str(user.get("ID"));
|
String userName = ConvertUtil.obj2Str(user.get("ZSXM"));
|
GG_RECORD record = new GG_RECORD();
|
record.setDeal_content("指派人员:"+userName+"进行了人员指派");
|
record.setDeal_time(DateUtil.getCurrentDate14());
|
record.setDeal_user_id(userId);
|
record.setDeal_user_name(userName);
|
record.setBusiness_id(flowId);
|
record.setNode_id(nodeId);
|
recordService.addRecord(record);
|
|
//将结果信息放入session中
|
session.setAttribute(SysConstants.SJTIPSESSION, msg);
|
WebUtil.write(response, "1");
|
|
}
|
|
/**
|
* 关闭例行维护流程
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewCloseWorkFlow.html",method=RequestMethod.GET)
|
public ModelAndView ewCloseWorkFlow(HttpServletRequest request,HttpServletResponse response){
|
Map<String, String> param = ParamsMapUtil.getParameterMap(request);
|
String orderId = param.get("orderId");
|
String nodeId = param.get("nodeId");
|
String flowId = param.get("flowId");
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ewCloseWorkFlow");
|
return view.addObject("orderId",orderId)
|
.addObject("nodeId",nodeId).addObject("flowId", flowId);
|
}
|
|
/**
|
* 关闭提交
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewCloseWorkFlow.html",method=RequestMethod.POST)
|
public void ewCloseWorkFlowSubmit(HttpServletRequest request,HttpServletResponse response){
|
ewHealthFacade.doCloseWrokFlow(request);
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
* 基本信息(只读)
|
* @param model
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("ewHealthDealInfo.html")
|
public String ewHealthDealInfo(Model model,HttpServletRequest request, HttpServletResponse response) {
|
String orderId = request.getParameter("orderId");
|
Map health = healthFacade.getHealthInfo(orderId);
|
model.addAttribute("info", health);
|
return "/business/wechat/ewyw/ewHealth/ewHealthDealInfo";
|
}
|
|
/**
|
* 工程师提交页面
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("ewEngineerCommit.html")
|
public String ewEngineerCommit(Model model,HttpServletRequest request, HttpServletResponse response) {
|
String orderId = request.getParameter("orderId");
|
String isAdmin = request.getParameter("isAdmin");
|
if(isAdmin!=null&&isAdmin.equals("1")){
|
List<Map> commonList = healthFacade.getCommonPatrolItem(orderId);
|
model.addAttribute("commonList", commonList);
|
}
|
return "/business/wechat/ewyw/ewHealth/ewEngineerCommit";
|
}
|
|
/**
|
* 获取环节未执行人列表
|
* @param request
|
* @param response
|
*/
|
@RequestMapping("ewGetNotDealList.html")
|
public void ewGetNotDealList(HttpServletRequest request, HttpServletResponse response){
|
String flowId = request.getParameter("flowId");
|
List<Map> list = workFlowSupportService.getNotDealList(flowId);
|
WebUtil.write(response, JsonUtil.list2Json(list));
|
}
|
|
/**
|
* 保存工程师巡检信息
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("doEngineerPatrol.html")
|
public String doEngineerPatrol(HttpServletRequest request, HttpServletResponse response) {
|
Map msg = ewHealthFacade.doSendToManager(request);
|
String flowId = request.getParameter("flowId");
|
String nodeId = request.getParameter("nodeId");
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
String userId= ConvertUtil.obj2Str(user.get("ID"));
|
String userName=ConvertUtil.obj2Str(user.get("ZSXM"));
|
GG_RECORD record = new GG_RECORD();
|
record.setDeal_content("工程师巡检:"+userName+"进行了巡检");
|
record.setDeal_time(DateUtil.getCurrentDate14());
|
record.setDeal_user_id(userId);
|
record.setDeal_user_name(userName);
|
record.setBusiness_id(flowId);
|
record.setNode_id(nodeId);
|
recordService.addRecord(record);
|
|
//将结果信息放入session中
|
request.getSession().setAttribute(SysConstants.SJTIPSESSION, msg);
|
return "redirect:/ewyw/ewIncident/ewoption.html?wt=3";
|
|
}
|
|
/**
|
* 项目经理审批提交页面
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("ewApproveCommit.html")
|
public String ewApproveCommit(HttpServletRequest request, HttpServletResponse response) {
|
return "business/wechat/ewyw/ewHealth/ewApproveCommit";
|
}
|
/**
|
* 结束流程
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("doEndHealthFlow.html")
|
public void doEndHealthFlow(HttpServletRequest request, HttpServletResponse response) {
|
ewHealthFacade.doEndHealthFlow(request);
|
String flowId = request.getParameter("flowId");
|
String nodeId = request.getParameter("nodeId");
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
String userId= ConvertUtil.obj2Str(user.get("ID"));
|
String userName=ConvertUtil.obj2Str(user.get("ZSXM"));
|
GG_RECORD record = new GG_RECORD();
|
record.setDeal_content("流程结束:"+userName+"进行了巡检审核");
|
record.setDeal_time(DateUtil.getCurrentDate14());
|
record.setDeal_user_id(userId);
|
record.setDeal_user_name(userName);
|
record.setBusiness_id(flowId);
|
record.setNode_id(nodeId);
|
recordService.addRecord(record);
|
|
Map msg = new HashMap();
|
msg.put("result", "1");
|
//将结果信息放入session中
|
request.getSession().setAttribute(SysConstants.SJTIPSESSION, msg);
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
* 回退
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewHealthSendback.html",method=RequestMethod.GET)
|
public ModelAndView ewHealthSendback(HttpServletRequest request,HttpServletResponse response){
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealthSendback");
|
String orderId = request.getParameter("orderId");
|
String nodeId = request.getParameter("nodeId");
|
String flowId = request.getParameter("flowId");
|
String lastNodeTemplateId = "";
|
lastNodeTemplateId = Constants.HEALTH_PATROL;
|
view.addObject("lastNodeTemplateId",lastNodeTemplateId);
|
view.addObject("orderId",orderId);
|
view.addObject("flowId",flowId);
|
view.addObject("nodeId",nodeId);
|
|
return view;
|
}
|
|
/**
|
* 回退提交
|
* */
|
@RequestMapping(value="ewHealthSendback.html",method=RequestMethod.POST)
|
public void doHealthSendback(HttpServletRequest request,HttpServletResponse response){
|
Map msg = ewHealthFacade.doSendback(request);
|
String flowId = request.getParameter("flowId");
|
String nodeId = request.getParameter("nodeId");
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
String userId= ConvertUtil.obj2Str(user.get("ID"));
|
String userName=ConvertUtil.obj2Str(user.get("ZSXM"));
|
GG_RECORD record = new GG_RECORD();
|
record.setDeal_content("回退:"+userName+"进行了回退操作");
|
record.setDeal_time(DateUtil.getCurrentDate14());
|
record.setDeal_user_id(userId);
|
record.setDeal_user_name(userName);
|
record.setBusiness_id(flowId);
|
record.setNode_id(nodeId);
|
recordService.addRecord(record);
|
|
request.getSession().setAttribute(SysConstants.SJTIPSESSION, msg);
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
* 跳转到巡检配置页面
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("ewHealthCiList.html")
|
public ModelAndView ewHealthCiList(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealthCiList");
|
String orderId = request.getParameter("orderId");
|
List<Map> nodeList = healthFacade.getCiPatrolItem(orderId);
|
view.addObject("orderId",orderId);
|
view.addObject("nodeList", nodeList);
|
return view;
|
}
|
|
/**
|
* 跳转到巡检配置页面(进行中)
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("ewHealthCiListCl.html")
|
public ModelAndView ewHealthCiListCl(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealthCiListCl");
|
String orderId = request.getParameter("orderId");
|
String nodeTemplateId = request.getParameter("nodeTemplateId");
|
//基本信息
|
if(StringUtil.isNotBlank(orderId)){
|
Map health = healthFacade.getHealthInfo(orderId);
|
view.addObject("info",health);
|
}
|
//需要查询设备peikezhan
|
List<Map> ciList = healthFacade.getPatrolCiList(orderId);
|
//查询该工单下的指标list
|
List<Map> itemList = healthFacade.getPatrolIteamsList(orderId);
|
//拼装设备和指标tree
|
TreeUtil treeUtil = new TreeUtil();
|
List treelist=treeUtil.createTreeByCate(ciList, itemList);
|
|
view.addObject("orderId",orderId);
|
view.addObject("flowId", request.getParameter("flowId"));
|
view.addObject("nodeId", request.getParameter("nodeId"));
|
view.addObject("nodeTemplateId", nodeTemplateId);
|
//不同节点显示不同数据
|
view.addObject("ciList",treelist);
|
List<Map> nodeList = healthFacade.getCiPatrolItem(orderId);
|
view.addObject("nodeList", nodeList);
|
return view;
|
}
|
|
/**
|
* 跳转到增加巡检设备页面
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewAddCiDialog.html",method=RequestMethod.GET)
|
public ModelAndView ewAddCiDialog(HttpServletRequest request, HttpServletResponse response) {
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ewAddCiDialog");
|
//查询设备
|
List<Map> ciList = healthFacade.getHealthCiList(request);
|
//查询该客户的所有可选item进行匹配
|
List<Map> itemsList=healthFacade.getAllItemOfCus(request);
|
TreeUtil treeUtil = new TreeUtil();
|
List treeList=treeUtil.createTreeByLvlId(ciList, itemsList);
|
view.addObject("ciList",treeList);
|
view.addObject("orderId", request.getParameter("orderId"));
|
view.addObject("ciIds", request.getParameter("ciIds"));
|
view.addObject("items", request.getParameter("items"));
|
return view;
|
}
|
|
@RequestMapping(value="ewAddCiDialog.html",method=RequestMethod.POST)
|
public void ewAddCiDialogSave(HttpServletRequest request, HttpServletResponse response) {
|
String orderId = request.getParameter("orderId");
|
String[] ciIdAry = request.getParameter("cilist").split(",");
|
String items = request.getParameter("items");
|
List itemlist = JsonUtil.json2List(items);
|
//添加巡检设备和指标(edit by peikezhan 2016.07.14)
|
HealthFacade impl = new HealthFacadeImpl();
|
ewHealthFacade.addPatrolCi(orderId,ciIdAry,itemlist);
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
* 查询设备下的item
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("ewSelectItem.html")
|
public ModelAndView selectItem(HttpServletRequest request, HttpServletResponse response) {
|
Map<String, String> params = ParamsMapUtil.getParameterMap(request);
|
ModelAndView view = new ModelAndView("/business/wechat/ewyw/ewHealth/ewSelectItem");
|
//查询该客户的所有可选item进行匹配
|
Map itemMap=healthFacade.getAllItemOfDevice(params);
|
view.addObject("itemMap",itemMap);
|
|
//所有配置及指标信息,为了隐藏显示
|
String orderId = request.getParameter("orderId");
|
//基本信息
|
if(StringUtil.isNotBlank(orderId)){
|
Map health = healthFacade.getHealthInfo(orderId);
|
view.addObject("info",health);
|
}
|
//需要查询设备peikezhan
|
List<Map> ciList = healthFacade.getPatrolCiList(orderId);
|
//查询该工单下的指标list
|
List<Map> itemList = healthFacade.getPatrolIteamsList(orderId);
|
//拼装设备和指标tree
|
TreeUtil treeUtil = new TreeUtil();
|
List treelist=treeUtil.createTreeByCate(ciList, itemList);
|
view.addObject("orderId",orderId);
|
view.addObject("ciList",treelist);
|
return view;
|
}
|
|
/**
|
* 工程师设备巡检(填写备注)
|
* @param model
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewHealthCiPatrol.html",method=RequestMethod.GET)
|
public String ewHealthCiPatrol(Model model,HttpServletRequest request, HttpServletResponse response) {
|
String patrolCiId = request.getParameter("patrolCiId");
|
SC_WORKFLOW_CI_HEALTH_CIDETAIL info = new SC_WORKFLOW_CI_HEALTH_CIDETAIL(patrolCiId).getInstanceById();
|
model.addAttribute("info", info);
|
model.addAttribute("patrolCiId", patrolCiId);
|
model.addAttribute("orderId", request.getParameter("orderId"));
|
return "/business/wechat/ewyw/ewHealth/ewHealthCiPatrol";
|
}
|
@RequestMapping(value="ewHealthCiPatrol.html",method=RequestMethod.POST)
|
public void doHealthCiPatrol(SC_WORKFLOW_CI_HEALTH_CIDETAIL ciItem,HttpServletRequest request, HttpServletResponse response) {
|
String patrolCiId = request.getParameter("patrolCiId");
|
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
ciItem.setId(patrolCiId)
|
.setUser_id(user.get("ID").toString())
|
.setUser_name(user.get("ZSXM").toString())
|
.update();
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
*工程师指标巡检
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewHealthItemPatrol.html",method=RequestMethod.GET)
|
public String ewHealthItemPatrol(Model model,HttpServletRequest request, HttpServletResponse response) {
|
String patrolItemId = request.getParameter("patrolItemId");
|
String orderId = request.getParameter("orderId");
|
Map info = healthFacade.getPatrolItemInfo(patrolItemId);
|
model.addAttribute("info", info);
|
model.addAttribute("patrolItemId", patrolItemId);
|
model.addAttribute("orderId", orderId);
|
return "/business/wechat/ewyw/ewHealth/ewHealthItemPatrol";
|
}
|
/**
|
* 工程师指标巡检
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewHealthItemPatrol.html",method=RequestMethod.POST)
|
public void doHealthItemPatrol(SC_WORKFLOW_ITEM_HEALTH_CIDETAIL ciItem,HttpServletRequest request, HttpServletResponse response) {
|
String patrolItemId = request.getParameter("patrolItemId");
|
|
Map user = WebUtil.getWywEngineerLoginUser(request);
|
ciItem.setId(patrolItemId)
|
.setUser_id(user.get("ID").toString())
|
.setUser_name(user.get("ZSXM").toString())
|
.update();
|
WebUtil.write(response, "1");
|
}
|
|
/**
|
*工程师指标巡检详情
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewHealthItemPatrolRead.html",method=RequestMethod.GET)
|
public String ewHealthItemPatrolRead(Model model,HttpServletRequest request, HttpServletResponse response) {
|
String patrolItemId = request.getParameter("patrolItemId");
|
Map info = healthFacade.getPatrolItemInfo(patrolItemId);
|
model.addAttribute("info", info);
|
return "/business/wechat/ewyw/ewHealth/ewHealthItemPatrolRead";
|
}
|
/**
|
*工程师配置巡检详情
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value="ewHealthCiPatrolRead.html",method=RequestMethod.GET)
|
public String healthCiPatrolRead(Model model,HttpServletRequest request, HttpServletResponse response) {
|
String patrolCiId = request.getParameter("patrolCiId");
|
SC_WORKFLOW_CI_HEALTH_CIDETAIL info = new SC_WORKFLOW_CI_HEALTH_CIDETAIL(patrolCiId).getInstanceById();
|
model.addAttribute("info", info);
|
return "/business/wechat/ewyw/ewHealth/ewHealthCiPatrolRead";
|
}
|
|
/**
|
* 健康检查工单响应
|
* @param request
|
* @param response
|
*/
|
@RequestMapping("answerHealth.html")
|
public void answerHealth(HttpServletRequest request,HttpServletResponse response) {
|
String result = ewHealthFacade.doOrderConfirm(request);
|
WebUtil.write(response, result);
|
}
|
/**
|
* 跳转到我的健康检查日历页面
|
*/
|
@RequestMapping("ewMyHealthCheck.html")
|
public String ewMyHealthCheck(Model model,HttpServletRequest request) {
|
|
//查询当前年前五年和后五年
|
int year = DateUtil.getYear();
|
List years = new ArrayList();
|
for(int i=5; i>=0; i--) {
|
int preYear = year-i;
|
years.add(preYear);
|
}
|
|
for(int i=1; i<5; i++) {
|
int nextYear = year+i;
|
years.add(nextYear);
|
}
|
|
model.addAttribute("years", years);
|
|
model.addAttribute("year", DateUtil.getToday("yyyy"));
|
model.addAttribute("month", DateUtil.getToday("MM"));
|
|
List months = new ArrayList();
|
for(int i=1; i<=12; i++) {
|
if(i<10) {
|
months.add("0"+i);
|
} else {
|
months.add(i);
|
}
|
}
|
model.addAttribute("months", months);
|
return "/business/wechat/ewyw/ewHealth/ewMyHealthCheck";
|
}
|
/**
|
* 查询健康检查日历
|
*/
|
@SuppressWarnings("unchecked")
|
@RequestMapping("ewMyHealthCal.html")
|
public String eMyDailyCal(Model model,HttpServletRequest request,HttpServletResponse response) {
|
|
String year = request.getParameter("year");
|
String month = request.getParameter("month");
|
|
Map result = ewHealthFacade.queryHealthCalandar(request);
|
List list = (List)result.get("monthDays");
|
List weekDays = (List)result.get("weekDays");
|
model.addAttribute("calandars", list);
|
model.addAttribute("weeks", weekDays);
|
|
|
Long[] dates = DateUtil.getDateFromMonth(ConvertUtil.obj2Int(year),ConvertUtil.obj2Int(month));
|
List<Map> healths = ewHealthFacade.ewMyHealthData(request);
|
model.addAttribute("orderList", healths);
|
return "/business/wechat/ewyw/ewHealth/ewMyHealthCal";
|
}
|
/**
|
* 根据日期获取我的例行维护列表
|
* @author chenlong
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping("ewMyHealthByDate.html")
|
public String ewMyHealthByDate(Model model,HttpServletRequest request){
|
initProSelector(model,request);
|
return "/business/wechat/ewyw/ewHealth/ewMyHealthByDate";
|
}
|
/**
|
* 根据日期获取所有例行维护列表
|
* @author chenlong
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping("ewHealthByDate.html")
|
public String ewHealthByDate(Model model,HttpServletRequest request){
|
initProSelector(model,request);
|
return "/business/wechat/ewyw/ewHealth/ewHealthByDate";
|
}
|
|
/**
|
* 初始化项目选择下拉框
|
* @author chenlong
|
* @param model
|
* @param request
|
*/
|
private void initProSelector(Model model,HttpServletRequest request){
|
//客户列表
|
List<Map> customers = incidentFacade.getCustomerList();
|
model.addAttribute("customers",customers);
|
}
|
/**
|
* 健康检查报告
|
* @author chenlong
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping("ewHealthReport.html")
|
public String ewHealthReport(Model model,HttpServletRequest request){
|
String orderId = request.getParameter("orderId");
|
String flowId = request.getParameter("flowId");
|
Map healthInfo = healthFacade.getHealthReportInfo(orderId,flowId);
|
model.addAttribute("healthInfo", healthInfo);
|
return "/business/wechat/ewyw/ewHealth/ewHealthReport";
|
}
|
//*********************************************运维管理******************************************************
|
/**
|
* 跳转到所有健康检查工单页面
|
*/
|
@RequestMapping("ewHealth.html")
|
public ModelAndView ewHealth(HttpServletRequest request,HttpServletResponse response) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealth");
|
//查询工单状态
|
Map<String, String> state = Constants.mapWORKFLOW_BASE_WFSTATE_PART;
|
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);
|
}
|
//查询健康检查所有环节
|
Map<String, String> node = Constants.healthNode;
|
List nodes = new ArrayList();
|
for (Map.Entry<String, String> entry : node.entrySet()) {
|
String key = entry.getKey();
|
String value = entry.getValue();
|
Map map = new HashMap();
|
map.put("nodeId", key);
|
map.put("nodeName", value);
|
nodes.add(map);
|
}
|
modelAndView.addObject("nodes", nodes);
|
modelAndView.addObject("status", status);
|
return modelAndView;
|
}
|
|
|
/**
|
* 查询工单列表
|
*/
|
@RequestMapping(value="ewHealthData.html",method=RequestMethod.POST)
|
public ModelAndView eHealthData(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewHealth/ewHealthData");
|
List list = ewHealthFacade.ewHealthData(request);
|
modelAndView.addObject("orderList", list);
|
String flowstate = request.getParameter("flowstate");
|
modelAndView.addObject("flowstate", flowstate);
|
return modelAndView;
|
}
|
|
/**
|
* 查询工单总数量
|
*/
|
@RequestMapping(value="ewHealthCount.html",method=RequestMethod.POST)
|
public void eHealthCount(HttpServletRequest request,HttpServletResponse response) {
|
int count = ewHealthFacade.ewHealthCount(request);
|
WebUtil.write(response, String.valueOf(count));
|
}
|
/**
|
* 跳转到健康检查日历页面
|
*/
|
@RequestMapping("ewHealthCheck.html")
|
public String ewHealthCheck(Model model,HttpServletRequest request) {
|
|
//查询当前年前五年和后五年
|
int year = DateUtil.getYear();
|
List years = new ArrayList();
|
for(int i=5; i>=0; i--) {
|
int preYear = year-i;
|
years.add(preYear);
|
}
|
|
for(int i=1; i<5; i++) {
|
int nextYear = year+i;
|
years.add(nextYear);
|
}
|
|
model.addAttribute("years", years);
|
|
model.addAttribute("year", DateUtil.getToday("yyyy"));
|
model.addAttribute("month", DateUtil.getToday("MM"));
|
|
List months = new ArrayList();
|
for(int i=1; i<=12; i++) {
|
if(i<10) {
|
months.add("0"+i);
|
} else {
|
months.add(i);
|
}
|
}
|
model.addAttribute("months", months);
|
return "/business/wechat/ewyw/ewHealth/ewHealthCheck";
|
}
|
/**
|
* 查询健康检查日历
|
*/
|
@RequestMapping("ewHealthCal.html")
|
public String ewHealthCal(Model model,HttpServletRequest request,HttpServletResponse response) {
|
|
String year = request.getParameter("year");
|
String month = request.getParameter("month");
|
|
Map result = ewHealthFacade.queryHealthCalandar(request);
|
List list = (List)result.get("monthDays");
|
List weekDays = (List)result.get("weekDays");
|
model.addAttribute("calandars", list);
|
model.addAttribute("weeks", weekDays);
|
|
|
Long[] dates = DateUtil.getDateFromMonth(ConvertUtil.obj2Int(year),ConvertUtil.obj2Int(month));
|
List<Map> healths = ewHealthFacade.ewHealthData(request);
|
model.addAttribute("orderList", healths);
|
return "/business/wechat/ewyw/ewHealth/ewHealthCal";
|
}
|
/**
|
* 查询关联设备
|
*/
|
@RequestMapping("ewLinkDevice.html")
|
public ModelAndView ewLinkDevice(HttpServletRequest request) {
|
ModelAndView modelAndView = new ModelAndView("/business/wechat/ewyw/ewIncident/ewLinkDevice");
|
String flowId = request.getParameter("flowId");
|
List devices = ewHealthFacade.queryDevices(flowId);
|
modelAndView.addObject("devices", devices);
|
return modelAndView;
|
}
|
}
|