相关代码提交
This commit is contained in:
parent
fccdc1f3df
commit
750dc07eaf
@ -73,7 +73,7 @@ public class CreateDataKnow implements IJob {
|
||||
if (rowMap!=null){
|
||||
System.out.println("该知识已经存在于PAL资产库中的EXT4中,并且已经在知识中");
|
||||
}else{
|
||||
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+rowmap.getString("PLVER"),rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
|
||||
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+"V"+rowmap.getString("PLVER"),rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
|
||||
/*Map names = new LinkedHashMap<>();
|
||||
|
||||
String plname = rowmap.getString("PLNAME");
|
||||
@ -99,7 +99,7 @@ public class CreateDataKnow implements IJob {
|
||||
}*/
|
||||
}
|
||||
}else {
|
||||
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+rowmap.getString("PLVER"),rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
|
||||
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+"V"+rowmap.getString("PLVER"),rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
|
||||
/*Map names = new LinkedHashMap<>();
|
||||
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
jsonObject.put("action","read");
|
||||
jsonObject.put("title"," " +
|
||||
"["+boActCoePublish.getString("PROCESS_TITLE")+"]需要处理");
|
||||
""+boActCoePublish.getString("PROCESS_TITLE")+"");
|
||||
System.out.println("部门庄户》》》》》》》"+SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getTaskInstance().getTarget()).getNo());
|
||||
jsonObject.put("dept",SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getTaskInstance().getTarget()).getNo());//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo()
|
||||
String target = processExecutionContext.getTaskInstance().getTarget();
|
||||
|
||||
@ -6,6 +6,8 @@ import java.io.UnsupportedEncodingException;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.oauth.AbstractOauth;
|
||||
import com.actionsoft.bpms.server.RequestParams;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.LogAPI;
|
||||
import com.actionsoft.sdk.local.api.Logger;
|
||||
@ -49,25 +51,48 @@ public class OauthLogin extends AbstractOauth {
|
||||
}
|
||||
@Override
|
||||
public String validate(RequestParams params) throws IOException {
|
||||
|
||||
|
||||
BO bo = new BO();
|
||||
long begintime = System.currentTimeMillis();
|
||||
bo.set("BEGIN_TIME",begintime);
|
||||
String userid = "";
|
||||
long login_end_time = 0L;
|
||||
if (StringUtils.isNotEmpty(params.get("casaccount"))){
|
||||
BO detail = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("LOGINID=", params.get("casaccount")).detail();
|
||||
String workcode = detail.getString("WORKCODE");
|
||||
if (workcode.length()!=8){
|
||||
login_end_time = System.currentTimeMillis();
|
||||
bo.set("END_TIME",login_end_time);
|
||||
bo.set("USER_ID","00"+workcode);
|
||||
UserContext userContext = UserContext.fromUID("admin");
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
|
||||
return "00"+workcode;
|
||||
}else{
|
||||
login_end_time = System.currentTimeMillis();
|
||||
bo.set("END_TIME",login_end_time);
|
||||
bo.set("USER_ID",params.get("casaccount"));
|
||||
UserContext userContext = UserContext.fromUID("admin");
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
|
||||
return params.get("casaccount");
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(params.get("usercode"))){
|
||||
|
||||
login_end_time = System.currentTimeMillis();
|
||||
bo.set("END_TIME",login_end_time);
|
||||
bo.set("USER_ID",params.get("usercode"));
|
||||
UserContext userContext = UserContext.fromUID("admin");
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
|
||||
|
||||
return params.get("usercode");
|
||||
}
|
||||
|
||||
|
||||
logger.info("单点登录验证---------"+params);
|
||||
try {
|
||||
|
||||
long loginbegintime = System.currentTimeMillis();
|
||||
bo.set("BEGIN_TIME",loginbegintime);
|
||||
String redirect_uri = params.get("code");
|
||||
|
||||
if(StringUtils.isEmpty(redirect_uri)){
|
||||
@ -90,6 +115,15 @@ public class OauthLogin extends AbstractOauth {
|
||||
JSONObject json = JSONObject.parseObject(userInfo);
|
||||
System.out.println("json-=====>>>>"+json);
|
||||
if (StringUtils.isNotEmpty(json.getString("employeenumber"))){
|
||||
System.out.println("userid》》》》》》》》》》"+json.getString("employeenumber"));
|
||||
userid = json.getString("employeenumber");
|
||||
login_end_time = System.currentTimeMillis();
|
||||
bo.set("END_TIME",login_end_time);
|
||||
bo.set("SCENDTIME",(login_end_time-loginbegintime));
|
||||
bo.set("LOGIN_END_TIME",login_end_time);
|
||||
bo.set("USER_ID",userid);
|
||||
UserContext userContext = UserContext.fromUID("admin");
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
|
||||
return json.getString("employeenumber");
|
||||
}
|
||||
}
|
||||
@ -97,26 +131,6 @@ public class OauthLogin extends AbstractOauth {
|
||||
}
|
||||
|
||||
|
||||
//统一身份认证
|
||||
//String result = getToken(casaccount, appaccount, appid, validcode);
|
||||
/* if("true".equals(result)) {
|
||||
// 验证账号是否存在
|
||||
if (UserCache.getModel(appaccount) != null) {
|
||||
// 身份认证成功
|
||||
return appaccount;
|
||||
}else {
|
||||
logger.error("单点登录查找用户失败!");
|
||||
return null;
|
||||
}
|
||||
}else if ("false".equals(result)){
|
||||
//身份认证失败
|
||||
logger.error("统一身份认证失败!");
|
||||
return null;
|
||||
}else {
|
||||
//身份认证失败
|
||||
logger.error("统一身份认证失败!网络连接超时,请联系管理员进行查看连接是否联通");
|
||||
return null;
|
||||
}*/
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("统一身份认证失败!", e);
|
||||
|
||||
@ -200,7 +200,6 @@ public class TaskController {
|
||||
String processInstId = params.get("processInstId");
|
||||
String taskInstId = params.get("taskInstId");
|
||||
String usercode = params.get("usercode");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
map.put("sid", sid);
|
||||
|
||||
@ -212,17 +211,18 @@ public class TaskController {
|
||||
|
||||
|
||||
for (BO bo : list) {
|
||||
System.out.println("开始时间》》》》》》》"+System.currentTimeMillis());
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
String is_not_publish_sql = "SELECT id,PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME ='" + bo.get("PUBLISHFILENAME") + "'";
|
||||
List<RowMap> Row_maps_is_not_publish = DBSql.getMaps(conn, is_not_publish_sql);
|
||||
String is_not_publish_sql = "SELECT id,PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID ='" + bo.get("PUBLISHFILEID") + "'";
|
||||
RowMap Row_maps_is_not_publish = DBSql.getMap(conn, is_not_publish_sql);
|
||||
/*boolean havingStartProcessPermission =SDK.getPermAPI().havingStartProcessPermission(uc.getUID(), processDefId);
|
||||
if(havingStartProcessPermission) {*/
|
||||
String id = bo.getString("TASKID");
|
||||
jsonObject.put("title",bo.get("PUBLISHFILENAME"));
|
||||
jsonObject.put("link",SDK.getPortalAPI().getPortalUrl()+ "/r/w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + Row_maps_is_not_publish.get(0).getString("id") + "&sid=" + sid);
|
||||
jsonObject.put("link",SDK.getPortalAPI().getPortalUrl()+ "/r/w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + Row_maps_is_not_publish.getString("id") + "&sid=" + sid);
|
||||
jsonObject.put("size","");
|
||||
jsonObject.put("id",num);
|
||||
|
||||
jsonObject.put("id",id);
|
||||
System.out.println("查询完成后时间》》》》》》》"+System.currentTimeMillis());
|
||||
OutputTaskModel model = new OutputTask().getTaskReportById(id);
|
||||
JSONObject json = new JSONObject();
|
||||
if (model != null) {
|
||||
@ -248,6 +248,7 @@ public class TaskController {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
System.out.println("构建表完成时间》》》》》》》"+System.currentTimeMillis());
|
||||
jsonArray.add(jsonObject);
|
||||
num++;
|
||||
|
||||
@ -266,27 +267,9 @@ public class TaskController {
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
String url = portalUrl + "/r/or?cmd=com.yili_process_page&processInstId=" + processInstId + "&taskInstId=" + taskInstId;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String sql = "SELECT * FROM WFC_PROCESS WHERE ID ='" + processInstId + "'";
|
||||
List<RowMap> rowMaps = DBSql.getMaps(conn, sql);
|
||||
//if (rowMaps.size()==1){
|
||||
/* for (RowMap rowmp:
|
||||
rowMaps) {
|
||||
jsonObject.put("title",rowmp.getString("PROCESSTITLE"));
|
||||
String endTime = rowmp.getString("ENDTIME");
|
||||
String time = endTime.substring(0,endTime.indexOf(" "));
|
||||
jsonObject.put("date",time);
|
||||
}*/
|
||||
|
||||
jsonObject.put("action", "read");
|
||||
// jsonObject.put("dept",UserContext.fromUID(usercode).getDepartmentModel().getNo());
|
||||
// jsonObject.put("user",usercode);
|
||||
// jsonObject.put("remark","");
|
||||
jsonObject.put("status", "1");
|
||||
// jsonObject.put("pcurl",url);
|
||||
// jsonObject.put("mobileurl",url);
|
||||
|
||||
// jsonObject.put("userList","00345531");
|
||||
HttpClientUtil httpClientUtil = new HttpClientUtil();
|
||||
// String s = httpClientUtil.SendPreview("http://10.119.22.207:80/services/service_lcglpt?wsdl", jsonObject);
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstId).detail();
|
||||
@ -295,17 +278,6 @@ public class TaskController {
|
||||
if (bo_act_dataid != null) {
|
||||
String dataid = SDK.getBOAPI().query("BO_ACT_DATAID", true).addQuery("PROCESSID=", processInstId).addQuery("USER_ID=",usercode).detail().getString("DATAID");
|
||||
jsonObject.put("dataid", dataid);
|
||||
} else {
|
||||
BO test = SDK.getBOAPI().query("BO_EU_TEST", true).addQuery("BINDID=", processInstId).detail();
|
||||
if (test != null) {
|
||||
String dataid = test.getString("DATAID");
|
||||
if (dataid.contains(usercode)) {
|
||||
dataid = dataid.substring(dataid.indexOf(usercode + "","dataid":"") + 40, dataid.indexOf(usercode + "","dataid":"") + 47);
|
||||
dataid = getNumberFromString(dataid);
|
||||
System.out.println("待阅dataid输出" + dataid);
|
||||
}
|
||||
jsonObject.put("dataid", dataid);
|
||||
}
|
||||
}
|
||||
|
||||
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n" +
|
||||
@ -363,7 +335,7 @@ public class TaskController {
|
||||
String sid = me.getSessionId();
|
||||
String processInstId = params.get("processInstId");
|
||||
String taskInstId = params.get("taskInstId");
|
||||
String usercode = params.get("usercode");
|
||||
String usercode = params.get("userid");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(processInstId);
|
||||
String sourceAppId = instanceById.getAppId();
|
||||
@ -377,8 +349,9 @@ public class TaskController {
|
||||
|
||||
for (BO bo:list) {
|
||||
|
||||
if(StringUtils.isNotEmpty(bo.getString("TASKID"))){
|
||||
if(StringUtils.isNotEmpty(bo.getString("TASKID"))&& !bo.getString("TASKID").equals("submit_create")){
|
||||
OutputTaskModel model = new OutputTask().getTaskReportById(bo.getString("TASKID"));
|
||||
System.out.println(",odel>>>>>>>>"+bo.getString("TASKID"));
|
||||
OutputAppProfile appProfile = OutputAppManager.getProfile(model.getProfileId());
|
||||
if (appProfile==null){
|
||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + "_900fde3255248317266cad1c72f157b1");
|
||||
@ -386,7 +359,7 @@ public class TaskController {
|
||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||
if (dcProfile == null)
|
||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||
String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME = '"+bo.getString("PUBLISHFILENAME")+"'";
|
||||
String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+bo.getString("PUBLISHFILEID")+"'";
|
||||
String lever = DBSql.getString(conn, sql_lever);
|
||||
System.out.println("lever====>>>>>"+lever);
|
||||
lever = lever+".0";
|
||||
@ -425,7 +398,7 @@ public class TaskController {
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params_preview);
|
||||
|
||||
System.out.println("ro>>>>>>>>>>>>>>>>"+ro);
|
||||
String is_not_publish_sql = "SELECT id,PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME ='"+bo.get("PUBLISHFILENAME")+"'";
|
||||
String is_not_publish_sql = "SELECT id,PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE id ='"+bo.get("PUBLISHFILEID")+"'";
|
||||
List<RowMap> Row_maps_is_not_publish = DBSql.getMaps(conn, is_not_publish_sql);
|
||||
|
||||
/*boolean havingStartProcessPermission =SDK.getPermAPI().havingStartProcessPermission(uc.getUID(), processDefId);
|
||||
@ -443,7 +416,7 @@ public class TaskController {
|
||||
|
||||
|
||||
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where PLNAME= '"+bo.getString("PUBLISHFILENAME")+"'" +
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"'" +
|
||||
")";
|
||||
List<RowMap> maps = DBSql.getMaps(conn,sql_upfile);
|
||||
UserContext userContext = UserContext.fromSessionId(sid);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user