伊利接口提交
This commit is contained in:
parent
84a8927704
commit
1ac9f3203b
@ -0,0 +1,19 @@
|
||||
package com.awspaas.user.apps.integration.controller;
|
||||
|
||||
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
@Controller
|
||||
public class GetSomeIndexController {
|
||||
@Mapping(value = "com.awspaas.user.apps.integration.controller.GetSomeIndexController.toIndex",session = false,
|
||||
noSessionEvaluate = "无安全隐患",
|
||||
noSessionReason = "模拟登陆获取sid")
|
||||
public String toIndex(){
|
||||
return HtmlPageTemplate.merge("com.awspaas.user.apps.yili.integration","domainprocess.html",new LinkedHashMap<>());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,716 @@
|
||||
package com.awspaas.user.apps.integration.controller;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
public class GetmeritsController {
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getMetritsFirst")
|
||||
public JSONObject getMetritsFirst(String sid,String departname){
|
||||
JSONObject result = new JSONObject(new LinkedHashMap<>());
|
||||
List list = new ArrayList(new LinkedList());
|
||||
list.add(0,"");
|
||||
list.add(1,"L1流程架构");
|
||||
list.add(2,"绩效指标");
|
||||
result.put("headtop",list);
|
||||
if (StringUtils.isEmpty(departname)){
|
||||
|
||||
|
||||
/**
|
||||
* 战略流程
|
||||
*/
|
||||
JSONArray jsonArray1 =new JSONArray(new LinkedList<>());
|
||||
JSONObject json_first = new JSONObject(new LinkedHashMap<>());
|
||||
json_first.put("leftname","战略流程");
|
||||
JSONArray secondcont = new JSONArray();
|
||||
JSONArray num1 = new JSONArray();
|
||||
List<BO> list1 = SDK.getBOAPI().query("BO_EU_LCJG", true).addQuery("JG_NAME=", "战略流程").orderByCreated().asc().list();
|
||||
for (BO bo:list1
|
||||
) {
|
||||
JSONObject jsonObject_se = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
String name = bo.getString("LC_NAME").substring(bo.getString("LC_NAME").indexOf(" ")+1,bo.getString("LC_NAME").length());
|
||||
jsonObject_se.put("name",bo.getString("LC_NAME"));
|
||||
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '"+bo.getString("LC_NAME")+"' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
RowMap maps = DBSql.getMap(sql);
|
||||
jsonObject_se.put("id",maps.getString("ID"));
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where like '%" +name + "%'");
|
||||
jsonObject_name.put("name",string);
|
||||
num1.add(jsonObject_name);
|
||||
secondcont.add(jsonObject_se);
|
||||
}
|
||||
|
||||
json_first.put("secondcont",secondcont);
|
||||
json_first.put("num1",num1);
|
||||
|
||||
/**
|
||||
* 运营流程
|
||||
*/
|
||||
JSONObject json_second = new JSONObject(new LinkedHashMap<>());
|
||||
json_second.put("leftname","运营流程");
|
||||
JSONArray secondcont_second = new JSONArray();
|
||||
JSONArray num1_second = new JSONArray();
|
||||
List<BO> list1_second = SDK.getBOAPI().query("BO_EU_LCJG", true).addQuery("JG_NAME=", "运营流程").orderByCreated().asc().list();
|
||||
for (BO bo:list1_second
|
||||
) {
|
||||
JSONObject jsonObject_se = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_se.put("name",bo.getString("LC_NAME"));
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '"+bo.getString("LC_NAME")+"' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
RowMap maps = DBSql.getMap(sql);
|
||||
jsonObject_se.put("id",maps.getString("ID"));
|
||||
String name = bo.getString("LC_NAME").substring(bo.getString("LC_NAME").indexOf(" ")+1,bo.getString("LC_NAME").length());
|
||||
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%" +name + "%'");
|
||||
jsonObject_name.put("name",string);
|
||||
num1_second.add(jsonObject_name);
|
||||
secondcont_second.add(jsonObject_se);
|
||||
}
|
||||
|
||||
json_second.put("secondcont",secondcont_second);
|
||||
json_second.put("num1",num1_second);
|
||||
|
||||
/**
|
||||
* 支持流程
|
||||
*/
|
||||
|
||||
/**
|
||||
* 运营流程
|
||||
*/
|
||||
JSONObject json_thrid = new JSONObject(new LinkedHashMap<>());
|
||||
json_thrid.put("leftname","支持流程");
|
||||
JSONArray secondcont_thrid = new JSONArray();
|
||||
JSONArray num1_thrid = new JSONArray();
|
||||
List<BO> list1_thrid = SDK.getBOAPI().query("BO_EU_LCJG", true).addQuery("JG_NAME=", "支持流程").orderByCreated().asc().list();
|
||||
for (BO bo:list1_thrid
|
||||
) {
|
||||
JSONObject jsonObject_se = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_se.put("name",bo.getString("LC_NAME"));
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '"+bo.getString("LC_NAME")+"' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
RowMap maps = DBSql.getMap(sql);
|
||||
jsonObject_se.put("id",maps.getString("ID"));
|
||||
String name = bo.getString("LC_NAME").substring(bo.getString("LC_NAME").indexOf(" ")+1,bo.getString("LC_NAME").length());
|
||||
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%" +name+ "%'");
|
||||
jsonObject_name.put("name",string);
|
||||
num1_thrid.add(jsonObject_name);
|
||||
secondcont_thrid.add(jsonObject_se);
|
||||
}
|
||||
|
||||
json_thrid.put("secondcont",secondcont_thrid);
|
||||
json_thrid.put("num1",num1_thrid);
|
||||
jsonArray1.add(json_first);
|
||||
jsonArray1.add(json_second);
|
||||
jsonArray1.add(json_thrid);
|
||||
result.put("content",jsonArray1);
|
||||
return result;
|
||||
}else{
|
||||
/**
|
||||
* 战略流程
|
||||
*/
|
||||
JSONArray jsonArray1 =new JSONArray(new LinkedList<>());
|
||||
JSONObject json_first = new JSONObject(new LinkedHashMap<>());
|
||||
json_first.put("leftname","战略流程");
|
||||
JSONArray secondcont = new JSONArray();
|
||||
JSONArray num1 = new JSONArray();
|
||||
List<BO> list1 = SDK.getBOAPI().query("BO_EU_LCJG", true).addQuery("JG_NAME=", "战略流程").orderByCreated().asc().list();
|
||||
for (BO bo:list1
|
||||
) {
|
||||
JSONObject jsonObject_se = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
String name = bo.getString("LC_NAME").substring(bo.getString("LC_NAME").indexOf(" ")+1,bo.getString("LC_NAME").length());
|
||||
jsonObject_se.put("name",bo.getString("LC_NAME"));
|
||||
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '"+bo.getString("LC_NAME")+"' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
RowMap maps = DBSql.getMap(sql);
|
||||
jsonObject_se.put("id",maps.getString("ID"));
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%" +name + "%'");
|
||||
jsonObject_name.put("name",string);
|
||||
num1.add(jsonObject_name);
|
||||
secondcont.add(jsonObject_se);
|
||||
}
|
||||
|
||||
json_first.put("secondcont",secondcont);
|
||||
json_first.put("num1",num1);
|
||||
|
||||
/**
|
||||
* 运营流程
|
||||
*/
|
||||
JSONObject json_second = new JSONObject(new LinkedHashMap<>());
|
||||
json_second.put("leftname","运营流程");
|
||||
JSONArray secondcont_second = new JSONArray();
|
||||
JSONArray num1_second = new JSONArray();
|
||||
List<BO> list1_second = SDK.getBOAPI().query("BO_EU_LCJG", true).addQuery("JG_NAME=", "运营流程").orderByCreated().asc().list();
|
||||
for (BO bo:list1_second
|
||||
) {
|
||||
JSONObject jsonObject_se = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_se.put("name",bo.getString("LC_NAME"));
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '"+bo.getString("LC_NAME")+"' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
RowMap maps = DBSql.getMap(sql);
|
||||
jsonObject_se.put("id",maps.getString("ID"));
|
||||
String name = bo.getString("LC_NAME").substring(bo.getString("LC_NAME").indexOf(" ")+1,bo.getString("LC_NAME").length());
|
||||
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%" +name + "%'");
|
||||
jsonObject_name.put("name",string);
|
||||
num1_second.add(jsonObject_name);
|
||||
secondcont_second.add(jsonObject_se);
|
||||
}
|
||||
|
||||
json_second.put("secondcont",secondcont_second);
|
||||
json_second.put("num1",num1_second);
|
||||
|
||||
/**
|
||||
* 支持流程
|
||||
*/
|
||||
|
||||
/**
|
||||
* 运营流程
|
||||
*/
|
||||
JSONObject json_thrid = new JSONObject(new LinkedHashMap<>());
|
||||
json_thrid.put("leftname","支持流程");
|
||||
JSONArray secondcont_thrid = new JSONArray();
|
||||
JSONArray num1_thrid = new JSONArray();
|
||||
List<BO> list1_thrid = SDK.getBOAPI().query("BO_EU_LCJG", true).addQuery("JG_NAME=", "支持流程").orderByCreated().asc().list();
|
||||
for (BO bo:list1_thrid
|
||||
) {
|
||||
JSONObject jsonObject_se = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_se.put("name",bo.getString("LC_NAME"));
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '"+bo.getString("LC_NAME")+"' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
RowMap maps = DBSql.getMap(sql);
|
||||
jsonObject_se.put("id",maps.getString("ID"));
|
||||
String name = bo.getString("LC_NAME").substring(bo.getString("LC_NAME").indexOf(" ")+1,bo.getString("LC_NAME").length());
|
||||
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%" +name+ "%'");
|
||||
jsonObject_name.put("name",string);
|
||||
num1_thrid.add(jsonObject_name);
|
||||
secondcont_thrid.add(jsonObject_se);
|
||||
}
|
||||
|
||||
json_thrid.put("secondcont",secondcont_thrid);
|
||||
json_thrid.put("num1",num1_thrid);
|
||||
jsonArray1.add(json_first);
|
||||
jsonArray1.add(json_second);
|
||||
jsonArray1.add(json_thrid);
|
||||
result.put("content",jsonArray1);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getDepartname")
|
||||
public JSONObject getDepartname(String sid){
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
List<BO> bo_eu_depat_name = SDK.getBOAPI().query("BO_EU_DEPAT_NAME", true).list();
|
||||
int i=0;
|
||||
for (BO bo:bo_eu_depat_name
|
||||
) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("termsKey",i);
|
||||
jsonObject.put("termsVal",bo.getString("DEPART_NAME"));
|
||||
jsonArray.add(jsonObject);
|
||||
i++;
|
||||
}
|
||||
result.put("result","ok");
|
||||
result.put("fileTypes",jsonArray);
|
||||
return result;
|
||||
}
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getFirst")
|
||||
public JSONArray getFirst(String sid,String plid,String name){
|
||||
JSONArray jsonArray = new JSONArray(new LinkedList<>());
|
||||
String sql_parent = "select * from APP_ACT_COE_PAL_REPOSITORY where PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = '"+plid+"' order by PLORDERINDEX asc";
|
||||
List<RowMap> maps1 = DBSql.getMaps(sql_parent);
|
||||
for (RowMap rowMap: maps1) {
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject.put("text",rowMap.getString("PLNAME"));
|
||||
jsonObject.put("href","#");
|
||||
String PLname = rowMap.getString("PLNAME").substring(rowMap.getString("PLNAME").indexOf(" ")+1,rowMap.getString("PLNAME").length());
|
||||
String names = name.substring(name.indexOf(" ")+1,name.length());
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%"+names+"%' AND PROCESS_ARCHITECTURE_L2 like '%" + PLname + "%'");
|
||||
jsonObject.put("num",string);
|
||||
JSONArray jsonArray1 = new JSONArray(new LinkedList<>());
|
||||
String sql_parent11 = "select * from APP_ACT_COE_PAL_REPOSITORY where PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = '"+rowMap.getString("ID")+"' order by PLORDERINDEX asc";
|
||||
List<RowMap> maps111 = DBSql.getMaps(sql_parent11);
|
||||
for (RowMap rowmap: maps111) {
|
||||
JSONObject jsonObject1 = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject1.put("text",rowmap.getString("PLNAME"));
|
||||
jsonObject1.put("href","#");
|
||||
String PLname1 = rowmap.getString("PLNAME").substring(rowmap.getString("PLNAME").indexOf(" ")+1,rowmap.getString("PLNAME").length());
|
||||
String names1 = rowMap.getString("PLNAME").substring(rowMap.getString("PLNAME").indexOf(" ")+1,rowMap.getString("PLNAME").length());
|
||||
String strings = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%"+names+"%' AND PROCESS_ARCHITECTURE_L3 like '%"+PLname1+"%' AND PROCESS_ARCHITECTURE_L2 like '%" + names1 + "%'");
|
||||
jsonObject1.put("num",strings);
|
||||
jsonArray1.add(jsonObject1);
|
||||
String sql_parent111 = "select * from APP_ACT_COE_PAL_REPOSITORY where PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = '"+rowmap.getString("ID")+"' order by PLORDERINDEX asc";
|
||||
List<RowMap> maps1111 = DBSql.getMaps(sql_parent111);
|
||||
JSONArray jsonArray2 = new JSONArray(new LinkedList<>());
|
||||
for (RowMap map:maps1111
|
||||
) {
|
||||
JSONObject jsonObject2 = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject2.put("text",map.getString("PLNAME"));
|
||||
jsonObject2.put("href","#");
|
||||
String PLname2 = map.getString("PLNAME").substring(map.getString("PLNAME").indexOf(" ")+1,map.getString("PLNAME").length());
|
||||
String names2 = rowmap.getString("PLNAME").substring(rowmap.getString("PLNAME").indexOf(" ")+1,rowmap.getString("PLNAME").length());
|
||||
String stringss = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PROCESS_ARCHITECTURE_L1 like '%"+PLname+"%' AND PROCESS_ARCHITECTURE_L3 like '%" + names2 + "%' AND PROCESS_ARCHITECTURE_L2 like '%"+PLname2+"%'");
|
||||
jsonObject2.put("num",stringss);
|
||||
jsonArray2.add(jsonObject2);
|
||||
}
|
||||
//jsonObject1.put("nodes",jsonArray2);
|
||||
}
|
||||
jsonObject.put("nodes",jsonArray1);
|
||||
jsonArray.add(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getsecondDepartname")
|
||||
public JSONArray getsecondDepartname(String sid){
|
||||
JSONArray result = new JSONArray();
|
||||
List<BO> bo_eu_depat_name = SDK.getBOAPI().query("BO_EU_DEPAT_NAME", true).list();
|
||||
int i=0;
|
||||
for (BO bo:bo_eu_depat_name
|
||||
) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("name",bo.getString("DEPART_NAME"));
|
||||
result.add(jsonObject);
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getL1Process")
|
||||
public JSONObject getL1Process(String sid){
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
List<RowMap> maps = DBSql.getMaps(sql); int i=0;
|
||||
for (RowMap rowMap:maps
|
||||
) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("termsKey",rowMap.getString("ID"));
|
||||
jsonObject.put("termsVal",rowMap.getString("PLNAME"));
|
||||
jsonArray.add(jsonObject);
|
||||
i++;
|
||||
}
|
||||
result.put("result","ok");
|
||||
result.put("fileTypes",jsonArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getTable2Data")
|
||||
public JSONObject getTable2Data(String sid,String plname,String departname) {
|
||||
JSONObject result = new JSONObject(new LinkedHashMap<>());
|
||||
JSONArray jsonArray_content = new JSONArray(new LinkedList<>());
|
||||
|
||||
String id = DBSql.getString("select ID from APP_ACT_COE_PAL_REPOSITORY where PLNAME = '" + plname + "' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc");
|
||||
|
||||
/**
|
||||
* 这是L1的流程绩效数据汇总
|
||||
*/
|
||||
JSONObject jsonObject1 = new JSONObject(new LinkedHashMap<>());
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY where ID = '" + id + "' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLPARENTID = 'process' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
|
||||
RowMap map = DBSql.getMap(sql);
|
||||
jsonObject1.put("leftname", "L1流程绩效指标");
|
||||
JSONArray jsonArray1 = new JSONArray();
|
||||
JSONObject jsonObject_secondcont = new JSONObject(new LinkedHashMap<>());
|
||||
JSONArray jsonArray_name = new JSONArray(new LinkedList<>());
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_name.put("title", map.getString("PLNAME"));
|
||||
jsonObject_name.put("id", map.getString("ID"));
|
||||
jsonObject_name.put("incident", true);
|
||||
String name = map.getString("PLNAME").substring(map.getString("PLNAME").indexOf(" ")+1);
|
||||
List<BO> list = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PROCESS_ARCHITECTURE_L1 like '%"+name+"%' ",null).addQuery("PERFORMANCE_TYPE=","L1L3流程绩效").addQuery("PROCESS_ARCHITECTURE_L2 = ''", null).addQuery("PROCESS_ARCHITECTURE_L3 = ''", null).list();
|
||||
List list_child = new LinkedList();
|
||||
List linked_Waring = new LinkedList();
|
||||
int i = 0;
|
||||
for (BO bo : list
|
||||
) {
|
||||
list_child.add(i, bo.getString("PERFORMANCE_INDICATOR_NAME"));
|
||||
linked_Waring.add(i, 10);
|
||||
i++;
|
||||
}
|
||||
jsonObject_name.put("child", list_child);
|
||||
jsonObject_name.put("Warning", linked_Waring);
|
||||
jsonArray_name.add(jsonObject_name);
|
||||
jsonObject_secondcont.put("name", jsonArray_name);
|
||||
jsonObject_secondcont.put("list1", new LinkedList<>());
|
||||
jsonObject_secondcont.put("list2", new LinkedList<>());
|
||||
jsonObject_secondcont.put("list3", new LinkedList<>());
|
||||
jsonArray1.add(jsonObject_secondcont);
|
||||
jsonObject1.put("secondcont", jsonArray1);
|
||||
|
||||
/**
|
||||
* L2流程数据汇总
|
||||
*/
|
||||
String sqls = "select * from APP_ACT_COE_PAL_REPOSITORY where PLPARENTID = '" + id + "' AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
|
||||
List<RowMap> maps = DBSql.getMaps(sqls);
|
||||
|
||||
String ids = "";
|
||||
|
||||
JSONObject jsonObject2 = new JSONObject(new LinkedHashMap<>());
|
||||
|
||||
jsonObject2.put("leftname", "L2流程绩效指标");
|
||||
JSONArray jsonArray2 = new JSONArray();
|
||||
JSONObject jsonObject_secondcont2 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONArray jsonArray_name2 = new JSONArray(new LinkedList<>());
|
||||
for (RowMap rowmap : maps
|
||||
) {
|
||||
ids+=rowmap.getString("ID")+",";
|
||||
|
||||
JSONObject jsonObject_name2 = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_name2.put("title", rowmap.getString("PLNAME"));
|
||||
jsonObject_name2.put("id", rowmap.getString("ID"));
|
||||
jsonObject_name2.put("incident", true);
|
||||
String name2 = rowmap.getString("PLNAME").substring(rowmap.getString("PLNAME").indexOf(" ")+1);;
|
||||
List<BO> lists = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PROCESS_ARCHITECTURE_L1 like '%"+name+"%' ",null).addQuery("PERFORMANCE_TYPE=","L1L3流程绩效").addQuery("PROCESS_ARCHITECTURE_L2 like '%"+name2+"%' ", null).addQuery("PROCESS_ARCHITECTURE_L3 = ''", null).list();
|
||||
List list_childs = new LinkedList();
|
||||
int j = 0;
|
||||
for (BO bo : lists
|
||||
) {
|
||||
list_childs.add(j, bo.getString("PERFORMANCE_INDICATOR_NAME"));
|
||||
j++;
|
||||
}
|
||||
jsonObject_name2.put("child", list_childs);
|
||||
jsonArray_name2.add(jsonObject_name2);
|
||||
|
||||
}
|
||||
jsonObject_secondcont2.put("name", jsonArray_name2);
|
||||
jsonObject_secondcont2.put("list1", new LinkedList<>());
|
||||
jsonObject_secondcont2.put("list2", new LinkedList<>());
|
||||
jsonObject_secondcont2.put("list3", new LinkedList<>());
|
||||
jsonArray2.add(jsonObject_secondcont2);
|
||||
jsonObject2.put("secondcont",jsonArray2);
|
||||
String dleass = "";
|
||||
String[] deptSplit = ids.split(",");
|
||||
if(deptSplit.length==1){
|
||||
dleass = "'"+deptSplit[0]+"'";
|
||||
}
|
||||
dleass ="'"+ StringUtils.join(deptSplit, "','")+"'";
|
||||
System.out.println(
|
||||
"dleass》》》》》》》》》》"+dleass
|
||||
);
|
||||
|
||||
/**
|
||||
* 关联流程清单
|
||||
*/
|
||||
JSONObject jsonObject4 = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject4.put("leftname", "关联流程清单");
|
||||
JSONArray jsonArray4_secondcont = new JSONArray(new LinkedList<>());
|
||||
JSONObject jsonObject4_secondcont = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject4_secondcont.put("name",new LinkedList<>());
|
||||
jsonObject4_secondcont.put("list1",new LinkedList<>());
|
||||
jsonObject4_secondcont.put("list2",new LinkedList<>());
|
||||
jsonObject4_secondcont.put("list3",new LinkedList<>());
|
||||
jsonArray4_secondcont.add(jsonObject4_secondcont);
|
||||
jsonObject4.put("secondcont",jsonArray4_secondcont);
|
||||
/**
|
||||
* L3流程数据汇总
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
JSONObject jsonObject3 = new JSONObject(new LinkedHashMap<>());
|
||||
|
||||
jsonObject3.put("leftname", "L3流程绩效指标");
|
||||
JSONArray jsonArray3 = new JSONArray();
|
||||
|
||||
List<Integer> list_num = new LinkedList();
|
||||
int q=0;
|
||||
String[] plid = dleass.split(",");
|
||||
for (String ikds:plid
|
||||
) {
|
||||
String sqls3 = "select * from APP_ACT_COE_PAL_REPOSITORY where PLPARENTID = "+ikds+" AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
|
||||
List<RowMap> mapss = DBSql.getMaps(sqls3);
|
||||
for (RowMap rowmaps : mapss) {
|
||||
String name2 = rowmaps.getString("PLNAME").substring(rowmaps.getString("PLNAME").indexOf(" ") + 1);
|
||||
;
|
||||
|
||||
String string = DBSql.getString("select count(*) from BO_EU_PER_IND_LIB where PERFORMANCE_TYPE = 'L1L3流程绩效' and PROCESS_ARCHITECTURE_L3 like '%" + name2 + "%'");
|
||||
list_num.add(q, Integer.valueOf(string));
|
||||
q++;
|
||||
}
|
||||
}
|
||||
|
||||
Integer max = Collections.max(list_num);
|
||||
if (max==0){
|
||||
max=3;
|
||||
}
|
||||
|
||||
Map<String,List<Object>> map_list = new HashMap<String,List<Object>>();
|
||||
for(int h = 0;h<max;h++){
|
||||
map_list.put(String.valueOf(h),new ArrayList<Object>());
|
||||
}
|
||||
JSONObject jsonObject_secondcont3 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONArray jsonArray_name3 = new JSONArray(new LinkedList<>());
|
||||
|
||||
for (String ikds:plid
|
||||
) {
|
||||
String sqls3 = "select * from APP_ACT_COE_PAL_REPOSITORY where PLPARENTID = "+ikds+" AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
|
||||
List<RowMap> mapss = DBSql.getMaps(sqls3);
|
||||
|
||||
for (RowMap rowmaps : mapss
|
||||
) {
|
||||
|
||||
|
||||
JSONObject jsonObject_name3 = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject_name3.put("title", rowmaps.getString("PLNAME"));
|
||||
jsonObject_name3.put("id", rowmaps.getString("ID"));
|
||||
jsonObject_name3.put("incident", true);
|
||||
String name2 = rowmaps.getString("PLNAME").substring(rowmaps.getString("PLNAME").indexOf(" ")+1);;
|
||||
List<BO> lists = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PERFORMANCE_TYPE=","L1L3流程绩效").addQuery("PROCESS_ARCHITECTURE_L3 like '%"+name2+"%'", null).list();
|
||||
List list_childs = new LinkedList();
|
||||
jsonObject_name3.put("child", list_childs);
|
||||
jsonArray_name3.add(jsonObject_name3);
|
||||
|
||||
}
|
||||
}
|
||||
jsonObject_secondcont3.put("name", jsonArray_name3);
|
||||
|
||||
int r=0;
|
||||
|
||||
String sqls3 = "select * from APP_ACT_COE_PAL_REPOSITORY where PLPARENTID in (" + dleass + ") AND PLCATEGORY = 'process'and PLMETHODID ='process.framework' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试' ,'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试') and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e', 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09', '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5', '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093', '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c', '42c09260-c1d3-44b7-ac3d-f8280e04c294') order by PLORDERINDEX asc";
|
||||
|
||||
List<RowMap> mapss = DBSql.getMaps(sqls3);
|
||||
for (RowMap rowmaps : mapss) {
|
||||
String name2 = rowmaps.getString("PLNAME").substring(rowmaps.getString("PLNAME").indexOf(" ") + 1);
|
||||
;
|
||||
List<BO> lists = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PERFORMANCE_TYPE=", "L1L3流程绩效").addQuery("PROCESS_ARCHITECTURE_L3 like '%" + name2 + "%'", null).list();
|
||||
|
||||
for (int w = 0; w < lists.size(); w++) {
|
||||
map_list.get(String.valueOf(w)).add(r, lists.get(w).getString("PERFORMANCE_INDICATOR_NAME"));
|
||||
}
|
||||
if (lists.size() < map_list.size()) {
|
||||
for (int u = lists.size(); u < map_list.size(); u++) {
|
||||
map_list.get(String.valueOf(u)).add(r, "");
|
||||
}
|
||||
|
||||
}
|
||||
r++;
|
||||
|
||||
}
|
||||
for (int t=0;t<map_list.size();t++) {
|
||||
jsonObject_secondcont3.put("list"+(t+1), map_list.get(String.valueOf(t)));
|
||||
}
|
||||
|
||||
jsonArray3.add(jsonObject_secondcont3);
|
||||
jsonObject3.put("secondcont",jsonArray3);
|
||||
jsonArray_content.add(jsonObject1);
|
||||
jsonArray_content.add(jsonObject2);
|
||||
jsonArray_content.add(jsonObject3);
|
||||
jsonArray_content.add(jsonObject4);
|
||||
result.put("content",jsonArray_content);
|
||||
List lisr = new LinkedList<>();
|
||||
lisr.add(1);
|
||||
lisr.add(2);
|
||||
lisr.add(4);
|
||||
result.put("yunxing",lisr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.tabledrag")
|
||||
public JSONObject tabledrag(String sid,String id){
|
||||
JSONObject result = new JSONObject(new LinkedHashMap<>());
|
||||
List list = new LinkedList();
|
||||
list.add("流程绩效指标");
|
||||
list.add("衡量单位");
|
||||
list.add("跟踪频率");
|
||||
list.add("计算公式");
|
||||
list.add("数据来源");
|
||||
result.put("headtop",list);
|
||||
JSONArray jsonArray = new JSONArray(new LinkedList<>());
|
||||
JSONObject jsonObject_contant = new JSONObject(new LinkedHashMap<>());
|
||||
JSONArray jsonArray_secondcont = new JSONArray(new LinkedList<>());
|
||||
JSONArray jsonArray_num1 = new JSONArray(new LinkedList<>());
|
||||
JSONArray jsonArray_num2 = new JSONArray(new LinkedList<>());
|
||||
JSONArray jsonArray_num3 = new JSONArray(new LinkedList<>());
|
||||
JSONArray jsonArray_num4 = new JSONArray(new LinkedList<>());
|
||||
RowMap rowMap = DBSql.getMap("select * from APP_ACT_COE_PAL_REPOSITORY where id = '" + id + "'");
|
||||
|
||||
|
||||
if (rowMap.getString("PLPARENTID").equals("process")){
|
||||
String Planme = rowMap.getString("PLNAME").substring(rowMap.getString("PLNAME").indexOf(" ") + 1);
|
||||
List<BO> bo_eu_per_ind_lib = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PROCESS_ARCHITECTURE_L1 like '%" + Planme + "%'", null).addQuery("PROCESS_ARCHITECTURE_L2 = ''", null).addQuery("PROCESS_ARCHITECTURE_L3 = ''", null).addQuery("PERFORMANCE_TYPE=","末级流程绩效") .list();
|
||||
|
||||
for (BO bo:
|
||||
bo_eu_per_ind_lib) {
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num1 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num2 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num3 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num4 = new JSONObject(new LinkedHashMap<>());
|
||||
if (StringUtils.isNotEmpty(bo.getString("PERFORMANCE_INDICATOR_NAME"))){
|
||||
jsonObject_name.put("name",bo.getString("PERFORMANCE_INDICATOR_NAME"));
|
||||
}else {
|
||||
jsonObject_name.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("UNIT_MEASUREMENT"))){
|
||||
jsonObject_num1.put("name",bo.getString("UNIT_MEASUREMENT"));
|
||||
}else {
|
||||
jsonObject_num1.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("STATISTICAL_PERIOD"))){
|
||||
jsonObject_num2.put("name",bo.getString("STATISTICAL_PERIOD"));
|
||||
}else {
|
||||
jsonObject_num2.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("COMPUTATIONAL_FORMULA"))){
|
||||
jsonObject_num3.put("name",bo.getString("COMPUTATIONAL_FORMULA"));
|
||||
}else {
|
||||
jsonObject_num3.put("name","/");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(bo.getString("DATA_SOURCES"))){
|
||||
jsonObject_num4.put("name",bo.getString("DATA_SOURCES"));
|
||||
}else {
|
||||
jsonObject_num4.put("name","/");
|
||||
}
|
||||
jsonArray_secondcont.add(jsonObject_name);
|
||||
jsonArray_num1.add(jsonObject_num1);
|
||||
jsonArray_num2.add(jsonObject_num2);
|
||||
jsonArray_num3.add(jsonObject_num3);
|
||||
jsonArray_num4.add(jsonObject_num4);
|
||||
}
|
||||
jsonObject_contant.put("secondcont",jsonArray_secondcont);
|
||||
jsonObject_contant.put("num1",jsonArray_num1);
|
||||
jsonObject_contant.put("num2",jsonArray_num2);
|
||||
jsonObject_contant.put("num3",jsonArray_num3);
|
||||
jsonObject_contant.put("num4",jsonArray_num4);
|
||||
jsonArray.add(jsonObject_contant);
|
||||
result.put("content",jsonArray);
|
||||
}else {
|
||||
RowMap rowMap1 = DBSql.getMap("select * from APP_ACT_COE_PAL_REPOSITORY where id = '" + rowMap.getString("PLPARENTID") + "'");
|
||||
if (rowMap1.getString("PLPARENTID").equals("process")){
|
||||
String Planme = rowMap1.getString("PLNAME").substring(rowMap1.getString("PLNAME").indexOf(" ") + 1);
|
||||
List<BO> bo_eu_per_ind_lib = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PROCESS_ARCHITECTURE_L2 like '%" + Planme + "%'", null).addQuery("PROCESS_ARCHITECTURE_L3 = ''", null).addQuery("PERFORMANCE_TYPE=","末级流程绩效").list();
|
||||
for (BO bo:
|
||||
bo_eu_per_ind_lib) {
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num1 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num2 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num3 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num4 = new JSONObject(new LinkedHashMap<>());
|
||||
if (StringUtils.isNotEmpty(bo.getString("PERFORMANCE_INDICATOR_NAME"))){
|
||||
jsonObject_name.put("name",bo.getString("PERFORMANCE_INDICATOR_NAME"));
|
||||
}else {
|
||||
jsonObject_name.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("UNIT_MEASUREMENT"))){
|
||||
jsonObject_num1.put("name",bo.getString("UNIT_MEASUREMENT"));
|
||||
}else {
|
||||
jsonObject_num1.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("STATISTICAL_PERIOD"))){
|
||||
jsonObject_num2.put("name",bo.getString("STATISTICAL_PERIOD"));
|
||||
}else {
|
||||
jsonObject_num2.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("COMPUTATIONAL_FORMULA"))){
|
||||
jsonObject_num3.put("name",bo.getString("COMPUTATIONAL_FORMULA"));
|
||||
}else {
|
||||
jsonObject_num3.put("name","/");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(bo.getString("DATA_SOURCES"))){
|
||||
jsonObject_num4.put("name",bo.getString("DATA_SOURCES"));
|
||||
}else {
|
||||
jsonObject_num4.put("name","/");
|
||||
}
|
||||
jsonArray_secondcont.add(jsonObject_name);
|
||||
jsonArray_num1.add(jsonObject_num1);
|
||||
jsonArray_num2.add(jsonObject_num2);
|
||||
jsonArray_num3.add(jsonObject_num3);
|
||||
jsonArray_num4.add(jsonObject_num4);
|
||||
}
|
||||
jsonObject_contant.put("secondcont",jsonArray_secondcont);
|
||||
jsonObject_contant.put("num1",jsonArray_num1);
|
||||
jsonObject_contant.put("num2",jsonArray_num2);
|
||||
jsonObject_contant.put("num3",jsonArray_num3);
|
||||
jsonObject_contant.put("num4",jsonArray_num4);
|
||||
jsonArray.add(jsonObject_contant);
|
||||
result.put("content",jsonArray);
|
||||
}else{
|
||||
String Planme = rowMap.getString("PLNAME").substring(rowMap.getString("PLNAME").indexOf(" ") + 1);
|
||||
List<BO> bo_eu_per_ind_lib = SDK.getBOAPI().query("BO_EU_PER_IND_LIB", true).addQuery("PROCESS_ARCHITECTURE_L3 like '%" + Planme + "%'", null).addQuery("PERFORMANCE_TYPE=","末级流程绩效").list();
|
||||
for (BO bo:
|
||||
bo_eu_per_ind_lib) {
|
||||
JSONObject jsonObject_name = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num1 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num2 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num3 = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_num4 = new JSONObject(new LinkedHashMap<>());
|
||||
if (StringUtils.isNotEmpty(bo.getString("PERFORMANCE_INDICATOR_NAME"))){
|
||||
jsonObject_name.put("name",bo.getString("PERFORMANCE_INDICATOR_NAME"));
|
||||
}else {
|
||||
jsonObject_name.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("UNIT_MEASUREMENT"))){
|
||||
jsonObject_num1.put("name",bo.getString("UNIT_MEASUREMENT"));
|
||||
}else {
|
||||
jsonObject_num1.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("STATISTICAL_PERIOD"))){
|
||||
jsonObject_num2.put("name",bo.getString("STATISTICAL_PERIOD"));
|
||||
}else {
|
||||
jsonObject_num2.put("name","/");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(bo.getString("COMPUTATIONAL_FORMULA"))){
|
||||
jsonObject_num3.put("name",bo.getString("COMPUTATIONAL_FORMULA"));
|
||||
}else {
|
||||
jsonObject_num3.put("name","/");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(bo.getString("DATA_SOURCES"))){
|
||||
jsonObject_num4.put("name",bo.getString("DATA_SOURCES"));
|
||||
}else {
|
||||
jsonObject_num4.put("name","/");
|
||||
}
|
||||
|
||||
jsonArray_secondcont.add(jsonObject_name);
|
||||
jsonArray_num1.add(jsonObject_num1);
|
||||
jsonArray_num2.add(jsonObject_num2);
|
||||
jsonArray_num3.add(jsonObject_num3);
|
||||
jsonArray_num4.add(jsonObject_num4);
|
||||
}
|
||||
jsonObject_contant.put("secondcont",jsonArray_secondcont);
|
||||
jsonObject_contant.put("num1",jsonArray_num1);
|
||||
jsonObject_contant.put("num2",jsonArray_num2);
|
||||
jsonObject_contant.put("num3",jsonArray_num3);
|
||||
jsonObject_contant.put("num4",jsonArray_num4);
|
||||
jsonArray.add(jsonObject_contant);
|
||||
result.put("content",jsonArray);
|
||||
}
|
||||
}
|
||||
result.put("content",jsonArray);
|
||||
System.out.println("jsonArray》》》》》》》》》》》"+jsonArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -8,8 +8,15 @@ import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integration.util.JDBCUtil;
|
||||
import com.awspaas.user.apps.integration.util.UtilUrl;
|
||||
import jodd.util.StringUtil;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
|
||||
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
@ -24,9 +31,10 @@ import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
* 伊利OA系统与流程审批节点操作数据查询接口集成
|
||||
@ -35,51 +43,54 @@ public class CreateWorkflowServiceJob implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
System.out.println("portal======>>>>"+portalUrl);
|
||||
System.out.println("portal======>>>>" + portalUrl);
|
||||
/*if (portalUrl.equals("http://10.114.11.135:8088/portal")){
|
||||
portalUrl = "http://bpm.yili.com:8088/portal/";
|
||||
}*/
|
||||
JDBCUtil jdbcUtil = new JDBCUtil();
|
||||
Connection open = DBSql.open();
|
||||
|
||||
try {
|
||||
|
||||
|
||||
List<BO> bos = SDK.getBOAPI().query("BO_EU_OA_WORKFLOW_DATA", true).list();
|
||||
for (BO bo : bos
|
||||
) {
|
||||
|
||||
|
||||
try {
|
||||
int tale = Integer.parseInt(bo.getString("WORKFLOWID"));
|
||||
String workflowname = bo.getString("WORKFLOWNAME");
|
||||
//ProcessExecutionContext processExecutionContext,String fileCreateName,String fileName,String fileurl,String readingScope_org,String isFullCompany,String fileCreateDate,String relationProcessinstId,String readingScope_post,String readingScope_level,String fileid
|
||||
|
||||
int tale = 561486;
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
jsonObject.put("workflowId",tale);
|
||||
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",10);
|
||||
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
jsonObject.put("workflowId", tale);
|
||||
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", 10);
|
||||
|
||||
|
||||
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:getFormDataByWfId>" +
|
||||
" <web:in0>" +
|
||||
""+jsonObject+""+
|
||||
" </web:in0>" +
|
||||
" </web:getFormDataByWfId>" +
|
||||
" </soapenv:Body>" +
|
||||
"</soapenv:Envelope>";
|
||||
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:getFormDataByWfId>" +
|
||||
" <web:in0>" +
|
||||
"" + jsonObject + "" +
|
||||
" </web:in0>" +
|
||||
" </web:getFormDataByWfId>" +
|
||||
" </soapenv:Body>" +
|
||||
"</soapenv:Envelope>";
|
||||
|
||||
|
||||
/* String xmls = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n" +
|
||||
" <soapenv:Header/> <soapenv:Body> <web:service> <web:in0><![CDATA[ {\"action\":\"read\",\"title\":\"asdadasdadasda\",\"dept\":\"00000010\",\"user\":\"00345531\",\"date\":\"2022-07-13\",\"remark\":\"分发本部门人员查看\",\"status\":\"0\",\"pcurl\":\"http://10.119.254.49:33018/r/or?cmd=com.yili_process_page&oauthName=oauthLogin&processInstId=cf8ec45e-8209-4437-a8dd-a2ea278771ae\",\"mobileurl\":\"http://10.119.254.49:33018/r/or?cmd=com.yili_process_page&oauthName=oauthLogin&processInstId=cf8ec45e-8209-4437-a8dd-a2ea278771ae\",\"userList\":\"00345531\"} ]]> </web:in0> </web:service> </soapenv:Body></soapenv:Envelope>";
|
||||
*/
|
||||
System.out.println("参数==============="+xmlStr);
|
||||
//System.out.println("参数==============="+xmls);
|
||||
//HttpClientUtil httpClientUtil = new HttpClientUtil();
|
||||
int timeout = 600000;
|
||||
// HttpURLConnection 发送SOAP请求
|
||||
System.out.println("HttpURLConnection 发送SOAP请求");
|
||||
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, "");
|
||||
String postSoap = UtilUrl.doPostSoap("http://10.119.22.207:80/services/WorkflowService", xmlStr, "");
|
||||
|
||||
/*// HttpClient发送SOAP请求
|
||||
System.out.println("HttpClient 发送SOAP请求");
|
||||
@ -104,89 +115,304 @@ public class CreateWorkflowServiceJob implements IJob {
|
||||
|
||||
System.out.println("result=========>>>>>>>"+responseBodyAsString);*/
|
||||
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
System.out.println("rootElement>>>>>>"+rootElement);
|
||||
Element result = rootElement.element("Body").element("getFormDataByWfIdResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
System.out.println("resultString=>>>>>>>>>>"+resultString);
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("datas");
|
||||
JSONArray resultArray = JSONObject.parseArray(datas);
|
||||
System.out.println("个数》》》》》》》》"+resultArray.size());
|
||||
StringBuffer allKey = getAllKey(resultArray.getJSONObject(0));
|
||||
System.out.println("所有的字段名称信息输出》》》》》》》》》》》》"+allKey
|
||||
);
|
||||
String strs[] = allKey.toString().split(",");
|
||||
String sql = "create table T"+tale+"(";
|
||||
for (String field:strs
|
||||
) {
|
||||
sql+=field+" "+"nvarchar2(2000),";
|
||||
}
|
||||
sql = sql.substring(0,sql.length()-1)+")";
|
||||
System.out.println("sql>>>>>>>>>>>>>>"+sql);
|
||||
RowMap map = DBSql.getMap("select * from user_tables t where table_name= upper('T"+tale+"')");
|
||||
System.out.println("rowMap>>>>>>>>"+map);
|
||||
if (map==null){
|
||||
int update = DBSql.update(sql
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
System.out.println("rootElement>>>>>>" + rootElement);
|
||||
Element result = rootElement.element("Body").element("getFormDataByWfIdResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
System.out.println("resultString=>>>>>>>>>>" + resultString);
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("datas");
|
||||
JSONArray resultArray = JSONObject.parseArray(datas);
|
||||
System.out.println("个数》》》》》》》》" + resultArray.size());
|
||||
StringBuffer allKey = getAllKey(resultArray.getJSONObject(0));
|
||||
System.out.println("所有的字段名称信息输出》》》》》》》》》》》》" + allKey
|
||||
);
|
||||
System.out.println("是否已经插入数据"+update);
|
||||
}
|
||||
|
||||
|
||||
// DBSql.update("create index AWS_IN_63A5A52E2FA2 on T"+tale+" (BINDID);");
|
||||
String substring = allKey.substring(0, allKey.length() - 1);
|
||||
String insetr = "insert into T"+tale+"("+substring+") values(";
|
||||
//for (int i =0;i<resultArray.size();i++){
|
||||
|
||||
|
||||
for (int i=0;i<resultArray.size();i++){
|
||||
String data = "";
|
||||
JSONObject jsonObject2 = resultArray.getJSONObject(i);
|
||||
for (String field:strs
|
||||
String strs[] = allKey.toString().split(",");
|
||||
String sql = "create table T" + tale + "(";
|
||||
for (String name : strs
|
||||
) {
|
||||
if (jsonObject2.get(field).toString().contains("'")){
|
||||
String basic_data = jsonObject2.get(field).toString().replaceAll("'","'||CHR(39)||'");
|
||||
if (basic_data.length()>2000){
|
||||
DBSql.update("alter table T"+tale+" add "+field+"_temp clob");
|
||||
DBSql.update("update T"+tale+" set "+field+"_temp = "+field+"");
|
||||
DBSql.update("alter table T"+tale+" drop column "+field+"");
|
||||
DBSql.update("alter table T"+tale+" rename column "+field+"_temp to "+field+"");
|
||||
}
|
||||
data +="'"+basic_data+"',";
|
||||
}else{
|
||||
if (jsonObject2.get(field).toString().length()>2000){
|
||||
DBSql.update("alter table T"+tale+" add "+field+"_temp clob");
|
||||
DBSql.update("update T"+tale+" set "+field+"_temp = "+field+"");
|
||||
DBSql.update("alter table T"+tale+" drop column "+field+"");
|
||||
DBSql.update("alter table T"+tale+" rename column "+field+"_temp to "+field+"");
|
||||
}
|
||||
data += "'"+jsonObject2.get(field).toString()+"',";
|
||||
String field = getPYIndexStr(name,true);
|
||||
|
||||
if (field.contains("(")){
|
||||
field =field.replaceAll("[(]","L");
|
||||
}
|
||||
if (field.contains(")")){
|
||||
field =field.replaceAll("[)]","R");
|
||||
}
|
||||
if (isStartWithNumber(field)){
|
||||
field = "A"+field;
|
||||
}
|
||||
|
||||
|
||||
System.out.println("flename=>>>>>>>"+name+">>>>fileid》》》》》"+field);
|
||||
|
||||
sql += field + " " + "nvarchar2(2000),";
|
||||
}
|
||||
sql = sql.substring(0, sql.length() - 1) + ")";
|
||||
System.out.println("sql>>>>>>>>>>>>>>" + sql);
|
||||
RowMap map = DBSql.getMap("select * from user_tables t where table_name= upper('T" + tale + "')");
|
||||
System.out.println("rowMap>>>>>>>>" + map);
|
||||
if (map == null) {
|
||||
int update = DBSql.update(sql
|
||||
);
|
||||
|
||||
for (String name : strs
|
||||
) {
|
||||
String field = getPYIndexStr(name,true);
|
||||
//sql += field + " " + "nvarchar2(2000),";
|
||||
if (field.contains("(")){
|
||||
field =field.replaceAll("[(]","L");
|
||||
}
|
||||
if (field.contains(")")){
|
||||
field =field.replaceAll("[)]","R");
|
||||
}
|
||||
if (isStartWithNumber(field)){
|
||||
field = "A"+field;
|
||||
}
|
||||
System.out.println("flename=>>>>>>>"+name+">>>>fileid》》》》》"+field);
|
||||
jdbcUtil.comment("T"+tale,field,name);
|
||||
}
|
||||
|
||||
System.out.println("是否已经插入数据" + update);
|
||||
}
|
||||
|
||||
|
||||
// DBSql.update("create index AWS_IN_63A5A52E2FA2 on T"+tale+" (BINDID);");
|
||||
String substring = allKey.substring(0, allKey.length() - 1);
|
||||
String insetr = "insert into T" + tale + "(" + substring + ") values(";
|
||||
//for (int i =0;i<resultArray.size();i++){
|
||||
|
||||
|
||||
for (int i = 0; i < resultArray.size(); i++) {
|
||||
String data = "";
|
||||
JSONObject jsonObject2 = resultArray.getJSONObject(i);
|
||||
for (String field : strs
|
||||
) {
|
||||
if (jsonObject2.get(field).toString().contains("'")) {
|
||||
String basic_data = jsonObject2.get(field).toString().replaceAll("'", "'||CHR(39)||'");
|
||||
if (basic_data.length() > 2000) {
|
||||
DBSql.update("alter table T" + tale + " add " + field + "_temp clob");
|
||||
DBSql.update("update T" + tale + " set " + field + "_temp = " + field + "");
|
||||
DBSql.update("alter table T" + tale + " drop column " + field + "");
|
||||
DBSql.update("alter table T" + tale + " rename column " + field + "_temp to " + field + "");
|
||||
}
|
||||
data += "'" + basic_data + "',";
|
||||
} else {
|
||||
if (jsonObject2.get(field).toString().length() > 2000) {
|
||||
DBSql.update("alter table T" + tale + " add " + field + "_temp clob");
|
||||
DBSql.update("update T" + tale + " set " + field + "_temp = " + field + "");
|
||||
DBSql.update("alter table T" + tale + " drop column " + field + "");
|
||||
DBSql.update("alter table T" + tale + " rename column " + field + "_temp to " + field + "");
|
||||
}
|
||||
data += "'" + jsonObject2.get(field).toString() + "',";
|
||||
}
|
||||
|
||||
}
|
||||
System.out.println("最后数据=====》》》》》" + data);
|
||||
data = data.substring(0, data.length() - 1);
|
||||
String sqsl = insetr + data + ")";
|
||||
System.out.println("sqsl>>>>>>>>>>>>" + sqsl);
|
||||
int update = DBSql.update(sqsl);
|
||||
System.out.println("插入数据影响行数》》》》》》》》》》》" + update);
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
open.close();
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
System.out.println("最后数据=====》》》》》"+data);
|
||||
data = data.substring(0,data.length()-1);
|
||||
String sqsl = insetr+data+")";
|
||||
System.out.println("sqsl>>>>>>>>>>>>"+sqsl);
|
||||
int update = DBSql.update(sqsl);
|
||||
System.out.println("插入数据影响行数》》》》》》》》》》》"+update);
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
try {
|
||||
open.close();
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
System.out.println("同步插入OA表单数据同步完成");
|
||||
}
|
||||
System.out.println("同步插入OA表单数据同步完成");
|
||||
}
|
||||
|
||||
public String getPYIndexStr(String strChinese, boolean bUpCase){
|
||||
|
||||
try{
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
String chinese = "";
|
||||
|
||||
byte b[] = strChinese.getBytes("GBK");//把中文转化成byte数组
|
||||
|
||||
for(int i = 0; i < b.length; i++){
|
||||
|
||||
if((b[i] & 255) > 128){
|
||||
|
||||
int char1 = b[i++] & 255;
|
||||
|
||||
char1 <<= 8;//左移运算符用“<<”表示,是将运算符左边的对象,向左移动运算符右边指定的位数,并且在低位补零。其实,向左移n位,就相当于乘上2的n次方
|
||||
|
||||
int chart = char1 + (b[i] & 255);
|
||||
|
||||
buffer.append(getPYIndexChar((char)chart, bUpCase));
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
char c = (char)b[i];
|
||||
|
||||
//确定指定字符是否是汉字、大写字母、数字
|
||||
if(!Character.isJavaIdentifierPart(c) || (c >= 'A' && c <= 'Z') || Character.isDigit(c)){
|
||||
|
||||
buffer.append(c);
|
||||
|
||||
}if (c >= 'a' && c <= 'z'){
|
||||
|
||||
buffer.append((char) (c - 'a' + 'A'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (buffer.toString().contains("-")){
|
||||
chinese = buffer.toString().replaceAll("-","_");
|
||||
}else if (buffer.toString().contains(" ")){
|
||||
chinese = buffer.toString().replaceAll(" ","_");
|
||||
}else {
|
||||
chinese = buffer.toString();
|
||||
}
|
||||
|
||||
if (chinese.contains("\\(")){
|
||||
chinese = buffer.toString().replaceAll("\\(","L");
|
||||
}
|
||||
|
||||
if (chinese.contains(")")){
|
||||
chinese = buffer.toString().replaceAll("[)]","R");
|
||||
}
|
||||
|
||||
return chinese;
|
||||
|
||||
}catch(Exception e){
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static char getPYIndexChar(char strChinese, boolean bUpCase){
|
||||
|
||||
int charGBK = strChinese;
|
||||
|
||||
char result;
|
||||
|
||||
if(charGBK >= 45217 && charGBK <= 45252){
|
||||
|
||||
result = 'A';
|
||||
|
||||
}else if(charGBK >= 45253 && charGBK <= 45760){
|
||||
|
||||
result = 'B';
|
||||
|
||||
}else if(charGBK >= 45761 && charGBK <= 46317){
|
||||
|
||||
result = 'C';
|
||||
|
||||
}else if(charGBK >= 46318 && charGBK <= 46825){
|
||||
|
||||
result = 'D';
|
||||
|
||||
} else if(charGBK >= 46826 && charGBK <= 47009){
|
||||
|
||||
result = 'E';
|
||||
|
||||
}else if(charGBK >= 47010 && charGBK <= 47296){
|
||||
|
||||
result = 'F';
|
||||
|
||||
}else if(charGBK >= 47297 && charGBK <= 47613){
|
||||
|
||||
result = 'G';
|
||||
|
||||
}else if(charGBK >= 47614 && charGBK <= 48118){
|
||||
|
||||
result = 'H';
|
||||
|
||||
}else if(charGBK >= 48119 && charGBK <= 49061){
|
||||
|
||||
result = 'J';
|
||||
|
||||
} else if(charGBK >= 49062 && charGBK <= 49323){
|
||||
|
||||
result = 'K';
|
||||
|
||||
}else if(charGBK >= 49324 && charGBK <= 49895){
|
||||
|
||||
result = 'L';
|
||||
|
||||
}else if(charGBK >= 49896 && charGBK <= 50370){
|
||||
|
||||
result = 'M';
|
||||
|
||||
}else if(charGBK >= 50371 && charGBK <= 50613){
|
||||
|
||||
result = 'N';
|
||||
|
||||
}else if(charGBK >= 50614 && charGBK <= 50621){
|
||||
|
||||
result = 'O';
|
||||
|
||||
}else if(charGBK >= 50622 && charGBK <= 50905){
|
||||
|
||||
result = 'P';
|
||||
|
||||
}else if(charGBK >= 50906 && charGBK <= 51386){
|
||||
|
||||
result = 'Q';
|
||||
|
||||
}else if(charGBK >= 51387 && charGBK <= 51445){
|
||||
|
||||
result = 'R';
|
||||
|
||||
}else if(charGBK >= 51446 && charGBK <= 52217){
|
||||
|
||||
result = 'S';
|
||||
|
||||
}else if(charGBK >= 52218 && charGBK <= 52697){
|
||||
|
||||
result = 'T';
|
||||
|
||||
}else if(charGBK >= 52698 && charGBK <= 52979){
|
||||
|
||||
result = 'W';
|
||||
|
||||
}else if(charGBK >= 52980 && charGBK <= 53688){
|
||||
|
||||
result = 'X';
|
||||
|
||||
}else if(charGBK >= 53689 && charGBK <= 54480){
|
||||
|
||||
result = 'Y';
|
||||
|
||||
}else if(charGBK >= 54481 && charGBK <= 55289){
|
||||
|
||||
result = 'Z';
|
||||
|
||||
}else{
|
||||
|
||||
result = (char)(65 + (new Random()).nextInt(25));
|
||||
|
||||
}
|
||||
|
||||
if(!bUpCase){
|
||||
result = Character.toLowerCase(result);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
//根据JSONArray获取所有的key
|
||||
public static StringBuffer getAllKey(JSONArray json1) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
@ -280,4 +506,85 @@ public class CreateWorkflowServiceJob implements IJob {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 将汉字转换为全拼
|
||||
public static String getPingYin(String src) {
|
||||
|
||||
char[] t1 = null;
|
||||
t1 = src.toCharArray();
|
||||
String[] t2 = new String[t1.length];
|
||||
HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();
|
||||
t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);
|
||||
t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
|
||||
t3.setVCharType(HanyuPinyinVCharType.WITH_V);
|
||||
String t4 = "";
|
||||
int t0 = t1.length;
|
||||
try {
|
||||
for (int i = 0; i < t0; i++) {
|
||||
// 判断是否为汉字字符
|
||||
if (java.lang.Character.toString(t1[i]).matches(
|
||||
"[\\u4E00-\\u9FA5]+")) {
|
||||
t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);
|
||||
t4 += t2[0];
|
||||
} else
|
||||
t4 += java.lang.Character.toString(t1[i]);
|
||||
}
|
||||
// System.out.println(t4);
|
||||
return t4;
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
return t4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 返回中文的首字母
|
||||
public static String getPinYinHeadChar(String str) {
|
||||
String temp = "";
|
||||
String demo = "";
|
||||
String convert = "";
|
||||
for (int j = 0; j < str.length(); j++) {
|
||||
char word = str.charAt(j);
|
||||
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
|
||||
if (pinyinArray != null) {
|
||||
convert += pinyinArray[0].charAt(0);
|
||||
} else {
|
||||
convert += word;
|
||||
}
|
||||
}
|
||||
for(int i=0;i<convert.length();i++){//convert目前为小写首字母,下面是将小写首字母转化为大写
|
||||
if(convert.charAt(i)>='a' && convert.charAt(i)<='z'){
|
||||
temp=convert.substring(i,i+1).toUpperCase();
|
||||
demo += temp;
|
||||
}
|
||||
}
|
||||
return demo;
|
||||
}
|
||||
|
||||
// 将字符串转移为ASCII码
|
||||
public static String getCnASCII(String cnStr) {
|
||||
StringBuffer strBuf = new StringBuffer();
|
||||
byte[] bGBK = cnStr.getBytes();
|
||||
for (int i = 0; i < bGBK.length; i++) {
|
||||
// System.out.println(Integer.toHexString(bGBK[i]&0xff));
|
||||
strBuf.append(Integer.toHexString(bGBK[i] & 0xff));
|
||||
}
|
||||
return strBuf.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//判断字符串是不是以数字开头
|
||||
public static boolean isStartWithNumber(String str) {
|
||||
Pattern pattern = Pattern.compile("[0-9]*");
|
||||
Matcher isNum = pattern.matcher(str.charAt(0)+"");
|
||||
if (!isNum.matches()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
package com.awspaas.user.apps.integration.job;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integration.util.UtilUrl;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* 伊利oa审批数据获取
|
||||
*/
|
||||
public class CreategetFlowListALLByWfidJob implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
try {
|
||||
|
||||
DBSql.update("delete from BO_EU_OA_PROCESS");
|
||||
//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()
|
||||
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\">\n" +
|
||||
" <soapenv:Header/>\n" +
|
||||
" <soapenv:Body>\n" +
|
||||
" <web:getAllWfId/>\n" +
|
||||
" </soapenv:Body>\n" +
|
||||
"</soapenv:Envelope>";
|
||||
|
||||
System.out.println("参数==============="+xmlStr);
|
||||
UserContext userContext = UserContext.fromUID("admin");
|
||||
//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("getAllWfIdResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
System.out.println("resultString=>>>>>>>>>>"+resultString);
|
||||
JSONArray jsonArray = JSON.parseArray(resultString);
|
||||
|
||||
for (int i=0;i<jsonArray.size();i++
|
||||
) {
|
||||
JSONObject jsonObject = JSON.parseObject(jsonArray.get(i).toString());
|
||||
if ((jsonObject.get("WORKFLOWNAME").toString().contains("废止")&&!jsonObject.get("WORKFLOWNAME").toString().contains("仅查询"))||jsonObject.get("WORKFLOWNAME").toString().contains("停止")
|
||||
||jsonObject.get("WORKFLOWNAME").toString().contains("停用")||jsonObject.get("WORKFLOWNAME").toString().contains("(废)")){
|
||||
|
||||
}else {
|
||||
BO bo = new BO();
|
||||
bo.set("WORKFLOWID",jsonObject.get("ID"));
|
||||
bo.set("ISVALID",jsonObject.get("ISVALID"));
|
||||
bo.set("VERSION",jsonObject.get("VERSION"));
|
||||
bo.set("WORKFLOWNAME",jsonObject.get("WORKFLOWNAME"));
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_PROCESS",bo,userContext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.awspaas.user.apps.integration.job;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integration.util.UtilUrl;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 伊利oa审批数据获取
|
||||
*/
|
||||
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) {
|
||||
|
||||
|
||||
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>";
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
} catch (DocumentException documentException) {
|
||||
documentException.printStackTrace();
|
||||
}
|
||||
|
||||
//}
|
||||
System.out.println("保存OA流程数据完成");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.awspaas.user.apps.integration.job;
|
||||
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.awspaas.user.apps.integration.util.UtilUrl;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
public class UpdateOA implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:com=\"com.synctooa.webservices\">" +
|
||||
" <soapenv:Header/>" +
|
||||
" <soapenv:Body>" +
|
||||
" <com:InsertTodoCominfo>" +
|
||||
" <com:in0>" +
|
||||
"<![CDATA[ " +
|
||||
"<?xml version='1.0' encoding='UTF-8'?>" +
|
||||
"<root>" +
|
||||
" <Todo>" +
|
||||
" <outsysid>LCZD</outsysid>" +
|
||||
" <todoid>922fdd65-104c-4a17-8b52-5e07824b72d3</todoid>" +
|
||||
" <content> 您有一条待办流程【关于发布《无菌/保温试验不合格处理流程》的通知】,点击进行处理</content>" +
|
||||
" <pcurl>https://bpm.yili.com:8088/portal/r/or?cmd=com.yili_form_page_open&oauthName=oauthLogin&processInstId=6ae0dea1-f311-4311-b386-42ae1397e191&taskInstId=922fdd65-104c-4a17-8b52-5e07824b72d3</pcurl>" +
|
||||
" <mobileurl>https://bpm.yili.com:8088/portal/r/or?cmd=com.yili_form_page_open&oauthName=WechatOauthLogin&casaccount=00102699&processInstId=6ae0dea1-f311-4311-b386-42ae1397e191&taskInstId=922fdd65-104c-4a17-8b52-5e07824b72d3</mobileurl>" +
|
||||
" <hrcode>wly</hrcode>" +
|
||||
" <createtime> 18:32:33</createtime>" +
|
||||
" <donetime> 18:32:33</donetime>" +
|
||||
" <status>1</status>" +
|
||||
" <wftype>0</wftype>" +
|
||||
" <viewtype>-2</viewtype>" +
|
||||
" <createdate>2022-09-05</createdate>" +
|
||||
" <donedate>2022-09-05</donedate>" +
|
||||
" <receivedate>2022-09-05</receivedate>" +
|
||||
" <receivetime> 18:32:33</receivetime>" +
|
||||
" <currentnodetype>0</currentnodetype>" +
|
||||
" <requestcode>6ae0dea1-f311-4311-b386-42ae1397e191</requestcode>" +
|
||||
" <currentnodename>内部审核</currentnodename>" +
|
||||
" <nooperator>wly</nooperator>" +
|
||||
" <workcode></workcode>" +
|
||||
" <workflowname>关于发布《无菌/保温试验不合格处理流程》的通知-李强-2022-09-05 10:40:40</workflowname>" +
|
||||
" <createrhrcode>wly</createrhrcode>" +
|
||||
" <createrworkcode></createrworkcode>" +
|
||||
" </Todo>" +
|
||||
"</root>" +
|
||||
"]]>" +
|
||||
"</com:in0>" +
|
||||
" </com:InsertTodoCominfo>" +
|
||||
" </soapenv:Body>" +
|
||||
"</soapenv:Envelope>";
|
||||
String postSoap = UtilUrl.doPostSoap("http://10.105.1.59/services/yili", xmlStr, "");
|
||||
System.out.println("是否更新为已办:::::::::"+postSoap);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.awspaas.user.apps.integration.job;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integration.XmlDatasUtil;
|
||||
import com.awspaas.user.apps.integration.util.HttpClientUtil;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class UpdateOADAIBANJob implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
List<BO> bo_eu_oa_mobileurl = SDK.getBOAPI().query("BO_EU_OA_MOBILEURL", true).list();
|
||||
for (BO bo:bo_eu_oa_mobileurl
|
||||
) {
|
||||
XmlDatasUtil xmlDatasUtil = new XmlDatasUtil();
|
||||
xmlDatasUtil.setExternal_system_ID("LCZD");
|
||||
|
||||
xmlDatasUtil.setOther_system_to_do_ID(bo.getString("TODOID"));
|
||||
xmlDatasUtil.setProcess_title(bo.getString("CONTENT"));
|
||||
//http://localhost:8089/portal/r/or?cmd=com.yili_form_page_open&processInstId=3505e654-9217-41cd-a31d-4971846b3219&taskInstId=8a71d75e-3ee0-43a2-a226-ecb01419319c&oauthName=oauthLogin&token=admin
|
||||
|
||||
xmlDatasUtil.setPcurl(bo.getString("PCURL"));
|
||||
xmlDatasUtil.setMobileurl(bo.getString("MOBILEURL"));
|
||||
|
||||
xmlDatasUtil.setTo_do_login_account(bo.getString("HRCODE"));
|
||||
xmlDatasUtil.setTo_do_creation_time(bo.getString("NEWCREATETIME"));
|
||||
xmlDatasUtil.setTo_do_completion_time(bo.getString("NEWDONETIME"));
|
||||
|
||||
xmlDatasUtil.setTo_do_status(bo.getString("STATUS"));
|
||||
|
||||
xmlDatasUtil.setTo_do_official_type(bo.getString("WFTYPE"));
|
||||
|
||||
xmlDatasUtil.setViewtype(bo.getString("VIEWTYPE"));
|
||||
|
||||
xmlDatasUtil.setCreatedate(bo.getString("CREATEDATES"));
|
||||
xmlDatasUtil.setDonedate(bo.getString("DONEDATE"));
|
||||
|
||||
xmlDatasUtil.setReceivedate(bo.getString("RECEIVEDATE"));
|
||||
xmlDatasUtil.setReceivetime(bo.getString("RECEIVETIME"));
|
||||
xmlDatasUtil.setCurrentnodetype(bo.getString("CURRENTNODETYPE"));
|
||||
|
||||
xmlDatasUtil.setRequestcode(bo.getString("REQUESTCODE"));
|
||||
xmlDatasUtil.setCurrentnodename(bo.getString("CURRENTNODENAME"));
|
||||
|
||||
|
||||
xmlDatasUtil.setNooperator(bo.getString("NOOPERATOR"));
|
||||
xmlDatasUtil.setWorkcode("");
|
||||
xmlDatasUtil.setWorkflowname(bo.getString("WORKFLOWNAME"));
|
||||
|
||||
xmlDatasUtil.setCreaterhrcode(bo.getString("CREATERHRCODE"));
|
||||
|
||||
xmlDatasUtil.setCreaterworkcode("");
|
||||
HttpClientUtil httpClientUtil = new HttpClientUtil();
|
||||
try {
|
||||
String s = httpClientUtil.SendPend("http://10.105.1.59/services/yili", xmlDatasUtil);
|
||||
System.out.println("更新成功数据》》》》》》"+s);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,8 +8,9 @@ import org.quartz.JobExecutionException;
|
||||
public class deleteTestBO implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
DBSql.update(
|
||||
/*DBSql.update(
|
||||
"drop table T561486"
|
||||
);
|
||||
);*/
|
||||
DBSql.update("delete from SYS_NAV_DIRECTORY where DIRECTORYNAME in ('单表','看板','系统') ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.awspaas.user.apps.integration.job;
|
||||
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
/**
|
||||
* 存储OA流程数据
|
||||
*/
|
||||
public class getAllOA implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,10 @@ import java.util.*;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.bpmn.engine.ProcessAPIManager;
|
||||
import com.actionsoft.bpms.bpmn.engine.model.run.TaskCommentModel;
|
||||
import com.actionsoft.bpms.commons.login.constant.LoginConst;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.server.SSOUtil;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@ -143,7 +146,7 @@ public class OaPendComponent {
|
||||
portalUrl = "https://bpm.yili.com:8088/portal/";
|
||||
}
|
||||
xmlDatasUtil.setPcurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&oauthName=oauthLogin&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
xmlDatasUtil.setMobileurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&oauthName=WechatOauthLogin&casaccount="+pec.getTaskInstance().getTarget()+"&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
xmlDatasUtil.setMobileurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&corpid=wwb0ae23173b140618&appAgentId=1000014&oauthName=wechat&casaccount="+pec.getTaskInstance().getTarget()+"&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
String target = taskInstance.getTarget();
|
||||
if (target.length()==8&&"00".equals(target.substring(0,2))){
|
||||
target = target.substring(2);
|
||||
@ -302,7 +305,7 @@ public class OaPendComponent {
|
||||
portalUrl = "https://bpm.yili.com:8088/portal/";
|
||||
}
|
||||
xmlDatasUtil.setPcurl("https://bpm.yili.com:8088/portal"+"/r/or?cmd=com.yili_form_page_open&oauthName=oauthLogin&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
xmlDatasUtil.setMobileurl("https://bpm.yili.com:8088/portal"+"/r/or?cmd=com.yili_form_page_open&oauthName=WechatOauthLogin&casaccount="+pec.getTaskInstance().getTarget()+"&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
xmlDatasUtil.setMobileurl("https://bpm.yili.com:8088/portal"+"/r/or?cmd=com.yili_form_page_open&corpid=wwb0ae23173b140618&appAgentId=1000014&oauthName=wechat&casaccount="+pec.getTaskInstance().getTarget()+"&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
|
||||
String target = taskInstance.getTarget();
|
||||
if (target.length()==8&&"00".equals(target.substring(0,2))){
|
||||
@ -328,7 +331,13 @@ public class OaPendComponent {
|
||||
|
||||
xmlDatasUtil.setCreatedate(str.substring(0, str.indexOf(" ")));
|
||||
xmlDatasUtil.setDonedate(df.format(taskInstance.getBeginTime()).substring(0, df.format(taskInstance.getBeginTime()).indexOf(" ")));
|
||||
String der = df.format(taskInstance.getReadTime());
|
||||
String der = "";
|
||||
if (taskInstance.getReadTime()==null){
|
||||
der= df.format(new Date());
|
||||
}else {
|
||||
der= df.format(taskInstance.getReadTime());
|
||||
}
|
||||
|
||||
xmlDatasUtil.setReceivedate(der.substring(0, der.indexOf(" ")));
|
||||
xmlDatasUtil.setReceivetime(der.substring(der.indexOf(" "),der.length()));
|
||||
String actionName = getActionName(taskInstance);
|
||||
@ -350,7 +359,13 @@ public class OaPendComponent {
|
||||
//流程实例id,必填
|
||||
params.put("processInstId", pec.getProcessInstance().getId());
|
||||
//,必填
|
||||
params.put("sid", pec.getUserContext().getSessionId());
|
||||
if (pec.getUserContext()!=null){
|
||||
params.put("sid", pec.getUserContext().getSessionId());
|
||||
}else {
|
||||
String sessionId = new SSOUtil().registerClientSessionNoPassword(pec.getTaskInstance().getTarget(), LoginConst.DEFAULT_LANG, "127.0.0.1", LoginConst.DEVICE_PC);
|
||||
params.put("sid", sessionId);
|
||||
}
|
||||
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//流程节点数据
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
@ -371,7 +386,12 @@ public class OaPendComponent {
|
||||
}
|
||||
xmlDatasUtil.setNooperator(username);
|
||||
xmlDatasUtil.setWorkcode("");
|
||||
xmlDatasUtil.setWorkflowname(pec.getProcessDef().getName());
|
||||
if (pec.getProcessDef()!=null){
|
||||
xmlDatasUtil.setWorkflowname(pec.getProcessDef().getName());
|
||||
}else {
|
||||
xmlDatasUtil.setWorkflowname("流程发布");
|
||||
}
|
||||
|
||||
if (bo_eu_oa_reson!=null){
|
||||
xmlDatasUtil.setCreaterhrcode(bo_eu_oa_reson.getString("LOGINID"));
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ public class TaskListener extends ProcessPubicListener {
|
||||
}
|
||||
|
||||
} else if (PublicEventConst.TASK_DELETE.equals(eventName) || taskInstance.getControlState() == "delete") {
|
||||
if (actionName == "") {
|
||||
if (actionName == ""||actionName.equals("收回沟通任务")||(actionName.equals("传阅")&& PublicEventConst.TASK_READ.equals(eventName))) {
|
||||
logger.info("调用OA删除任务接口:taskInstanceId:" + taskInstance.getId());
|
||||
try {
|
||||
component.updatePending(taskInstance,pec);
|
||||
|
||||
@ -11,6 +11,7 @@ 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;
|
||||
import com.actionsoft.sdk.service.model.UserModel;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yili.wsclient.ClientService;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
@ -138,6 +139,15 @@ public class OauthLogin extends AbstractOauth {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public long getCookieTime(UserModel user) {
|
||||
System.out.println("session时间>>>>>>>>>>"+user.getSessionTime());
|
||||
//下面的值代表与 AWS PaaS 会话过期时间一致,
|
||||
//因平台会话过期时间以分钟计,所以需要乘以 60
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一身份认证接口
|
||||
* @param1 webserviceUrl 身份认证接口地址
|
||||
@ -155,6 +165,7 @@ public class OauthLogin extends AbstractOauth {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String geAuthorization(String clientId, String clientSecret) {
|
||||
try {
|
||||
byte[] key = (clientId + ":" + clientSecret).getBytes("utf-8");
|
||||
|
||||
@ -62,27 +62,48 @@ public class TaskController {
|
||||
|
||||
/**
|
||||
* OA系统单点访问PAL系统
|
||||
* @param me
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.yili_pal_portal_open")
|
||||
public String openPALConsole(UserContext me, RequestParams params) throws Exception {
|
||||
public String openPALConsole(String code) throws Exception {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
String sessionId = me.getSessionId();
|
||||
|
||||
|
||||
String userid = "";
|
||||
|
||||
App app = new App();
|
||||
String tokens = app.getTokens("http://10.114.11.135:8088/portal/yili.html", code);
|
||||
if(StringUtils.isEmpty(tokens)){
|
||||
System.out.println("这个认证是失败的,code为空,请联系管理员");;
|
||||
}else {
|
||||
JSONObject jsonObjects = JSONObject.parseObject(tokens);
|
||||
String access_token = jsonObjects.getString("access_token");
|
||||
String userInfo = app.getUserInfo(access_token);
|
||||
|
||||
if (StringUtils.isNotEmpty(userInfo)){
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
String sessionId = UserContext.fromUID(userid).getSessionId();
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
//http://localhost:8089/portal/r/w?cmd=com.actionsoft.apps.coe.pal_user_home_page&sid=0161dfa4-922f-4645-a45a-a68133c160a1#/repository
|
||||
//打开控制台
|
||||
// String palConsoleUrl= portalUrl + "/r/w?cmd=com.actionsoft.apps.coe.pal_user_home_page&sid="+sessionId+"#/repository";
|
||||
//打开个人门户、
|
||||
|
||||
String url = portalUrl +"/r/w?sid="+sessionId+"&cmd=com.actionsoft.apps.skins.mportal3_home_page&id=5af46cd5-a1bc-4125-a144-86d1a199eec1";
|
||||
// String palPortalUrl= portalUrl + "/r/w?sid="+sessionId+"&cmd=com.actionsoft.apps.skins.mportal3_home_page&id=5af46cd5-a1bc-4125-a144-86d1a199eec1";
|
||||
|
||||
String portal_url = "https://bpm.yili.com:8088"+"/portal/r/or?cmd=com.actionsoft.apps.skins.mportal3_home_page&id=5af46cd5-a1bc-4125-a144-86d1a199eec1&sid="+sessionId+"&oauthName=oauthLogin&code="+code;
|
||||
|
||||
//ro.put("new_url",url);
|
||||
|
||||
return url;
|
||||
return portal_url;
|
||||
|
||||
}
|
||||
|
||||
@ -108,30 +129,7 @@ public class TaskController {
|
||||
public String openFormPage(UserContext me, RequestParams params) {
|
||||
System.out.println("进入表单了===========");
|
||||
System.out.println("参数输出==========="+params.asMap());
|
||||
if (StringUtils.isNotEmpty(params.get("state"))){
|
||||
|
||||
if (params.get("state").equals("STATE")){
|
||||
String code = params.get("code");
|
||||
WechatApp app = new WechatApp();
|
||||
String tokens = app.getTokens(code);
|
||||
if(StringUtils.isEmpty(tokens)){
|
||||
//logger.error("获取token为空,请重新输入登录信息获取code");
|
||||
return null;
|
||||
}else {
|
||||
JSONObject jsonObjects = JSONObject.parseObject(tokens);
|
||||
String access_token = jsonObjects.getString("UserId");
|
||||
System.out.println("UserId======>>>>>>>"+access_token);
|
||||
//BO detail = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=", access_token).detail();
|
||||
// String workcode = detail.getString("WORKCODE");
|
||||
//if (workcode.length()!=8){
|
||||
// UserContext userContext = UserContext.fromUID(access_token);
|
||||
//}else{
|
||||
UserContext userContext = UserContext.fromUID(access_token);
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String sessionId = me.getSessionId();
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
@ -373,7 +371,7 @@ public class TaskController {
|
||||
String dataid = SDK.getBOAPI().query("BO_ACT_DATAID", true).addQuery("PROCESSID=", processInstId).addQuery("USER_ID=",usercode).detail().getString("DATAID");
|
||||
jsonObject.put("dataid", dataid);
|
||||
}
|
||||
|
||||
jsonObject.put("status","1");
|
||||
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n" +
|
||||
" <soapenv:Header/>" +
|
||||
" <soapenv:Body>" +
|
||||
@ -457,8 +455,11 @@ public class TaskController {
|
||||
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";
|
||||
DCContext dcContext = new DCContext(me, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), bo.getString("TASKID"),bo.getString("PUBLISHFILENAME")+"_"+lever+".doc");
|
||||
if (lever.length()!=5){
|
||||
lever = lever+".0";
|
||||
}
|
||||
String name = bo.getString("PUBLISHFILENAME").replaceAll("/","");
|
||||
DCContext dcContext = new DCContext(me, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), bo.getString("TASKID"),name+"_"+lever+".doc");
|
||||
|
||||
|
||||
|
||||
@ -469,7 +470,7 @@ public class TaskController {
|
||||
//文档是否允许下载,必填
|
||||
params_preview.put("isDownload", true);
|
||||
//显示文件名,必填
|
||||
params_preview.put("fileNameOriginal", bo.getString("PUBLISHFILENAME")+"_"+lever+".doc");
|
||||
params_preview.put("fileNameOriginal", name+"_"+lever+".doc");
|
||||
//PDF转图片处理选项。- 0代表只在需要时做转换;- 1代表打开即检查是否已转换成图片,如未处理,强制转换。默认0,非必填
|
||||
params_preview.put("isPDFCovertPNG", 0);
|
||||
//groupJson参数,用于表单附件OfficeOnline服务预览回传文件流,非必填
|
||||
@ -577,8 +578,11 @@ public class TaskController {
|
||||
String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+bo.getString("CHANGEDFILEIDNEW")+"'";
|
||||
String lever = DBSql.getString(conn, sql_lever);
|
||||
System.out.println("lever====>>>>>"+lever);
|
||||
lever = lever+".0";
|
||||
DCContext dcContext = new DCContext(me, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), bo.getString("TASKID"),bo.getString("CHANGEDFILENAMENEW")+"_"+lever+".doc");
|
||||
if (lever.length()!=5){
|
||||
lever = lever+".0";
|
||||
}
|
||||
String name = bo.getString("CHANGEDFILENAMENEW").replaceAll("/","");
|
||||
DCContext dcContext = new DCContext(me, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), bo.getString("TASKID"),name+"_"+lever+".doc");
|
||||
|
||||
|
||||
|
||||
@ -589,7 +593,7 @@ public class TaskController {
|
||||
//文档是否允许下载,必填
|
||||
params_preview.put("isDownload", true);
|
||||
//显示文件名,必填
|
||||
params_preview.put("fileNameOriginal", bo.getString("CHANGEDFILENAMENEW")+"_"+lever+".doc");
|
||||
params_preview.put("fileNameOriginal", name+"_"+lever+".doc");
|
||||
//PDF转图片处理选项。- 0代表只在需要时做转换;- 1代表打开即检查是否已转换成图片,如未处理,强制转换。默认0,非必填
|
||||
params_preview.put("isPDFCovertPNG", 0);
|
||||
//groupJson参数,用于表单附件OfficeOnline服务预览回传文件流,非必填
|
||||
|
||||
@ -0,0 +1,222 @@
|
||||
package com.awspaas.user.apps.integration.util;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ChineseIntoLetters {
|
||||
|
||||
/**
|
||||
|
||||
* 返回首字母
|
||||
|
||||
* @param strChinese
|
||||
|
||||
* @param bUpCase
|
||||
|
||||
* @return
|
||||
|
||||
*/
|
||||
|
||||
public static String getPYIndexStr(String strChinese, boolean bUpCase){
|
||||
|
||||
try{
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
String chinese = "";
|
||||
|
||||
byte b[] = strChinese.getBytes("GBK");//把中文转化成byte数组
|
||||
|
||||
for(int i = 0; i < b.length; i++){
|
||||
|
||||
if((b[i] & 255) > 128){
|
||||
|
||||
int char1 = b[i++] & 255;
|
||||
|
||||
char1 <<= 8;//左移运算符用“<<”表示,是将运算符左边的对象,向左移动运算符右边指定的位数,并且在低位补零。其实,向左移n位,就相当于乘上2的n次方
|
||||
|
||||
int chart = char1 + (b[i] & 255);
|
||||
|
||||
buffer.append(getPYIndexChar((char)chart, bUpCase));
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
char c = (char)b[i];
|
||||
|
||||
//确定指定字符是否是汉字、大写字母、数字
|
||||
if(!Character.isJavaIdentifierPart(c) || (c >= 'A' && c <= 'Z') || Character.isDigit(c)){
|
||||
|
||||
buffer.append(c);
|
||||
|
||||
}if (c >= 'a' && c <= 'z'){
|
||||
|
||||
buffer.append((char) (c - 'a' + 'A'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (buffer.toString().contains("-")){
|
||||
chinese = buffer.toString().replaceAll("-","_");
|
||||
}else if (buffer.toString().contains(" ")){
|
||||
chinese = buffer.toString().replaceAll(" ","_");
|
||||
}else {
|
||||
chinese = buffer.toString();
|
||||
}
|
||||
|
||||
if (chinese.contains("\\(")){
|
||||
chinese = buffer.toString().replaceAll("\\(","L");
|
||||
}
|
||||
|
||||
if (chinese.contains(")")){
|
||||
chinese = buffer.toString().replaceAll("[)]","R");
|
||||
}
|
||||
|
||||
return chinese;
|
||||
|
||||
}catch(Exception e){
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* 得到首字母
|
||||
|
||||
* @param strChinese
|
||||
|
||||
* @param bUpCase
|
||||
|
||||
* @return
|
||||
|
||||
*/
|
||||
|
||||
private static char getPYIndexChar(char strChinese, boolean bUpCase){
|
||||
|
||||
int charGBK = strChinese;
|
||||
|
||||
char result;
|
||||
|
||||
if(charGBK >= 45217 && charGBK <= 45252){
|
||||
|
||||
result = 'A';
|
||||
|
||||
}else if(charGBK >= 45253 && charGBK <= 45760){
|
||||
|
||||
result = 'B';
|
||||
|
||||
}else if(charGBK >= 45761 && charGBK <= 46317){
|
||||
|
||||
result = 'C';
|
||||
|
||||
}else if(charGBK >= 46318 && charGBK <= 46825){
|
||||
|
||||
result = 'D';
|
||||
|
||||
} else if(charGBK >= 46826 && charGBK <= 47009){
|
||||
|
||||
result = 'E';
|
||||
|
||||
}else if(charGBK >= 47010 && charGBK <= 47296){
|
||||
|
||||
result = 'F';
|
||||
|
||||
}else if(charGBK >= 47297 && charGBK <= 47613){
|
||||
|
||||
result = 'G';
|
||||
|
||||
}else if(charGBK >= 47614 && charGBK <= 48118){
|
||||
|
||||
result = 'H';
|
||||
|
||||
}else if(charGBK >= 48119 && charGBK <= 49061){
|
||||
|
||||
result = 'J';
|
||||
|
||||
} else if(charGBK >= 49062 && charGBK <= 49323){
|
||||
|
||||
result = 'K';
|
||||
|
||||
}else if(charGBK >= 49324 && charGBK <= 49895){
|
||||
|
||||
result = 'L';
|
||||
|
||||
}else if(charGBK >= 49896 && charGBK <= 50370){
|
||||
|
||||
result = 'M';
|
||||
|
||||
}else if(charGBK >= 50371 && charGBK <= 50613){
|
||||
|
||||
result = 'N';
|
||||
|
||||
}else if(charGBK >= 50614 && charGBK <= 50621){
|
||||
|
||||
result = 'O';
|
||||
|
||||
}else if(charGBK >= 50622 && charGBK <= 50905){
|
||||
|
||||
result = 'P';
|
||||
|
||||
}else if(charGBK >= 50906 && charGBK <= 51386){
|
||||
|
||||
result = 'Q';
|
||||
|
||||
}else if(charGBK >= 51387 && charGBK <= 51445){
|
||||
|
||||
result = 'R';
|
||||
|
||||
}else if(charGBK >= 51446 && charGBK <= 52217){
|
||||
|
||||
result = 'S';
|
||||
|
||||
}else if(charGBK >= 52218 && charGBK <= 52697){
|
||||
|
||||
result = 'T';
|
||||
|
||||
}else if(charGBK >= 52698 && charGBK <= 52979){
|
||||
|
||||
result = 'W';
|
||||
|
||||
}else if(charGBK >= 52980 && charGBK <= 53688){
|
||||
|
||||
result = 'X';
|
||||
|
||||
}else if(charGBK >= 53689 && charGBK <= 54480){
|
||||
|
||||
result = 'Y';
|
||||
|
||||
}else if(charGBK >= 54481 && charGBK <= 55289){
|
||||
|
||||
result = 'Z';
|
||||
|
||||
}else{
|
||||
|
||||
result = (char)(65 + (new Random()).nextInt(25));
|
||||
|
||||
}
|
||||
|
||||
if(!bUpCase){
|
||||
result = Character.toLowerCase(result);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
String str=",.;'90中国cD///*-+";
|
||||
|
||||
System.out.println("中文首字母:" + getPYIndexStr(str,true));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.awspaas.user.apps.integration.util;
|
||||
|
||||
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
|
||||
import oracle.jdbc.pool.OracleDataSource;
|
||||
|
||||
import java.sql.*;
|
||||
|
||||
public class JDBCUtil {
|
||||
|
||||
|
||||
public void comment(String tablename,String flid,String flidname) throws SQLException {
|
||||
|
||||
try {
|
||||
//加载驱动
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
String url ="jdbc:oracle:thin:@10.119.71.12:1521/bpmprod" ;
|
||||
Connection conn= DriverManager.getConnection(url,"bpmprod","456rty$%^RTY");
|
||||
Statement stmt = conn.createStatement();
|
||||
String sql = "COMMENT ON T"+tablename+"."+flid+" IS '"+flidname+"'";
|
||||
PreparedStatement pstmt = conn.prepareStatement(sql);
|
||||
boolean execute = pstmt.execute();
|
||||
System.out.println("执行成功与否》》》》》》》》》》》》"+execute);
|
||||
/*while (rs.next()) {
|
||||
System.out.println(rs.getString("user_password"));
|
||||
System.out.println(rs.getString("user_name"));
|
||||
}*/
|
||||
pstmt.close();
|
||||
stmt.close();
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成 catch 块
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,291 @@
|
||||
package com.awspaas.user.apps.integration.webapi;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.HandlerType;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integration.util.UtilUrl;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@Controller(type = HandlerType.RESTFUL, apiName = "workfolwapi", desc = "这是workflow的相关接口文档")
|
||||
@Path("/workfolw")
|
||||
public class Sayhello {
|
||||
|
||||
@GET
|
||||
public String sayHello() {
|
||||
return "hello,world! - get";
|
||||
}
|
||||
|
||||
@POST
|
||||
public String sayHelloPost() {
|
||||
return "hello,world!- post ";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取activiti流程信息
|
||||
* @param processIdAndDateline Key:流程定义ID,value:流程上次抽取的时间点(第一次抽取value为null),即此流程本次抽取数据的开始时间
|
||||
* @param nowDateTime 此次抽取数据结束时间点
|
||||
* @return activiti流程信息
|
||||
* @throws DocumentException
|
||||
* @throws ParseException
|
||||
*/
|
||||
@Path("/process")
|
||||
@POST
|
||||
public String sayHelloQueryParam(@QueryParam("processIdAndDateline") String processIdAndDateline, @QueryParam("nowDateTime") String nowDateTime) throws DocumentException, ParseException {
|
||||
JSONObject result = new JSONObject(new LinkedHashMap<>());
|
||||
Map<String,Object> res = null;
|
||||
try {
|
||||
Gson gson = new Gson();
|
||||
res = gson.fromJson(processIdAndDateline, new TypeToken<Map<String, Object>>() {
|
||||
}.getType());
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
jsonObject.put("workflowId",747487);
|
||||
//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>";
|
||||
|
||||
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 results = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out");
|
||||
String resultString = results.getData().toString();
|
||||
System.out.println("resultString=>>>>>>>>>>"+resultString);
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("datas");
|
||||
JSONArray jsonArrays = JSONArray.parseArray(datas);
|
||||
|
||||
System.out.println("jsonArrayData》》》》》》》》》》》》"+jsonArrays);
|
||||
JSONArray jsonArray_new = new JSONArray(new LinkedList<>());
|
||||
for (int i=0;i<jsonArrays.size();i++) {
|
||||
JSONObject jsonObject2 = new JSONObject();
|
||||
jsonObject2.put("processInstanceId",JSONObject.parseObject(jsonArrays.get(i).toString()).get("requestId"));
|
||||
jsonObject2.put("processDefinitionId",JSONObject.parseObject(jsonArrays.get(i).toString()).get("workflowId"));
|
||||
jsonObject2.put("processDefinitionName",JSONObject.parseObject(jsonArrays.get(i).toString()).get("workflowName"));
|
||||
jsonObject2.put("startUserId",JSONObject.parseObject(jsonArrays.get(i).toString()).get("operatorWorkCode"));
|
||||
jsonObject2.put("startTime",JSONObject.parseObject(jsonArrays.get(i).toString()).get("operateDate"));
|
||||
jsonObject2.put("endTime",JSONObject.parseObject(jsonArrays.get(i).toString()).get("receiveDate"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date beginDate = sdf.parse(JSONObject.parseObject(jsonArrays.get(i).toString()).get("operateDate").toString());
|
||||
Date endDate = sdf.parse(JSONObject.parseObject(jsonArrays.get(i).toString()).get("receiveDate").toString());
|
||||
long dates = (endDate.getTime()-beginDate.getTime())/(1000 * 60);
|
||||
jsonObject2.put("durationInMillis",dates);
|
||||
BO bo = SDK.getBOAPI().query("BO_EU_OA_PROCESS", true).addQuery("WORKFLOWID=", JSONObject.parseObject(jsonArrays.get(i).toString()).get("workflowId")).detail();
|
||||
if (bo.getString("VERSION")!=null||bo.getString("VERSION")!=""){
|
||||
jsonObject2.put("processDefinitionVersion",bo.getString("VERSION"));
|
||||
}else {
|
||||
jsonObject2.put("processDefinitionVersion","1");
|
||||
}
|
||||
|
||||
jsonArray_new.add(jsonObject2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
result.put("code","1");
|
||||
result.put("msg","success");
|
||||
result.put("body",jsonArray_new);
|
||||
|
||||
|
||||
return result.toString() ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.获取任务信息
|
||||
* @param processIdAndDateline Key:流程定义ID,value:流程上次抽取的时间点(第一次抽取value为null),即此流程本次抽取数据的开始时间
|
||||
* @param nowDateTime 此次抽取数据结束时间点
|
||||
* @return 任务信息
|
||||
* @throws DocumentException
|
||||
* @throws ParseException
|
||||
*/
|
||||
|
||||
@Path("/task")
|
||||
@POST
|
||||
public String sayHelloQueryParam2(@QueryParam("processIdAndDateline") String processIdAndDateline, @QueryParam("nowDateTime") String nowDateTime) throws DocumentException, ParseException {
|
||||
JSONObject result = new JSONObject(new LinkedHashMap<>());
|
||||
|
||||
Map<String,Object> res = null;
|
||||
try {
|
||||
Gson gson = new Gson();
|
||||
res = gson.fromJson(processIdAndDateline, new TypeToken<Map<String, Object>>() {
|
||||
}.getType());
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
jsonObject.put("workflowId",747487);
|
||||
//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>";
|
||||
|
||||
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 results = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out");
|
||||
String resultString = results.getData().toString();
|
||||
System.out.println("resultString=>>>>>>>>>>"+resultString);
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("datas");
|
||||
JSONArray jsonArrays = JSONArray.parseArray(datas);
|
||||
|
||||
System.out.println("jsonArrayData》》》》》》》》》》》》"+jsonArrays);
|
||||
JSONArray jsonArray_new = new JSONArray(new LinkedList<>());
|
||||
for (int i=0;i<jsonArrays.size();i++) {
|
||||
JSONObject jsonObject2 = new JSONObject();
|
||||
jsonObject2.put("id",JSONObject.parseObject(jsonArrays.get(i).toString()).get("id"));
|
||||
String node_key = JSONObject.parseObject(jsonArrays.get(i).toString()).get("nodeid").toString();
|
||||
jsonObject2.put("taskDefinitionKey",node_key);
|
||||
jsonObject2.put("processInstanceId",JSONObject.parseObject(jsonArrays.get(i).toString()).get("requestId"));
|
||||
jsonObject2.put("processDefinitionId",JSONObject.parseObject(jsonArrays.get(i).toString()).get("workflowId"));
|
||||
jsonObject2.put("name",JSONObject.parseObject(jsonArrays.get(i).toString()).get("nodeName"));
|
||||
jsonObject2.put("assignee",JSONObject.parseObject(jsonArrays.get(i).toString()).get("operatorWorkCode"));
|
||||
String user = JSONObject.parseObject(jsonArrays.get(i).toString()).get("operatorWorkCode").toString();
|
||||
System.out.println("user>>>>>>>"+user);
|
||||
UserModel model = SDK.getORGAPI().getUser(user);
|
||||
System.out.println("model>>>>>>>>>>"+model);
|
||||
if (model!=null){
|
||||
jsonObject2.put("assigneeDeptId",model.getDepartmentId());
|
||||
jsonObject2.put("assigneeRoleId",model.getRoleId());
|
||||
}else {
|
||||
jsonObject2.put("assigneeDeptId","a93a7f77-8b11-4261-8770-20b0cdfab315");
|
||||
jsonObject2.put("assigneeRoleId","d102c89d-55f3-4865-9d5c-c00b7f47b803");
|
||||
}
|
||||
|
||||
|
||||
|
||||
jsonObject2.put("actionName",JSONObject.parseObject(jsonArrays.get(i).toString()).get("operateType"));
|
||||
jsonObject2.put("startTime",JSONObject.parseObject(jsonArrays.get(i).toString()).get("operateDate"));
|
||||
jsonObject2.put("endTime",JSONObject.parseObject(jsonArrays.get(i).toString()).get("receiveDate"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date beginDate = sdf.parse(JSONObject.parseObject(jsonArrays.get(i).toString()).get("operateDate").toString());
|
||||
Date endDate = sdf.parse(JSONObject.parseObject(jsonArrays.get(i).toString()).get("receiveDate").toString());
|
||||
long dates = (endDate.getTime()-beginDate.getTime())/(1000 * 60);
|
||||
jsonObject2.put("durationInMillis",dates);
|
||||
jsonArray_new.add(jsonObject2);
|
||||
}
|
||||
|
||||
result.put("code","1");
|
||||
result.put("msg","success");
|
||||
result.put("body",jsonArray_new);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@Path("/defid")
|
||||
@POST
|
||||
public String getTasksByProcessDefId(@QueryParam("processIdAndDateline") String processIdAndDateline, @QueryParam("nowDateTime") String nowDateTime) throws DocumentException {
|
||||
JSONObject result = new JSONObject(new LinkedHashMap<>());
|
||||
JSONObject jsonObject_newe = new JSONObject(new LinkedHashMap<>());
|
||||
JSONArray jsonArray = new JSONArray(new LinkedList<>());
|
||||
|
||||
List<RowMap> rowMap = DBSql.getMaps("SELECT DISTINCT WORKFLOWID FROM BO_EU_OA_PROCESS_TASK ");
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap<>());
|
||||
for (RowMap rowMapsw:
|
||||
rowMap) {
|
||||
|
||||
|
||||
List<BO> list = SDK.getBOAPI().query("BO_EU_OA_PROCESS_TASK").addQuery("WORKFLOWID=", rowMapsw.getString("WORKFLOWID")).list();
|
||||
jsonObject.put("processName",list.get(0).getString("WORKFLOWNAME"));
|
||||
jsonObject.put("category",list.get(0).getString("WORKFLOWTYPE_OA"));
|
||||
BO bos = SDK.getBOAPI().query("BO_EU_OA_PROCESS", true).addQuery("WORKFLOWID=", rowMapsw.getString("WORKFLOWID")).detail();
|
||||
if (bos.getString("VERSION")!=null||bos.getString("VERSION")!=""){
|
||||
jsonObject.put("version",bos.getString("VERSION"));
|
||||
}else {
|
||||
jsonObject.put("version","1");
|
||||
}
|
||||
JSONArray jsonArray1 =new JSONArray();
|
||||
for (BO bo:
|
||||
list) {
|
||||
JSONObject jsonObject1 = new JSONObject(new LinkedHashMap<>());
|
||||
jsonObject1.put("taskNo",bo.getString("NODEID"));
|
||||
jsonObject1.put("taskName",bo.getString("NODENAME"));
|
||||
jsonArray1.add(jsonObject1);
|
||||
}
|
||||
jsonObject.put("taskNodesList",jsonArray1);
|
||||
}
|
||||
|
||||
|
||||
jsonObject_newe.put("dispatch",jsonObject);
|
||||
result.put("code","1");
|
||||
result.put("msg","success");
|
||||
result.put("body",jsonObject_newe);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
package com.awspaas.user.apps.integration.webapi;
|
||||
|
||||
import com.actionsoft.bpms.cc.api.PermRequire;
|
||||
import com.actionsoft.bpms.cc.api.RequireType;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.HandlerType;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Param;
|
||||
import com.actionsoft.sdk.service.response.StringResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integration.util.UtilUrl;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.simpleframework.xml.Path;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller(type= HandlerType.OPENAPI, apiName = "WorkFlowAPI", desc = "BPA流程接口")
|
||||
@PermRequire({RequireType.APP, RequireType.CUSTOM, RequireType.ORG, RequireType.BO, RequireType.PROCESS, RequireType.ALL})
|
||||
@Path("/WorkFlow")
|
||||
public class WorkFlowAPI {
|
||||
|
||||
|
||||
@Mapping(value = "WorkFlow.getFlowList")
|
||||
public StringResponse getFlowList(
|
||||
@Param(value = "workflowId" , desc = "流程id" , required = true) int workflowId,
|
||||
@Param(value = "createDateStart" , desc = "创建开始时间" , required = false) String createDateStart,
|
||||
@Param(value = "createDateEnd" , desc = "创建结束时间" , required = false) String createDateEnd,
|
||||
@Param(value = "pageIndex" , desc = "页数" , required = true) int pageIndex,
|
||||
@Param(value = "pageSize" , desc = "每页个数" , required = true) int pageSize) throws Exception {
|
||||
System.err.println(">>>>调用getFlowList成功!");
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
jsonObject.put("workflowId",workflowId);
|
||||
jsonObject.put("createDateStart",createDateStart);
|
||||
jsonObject.put("createDateEnd",createDateEnd);
|
||||
jsonObject.put("pageIndex",pageIndex);
|
||||
jsonObject.put("pageSize",pageSize);
|
||||
|
||||
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>";
|
||||
|
||||
System.out.println("参数==============="+xmlStr);
|
||||
String postSoap = UtilUrl.doPostSoap("http://10.119.22.207:80/services/WorkflowService", xmlStr, "");
|
||||
|
||||
|
||||
Document document = null;
|
||||
try {
|
||||
document = DocumentHelper.parseText(postSoap);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
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");
|
||||
|
||||
|
||||
|
||||
JSONObject jsonObject2 = new JSONObject();
|
||||
Map map = new LinkedHashMap();
|
||||
map.put("747487",null);
|
||||
jsonObject2.put("processIdAndDateline",map);
|
||||
jsonObject2.put("nowDateTime",System.currentTimeMillis()+86400);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Mapping("/process/history/getProcessByProcessDefId")
|
||||
public String getProcessByProcessDefId(){
|
||||
|
||||
return "Say Hello";
|
||||
}
|
||||
|
||||
|
||||
public static String httpPostJson(String url,String json) throws Exception{
|
||||
String data="";
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
httpClient = HttpClients.createDefault();
|
||||
HttpPost httppost = new HttpPost(url);
|
||||
httppost.setHeader("Content-Type", "application/json;charset=UTF-8");
|
||||
StringEntity se = new StringEntity(json, Charset.forName("UTF-8"));
|
||||
se.setContentType("text/json");
|
||||
se.setContentEncoding("UTF-8");
|
||||
httppost.setEntity(se);
|
||||
response = httpClient.execute(httppost);
|
||||
int code = response.getStatusLine().getStatusCode();
|
||||
System.out.println("接口响应码:"+code);
|
||||
data = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||
EntityUtils.consume(response.getEntity());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(response!=null){ try{response.close();}catch (IOException e){} }
|
||||
if(httpClient!=null){ try{httpClient.close();}catch(IOException e){} }
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user