#EC_HJ142# 修改代码路径,方便管理及上线

main
shilei 1 year ago
parent eb7abf86da
commit 0adbbd8412

@ -1,6 +1,6 @@
package com.api.signature; package com.api.dito.signature;
import com.engine.signature.GetDocSignatureWebAction; import com.engine.dito.signature.GetDocSignatureWebAction;
import javax.ws.rs.Path; import javax.ws.rs.Path;

@ -2,7 +2,7 @@ package com.customization.dito.sendtodo;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.time.util.DateUtil; import com.time.util.DateUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;

@ -49,6 +49,7 @@ public class SendPortalErrorUtil {
Map<String,String> mainMap = new HashMap<String,String>(); Map<String,String> mainMap = new HashMap<String,String>();
mainMap.put("lcid",lcid); mainMap.put("lcid",lcid);
mainMap.put("lcxz",lcid);
mainMap.put("jdid",jdid); mainMap.put("jdid",jdid);
mainMap.put("jdmc",jdmc); mainMap.put("jdmc",jdmc);
mainMap.put("ryid",ryid); mainMap.put("ryid",ryid);

@ -2,7 +2,7 @@ package com.customization.dito.sendtodo;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.time.util.DateUtil; import com.time.util.DateUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;

@ -1,6 +1,6 @@
package com.customization.dito.sendtodo; package com.customization.dito.sendtodo;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.customization.dito.sendtodo.agent.SendPortalToReadByAgentUtil; import com.customization.dito.sendtodo.agent.SendPortalToReadByAgentUtil;
import com.customization.dito.sendtodo.agent.SendPortalTodoByAgentUtil; import com.customization.dito.sendtodo.agent.SendPortalTodoByAgentUtil;
import com.engine.core.cfg.annotation.CommandDynamicProxy; import com.engine.core.cfg.annotation.CommandDynamicProxy;

@ -2,11 +2,10 @@ package com.customization.dito.sendtodo;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.engine.core.interceptor.CommandContext; import com.engine.core.interceptor.CommandContext;
import com.time.util.DateUtil; import com.time.util.DateUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.jsoup.Connection;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.BaseBean; import weaver.general.BaseBean;
import weaver.general.Util; import weaver.general.Util;

@ -2,7 +2,7 @@ package com.customization.dito.sendtodo;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.engine.core.interceptor.CommandContext; import com.engine.core.interceptor.CommandContext;
import com.time.util.DateUtil; import com.time.util.DateUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;

@ -1,7 +1,7 @@
package com.customization.dito.sendtodo; package com.customization.dito.sendtodo;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.engine.core.interceptor.CommandContext; import com.engine.core.interceptor.CommandContext;
import com.time.util.DateUtil; import com.time.util.DateUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;

@ -6,8 +6,28 @@ import java.util.Map;
public interface RequestRemarkService { public interface RequestRemarkService {
/**
*
* @param datas
* @param user
* @return
*/
Map<String,Object> requestRemarkSubmit(Map<String,Object> datas,User user); Map<String,Object> requestRemarkSubmit(Map<String,Object> datas,User user);
/***
*
* @param datas
* @param user
* @return
*/
Map<String,Object> reqsubmit2Archived(Map<String,Object> datas,User user); Map<String,Object> reqsubmit2Archived(Map<String,Object> datas,User user);
/***
*
* @param datas
* @param user
* @return
*/
Map<String,Object> reqsubmit2OverTime(Map<String,Object> datas,User user);
} }

@ -3,6 +3,7 @@ package com.engine.dito.reqremark.service.impl;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.dito.reqremark.cmd.RequestRemarkArchivedCmd; import com.engine.dito.reqremark.cmd.RequestRemarkArchivedCmd;
import com.engine.dito.reqremark.cmd.RequestRemarkCmd; import com.engine.dito.reqremark.cmd.RequestRemarkCmd;
import com.engine.dito.reqremark.cmd.RequestRemarkOverTimeCmd;
import com.engine.dito.reqremark.service.RequestRemarkService; import com.engine.dito.reqremark.service.RequestRemarkService;
import weaver.hrm.User; import weaver.hrm.User;
@ -19,4 +20,9 @@ public class RequestRemarkServiceImpl extends Service implements RequestRemarkSe
public Map<String, Object> reqsubmit2Archived(Map<String, Object> datas, User user) { public Map<String, Object> reqsubmit2Archived(Map<String, Object> datas, User user) {
return commandExecutor.execute(new RequestRemarkArchivedCmd(datas,user)); return commandExecutor.execute(new RequestRemarkArchivedCmd(datas,user));
} }
@Override
public Map<String, Object> reqsubmit2OverTime(Map<String, Object> datas, User user) {
return commandExecutor.execute(new RequestRemarkOverTimeCmd(datas,user));
}
} }

@ -69,4 +69,26 @@ public class RequestRemarkAction {
return JSONObject.toJSONString(apidatas); return JSONObject.toJSONString(apidatas);
} }
@GET
@Path("/reqsubmit2OverTime")
@Produces({MediaType.TEXT_PLAIN})
public String reqsubmit2OverTime(@Context HttpServletRequest request, @Context HttpServletResponse response) {
BaseBean bb = new BaseBean();
bb.writeLog("reqsubmit2Archived");
Map<String,Object> apidatas = new HashMap<String,Object>();
try{
User user = HrmUserVarify.getUser(request, response);
Map<String,Object> dataMap = ParamUtil.request2Map(request);
apidatas.putAll(getService().reqsubmit2OverTime(dataMap,user));
apidatas.put("api_status",true);
}catch (Exception e){
apidatas.put("api_status",false);
apidatas.put("api_errormsg","exception:"+e.getMessage());
}
bb.writeLog("apidatas:"+ JSONObject.toJSONString(apidatas));
return JSONObject.toJSONString(apidatas);
}
} }

