<%@ page language="java" contentType="text/html; charset=UTF-8"%> <%@ page import="net.sf.json.JSONObject"%> <%@ page import="net.sf.json.JSONArray"%> <%@ page import="java.util.*" %> <%@ page import="weaver.general.*" %> <%@ page import="java.io.IOException"%> <%@ page import="weaver.common.DateUtil"%> <%@ page import="weaver.conn.RecordSet"%> <%-- 天一建设移动门户 访问路径: /mobilemode/apps/QC708794/action.jsp?action=*** 幻灯片路径: /mobilemode/apps/QC708794/action.jsp?action=getSlideImages&userid={curruser}&catalogid=1,2,3&counts=3 -- created by cdh 2019/10/25 --%> <% String action = Util.null2String(request.getParameter("action")); if("getSlideImages".equalsIgnoreCase(action)){// 获取幻灯片图片 JSONArray datas = new JSONArray(); int userid = Util.getIntValue(request.getParameter("userid")); String catalogid = Util.null2String(request.getParameter("catalogid")); int counts = Util.getIntValue(request.getParameter("counts")); // rs.writeLog("【Debug】/mobilemode/apps/QC708794/action.jsp >>>>> [userid:"+userid+", catalogid:"+catalogid+", counts:"+counts+"]"); List> resultList = DocGetListService.getDocInfo(userid, catalogid, counts); if(resultList.size() == 0){ JSONObject data = new JSONObject(); data.put("action", ""); data.put("pic_path", "/mobilemode/images/mec/pic-icon_wev8.png"); data.put("pic_desc", ""); datas.add(data); }else{ for(int i=0; i resultMap = resultList.get(i); String docid = resultMap.get("docid"); String pic_path = Util.null2String(resultMap.get("pic_path")); if("".equals(pic_path)){ continue; }else{ pic_path += "&mobileCompress=1"; } JSONObject data = new JSONObject(); //data.put("action", "openDocdetail("+docid+");"); data.put("action","/spa/document/static4mobile/index.html#/news/1664378919/doc/"+docid); data.put("pic_path", pic_path); data.put("pic_desc", ""); datas.add(data); } } /************** 模拟数据 **************** JSONObject data = new JSONObject(); data.put("action", "openDocdetail(872093);"); data.put("pic_path", "/mobilemode/apps/QC708794/images/b1.png"); data.put("pic_desc", ""); datas.add(data); data = new JSONObject(); data.put("action", "openDocdetail(872093);"); data.put("pic_path", "/mobilemode/apps/QC708794/images/b2.png"); data.put("pic_desc", ""); datas.add(data); data = new JSONObject(); data.put("action", "openDocdetail(872093);"); data.put("pic_path", "/mobilemode/apps/QC708794/images/b3.png"); data.put("pic_desc", ""); datas.add(data); data = new JSONObject(); data.put("action", ""); data.put("pic_path", "/mobilemode/images/mec/pic-icon_wev8.png"); data.put("pic_desc", ""); datas.add(data); */ /************** 模拟数据 *****************/ out.print(datas.toString()); }else if("getWorkflowTodoCount".equalsIgnoreCase(action)){// 获取待办流程数量 JSONObject resultObj = new JSONObject(); try { int userid = Util.getIntValue(request.getParameter("userid")); String showCopy = Util.null2String(request.getParameter("showCopy")); String showFlag = Util.null2String(request.getParameter("showFlag")); String[] conditions = new String[]{}; boolean hasShowCopy = "1".equals(showCopy) ? true : false;// 包含抄送 boolean belongtoshowFlag = "1".equals(showFlag) ? true : false;// 多账号 int counts = WorkflowService.getToDoWorkflowRequestCount(userid, hasShowCopy, conditions, belongtoshowFlag); resultObj.put("counts", counts); resultObj.put("status", "1"); } catch (Exception ex) { ex.printStackTrace(); resultObj.put("status", "-1"); resultObj.put("errMsg", ex.getMessage()); }finally{ try{ out.print(resultObj.toString()); out.flush(); }catch(IOException ex){ ex.printStackTrace(); } } }else if("getDocIsnewCount".equalsIgnoreCase(action)){// 获取指定文档目录文档未读数 JSONObject resultObj = new JSONObject(); try { int userid = Util.getIntValue(request.getParameter("userid")); String catalogid = Util.null2String(request.getParameter("catalogid")); // rs.writeLog("【Debug】/mobilemode/apps/QC708794/action.jsp >>>>> [userid:"+userid+", catalogid:"+catalogid+"]"); int counts = DocCountInfo.getDocNotReadNums(catalogid, userid); resultObj.put("counts", counts); resultObj.put("status", "1"); } catch (Exception ex) { ex.printStackTrace(); resultObj.put("status", "-1"); resultObj.put("errMsg", ex.getMessage()); }finally{ try{ out.print(resultObj.toString()); out.flush(); }catch(IOException ex){ ex.printStackTrace(); } } }else if("getWorkflowListData".equalsIgnoreCase(action)){// 获取流程列表数据 JSONObject resultObj = new JSONObject(); try { int pageNo = Util.getIntValue(request.getParameter("pageNo"), 1);// 分页当前页码 int pageSize = Util.getIntValue(request.getParameter("pageSize"), 10);// 分页每页条数 String searchKey = Util.null2String(request.getParameter("searchKey"));// 搜索条件(流程标题) String timestamp = Util.null2String(request.getParameter("timestamp"));// 时间戳 String userid = Util.null2String(request.getParameter("userid"));// 当前用户 String wftypeid = Util.null2String(request.getParameter("wftypeid"));// 流程分类id /**/ rs.writeLog("【debug】/mobilemode/apps/QC708794/action.jsp getWorkflowListData >>>>> [pageNo:"+pageNo+", pageSize:"+pageSize+", searchKey:"+searchKey +", userid:"+userid+", wftypeid:"+wftypeid+",timestamp:"+timestamp+"]"); int totalSize = 0; JSONArray dataArray = new JSONArray(); /************** 模拟数据 *****************/ totalSize = 4; JSONObject dataObj = new JSONObject(); dataObj.put("requestid", "1"); dataObj.put("workflowid", "1"); dataObj.put("workflowname", "[出差审批流程]"); dataObj.put("wftitle", "出差审批流程-系统管理员-2019-02-18(出差地点:北京)"); dataObj.put("creator", "系统管理员"); dataObj.put("createdate", "2019-02-18"); dataObj.put("createtime", "17:48:04"); dataObj.put("receivedate", "2019-02-18"); dataObj.put("receivetime", "17:48:04"); dataObj.put("isnew", "1"); dataArray.add(dataObj); dataObj = new JSONObject(); dataObj.put("requestid", "2"); dataObj.put("workflowid", "2"); dataObj.put("workflowname", "[部门发文申请]"); dataObj.put("wftitle", "部门发文申请-系统管理员-2019-02-19"); dataObj.put("creator", "系统管理员"); dataObj.put("createdate", "2019-02-19"); dataObj.put("createtime", "15:50:04"); dataObj.put("receivedate", "2019-02-19"); dataObj.put("receivetime", "15:50:04"); dataObj.put("isnew", "1"); dataArray.add(dataObj); dataObj = new JSONObject(); dataObj.put("requestid", "3"); dataObj.put("workflowid", "3"); dataObj.put("workflowname", "[系统提醒工作流]"); dataObj.put("wftitle", "License授权到期提醒"); dataObj.put("creator", "系统管理员"); dataObj.put("createdate", "2019-10-18"); dataObj.put("createtime", "16:49:04"); dataObj.put("receivedate", "2019-10-18"); dataObj.put("receivetime", "16:49:04"); dataObj.put("isnew", "0"); dataArray.add(dataObj); dataObj = new JSONObject(); dataObj.put("requestid", "4"); dataObj.put("workflowid", "4"); dataObj.put("workflowname", "[用车申请]"); dataObj.put("wftitle", "用车申请-系统管理员-2019-01-28"); dataObj.put("creator", "系统管理员"); dataObj.put("createdate", "2019-01-28"); dataObj.put("createtime", "16:47:04"); dataObj.put("receivedate", "2019-01-28"); dataObj.put("receivetime", "16:47:04"); dataObj.put("isnew", "1"); dataArray.add(dataObj); /************** 模拟数据 *****************/ resultObj.put("totalSize", totalSize); resultObj.put("datas", dataArray); resultObj.put("status", "1"); } catch (Exception ex) { ex.printStackTrace(); rs.writeLog(ex); rs.writeLog("【debug】/mobilemode/apps/QC708794/action.jsp getWorkflowListData error:"+ex.getMessage()); resultObj.put("status", "-1"); resultObj.put("totalSize", "0"); resultObj.put("errMsg", ex.getMessage()); }finally{ try{ // rs.writeLog("【debug】QC708794 getWorkflowListData finally resultObj:"+resultObj.toString()); out.print(resultObj.toString()); out.flush(); }catch(Exception ex){ ex.printStackTrace(); rs.writeLog(ex); rs.writeLog("【debug】/mobilemode/apps/QC708794/action.jsp getWorkflowListData finally error:"+ex.getMessage()); } } }else if("getWorkflowTodoCountByType".equalsIgnoreCase(action)){// 获取流程大类下的待办数量 JSONObject resultObj = new JSONObject(); try { int userid = Util.getIntValue(request.getParameter("userid")); String wftypeid = Util.null2String(request.getParameter("wftypeid"));// 流程分类id // rs.writeLog("【Debug】/mobilemode/apps/QC708794/action.jsp >>>>> [userid:"+userid+", wftypeid:"+wftypeid+"]"); resultObj.put("counts", 33); resultObj.put("status", "1"); } catch (Exception ex) { ex.printStackTrace(); resultObj.put("status", "-1"); resultObj.put("errMsg", ex.getMessage()); }finally{ try{ out.print(resultObj.toString()); out.flush(); }catch(IOException ex){ ex.printStackTrace(); } } } %>