伊利集成相关待办数据提交

This commit is contained in:
Mr-wang 2022-10-27 10:31:42 +08:00
parent 21606d6a1d
commit da2207c9ae
10 changed files with 285 additions and 126 deletions

View File

@ -65,7 +65,7 @@ public class CreateDataKnow implements IJob {
List<RowMap> rowMapList = DBSql.getMaps(sql);
for (RowMap rowmap:rowMapList
) {
) {
String card_sql = "SELECT * FROM APP_ACT_KMS_CARD WHERE CARDNAME like '"+rowmap.getString("PLNAME")+"%'";
RowMap map = DBSql.getMap(card_sql);
if (map!=null){
@ -74,7 +74,19 @@ public class CreateDataKnow implements IJob {
if (rowMap!=null){
System.out.println("该知识已经存在于PAL资产库中的EXT4中并且已经在知识中");
}else{
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);
String level = "";
if (rowMap!=null){
if (rowmap.getString("PLVER").contains(".00")){
String[] plvers = rowmap.getString("PLVER").split(".");
plvers[1] = plvers[1].replaceAll("0","");
level = plvers[0]+plvers[1];
}else {
level = rowmap.getString("PLVER");
}
}
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+"V"+level,rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
/*Map names = new LinkedHashMap<>();
String plname = rowmap.getString("PLNAME");
@ -100,7 +112,17 @@ public class CreateDataKnow implements IJob {
}*/
}
}else {
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);
String level = "";
if (rowmap!=null){
if (rowmap.getString("PLVER").contains(".00")){
String[] plvers = rowmap.getString("PLVER").split(".");
plvers[1] = plvers[1].replaceAll("0","");
level = plvers[0]+plvers[1];
}else {
level = rowmap.getString("PLVER");
}
}
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+"V"+level,rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
/*Map names = new LinkedHashMap<>();
@ -216,7 +238,7 @@ public class CreateDataKnow implements IJob {
String aslp = "aslp://com.actionsoft.apps.kms/CreateFile";
if (StringUtils.isNotEmpty(cardId)){
String sql_ext4 = "select * from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+cardId+"'";
String sql_ext4 = "select * from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+cardId+"'";
RowMap map = DBSql.getMap(sql_ext4);
RowMap rowMap = DBSql.getMap("select * from (select * from BO_ACT_COE_PUBLISH_N where PUBLISHFILEID = '"+map.getString("ID")+"' order by CREATEDATE desc) where rownum = 1");
if (rowMap!=null){
@ -293,16 +315,16 @@ public class CreateDataKnow implements IJob {
try {
UpfileModel upfileModel = new UpfileModel();
upfileModel.setType(row.getString("FILETYPE"));
upfileModel.setFileName(row.getString("FILENAME"));
upfileModel.setPl_uuid(row.getString("PALREPOSITORYID"));
upfileModel.setShape_uuid(row.getString("SHAPEID"));
DCContext dcContexts = upfileWeb.getDCContext(upfileModel);
paramss.put("dc", dcContexts);
AppAPI appAPIs = SDK.getAppAPI();
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, paramss);
System.out.println("流程模型附件的生成============="+ros);
UpfileModel upfileModel = new UpfileModel();
upfileModel.setType(row.getString("FILETYPE"));
upfileModel.setFileName(row.getString("FILENAME"));
upfileModel.setPl_uuid(row.getString("PALREPOSITORYID"));
upfileModel.setShape_uuid(row.getString("SHAPEID"));
DCContext dcContexts = upfileWeb.getDCContext(upfileModel);
paramss.put("dc", dcContexts);
AppAPI appAPIs = SDK.getAppAPI();
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, paramss);
System.out.println("流程模型附件的生成============="+ros);
}catch (Exception e){
System.out.println("附件无法上传>>>>>>>>"+row.getString("FILENAME"));
}
@ -314,7 +336,7 @@ public class CreateDataKnow implements IJob {
//创建文件
}
PublishKnow(userContext,cardId);
PublishKnow(userContext,cardId);
}
}
@ -322,11 +344,11 @@ public class CreateDataKnow implements IJob {
public void PublishKnow(UserContext userContext,String id){
String sql = "select EXT4 from APP_ACT_COE_PAL_REPOSITORY where id in (select PLPARENTID from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+id +"')";
String sql = "select EXT4 from APP_ACT_COE_PAL_REPOSITORY where id in (select PLPARENTID from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+id +"')";
List<RowMap> maps = DBSql.getMaps(sql);
String ids = "";
for (RowMap rowmap:maps
) {
) {
ids+=rowmap.getString("EXT4")+",";
}
String[] deptSplit_id = ids.split(",");

View File

@ -113,13 +113,11 @@ public class ProcessAfterData extends InterruptListener {
xmlDatasUtil.setPcurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&amp;oauthName=oauthLogin&amp;processInstId="+processInstance.getId()+"&amp;taskInstId="+taskInstance.getId()+"&amp;openState="+taskInstance.getState());
xmlDatasUtil.setMobileurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&amp;corpid=wwb0ae23173b140618&amp;appAgentId=1000014&amp;oauthName=wechat&amp;casaccount="+taskInstance.getTarget()+"&amp;processInstId="+processInstance.getId()+"&amp;taskInstId="+taskInstance.getId()+"&amp;openState="+taskInstance.getState());
String target = taskInstance.getTarget();
if (target.length()==8&&"00".equals(target.substring(0,2))){
target = target.substring(2);
}
System.out.println("当前账户======》》》》"+target);
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
System.out.println("bo>>>>>>>>>>"+bo_eu_oa_reson);
if (bo_eu_oa_reson!=null){
xmlDatasUtil.setTo_do_login_account(bo_eu_oa_reson.getString("LOGINID"));
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义格式不显示毫秒
@ -211,7 +209,7 @@ public class ProcessAfterData extends InterruptListener {
}
Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
/*Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
String resultString = result.getData().toString();
JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("result");
@ -224,8 +222,8 @@ public class ProcessAfterData extends InterruptListener {
System.out.println("发送待办任务失败,请联系管理员查看是否出现错误");
System.out.println("错误提示>>>>>>>>>>>>"+status);
flag = false;
}
bo.set("OA_RESULT",datas);
}*/
bo.set("OA_RESULT",rootElement);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
bo.set("OA_DATE",simpleDateFormat.format(new Date()));
SDK.getBOAPI().update("BO_EU_FAID_DATA",bo);
@ -267,9 +265,7 @@ public class ProcessAfterData extends InterruptListener {
xmlDatasUtil.setMobileurl("https://bpm.yili.com:8088/portal"+"/r/or?cmd=com.yili_form_page_open&amp;corpid=wwb0ae23173b140618&amp;appAgentId=1000014&amp;oauthName=wechat&amp;casaccount="+taskInstance.getTarget()+"&amp;processInstId="+processInstance.getId()+"&amp;taskInstId="+taskInstance.getId()+"&amp;openState="+taskInstance.getState());
String target = taskInstance.getTarget();
if (target.length()==8&&"00".equals(target.substring(0,2))){
target = target.substring(2);
}
System.out.println("当前账户======》》》》"+target);
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
System.out.println("bo>>>>>>>>>>>>>>"+bo_eu_oa_reson);
@ -367,7 +363,7 @@ public class ProcessAfterData extends InterruptListener {
}
Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
/*Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
String resultString = result.getData().toString();
JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("result");
@ -380,8 +376,8 @@ public class ProcessAfterData extends InterruptListener {
System.out.println("发送待办任务失败,请联系管理员查看是否出现错误");
System.out.println("错误提示>>>>>>>>>>>>"+status);
flag = false;
}
bo.set("OA_RESULT",datas);
}*/
bo.set("OA_RESULT",rootElement);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
bo.set("OA_DATE",simpleDateFormat.format(new Date()));
SDK.getBOAPI().update("BO_EU_FAID_DATA",bo);
@ -427,9 +423,7 @@ public class ProcessAfterData extends InterruptListener {
xmlDatasUtil.setMobileurl("https://bpm.yili.com:8088/portal"+"/r/or?cmd=com.yili_form_page_open&amp;corpid=wwb0ae23173b140618&amp;appAgentId=1000014&amp;oauthName=wechat&amp;casaccount="+taskInstance.getTarget()+"&amp;processInstId="+processInstance.getId()+"&amp;taskInstId="+taskInstance.getId()+"&amp;openState="+taskInstance.getState());
String target = taskInstance.getTarget();
if (target.length()==8&&"00".equals(target.substring(0,2))){
target = target.substring(2);
}
System.out.println("当前账户======》》》》"+target);
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
System.out.println("bo>>>>>>>>>>>>>>"+bo_eu_oa_reson);
@ -527,7 +521,7 @@ public class ProcessAfterData extends InterruptListener {
}
Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
/*Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
String resultString = result.getData().toString();
JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("result");
@ -540,8 +534,8 @@ public class ProcessAfterData extends InterruptListener {
System.out.println("发送待办任务失败,请联系管理员查看是否出现错误");
System.out.println("错误提示>>>>>>>>>>>>"+status);
flag = false;
}
bo.set("OA_RESULT",datas);
}*/
bo.set("OA_RESULT",rootElement);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
bo.set("OA_DATE",simpleDateFormat.format(new Date()));
SDK.getBOAPI().update("BO_EU_FAID_DATA",bo);

View File

@ -466,7 +466,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
String[] users = new_uid.split(",");
int length = 300;
int ys = users.length%length;
/*if (ys==0) {
/* if (ys==0) {
int size = users.length/length;
int flag = 0;
@ -522,8 +522,8 @@ public class ProcessEndAfterEvent extends ExecuteListener {
}
}
});
}*/
}
*/
// System.out.println("subString==========================="+substring.substring(substring.lastIndexOf(";")+1,substring.length()));
// substring = substring.substring(substring.lastIndexOf(";")+1,substring.length());
@ -539,30 +539,36 @@ public class ProcessEndAfterEvent extends ExecuteListener {
List<BO> bo_act_coe_publish_s = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S", true).addQuery("BINDID=", processExecutionContext.getProcessInstance().getId()).list();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
JSONArray jsonArray = new JSONArray();
JSONArray jsonArray_EHSQ = new JSONArray();
for (BO bo:bo_act_coe_publish_n
) {
JSONArray jsonArray_EHSQ = new JSONArray();
JSONObject jsonObject_ehsq = new JSONObject(new LinkedHashMap<>());
OutputTaskModel model = new OutputTask().getTaskReportById(bo.getString("TASKID"));
wsId = model.getWsId();
String publishfileid = bo.getString("PUBLISHFILEID");
LinkedHashMap<String,String> downloadurl = downloadUtil.outputReportDownload(UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()), bo.getString("TASKID"), publishfileid);
LinkedHashMap<String,String> downloadurl = downloadUtil.outputReportDownload(UserContext.fromUID(processExecutionContext.getProcessInstance().getCreateUser()), bo.getString("TASKID"), publishfileid);
jsonObject_ehsq.put("fileid",bo.getString("TASKID"));
jsonObject_ehsq.put("filename",bo.getString("PUBLISHFILENAME"));
jsonObject_ehsq.put("filecode",bo.getString("PUBLISH_NUMBER"));
//jsonObject_ehsq.put("filecode",bo.getString("PUBLISH_NUMBER"));
jsonObject_ehsq.put("filecode","123456");
String sql_n = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '"+publishfileid+"'";
RowMap map = DBSql.getMap(sql_n);
jsonObject_ehsq.put("verion",map.getString("PLVER"));
jsonObject_ehsq.put("version",map.getString("PLVER"));
jsonObject_ehsq.put("releasedate",simpleDateFormat.format(new Date()));
jsonObject_ehsq.put("effectivedate",simpleDateFormat.format(new Date()));
jsonObject_ehsq.put("authorcode",processExecutionContext.getTaskInstance().getTarget());
jsonObject_ehsq.put("authorname",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getUserName());
jsonObject_ehsq.put("companycode",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getDepartmentModel().getNo());
jsonObject_ehsq.put("authorcompany",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getDepartmentModel().getName());
//jsonObject_ehsq.put("authorcode",processExecutionContext.getTaskInstance().getTarget());
jsonObject_ehsq.put("authorcode","00116465");
//jsonObject_ehsq.put("authorname",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getUserName());
jsonObject_ehsq.put("authorname","毛鹏程");
//jsonObject_ehsq.put("companycode",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getDepartmentModel().getNo());
jsonObject_ehsq.put("companycode","00000013");
//jsonObject_ehsq.put("authorcompany",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getDepartmentModel().getName());
jsonObject_ehsq.put("authorcompany","总部质量管理部");
jsonObject_ehsq.put("releasescope","总部质量管理部");
BO bo1 = SDK.getBOAPI().query("BO_ACT_PUBLISH_PERM_SCOPE", true).addQuery("PALNAME=", bo.getString("PUBLISHFILENAME")).detail();
if (bo1!=null){
if (bo1.getString("PERMTYPE").equals("1")){
jsonObject_ehsq.put("releasescope","内蒙古伊利实业集团股份有限公司");
}else {
String departname = "";
@ -579,7 +585,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
) {
departname+=rowmas.getString("DEPARTMENTNAME")+";";
}
jsonObject_ehsq.put("releasescope",departname);
jsonObject_ehsq.put("releasescope","总部质量管理部");
}
}
@ -589,18 +595,41 @@ public class ProcessEndAfterEvent extends ExecuteListener {
System.out.println("办理者的sessionid>>>>>>>>>>>"+sessionId);
String downurl = downloadUtil.getzipURL(sessionId,bo.getString("TASKID"),bo.getString("PUBLISHFILENAME"));
jsonObject_ehsq.put("downloadurl","https://bpm.yili.com:8088/portal/r"+downurl.toString().substring(1));
//jsonObject_ehsq.put("downloadurl","http://bpm.eyili.com:8088/portal/r"+downurl.toString().substring(1));
String recordfiles = "";
String recordurls = "";
Set<String> keys = downloadurl.keySet();
for ( String key : keys ) {
recordfiles+=key+";";
String fileDownurl = downloadurl.get(key);
String cent_url = downloadurl.get(key).substring(downloadurl.get(key).indexOf("/df"),downloadurl.get(key).length());
String fileDownurl = "http://bpm.eyili.com:8088/portal/r"+cent_url;
recordurls+=fileDownurl+";";
}
jsonObject_ehsq.put("recordfiles",recordfiles);
jsonObject_ehsq.put("recordurls",recordurls);
String new_name = "";
String[] split = recordfiles.split(";");
if (split.length>0){
for (int i =1;i<split.length;i++){
new_name +=split[i]+";";
}
}
String new_url = "";
String[] urls = recordurls.split(";");
if (urls.length>0){
String loadurl = urls[0].replaceAll("&sid=null","&sid="+sessionId);
System.out.println("下载的地址是<<<<<<<<<<<<<<<<<<"+loadurl);
jsonObject_ehsq.put("downloadurl",loadurl);
for (int i =1;i<urls.length;i++){
String data_url = urls[i].replaceAll("&sid=null","&sid="+sessionId);
new_url +=data_url+";";
}
}
jsonObject_ehsq.put("recordfiles",new_name);
jsonObject_ehsq.put("recordurls",new_url);
jsonArray_EHSQ.add(jsonObject_ehsq);
SendEHSQFile(jsonArray_EHSQ);
}
int m = 0;
@ -705,6 +734,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
for (BO bo:bo_act_coe_publish_c
) {
JSONArray jsonArray_EHSQ = new JSONArray();
JSONObject jsonObject_ehsq = new JSONObject(new LinkedHashMap<>());
OutputTaskModel model = new OutputTask().getTaskReportById(bo.getString("TASKID"));
wsId = model.getWsId();
@ -712,7 +742,8 @@ public class ProcessEndAfterEvent extends ExecuteListener {
LinkedHashMap<String,String> downloadurl = downloadUtil.outputReportDownload(UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()), bo.getString("TASKID"), publishfileid);
jsonObject_ehsq.put("fileid",bo.getString("TASKID"));
jsonObject_ehsq.put("filename",bo.getString("CHANGEDFILENAMENEW"));
jsonObject_ehsq.put("filecode",bo.getString("CHANGE_NUMBER"));
//jsonObject_ehsq.put("filecode",bo.getString("CHANGE_NUMBER"));
jsonObject_ehsq.put("filecode","123456");
String sql_n = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '"+publishfileid+"'";
RowMap map = DBSql.getMap(sql_n);
jsonObject_ehsq.put("verion",map.getString("PLVER"));
@ -720,8 +751,8 @@ public class ProcessEndAfterEvent extends ExecuteListener {
jsonObject_ehsq.put("effectivedate",simpleDateFormat.format(new Date()));
jsonObject_ehsq.put("authorcode",processExecutionContext.getTaskInstance().getTarget());
jsonObject_ehsq.put("authorname",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getUserName());
jsonObject_ehsq.put("companycode",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getCompanyModel().getNo());
jsonObject_ehsq.put("authorcompany",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getCompanyModel().getName());
jsonObject_ehsq.put("companycode",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getDepartmentModel().getNo());
jsonObject_ehsq.put("authorcompany",UserContext.fromUID(processExecutionContext.getTaskInstance().getTarget()).getDepartmentModel().getName());
BO bo1 = SDK.getBOAPI().query("BO_ACT_PUBLISH_PERM_SCOPE", true).addQuery("PALNAME=", bo.getString("PUBLISHFILENAME")).detail();
if (bo1!=null){
if (bo1.getString("PERMTYPE").equals("1")){
@ -750,21 +781,42 @@ public class ProcessEndAfterEvent extends ExecuteListener {
String sessionId = new SSOUtil().registerClientSessionNoPassword(processExecutionContext.getTaskInstance().getTarget(), LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
String downurl = downloadUtil.getzipURL(sessionId,bo.getString("TASKID"),bo.getString("CHANGEDFILENAMENEW"));
jsonObject_ehsq.put("downloadurl","https://bpm.yili.com:8088/portal/r"+downurl.toString().substring(1));
String recordfiles = "";
String recordurls = "";
Set<String> keys = downloadurl.keySet();
for ( String key : keys ) {
recordfiles+=key+";";
String fileDownurl = downloadurl.get(key);
String cent_url = downloadurl.get(key).substring(downloadurl.get(key).indexOf("/df"),downloadurl.get(key).length());
String fileDownurl = "http://bpm.yili.com:8088/portal/r"+cent_url;
recordurls+=fileDownurl+";";
}
jsonObject_ehsq.put("recordfiles",recordfiles);
jsonObject_ehsq.put("recordurls",recordurls);
String new_name = "";
String[] split = recordfiles.split(";");
if (split.length>0){
for (int i =1;i<split.length;i++){
new_name +=split[i]+";";
}
}
String new_url = "";
String[] urls = recordurls.split(";");
if (urls.length>0){
String loadurl = urls[0].replaceAll("&sid=null","&sid="+sessionId);
System.out.println("下载的地址是<<<<<<<<<<<<<<<<<<"+loadurl);
jsonObject_ehsq.put("downloadurl",loadurl);
for (int i =1;i<urls.length;i++){
String data_url = urls[i].replaceAll("&sid=null","&sid="+sessionId);
new_url +=data_url+";";
}
}
jsonObject_ehsq.put("recordfiles",new_name);
jsonObject_ehsq.put("recordurls",new_url);
jsonArray_EHSQ.add(jsonObject_ehsq);
SendEHSQFile(jsonArray_EHSQ);
}
SendEHSQFile(jsonArray_EHSQ);
for (BO bo:bo_act_coe_publish_c
) {
@ -1226,6 +1278,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
public String SendEHSQFile(JSONArray jsonArray) throws Exception {
System.out.println("===jsonArray==="+jsonArray);
/**
* 首先需要将传过来的参数进行加密操作,并设置
*/
@ -1233,9 +1286,12 @@ public class ProcessEndAfterEvent extends ExecuteListener {
String system = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "system");
String AES = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "AES");
String EHSQUrl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "EHSQUrl");
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMDDHHmmss");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String date = sdf.format(new Date());
String data = system+"##"+date;
String s1 = date.replaceAll("-", "").replaceAll(" ", "").replaceAll(":", "");
System.out.println("时间>>>>>>>>>>>>"+s1);
String data = system+"##"+s1;
String encrypt = aesUtil.encrypt(data, AES); //获取加密之后的秘钥
JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
jsonObject.put("system",system);

View File

@ -24,78 +24,96 @@ import java.util.List;
public class CreategetFlowListByWfidJob implements IJob {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
int tale = 747487;//747487
//List<BO> bo_eu_oa_process = SDK.getBOAPI().query("BO_EU_OA_PROCESS", true).list();
// for (BO bo:
// bo_eu_oa_process) {
// for (BO bo:
// bo_eu_oa_process) {
try{
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
jsonObject.put("workflowId",tale);
// jsonObject.put("workflowId",bo.getString("WORKFLOWID"));
//jsonObject.put("createDateStart","2019-07-01 00:00:00");//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo()
//jsonObject.put("createDateEnd","2023-09-01 00:00:00");//processExecutionContext.getProcessInstance().getCreateUser()
jsonObject.put("pageIndex",1);
jsonObject.put("pageSize",3000);
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\">\n" +
" <soapenv:Header/>" +
" <soapenv:Body>" +
" <web:getFlowListByWfId>" +
" <web:in0>" +
""+jsonObject+""+
" </web:in0>" +
" </web:getFlowListByWfId>" +
" </soapenv:Body>" +
"</soapenv:Envelope>";
List<BO> bo_eu_oa_process = SDK.getBOAPI().query("BO_EU_OA_PROCESS", true).list();
for (BO bos:bo_eu_oa_process
) {
int tale = Integer.valueOf(bos.getString("WORKFLOWID"));
System.out.println("参数==============="+xmlStr);
//System.out.println("参数==============="+xmls);
//HttpClientUtil httpClientUtil = new HttpClientUtil();
int timeout = 600000;
// HttpURLConnection 发送SOAP请求
System.out.println("HttpURLConnection 发送SOAP请求");
jsonObject.put("workflowId",tale);
// jsonObject.put("workflowId",bo.getString("WORKFLOWID"));
//jsonObject.put("createDateStart","2019-07-01 00:00:00");//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo()
//jsonObject.put("createDateEnd","2023-09-01 00:00:00");//processExecutionContext.getProcessInstance().getCreateUser()
jsonObject.put("pageIndex",1);
jsonObject.put("pageSize",3000);
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\">\n" +
" <soapenv:Header/>" +
" <soapenv:Body>" +
" <web:getFlowListByWfId>" +
" <web:in0>" +
""+jsonObject+""+
" </web:in0>" +
" </web:getFlowListByWfId>" +
" </soapenv:Body>" +
"</soapenv:Envelope>";
String postSoap = UtilUrl.doPostSoap("http://10.119.22.207:80/services/WorkflowService", xmlStr, "");
System.out.println("参数==============="+xmlStr);
//System.out.println("参数==============="+xmls);
//HttpClientUtil httpClientUtil = new HttpClientUtil();
int timeout = 600000;
// HttpURLConnection 发送SOAP请求
System.out.println("HttpURLConnection 发送SOAP请求");
String postSoap = UtilUrl.doPostSoap("http://10.119.22.207:80/services/WorkflowService", xmlStr, "");
Document document = DocumentHelper.parseText(postSoap);
Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out");
String resultString = result.getData().toString();
System.out.println("resultString=>>>>>>>>>>"+resultString);
JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("datas");
JSONArray jsonArray = JSONArray.parseArray(datas);
Document document = DocumentHelper.parseText(postSoap);
Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out");
String resultString = result.getData().toString();
System.out.println("resultString=>>>>>>>>>>"+resultString);
JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("datas");
JSONArray jsonArray = JSONArray.parseArray(datas);
System.out.println("jsonArrayData》》》》》》》》》》》》"+jsonArray);
UserContext userContext = UserContext.fromUID("admin");
for (int i=0;i<jsonArray.size();i++){
BO bo = new BO();
bo.set("TASKID",JSONObject.parseObject(jsonArray.get(i).toString()).get("id"));
bo.set("NODENAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("nodeName"));
bo.set("NODEID",JSONObject.parseObject(jsonArray.get(i).toString()).get("nodeid"));
bo.set("OPERATEDATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate"));
bo.set("OPERATETYPE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operateType"));
bo.set("OPERATOR",JSONObject.parseObject(jsonArray.get(i).toString()).get("operator"));
bo.set("OPERATORWORKCODE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operatorWorkCode"));
bo.set("RECEIVEDATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("receiveDate"));
bo.set("REQUESTID",JSONObject.parseObject(jsonArray.get(i).toString()).get("requestId"));
bo.set("REQUESTNAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("requestName"));
bo.set("STATUS",JSONObject.parseObject(jsonArray.get(i).toString()).get("status"));
bo.set("WORKFLOWID",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowId"));
bo.set("WORKFLOWNAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowName"));
bo.set("WORKFLOWTYPE_OA",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowType"));
SDK.getBOAPI().createDataBO("BO_EU_OA_PROCESS_TASK",bo,userContext);
System.out.println("jsonArrayData》》》》》》》》》》》》"+jsonArray);
UserContext userContext = UserContext.fromUID("admin");
for (int i=0;i<jsonArray.size();i++){
BO detail = SDK.getBOAPI().query("BO_EU_PROCESS_NEW", true).addQuery("WORKFLOWID=", JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowId")).addQuery("REQUESTID=", JSONObject.parseObject(jsonArray.get(i).toString()).get("requestId")).detail();
if (detail==null){
BO bo = new BO();
bo.set("OPERATORWORKCODE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operatorWorkCode"));
bo.set("REQUESTID",JSONObject.parseObject(jsonArray.get(i).toString()).get("requestId"));
bo.set("WORKFLOWID",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowId"));
bo.set("WORKFLOWNAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowName"));
bo.set("OPERATEDATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate"));
bo.set("RECEIVEDATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("receiveDate"));
SDK.getBOAPI().createDataBO("BO_EU_PROCESS_NEW",bo,userContext);
}
BO bo = new BO();
bo.set("TASKID",JSONObject.parseObject(jsonArray.get(i).toString()).get("id"));
bo.set("NODENAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("nodeName"));
bo.set("NODEID",JSONObject.parseObject(jsonArray.get(i).toString()).get("nodeid"));
bo.set("OPERATEDATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate"));
bo.set("OPERATETYPE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operateType"));
bo.set("OPERATOR",JSONObject.parseObject(jsonArray.get(i).toString()).get("operator"));
bo.set("OPERATORWORKCODE",JSONObject.parseObject(jsonArray.get(i).toString()).get("operatorWorkCode"));
bo.set("RECEIVEDATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("receiveDate"));
bo.set("REQUESTID",JSONObject.parseObject(jsonArray.get(i).toString()).get("requestId"));
bo.set("REQUESTNAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("requestName"));
bo.set("STATUS",JSONObject.parseObject(jsonArray.get(i).toString()).get("status"));
bo.set("WORKFLOWID",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowId"));
bo.set("WORKFLOWNAME",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowName"));
bo.set("WORKFLOWTYPE_OA",JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowType"));
SDK.getBOAPI().createDataBO("BO_EU_OA_PROCESS_TASK",bo,userContext);
}
}
} catch (DocumentException documentException) {
documentException.printStackTrace();
}
//}
System.out.println("保存OA流程数据完成");
}

View File

@ -172,9 +172,7 @@ public class OaPendComponent {
xmlDatasUtil.setPcurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&amp;oauthName=oauthLogin&amp;processInstId="+pec.getProcessInstance().getId()+"&amp;taskInstId="+taskInstance.getId()+"&amp;openState="+taskInstance.getState());
xmlDatasUtil.setMobileurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&amp;corpid=wwb0ae23173b140618&amp;appAgentId=1000014&amp;oauthName=wechat&amp;casaccount="+taskInstance.getTarget()+"&amp;processInstId="+pec.getProcessInstance().getId()+"&amp;taskInstId="+taskInstance.getId()+"&amp;openState="+taskInstance.getState());
String target = taskInstance.getTarget();
if (target.length()==8&&"00".equals(target.substring(0,2))){
target = target.substring(2);
}
System.out.println("当前账户======》》》》"+target);
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
System.out.println("bo>>>>>>>>>>"+bo_eu_oa_reson);
@ -392,9 +390,7 @@ public class OaPendComponent {
}
String target = taskInstance.getTarget();
if (target.length()==8&&"00".equals(target.substring(0,2))){
target = target.substring(2);
}
System.out.println("当前账户======》》》》"+target);
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
System.out.println("bo>>>>>>>>>>>>>>"+bo_eu_oa_reson);

View File

@ -7,12 +7,15 @@ import java.util.Date;
import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.commons.oauth.AbstractOauth;
import com.actionsoft.bpms.org.model.DepartmentModel;
import com.actionsoft.bpms.server.RequestParams;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.LogAPI;
import com.actionsoft.sdk.local.api.Logger;
import com.actionsoft.sdk.local.api.ORGAPI;
import com.actionsoft.sdk.service.model.UserModel;
import com.alibaba.fastjson.JSONObject;
import com.yili.wsclient.ClientService;
@ -55,6 +58,7 @@ public class OauthLogin extends AbstractOauth {
@Override
public String validate(RequestParams params) throws IOException {
BO bo = new BO();
String id = params.get("id");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long begintime = System.currentTimeMillis();
bo.set("BEGIN_TIME",sdf.format(new Date()));
@ -69,6 +73,13 @@ public class OauthLogin extends AbstractOauth {
bo.set("USER_ID","00"+workcode);
UserContext userContext = UserContext.fromUID("admin");
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
if (("5af46cd5-a1bc-4125-a144-86d1a199eec1").equals(id)){
try {
setUserLog("00"+workcode,"1");
}catch (Exception e){
}
}
return "00"+workcode;
}else{
login_end_time = System.currentTimeMillis();
@ -76,6 +87,13 @@ public class OauthLogin extends AbstractOauth {
bo.set("USER_ID",params.get("casaccount"));
UserContext userContext = UserContext.fromUID("admin");
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
if (("5af46cd5-a1bc-4125-a144-86d1a199eec1").equals(id)){
try {
setUserLog(params.get("casaccount"),"1");
}catch (Exception e){
}
}
return params.get("casaccount");
}
}
@ -87,7 +105,13 @@ public class OauthLogin extends AbstractOauth {
bo.set("USER_ID",params.get("usercode"));
UserContext userContext = UserContext.fromUID("admin");
SDK.getBOAPI().createDataBO("BO_EU_OA_LOGIN",bo,userContext);
if (("5af46cd5-a1bc-4125-a144-86d1a199eec1").equals(id)){
try {
setUserLog(params.get("usercode"),"1");
}catch (Exception e){
}
}
return params.get("usercode");
}
@ -99,6 +123,7 @@ public class OauthLogin extends AbstractOauth {
bo.set("LOGIN_BEGIN_TIME",sdf.format(new Date()));
String redirect_uri = params.get("code");
if(StringUtils.isEmpty(redirect_uri)){
logger.error("跳转地址为空,请重新输入");
return null;
@ -120,6 +145,14 @@ public class OauthLogin extends AbstractOauth {
System.out.println("json-=====>>>>"+json);
if (StringUtils.isNotEmpty(json.getString("employeenumber"))){
System.out.println("userid》》》》》》》》》》"+json.getString("employeenumber"));
if (("5af46cd5-a1bc-4125-a144-86d1a199eec1").equals(id)){
try {
setUserLog(json.getString("employeenumber"),"1");
}catch (Exception e){
}
}
userid = json.getString("employeenumber");
login_end_time = System.currentTimeMillis();
bo.set("END_TIME",sdf.format(new Date()));
@ -181,4 +214,39 @@ public class OauthLogin extends AbstractOauth {
}
}
/**
* 用户登录日志
* @param userid
* @param logType
*/
public void setUserLog(String userid,String logType) {
System.err.println("用户登录记录存入日志========>"+userid+"_类型:"+logType);
if (UtilString.isNotEmpty(userid)) {
String logTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
BO bo = new BO();
/*String slq = "SELECT ID,LOGINCOUNTS FROM BO_EU_USER_LOGIN_LOG WHERE LOGINUSERNAME = '"+userid+"' AND LOGINTIME = '"+logTime+"'";
List<RowMap> maps = DBSql.getMaps(slq);
if(maps.size()!=0) {
bo = SDK.getBOAPI().get("BO_EU_USER_LOGIN_LOG", maps.get(0).getString("ID"));
bo.set("LOGINCOUNTS", maps.get(0).getInt("LOGINCOUNTS")+1);
SDK.getBOAPI().update("BO_EU_USER_LOGIN_LOG", bo);
}else {*/
ORGAPI orgapi = SDK.getORGAPI();
com.actionsoft.bpms.org.model.UserModel user = orgapi.getUser(userid);
DepartmentModel departmentByUser = orgapi.getDepartmentByUser(userid);
bo.set("LOGINUSERNAME", userid);
bo.set("USERBUNAME",user.getExt4());
bo.set("USERPOST",user.getPositionName());
bo.set("USERDEPTNAME", departmentByUser.getPathNameOfCache());
bo.set("LOGINTIME", logTime);
bo.set("LOGINCOUNTS", 1);
bo.set("LOGTYPE", Integer.valueOf(logType));
SDK.getBOAPI().createDataBO("BO_EU_USER_LOGIN_LOG", bo, UserContext.fromUID("admin"));
//}
}
}
}

View File

@ -23,7 +23,7 @@ public class Plugins implements PluginListener {
//注册监听器
//注册外部系统跳转PAL系统 登陆插件
list.add(new ProcessPublicEventPluginProfile(TaskListener.class.getName(), "待办推送监听器"));
list.add(new ProcessPublicEventPluginProfile(TaskListener.class.getName(), "待办推送监听器"));
list.add(new OauthPluginProfile("oauthLogin", OauthLogin.class.getName(), "OA系统 跳转登陆PAl"));
list.add(new OauthPluginProfile("WechatOauthLogin", WechatOauthLogin.class.getName(), "企业微信认证"));
list.add(new OauthPluginProfile("processOathLogin", ProcessOathLogin.class.getName(), "流程中心发布"));

View File

@ -75,6 +75,10 @@ public class AesUtil {
public static void main(String[] args) throws Exception {
String data = "AUDIT##202210181611";
String key = "auditY809kUih23";
String url = "http://10.60.143.183:8088/portal/r/df?groupValue=7d3ca852-a0bd-42e6-80b1-3dcea6f55083&fileValue=d1135309-e376-4ec6-bd27-51947abe26ea&sid=null&repositoryName=output&appId=com.actionsoft.apps.coe.pal.output.pr&attachment=true&fileName=%E5%B9%BF%E5%91%8A%E5%88%9B%E6%84%8F%E7%94%9F%E6%88%90%E6%B5%81%E7%A8%8B_1.0.doc&lastModified=1666352134000";
String str1 = url.substring(0, url.indexOf("/df"));
System.out.println("str1>"+str1);
//String encryptMsg1 = AesUtil.encrypt(data, key);
//System.out.println("加密后:" + encryptMsg1);
/*message = "YPS5F%2F%2BVmdbVj0iuxrSINw%3D%3D";

View File

@ -35,6 +35,8 @@ public class DownloadUtil {
* @return
*/
public LinkedHashMap<String,String> outputReportDownload(UserContext _uc, String taskId, String ruuid) {
System.out.println("usercontext>>>>>>>>>>>"+_uc.getUID());
System.out.println("sid>>>>>>>>>>>"+_uc.getSessionId());
LinkedHashMap<String,String> map = new LinkedHashMap<>();
OutputTaskModel model = new OutputTask().getTaskReportById(taskId);
ResponseObject result = ResponseObject.newOkResponse();

View File

@ -65,9 +65,8 @@ public class WorkFlowAPI {
JSONArray jsonArray_new = new JSONArray(new LinkedList<>());
for (RowMap rowMapsw:
rowMap) {
List<BO> list = SDK. getBOAPI().query("BO_EU_OA_PROCESS_TASK").addQuery("WORKFLOWID=", rowMapsw.getString("WORKFLOWID")).list();
List<BO> list = SDK. getBOAPI().query("BO_EU_PROCESS_NEW").addQuery("WORKFLOWID=", rowMapsw.getString("WORKFLOWID")).list();
for (int i=0;i<list.size();i++) {
if (SDK.getORGAPI().getUser(list.get(i).getString("OPERATORWORKCODE"))!=null){
JSONObject jsonObject2 = new JSONObject();