@ -1,4 +1,4 @@
package com.engine.signature; package com.engine.dito.signature;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;

@ -0,0 +1,713 @@
package com.engine.workflow.biz;
import com.engine.workflow.biz.excelDesign.DoSaveFreeExcelDesignBiz;
import com.engine.workflow.biz.freeNode.FreeNodeBiz;
import com.engine.workflow.entity.newRequest.WfBean;
import com.engine.workflow.entity.newRequest.WfType;
import com.engine.workflow.entity.newRequest.WfUser;
import com.engine.workflow.util.CollectionUtil;
import net.sourceforge.pinyin4j.PinyinHelper;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Pinyin4j;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.company.DepartmentComInfo;
import weaver.hrm.company.SubCompanyComInfo;
import weaver.hrm.job.JobTitlesComInfo;
import weaver.hrm.resource.ResourceComInfo;
import weaver.ofs.bean.OfsWorkflow;
import weaver.ofs.util.OfsWorkflowShareUtils;
import weaver.share.ShareManager;
import weaver.soa.workflow.WorkFlowInit;
import weaver.workflow.request.todo.RequestUtil;
import weaver.workflow.workflow.WorkTypeComInfo;
import weaver.workflow.workflow.WorkflowAllComInfo;
import weaver.workflow.workflow.WorkflowConfigComInfo;
import weaver.workflow.workflow.WorkflowVersion;
import java.util.*;
/**
*
* Created by jhy on 2018/5/9.
*/
public class NewRequestBiz {
private Map<String, WfType> wftypeInfo = null;
private WorkTypeComInfo worktypecominfo = null;
private WorkflowAllComInfo workflowAllComInfo = null;
private ResourceComInfo resourceComInfo = null;
private DepartmentComInfo departmentComInfo = null;
private JobTitlesComInfo jobTitlesComInfo = null;
private SubCompanyComInfo subCompanyComInfo = null;
private ShareManager shareManager = null;
private WorkFlowInit workflowInit = null;
private List<String> usedtodoList = null;
private List<String> usedtodoAndCollWfIds = null;
private User user;
private String[] colors = null;
private String[] imgs = null;
private String isuserdefault; // 是否收藏
private String selectedworkflow;
private String currentdate;
private String currenttime;
private String commonuse = "0";
private String source = "";//请求来源
private static String specialstr = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~@#¥%……&*()--+|{}【】‘;:”“’。,、?]";
private boolean openofs = false;
private String inornot = "in";//用于不同入口拼接各自的数据范围的标识可选值in、not in
private String newRequestRange = "";//用于不同入口拼接各自的数据范围只接收workflowidworkflowtype需转成workflowid
private String customSqlWhere = "";
private String typeids = ""; // 限制的类型
private boolean ismobile = false;
private Map<String,List<OfsWorkflow>> ofsWorkflowDatas = new HashMap<>();//当前用户所有可创建的异构系统流程数据(如果开启主次账号统一显示,则数据包含次账号,无代理)
private String forceUnsupportSPAWF = "";//强制走jsp跳转至新建流程页面的路径id
private String ofsWorkflowids_CurrUser = "0";//当前用户所有可创建的异构系统workflowids不包含次账号用户常用流程计算
public NewRequestBiz(User user) {
this.user = user;
init();
}
public NewRequestBiz(User user,String source) {
this.user = user;
this.source = source;
init();
}
private void init() {
this.wftypeInfo = new HashMap<String, WfType>();
this.shareManager = new ShareManager();
this.workflowInit = new WorkFlowInit();
try {
this.worktypecominfo = new WorkTypeComInfo();
this.workflowAllComInfo = new WorkflowAllComInfo();
this.departmentComInfo = new DepartmentComInfo();
this.resourceComInfo = new ResourceComInfo();
this.jobTitlesComInfo = new JobTitlesComInfo();
this.subCompanyComInfo = new SubCompanyComInfo();
} catch (Exception e) {
e.printStackTrace();
}
this.usedtodoList = new ArrayList<String>();
this.usedtodoAndCollWfIds = new ArrayList<>();
Calendar today = Calendar.getInstance();
this.currentdate = Util.add0(today.get(Calendar.YEAR), 4) + "-" + Util.add0(today.get(Calendar.MONTH) + 1, 2) + "-" + Util.add0(today.get(Calendar.DAY_OF_MONTH), 2);
this.currenttime = Util.add0(today.get(Calendar.HOUR_OF_DAY), 2) + ":" + Util.add0(today.get(Calendar.MINUTE), 2) + ":" + Util.add0(today.get(Calendar.SECOND), 2);
this.selectedworkflow = "";
this.colors = new String[]{"#55D2D4", "#B37BFA", "#FFC62E", "#8DCE36", "#37B2FF", "#FF9537", "#FF5E56", "#FFC62E"};
this.imgs = new String[]{
"icon-New-Flow-Personnel-matters",
"icon-New-Flow-contract",
"icon-New-Flow-task",
"icon-New-Flow-printing",
"icon-New-Flow-summary",
"icon-coms-task-list",
"icon-coms-Paste",
"icon-meeting-cycle"
};
RequestUtil requestutil = new RequestUtil();
openofs = requestutil.getOfsSetting().getIsuse() == 1;
}
public List<WfType> getWfInfo(String wfids) {
String belongtoshow = "";
RecordSet rs = new RecordSet();
// 判断主次账户是否统一显示
rs.executeQuery("select belongtoshow from HrmUserSetting where resourceId = ?", user.getUID());
if (rs.next()) {
belongtoshow = Util.null2String(rs.getString("belongtoshow"));
}
String userIDAll = String.valueOf(user.getUID());
if (!"".equals(Util.null2String(user.getBelongtoids())) && "1".equals(belongtoshow) && !"wfcenter".equals(source)) {
userIDAll = user.getUID() + "," + user.getBelongtoids();
}
String logintype = user.getLogintype();
int usertype = 0;
if (logintype.equals("2")) {
usertype = 1;
}
if (usertype == 0) {
rs.executeProc("workflow_RUserDefault_Select", String.valueOf(user.getUID()));
if (rs.next()) {
selectedworkflow = rs.getString("selectedworkflow");
isuserdefault = rs.getString("isuserdefault");
commonuse = rs.getString("commonuse");
}
}
// isuserdefault = ("1".equals(needall))?"0":isuserdefault;
if (!selectedworkflow.equals(""))
selectedworkflow += "|";
List<String> selectedworkflowList = Util.TokenizerString(selectedworkflow,"|");
for(String wfid : selectedworkflowList){
if(wfid.contains("T")){
continue;
}else{
wfid = wfid.replace("W","");
String activeWfid = workflowAllComInfo.getActiveversionid(wfid);//收藏历史版本流程,活动版本未收藏
if(!usedtodoAndCollWfIds.contains(wfid)){//过滤脏数据
usedtodoAndCollWfIds.add(wfid);
}
if(!usedtodoAndCollWfIds.contains(activeWfid) && Util.getIntValue(activeWfid) > 0){
usedtodoAndCollWfIds.add(activeWfid);
selectedworkflow += "W"+activeWfid+"|";//收藏添加活动版本数据
}
}
}
//新建流程加载异构系统数据开关,默认是开启的
WorkflowConfigComInfo configComInfo = new WorkflowConfigComInfo();
boolean createRequestOpenOfs = "1".equals(configComInfo.getValue("create_request_open_ofs"));
//纯加载异构系统可创建流程数据
if(usertype == 0 && openofs && "0".equals(user.getAccount_type()) && createRequestOpenOfs){//仅主账号允许显示异构系统路径
loadAllWfCreateInfo4Ofs(userIDAll, usertype, wfids,ismobile);
}
// 加载常用流程 不开启显示常用流程时,不加载常用流程数据
if("1".equals(commonuse)){
loadUsedtodoWf(usertype, user);
}
// 加载所有可创建流程
loadAllWfCreateInfo(userIDAll, usertype, wfids);
// 加载可代理创建流程
if (usertype == 0 && !"wfcenter".equals(source)) {
loadWfAgentInfo(userIDAll,wfids);
}
// 加载所有异构系统可创建流程,不考虑代理--数据处理
if(usertype == 0 && openofs && "0".equals(user.getAccount_type())){
for (Map.Entry<String, List<OfsWorkflow>> entry : ofsWorkflowDatas.entrySet()) {
List<OfsWorkflow> ofsWorkflowList = entry.getValue();
int userid = Util.getIntValue(entry.getKey());
for(OfsWorkflow ofsWorkflow : ofsWorkflowList){
String typeid = ofsWorkflow.getSysid();
this.generateInjectData(wftypeInfo.get(typeid), typeid, ofsWorkflow.getWorkflowid(), ofsWorkflow.getShowname(),ofsWorkflow.getWorkflowname(), "", ofsWorkflow.getAppcwurl(), ofsWorkflow.getPccwurl(), userid, -1, false,true,ofsWorkflow.getWorkflowname());
}
}
}
// 剔除数据中心流程
getAllInputReport();
return sortWfTypes();
}
/**
*
*
* @return
*/
private void loadAllWfCreateInfo(String userIDAll, int usertype, String workflowids) {
RecordSet rs = new RecordSet();
String[] arr = userIDAll.split(",");
int userid = 0;
User _User = null;
String typeid = "";
for (int i = 0; i < arr.length; i++) {
userid = Util.getIntValue(arr[i]);
_User = workflowInit.getUser(userid);
if(usertype==1) {
_User = user;
}
String wfcrtSqlWhere = shareManager.getWfShareSqlWhere(_User, "t1");
String sql = "select t2.workflowtype,t1.workflowid,t2.workflowname,t2.workflowdesc,t2.isimportwf,t2.islockworkflow from ShareInnerWfCreate t1,workflow_base t2 where t1.workflowid=t2.id and t2.isvalid='1' and t1.usertype = ? ";
if(!"".equals(workflowids)){//拼接方法参数
sql += " and t2.id in (" + workflowids + ") ";
}
if(!"".equals(customSqlWhere)) {//拼接自定义条件
sql += customSqlWhere;
}
if(!"".equals(newRequestRange)){//拼接各入口条件
sql += " and " + Util.getSubINClause(newRequestRange, "t2.id", inornot);
}
if("wfcenter".equals(source)){//拼接流程模块--流程中心条件,此入口仅需要常用流程和我的收藏的流程
if(usedtodoAndCollWfIds.size() > 0){
sql += " and t2.id in(" + CollectionUtil.list2String(usedtodoAndCollWfIds,",") + ") ";
}else{
return;
}
}
sql += " and " + wfcrtSqlWhere + " order by t2.dsporder asc, t2.workflowname ";// 所有可创建流程类型集合
rs.executeQuery(sql, usertype);
while (rs.next()) {
if("1".equals(rs.getString("islockworkflow")))
continue;
typeid = rs.getString("workflowtype");
String workflowDesc = Util.null2String(rs.getString("workflowdesc"));
this.generateInjectData(wftypeInfo.get(typeid),typeid,rs.getString("workflowid"),Util.null2String(worktypecominfo.getWorkTypename(typeid)),Util.null2String(rs.getString("workflowname")),rs.getString("isimportwf"),"","",userid,-1,false,false,workflowDesc);
}
}
}
/**
*
*
* @param userIDAll
*/
private void loadWfAgentInfo(String userIDAll,String wfids) {
RecordSet rs = new RecordSet();
// 创建代理增加功能
// 获得当前的日期和时间
String begindate, begintime, enddate, endtime = "";
String agentworkflowtype, agentworkflow = "";
int beagenterid = 0;
String agentUserSql = "select distinct t.bagentuid from workflow_agentConditionSet t,workflow_base t1 where t.workflowid=t1.id and t1.isvalid in ('1','3') and t.agenttype>'0' and t.iscreateagenter=1 and t.agentuid in ("
+ userIDAll + ") ";
RecordSet agentRs = new RecordSet();
agentRs.executeQuery(agentUserSql);
while (agentRs.next()) {
int bagentuid = Util.getIntValue(agentRs.getString(1));
String bstatus = resourceComInfo.getStatus(bagentuid + "");
if ("5".equals(bstatus) || "".equals(bstatus)) {
continue;
}
User bagentUser = new User(bagentuid);
String bagentWfcrtSqlWhereMain = shareManager.getWfShareSqlWhere(bagentUser, "t3");
String agentUserPermissionSql = "select distinct t1.workflowtype,t.workflowid,t.bagentuid,t.begindate,t.begintime,t.enddate,t.endtime,t1.workflowname,t1.isimportwf,t1.islockworkflow "
+ " from workflow_agentConditionSet t,workflow_base t1, ShareInnerWfCreate t3 " + " where t.workflowid=t1.id and t1.isvalid in ('1','3') and t.agenttype>'0' and t.iscreateagenter=1 and t.agentuid in ("
+ userIDAll + ") " + " and t1.id=t3.workflowid and t3.usertype=0 and " + bagentWfcrtSqlWhereMain ;
if(!"".equals(wfids)){//拼接方法参数
agentUserPermissionSql += " and t1.id in (" + wfids + ") ";
}
if(!"".equals(customSqlWhere)){//拼接自定义条件
agentUserPermissionSql += " " + customSqlWhere.replaceAll("t2","t1");
}
if(!"".equals(newRequestRange)){//拼接各入口条件
agentUserPermissionSql += " and " + Util.getSubINClause(newRequestRange, "t1.id", inornot);
}
agentUserPermissionSql+=" order by t1.workflowtype,t.workflowid";
rs.executeQuery(agentUserPermissionSql);
while (rs.next()) {
if("1".equals(rs.getString("islockworkflow")) || !(bagentuid+"").equals(rs.getString("bagentuid")) )
continue;
begindate = Util.null2String(rs.getString("begindate"));
begintime = Util.null2String(rs.getString("begintime"));
enddate = Util.null2String(rs.getString("enddate"));
endtime = Util.null2String(rs.getString("endtime"));
agentworkflowtype = Util.null2String(rs.getString("workflowtype"));
agentworkflow = Util.null2String(rs.getString("workflowid"));
beagenterid = Util.getIntValue(rs.getString("bagentuid"), 0);
agentworkflow = WorkflowVersion.getActiveVersionWFID(agentworkflow);
// 判断代理时间是否到期
if (!"".equals(begindate)) {
if ((begindate + " " + begintime).compareTo(currentdate + " " + currenttime) > 0)
continue;
}
if (!"".equals(enddate)) {
if ((enddate + " " + endtime).compareTo(currentdate + " " + currenttime) < 0)
continue;
}
// 验证必要数据是否为空
if ("".equals(agentworkflowtype) || beagenterid == 0 || "".equals(agentworkflow)) {
continue;
}
// 更新数据到集合
String workflowdesc = getWorkflowDesc(agentworkflow);
this.generateInjectData(wftypeInfo.get(agentworkflowtype),agentworkflowtype,agentworkflow,Util.null2String(worktypecominfo.getWorkTypename(agentworkflowtype)),Util.null2String(rs.getString("workflowname")),rs.getString("isimportwf"),"","",-1,beagenterid,true,false,workflowdesc);
}
}
}
/**
*
* @param userIDAll
* @param usertype
* @param workflowids
*/
private void loadAllWfCreateInfo4Ofs(String userIDAll, int usertype, String workflowids,boolean ismobile){
if("".equals(workflowids)){//workflowids不为空的目前只有commonservice入口调用暂不处理其他情况
if("wfcenter".equals(source)){
workflowids = CollectionUtil.list2String(usedtodoAndCollWfIds,",");
}else{
workflowids = newRequestRange;
}
}
int currUserid = user.getUID();
OfsWorkflowShareUtils ofsWorkflowShareUtils = new OfsWorkflowShareUtils();
String[] arr = userIDAll.split(",");
for (int i = 0; i < arr.length; i++) {//按用户加载,包含主次账号
int userid = Util.getIntValue(arr[i]);
List<OfsWorkflow> ofsWorkflowList = ofsWorkflowShareUtils.getWorkflowDatas(userid,usertype+"",ismobile,typeids,workflowids,inornot);
for(OfsWorkflow ofsWorkflow : ofsWorkflowList){
if(currUserid == userid){//处理当前登录用户可创建异构系统流程id串用户常用流程计算
ofsWorkflowids_CurrUser += ofsWorkflow.getWorkflowid() + ",";
}
forceUnsupportSPAWF += ofsWorkflow.getWorkflowid() + ",";
}
ofsWorkflowDatas.put(userid+"",ofsWorkflowList);
}
ofsWorkflowids_CurrUser = ofsWorkflowids_CurrUser.endsWith(",") ? ofsWorkflowids_CurrUser.substring(0,ofsWorkflowids_CurrUser.length()-1) : ofsWorkflowids_CurrUser;
forceUnsupportSPAWF = forceUnsupportSPAWF.endsWith(",") ? forceUnsupportSPAWF.substring(0,forceUnsupportSPAWF.length()-1) : forceUnsupportSPAWF;
}
/**
* 使12
*/
private void loadUsedtodoWf(int usertype, User user) {
RecordSet rs = new RecordSet();
if (usertype == 0) {
String agentWfcrtSqlWhere = shareManager.getWfShareSqlWhere(user, "t1");
// 门户sql条件
String portalsqlwhere = "";
if(customSqlWhere != null && !"".equals(customSqlWhere)){
portalsqlwhere = customSqlWhere.replaceAll("t2","workflow_base");
}
String selectSql = " case workflow_base.isvalid when '3' then workflow_base.activeversionid else WorkflowUseCount.wfid end as wfid,WorkflowUseCount.userid, sum(WorkflowUseCount.count) as count ";
String groupbySql = " group by case workflow_base.isvalid when '3' then workflow_base.activeversionid else WorkflowUseCount.wfid end,WorkflowUseCount.userid ";
String innerjoinSql = " left join workflow_base on workflow_base.id = WorkflowUseCount.Wfid left join ofs_workflow on ofs_workflow.workflowid = WorkflowUseCount.wfid ";
if (rs.getDBType().equals("oracle")) {
String sql = "SELECT * FROM (select "
+ selectSql
+ " from WorkflowUseCount "
+ innerjoinSql
+ " where WorkflowUseCount.userid ="
+ user.getUID()
//+ (!"".equals(portalsqlwhere) ? portalsqlwhere : "")
+ " and ("+Util.getSubINClause(ofsWorkflowids_CurrUser, "wfid", "in")+" or wfid in(select t2.id as workflowid from ShareInnerWfCreate t1,workflow_base t2 where t1.workflowid=t2.id and t2.isvalid in ('1','3') and t1.usertype = "
+ usertype
+ " and "
+ agentWfcrtSqlWhere
+ " union all select t1.id as workflowid from workflow_agentConditionSet t,workflow_base t1 where exists (select * from HrmResource b where t.bagentuid=b.id and b.status<4) and t.workflowid=t1.id and t.agenttype>'0' and t.iscreateagenter=1 and t.agentuid="
+ user.getUID() + " and ((t.beginDate || t.beginTime||':00'<='" + currentdate + currenttime + "' and t.endDate || t.endTime || ':00'>='" + currentdate + currenttime
+ "')or(t.beginDate || t.beginTime='' and t.endDate || t.endTime = '')))) " + groupbySql + " order by count desc,wfid) WHERE ROWNUM <= 12 ORDER BY ROWNUM ASC";
rs.execute(sql);
} else if (rs.getDBType().equals("mysql")) {
String sql = "select "
+ selectSql
+ " from WorkflowUseCount "
+ innerjoinSql
+ " where WorkflowUseCount.userid ="
+ user.getUID()
//+ (!"".equals(portalsqlwhere)? portalsqlwhere : "")
+ " and ("+Util.getSubINClause(ofsWorkflowids_CurrUser, "wfid", "in")+" or wfid in ("
+ "select t.workflowid from workflow_agentConditionSet t,workflow_base t1 where exists (select * from HrmResource b where t.bagentuid=b.id and b.status<4) and t.workflowid=t1.id and t.agenttype>'0' and t.iscreateagenter=1 and t.agentuid="
+ user.getUID() + " union all select t1.workflowid from ShareInnerWfCreate t1,workflow_base t2 where t1.workflowid=t2.id and t2.isvalid in ('1','3'))) " + groupbySql
+ " order by count desc,wfid LIMIT 12";
rs.execute(sql);
}
else if(rs.getDBType().equalsIgnoreCase("postgresql"))
{
String sql = "select "
+ selectSql
+ " from WorkflowUseCount "
+ innerjoinSql
+ " where WorkflowUseCount.userid ="
+ user.getUID()
//+ (!"".equals(portalsqlwhere) ? portalsqlwhere : "")
+ " and ("+Util.getSubINClause(ofsWorkflowids_CurrUser, "wfid", "in")+" or wfid in ("
+ "select t.workflowid from workflow_agentConditionSet t,workflow_base t1 where exists (select * from HrmResource b where t.bagentuid=b.id and b.status<4) and t.workflowid=t1.id and t.agenttype>'0' and t.iscreateagenter=1 and t.agentuid="
+ user.getUID() + " union all select t1.workflowid from ShareInnerWfCreate t1,workflow_base t2 where t1.workflowid=t2.id and t2.isvalid in ('1','3'))) " + groupbySql
+ " order by count desc,wfid limit 12 ";
rs.execute(sql);
}
else {
String sql = "select top 12 "
+ selectSql
+ " from WorkflowUseCount "
+ innerjoinSql
+ " where WorkflowUseCount.userid ="
+ user.getUID()
//+ (!"".equals(portalsqlwhere) ? portalsqlwhere : "")
+ " and ("+Util.getSubINClause(ofsWorkflowids_CurrUser, "wfid", "in")+" or wfid in ("
+ "select t.workflowid from workflow_agentConditionSet t,workflow_base t1 where exists (select * from HrmResource b where t.bagentuid=b.id and b.status<4) and t.workflowid=t1.id and t.agenttype>'0' and t.iscreateagenter=1 and t.agentuid="
+ user.getUID() + " union all select t1.workflowid from ShareInnerWfCreate t1,workflow_base t2 where t1.workflowid=t2.id and t2.isvalid in ('1','3'))) " + groupbySql
+ " order by count desc,wfid ";
rs.execute(sql);
}
while (rs.next()) {
String wfid = rs.getString("wfid");
usedtodoList.add(wfid);
if(!usedtodoAndCollWfIds.contains(wfid)){
usedtodoAndCollWfIds.add(wfid);
}
}
}
}
/**
*
* @param wftype
* @param typeid
* @param workflowid
* @param workflowname
* @param isimportwf
* @param userid
* @param beagenterid
* @param isagent
*/
private void generateInjectData(WfType wftype,String typeid,String workflowid,String typename,String workflowname,String isimportwf,String mobileurl,String pcurl,int userid,int beagenterid,boolean isagent,boolean isos,String workflowdesc){
if((Util.getIntValue(typeid) > 0 && Util.getIntValue(workflowid) < 0) || (Util.getIntValue(typeid) < 0 && Util.getIntValue(workflowid) > 0)){//过滤脏数据
return;
}
if (wftype == null) {
wftype = new WfType();
wftype.setId(typeid);
wftype.setTypeName(typename);
// 设置该类型是否收藏
if (selectedworkflow.indexOf("T" + typeid + "|") > 0) {
wftype.setWftypeColl("1");
} else {
wftype.setWftypeColl("0");
}
wftypeInfo.put(typeid, wftype);
}
Map<String, WfBean> wfbeanInfo = wftype.getWfbeanInfo();
WfBean wfbean = wfbeanInfo.get(workflowid);
if (wfbean == null) {
wfbean = new WfBean();
wfbean.setId(workflowid);
wfbean.setName(workflowname);
wfbean.setWorkflowdesc(StringUtils.isNotEmpty(workflowdesc) ? workflowdesc : workflowname);
wfbean.setTypeId(typeid);
wfbean.setIsImportWf(isimportwf);
if (selectedworkflow.indexOf("W" + workflowid + "|") > -1 && isuserdefault.equals("1")) {
wfbean.setWfColl("1");
} else {
wfbean.setWfColl("0");
}
if (usedtodoList.contains(workflowid)) {
wfbean.setUsedtodo("1");
wfbean.setUsedtodoorder(usedtodoList.indexOf(workflowid));
}
wfbean.setLetter(getWfNameFirstLetter(workflowname));
wfbean.setSpell(Pinyin4j.spell(workflowname));
wfbean.setMobileurl(mobileurl);//异构系统移动端新建地址
wfbean.setPcurl(pcurl);//异构系统pc端新建地址
if(DoSaveFreeExcelDesignBiz.judgeIsFreeCustomForm(workflowid)){
wfbean.setIsFreeCustomeForm(1);
}
wfbeanInfo.put(workflowid, wfbean);
}
if (!isos && user.getUID() != userid && userid > 0) {//次账号身份信息--异构系统不展示
WfUser belonguser = getWfUser(String.valueOf(userid));
if (!wfbean.getBelongtoUsers().contains(belonguser)) {
wfbean.getBelongtoUsers().add(belonguser);
}
} else if(isagent && beagenterid > 0){//被代理人身份信息
WfUser beagentuser = getWfUser(String.valueOf(beagenterid));
if (!wfbean.getBeagenters().contains(beagentuser)) {
wfbean.getBeagenters().add(beagentuser);
}
}
}
private String getWfNameFirstLetter(String wfname) {
if(wfname == null || "".equals(wfname))
return "";
String[] currentData = wfname.split("`~`");
String currentLan = user.getLanguage() + " ";
String letter = "";
if (specialstr.indexOf(wfname.charAt(0)) >= 0) {
if (currentData.length > 3) {//处理多语言
for (String currentStr : currentData) {
if (currentStr.length() > 2) {
if (currentStr.substring(0, 2).equals(currentLan)) {
wfname = currentStr.substring(2);
}
}
}
}
char chinese = wfname.charAt(0);
String[] py = PinyinHelper.toHanyuPinyinStringArray(chinese);
letter = py == null ? chinese + "" : py[0];
letter = (letter.charAt(0) + "").toUpperCase();
} else {
char chinese = wfname.charAt(0);
String[] py = PinyinHelper.toHanyuPinyinStringArray(chinese);
letter = (py == null) ? chinese + "" : py[0];
letter = (letter.charAt(0) + "").toUpperCase();
}
return letter;
}
public WfUser getWfUser(String userId) {
WfUser wfUser = new WfUser();
wfUser.setId(userId);
wfUser.setLastname(resourceComInfo.getLastname(userId));
wfUser.setSubcompany(resourceComInfo.getSubCompanyID(userId));
wfUser.setDepartment(resourceComInfo.getDepartmentID(userId));
wfUser.setJobtitlename(jobTitlesComInfo.getJobTitlesname(resourceComInfo.getJobTitle(userId)));
try {
wfUser.setDepartmentName(departmentComInfo.getDepartmentname(wfUser.getDepartment()));
wfUser.setSubcompanyName(subCompanyComInfo.getSubcompanyname(wfUser.getSubcompany()));
} catch (Exception e) {
e.printStackTrace();
}
return wfUser;
}
/**
*
*/
private void getAllInputReport() {
RecordSet rs = new RecordSet();
String dataCenterWorkflowTypeId = "";
rs.executeQuery("select currentId from sequenceindex where indexDesc='dataCenterWorkflowTypeId'");
if (rs.next()) {
dataCenterWorkflowTypeId = Util.null2String(rs.getString("currentId"));
}
if ("".equals(dataCenterWorkflowTypeId)) {
return;
}
wftypeInfo.remove(dataCenterWorkflowTypeId);
}
// 排序,并计算各个类型在前台显示的位置
private List<WfType> sortWfTypes() {
RecordSet rs = new RecordSet();
rs.executeQuery("select * from (select id,iconkey,dsporder,0 as sysorder,id as absid from workflow_type union select sysid as id,icon as iconkey,showorder as dsporder,1 as sysorder,abs(sysid) as absid from ofs_sysinfo) t order by dsporder,sysorder,absid ");
int colorIndex = 0;
List<WfType> result = new ArrayList<WfType>();
while (rs.next()) {
String wftypeid = rs.getString(1);
String wfIconKey = Util.null2String(rs.getString("iconkey"));
WfType wftype = wftypeInfo.get(wftypeid);
if (wftype == null) {
continue;
}
wftype.setColor(colors[colorIndex % (colors.length)]);
if (!"".equals(wfIconKey)) {//如果取出来的数据不为空
wftype.setImg(wfIconKey);
} else {//如果后台没设置的,取随机
wftype.setImg(imgs[colorIndex % (colors.length)]);
}
colorIndex++;
wftype.getWfbeans().addAll(wftype.getWfbeanInfo().values());
wftype.setWfbeanInfo(null);
result.add(wftype);
}
return result;
}
/**
* ID
* @param workflowids
* @param user
* @return
*/
public List<WfType> getCreateWfList(String workflowids){
//获取所有版本的流程
String __workflowids = Util.null2String(WorkflowVersion.getAllVersionStringByWFIDs(workflowids));
if("".equals(__workflowids)){
return new ArrayList<WfType>();
}
return getWfInfo(__workflowids);
}
public Map<String, WfType> getWftypeInfo() {
return wftypeInfo;
}
public String getCommonuse() {
return commonuse;
}
public String getCustomSqlWhere() {
return customSqlWhere;
}
public void setCustomSqlWhere(String customSqlWhere) {
this.customSqlWhere = customSqlWhere;
}
public String getForceUnsupportSPAWF() {
return forceUnsupportSPAWF;
}
public String getInornot() {
return inornot;
}
public void setInornot(String inornot) {
this.inornot = Util.null2s(inornot,"in").trim();
}
public String getNewRequestRange() {
return newRequestRange;
}
public void setNewRequestRange(String newRequestRange) {
this.newRequestRange = newRequestRange;
}
public String getTypeids(){
return typeids;
}
public void setTypeids(String typeids){
this.typeids = typeids;
}
public boolean isIsmobile() {
return ismobile;
}
public void setIsmobile(boolean ismobile) {
this.ismobile = ismobile;
}
public Map<String, List<OfsWorkflow>> getOfsWorkflowDatas() {
return ofsWorkflowDatas;
}
public static List<String> getUnSupportSPAWf(){
return getUnSupportSPAWf("");
}
//初步计算出哪些流程不支持E9模式控制点击时跳转地址
public static List<String> getUnSupportSPAWf(String forceUnsupportSPAWF){
List<String> unSupportSPAWf = new ArrayList<String>();
RecordSet rs = new RecordSet();
rs.executeQuery("select workflowid from workflow_flownode a where nodetype='0' and (ismode='1' or (ismode='2' and not exists (select 1 from workflow_nodehtmllayout where nodeid=a.nodeid and version=2 and type=0 and isactive=1)))");
while(rs.next()){
unSupportSPAWf.add(Util.null2String(rs.getString("workflowid")));
}
//周工作总结、月工作总结特殊处理走E8逻辑
rs.executeQuery("select id from workflow_base where isbill=1 and formid in (17,21)");
while(rs.next()){
String wfid = rs.getString("id");
if(unSupportSPAWf.indexOf(wfid) == -1)
unSupportSPAWf.add(wfid);
}
unSupportSPAWf.addAll(Util.TokenizerString(forceUnsupportSPAWF,","));
return unSupportSPAWf;
}
public String getWorkflowDesc(String workflowid){
String workflowdesc = "" ;
RecordSet rs = new RecordSet();
String sql = " select workflowdesc from workflow_base where id = "+workflowid;
rs.executeQuery(sql);
if(rs.next()){
workflowdesc = Util.null2String(rs.getString("workflowdesc"));
}
return workflowdesc;
}
}

@ -0,0 +1,150 @@
package com.engine.workflow.entity.newRequest;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class WfBean implements Serializable{
private static final long serialVersionUID = 214529768535685281L;
private String id;
private String typeId;
private String type2;
private String name;
private String url;
private String wfColl; //流程是否已经收藏 ("1":收藏,"0":未收藏)
private String isImportWf; //流程导入
private String usedtodo; //常用流程
private List<WfUser> beagenters; //代理人
private List<WfUser> belongtoUsers; //有流程创建权限的次账号
private WfUser user;
private String letter;
private String spell;
private Integer usedtodoorder; //常用流程順序
private String pcurl;//异构系统pc端新建流程跳转页面
private String mobileurl;//异构系统移动端新建流程跳转页面
private int isFreeCustomeForm=0;//是否自由流程自定义表单 0否 1是
private String workflowdesc = "";
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTypeId() {
return typeId;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
public String getType2() {
return type2;
}
public void setType2(String type2) {
this.type2 = type2;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public String getUsedtodo() {
return usedtodo;
}
public void setUsedtodo(String usedtodo) {
this.usedtodo = usedtodo;
}
public List<WfUser> getBeagenters() {
return beagenters;
}
public void setBeagenters(List<WfUser> beagenters) {
this.beagenters = beagenters;
}
public List<WfUser> getBelongtoUsers() {
return belongtoUsers;
}
public void setBelongtoUsers(List<WfUser> belongtoUsers) {
this.belongtoUsers = belongtoUsers;
}
public String getWfColl() {
return wfColl;
}
public void setWfColl(String wfColl) {
this.wfColl = wfColl;
}
public void setUrl(String url) {
this.url = url;
}
public WfUser getUser() {
return user;
}
public void setUser(WfUser user) {
this.user = user;
}
public String getIsImportWf() {
return isImportWf;
}
public void setIsImportWf(String isImportWf) {
this.isImportWf = isImportWf;
}
public WfBean() {
this.beagenters = new ArrayList<WfUser>();
this.belongtoUsers = new ArrayList<WfUser>();
}
public String getLetter() {
return letter;
}
public void setLetter(String letter) {
this.letter = letter;
}
public String getSpell() {
return spell;
}
public void setSpell(String spell) {
this.spell = spell;
}
public Integer getUsedtodoorder() {
return usedtodoorder;
}
public void setUsedtodoorder(Integer usedtodoorder) {
this.usedtodoorder = usedtodoorder;
}
public String getPcurl() {
return pcurl;
}
public void setPcurl(String pcurl) {
this.pcurl = pcurl;
}
public String getMobileurl() {
return mobileurl;
}
public void setMobileurl(String mobileurl) {
this.mobileurl = mobileurl;
}
public int getIsFreeCustomeForm() {
return isFreeCustomeForm;
}
public void setIsFreeCustomeForm(int isFreeCustomeForm) {
this.isFreeCustomeForm = isFreeCustomeForm;
}
public String getWorkflowdesc() {
return workflowdesc;
}
public void setWorkflowdesc(String workflowdesc) {
this.workflowdesc = workflowdesc;
}
}

@ -1,4 +1,4 @@
package com.constant; package weaver.interfaces.dito.constant;
import weaver.interfaces.dito.comInfo.PropBean; import weaver.interfaces.dito.comInfo.PropBean;

@ -2,7 +2,7 @@ package weaver.interfaces.dito.monitor;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.customization.dito.sendtodo.HttpRequestUtil; import com.customization.dito.sendtodo.HttpRequestUtil;
import com.customization.dito.sendtodo.SendPortalErrorUtil; import com.customization.dito.sendtodo.SendPortalErrorUtil;
import com.engine.core.context.Context; import com.engine.core.context.Context;

@ -2,7 +2,7 @@ package weaver.interfaces.dito.overtime;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import okhttp3.*; import okhttp3.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;

@ -2,11 +2,10 @@ package weaver.interfaces.dito.overtime;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.constant.Constants; import weaver.interfaces.dito.constant.Constants;
import com.customization.dito.sendtodo.HttpRequestUtil; import com.customization.dito.sendtodo.HttpRequestUtil;
import com.customization.dito.sendtodo.SendPortalErrorUtil; import com.customization.dito.sendtodo.SendPortalErrorUtil;
import com.time.util.DateUtil; import com.time.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.BaseBean; import weaver.general.BaseBean;
import weaver.general.Util; import weaver.general.Util;

Loading…
Cancel
Save