待阅相关代码修改

This commit is contained in:
Mr-wang 2022-08-29 19:53:39 +08:00
parent 23c442187d
commit 8a6a99432b
2 changed files with 289 additions and 221 deletions

View File

@ -217,12 +217,12 @@ public class CreateDataKnow implements IJob {
if (StringUtils.isNotEmpty(cardId)){ if (StringUtils.isNotEmpty(cardId)){
String sql_ext4 = "select * from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+cardId+"'"; String sql_ext4 = "select * from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+cardId+"'";
RowMap map = DBSql.getMap(sql_ext4); RowMap map = DBSql.getMap(sql_ext4);
BO bos = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N",true).addQuery("PUBLISHFILEID = ",map.getString("ID")).detail(); RowMap rowMap = DBSql.getMap("select * from (select * from BO_ACT_COE_PUBLISH_N where PUBLISHFILEID = '"+map.getString("ID")+"' order by CREATEDATE desc) where rownum = 1");
if (bos!=null){ if (rowMap!=null){
if (StringUtils.isNotEmpty(bos.getString("TASKID"))) { if (StringUtils.isNotEmpty(rowMap.getString("TASKID"))) {
OutputTaskModel model = new OutputTask().getTaskReportById(bos.getString("TASKID")); OutputTaskModel model = new OutputTask().getTaskReportById(rowMap.getString("TASKID"));
if (model != null) { if (model != null) {
System.out.println("pdel============" + model); System.out.println("pdel============" + model);
System.out.println("123313123123123==========" + model.getProfileId()); System.out.println("123313123123123==========" + model.getProfileId());
@ -234,7 +234,7 @@ public class CreateDataKnow implements IJob {
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT); DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
if (dcProfile == null) if (dcProfile == null)
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT); throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + bos.getString("PUBLISHFILEID") + "'"; String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + rowMap.getString("PUBLISHFILEID") + "'";
String lever = DBSql.getString( sql_lever); String lever = DBSql.getString( sql_lever);
//lever = lever.substring(0,3); //lever = lever.substring(0,3);
if(lever.length()==5&&lever.substring(4).equals("0")){ if(lever.length()==5&&lever.substring(4).equals("0")){
@ -242,7 +242,7 @@ public class CreateDataKnow implements IJob {
}else if (lever.length()==1){ }else if (lever.length()==1){
lever=lever+".0"; lever=lever+".0";
} }
DCContext dcContext = new DCContext(userContext, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), bos.getString("TASKID"), bos.getString("PUBLISHFILENAME") + "_" + lever + ".doc"); DCContext dcContext = new DCContext(userContext, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), rowMap.getString("TASKID"), rowMap.getString("PUBLISHFILENAME") + "_" + lever + ".doc");
//UtilFile file = new UtilFile(dcContext.getPath()); //UtilFile file = new UtilFile(dcContext.getPath());

View File

@ -98,10 +98,11 @@ public class ProcessEndAfterEvent extends ExecuteListener {
jsonObject.put("action","read"); jsonObject.put("action","read");
jsonObject.put("title"," " + jsonObject.put("title"," " +
"["+boActCoePublish.getString("PROCESS_TITLE")+"]需要处理"); "["+boActCoePublish.getString("PROCESS_TITLE")+"]需要处理");
jsonObject.put("dept",SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo());//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo() System.out.println("部门庄户》》》》》》》"+SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getTaskInstance().getTarget()).getNo());
String target = ""; jsonObject.put("dept",SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getTaskInstance().getTarget()).getNo());//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo()
if (processExecutionContext.getProcessInstance().getCreateUser().length()==8&&"00".equals(processExecutionContext.getProcessInstance().getCreateUser().substring(0,2))){ String target = processExecutionContext.getTaskInstance().getTarget();
target = processExecutionContext.getProcessInstance().getCreateUser().substring(2); if (processExecutionContext.getTaskInstance().getTarget().length()==8&&"00".equals(processExecutionContext.getTaskInstance().getTarget().substring(0,2))){
target = processExecutionContext.getTaskInstance().getTarget().substring(2);
} }
System.out.println("当前账户======》》》》"+target); System.out.println("当前账户======》》》》"+target);
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail(); BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
@ -132,7 +133,12 @@ public class ProcessEndAfterEvent extends ExecuteListener {
} }
} else { } else {
List posts_list = new ArrayList(); List posts_list = new ArrayList();
String strs[] = bo_act_coe_publish1.getString("SEND_SCOPE_ORG").split(","); List<String> org_list = new ArrayList();
if (StringUtils.isNotEmpty(bo_act_coe_publish1.getString("SEND_SCOPE_ORG"))){
String strs[] = bo_act_coe_publish1.getString("SEND_SCOPE_ORG").split(",");
org_list= Arrays.asList(strs);
}
if (StringUtils.isNotEmpty(bo_act_coe_publish1.getString("SEND_SCOPE_POST"))) { if (StringUtils.isNotEmpty(bo_act_coe_publish1.getString("SEND_SCOPE_POST"))) {
String posts[] = bo_act_coe_publish1.getString("SEND_SCOPE_POST").split(","); String posts[] = bo_act_coe_publish1.getString("SEND_SCOPE_POST").split(",");
posts_list = Arrays.asList(posts); posts_list = Arrays.asList(posts);
@ -143,260 +149,322 @@ public class ProcessEndAfterEvent extends ExecuteListener {
ranks_list = Arrays.asList(ranks); ranks_list = Arrays.asList(ranks);
} }
for (String depaartid : strs System.out.println("部门id》》》》》》》》》》》》》"+org_list );
) { System.out.println("posts_list》》》》》》》》》》》》》"+posts_list);
DepartmentModel departmentModel = SDK.getORGAPI().getDepartmentById(depaartid); System.out.println("ranks_list》》》》》》》》》》》》》"+ranks_list);
boolean existSubModelOfCache = departmentModel.isExistSubModelOfCache(); if (org_list.size()!=0 && org_list!=null) {
//判断选中的是否有下级部门 for (String depaartid : org_list
if (existSubModelOfCache) { ) {
List<RowMap> maps = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + depaartid + "'"); System.out.println("departid>>>>>>>>>>>>>" + depaartid);
for (RowMap row : maps DepartmentModel departmentModel = SDK.getORGAPI().getDepartmentById(depaartid);
) { boolean existSubModelOfCache = departmentModel.isExistSubModelOfCache();
String id = row.getString("ID"); System.out.println("是否含有下级?????????????" + existSubModelOfCache);
DepartmentModel model = SDK.getORGAPI().getDepartmentById(id); //判断选中的是否有下级部门
if (existSubModelOfCache) {
List<RowMap> maps = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + depaartid + "'");
for (RowMap row : maps
) {
String id = row.getString("ID");
DepartmentModel model = SDK.getORGAPI().getDepartmentById(id);
if (model.isExistSubModelOfCache()) { if (model.isExistSubModelOfCache()) {
//有下级部门的选中有下级部门 //有下级部门的选中有下级部门
List<RowMap> rowMapList = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + id + "'"); List<RowMap> rowMapList = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + id + "'");
for (RowMap wo : for (RowMap wo :
rowMapList) { rowMapList) {
String ids = wo.getString("ID"); String ids = wo.getString("ID");
DepartmentModel model1 = SDK.getORGAPI().getDepartmentById(ids); DepartmentModel model1 = SDK.getORGAPI().getDepartmentById(ids);
if (model1.isExistSubModelOfCache()) { if (model1.isExistSubModelOfCache()) {
List<RowMap> rowMapLists = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + ids + "'"); List<RowMap> rowMapLists = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + ids + "'");
for (RowMap wsa : for (RowMap wsa :
rowMapLists) { rowMapLists) {
String wsaString = wsa.getString("ID"); String wsaString = wsa.getString("ID");
DepartmentModel model2 = SDK.getORGAPI().getDepartmentById(wsaString); DepartmentModel model2 = SDK.getORGAPI().getDepartmentById(wsaString);
if (model2.isExistSubModelOfCache()) { if (model2.isExistSubModelOfCache()) {
List<RowMap> rowMapList1 = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + wsaString + "'"); List<RowMap> rowMapList1 = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + wsaString + "'");
for (RowMap rows : for (RowMap rows :
rowMapList1) { rowMapList1) {
String rowsString = rows.getString("ID"); String rowsString = rows.getString("ID");
DepartmentModel model3 = SDK.getORGAPI().getDepartmentById(rowsString); DepartmentModel model3 = SDK.getORGAPI().getDepartmentById(rowsString);
if (model3.isExistSubModelOfCache()) { if (model3.isExistSubModelOfCache()) {
List<RowMap> rowMapList2 = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + rowsString + "'"); List<RowMap> rowMapList2 = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + rowsString + "'");
for (RowMap ormap : for (RowMap ormap :
rowMapList2) { rowMapList2) {
String rowsString1 = ormap.getString("ID"); String rowsString1 = ormap.getString("ID");
DepartmentModel model4 = SDK.getORGAPI().getDepartmentById(rowsString1); DepartmentModel model4 = SDK.getORGAPI().getDepartmentById(rowsString1);
if (model4.isExistSubModelOfCache()) { if (model4.isExistSubModelOfCache()) {
List<RowMap> rowMaps = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + rowsString1 + "'"); List<RowMap> rowMaps = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + rowsString1 + "'");
for (RowMap owmapr : for (RowMap owmapr :
rowMaps) { rowMaps) {
String row_id = owmapr.getString("ID"); String row_id = owmapr.getString("ID");
DepartmentModel model5 = SDK.getORGAPI().getDepartmentById(row_id); DepartmentModel model5 = SDK.getORGAPI().getDepartmentById(row_id);
if (model5.isExistSubModelOfCache()) { if (model5.isExistSubModelOfCache()) {
List<RowMap> rowMapList3 = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + row_id + "'"); List<RowMap> rowMapList3 = DBSql.getMaps("SELECT * FROM ORGDEPARTMENT WHERE PARENTDEPARTMENTID = '" + row_id + "'");
for (RowMap owzmap : for (RowMap owzmap :
rowMapList3) { rowMapList3) {
String idsa = owzmap.getString("ID"); String idsa = owzmap.getString("ID");
DepartmentModel model6 = SDK.getORGAPI().getDepartmentById(idsa); DepartmentModel model6 = SDK.getORGAPI().getDepartmentById(idsa);
if (model6.isExistSubModelOfCache()) { if (model6.isExistSubModelOfCache()) {
} else { } else {
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(idsa); List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(idsa);
for (UserModel user : allUsersByDepartments for (UserModel user : allUsersByDepartments
) { ) {
if (posts_list != null && ranks_list != null) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(row_id);
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(row_id); for (UserModel user : allUsersByDepartments
for (UserModel user : allUsersByDepartments ) {
) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list != null && ranks_list != null) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(rowsString1);
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(rowsString1); for (UserModel user : allUsersByDepartments
for (UserModel user : allUsersByDepartments ) {
) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list != null && ranks_list != null) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(rowsString);
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(rowsString); for (UserModel user : allUsersByDepartments
for (UserModel user : allUsersByDepartments ) {
) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list != null && ranks_list != null) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(wsaString);
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(wsaString); for (UserModel user : allUsersByDepartments
for (UserModel user : allUsersByDepartments ) {
) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list != null && ranks_list != null) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(ids);
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(ids); for (UserModel user : allUsersByDepartments
for (UserModel user : allUsersByDepartments ) {
) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list != null && ranks_list != null) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(id);
List<UserModel> allUsersByDepartments = SDK.getORGAPI().getAllUsersByDepartment(id); for (UserModel user : allUsersByDepartments
for (UserModel user : allUsersByDepartments ) {
) { if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list != null && ranks_list != null) { if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
} }
} } else {
} else { //选中的没有下级部门
//选中的没有下级部门 List<UserModel> allUsersByDepartment = SDK.getORGAPI().getAllUsersByDepartment(depaartid);
List<UserModel> allUsersByDepartment = SDK.getORGAPI().getAllUsersByDepartment(depaartid); for (UserModel user : allUsersByDepartment
for (UserModel user : allUsersByDepartment ) {
) { System.out.println("user.getExt2())???????????" + user.getExt2());
if (posts_list != null && ranks_list != null) { System.out.println("posts_list》》》》》》》》》das" + (posts_list.size() != 0));
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) { System.out.println("123123》》》》》》》》》》" + (ranks_list.size() != 0));
if (posts_list.size() != 0 && ranks_list.size() != 0) {
if (posts_list.contains(user.getPositionNo()) && ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() != 0 && ranks_list.size() == 0) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list.size() == 0 && ranks_list.size() != 0) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ","; uid += user.getUID() + ",";
} }
} else if (posts_list != null && ranks_list == null) {
if (posts_list.contains(user.getPositionNo())) {
uid += user.getUID() + ",";
}
} else if (posts_list == null && ranks_list != null) {
if (ranks_list.contains(user.getExt2())) {
uid += user.getUID() + ",";
}
} else {
uid += user.getUID() + ",";
} }
} }
}
}
if (org_list.size()==0||org_list==null){
String posts="";
String levels = "";
if (posts_list.size() !=0 &&ranks_list.size()!=0){
String[] post = bo_act_coe_publish1.getString("SEND_SCOPE_POST").split(",");
String[] level = bo_act_coe_publish1.getString("SEND_SCOPE_LEVEL").split(",");
if (post.length==1){
// DBSql.getMap("select USERID from ORGUSER WHERE POSITION_NO IN ");
posts = "'"+post[0]+"'";
}else {
posts = "'"+ StringUtils.join(post, "','")+"'";
}
if (level.length==1){
levels = "'"+level[0]+"'";
}else {
levels = "'"+ StringUtils.join(level, "','")+"'";
}
List<RowMap> maps = DBSql.getMaps("select USERID from ORGUSER where POSITION_NO in(" + posts + ") and EXT2 in (" + levels + ")");
for (RowMap map:maps
) {
uid+=map.getString("USERID")+",";
}
} else if (posts_list.size() !=0 &&ranks_list.size()==0) {
String[] post = bo_act_coe_publish1.getString("SEND_SCOPE_POST").split(",");
if (post.length==1){
// DBSql.getMap("select USERID from ORGUSER WHERE POSITION_NO IN ");
posts = "'"+post[0]+"'";
}else {
posts = "'"+ StringUtils.join(post, "','")+"'";
}
List<RowMap> maps = DBSql.getMaps("select USERID from ORGUSER where POSITION_NO in(" + posts + ")");
for (RowMap map:maps
) {
uid+=map.getString("USERID")+",";
}
}else if (posts_list.size() ==0 &&ranks_list.size()!=0){
String[] level = bo_act_coe_publish1.getString("SEND_SCOPE_LEVEL").split(",");
if (level.length==1){
levels = "'"+level[0]+"'";
}else {
levels = "'"+ StringUtils.join(level, "','")+"'";
}
List<RowMap> maps = DBSql.getMaps("select USERID from ORGUSER where EXT2 in (" + levels + ")");
for (RowMap map:maps
) {
uid+=map.getString("USERID")+",";
}
} }
} }
} }
System.out.println("userid》》》》》》》》》》》》》》》》》》》"+uid);
if (StringUtils.isNotEmpty(uid if (StringUtils.isNotEmpty(uid
)) { )) {
uid = uid.substring(0, uid.length() - 1); uid = uid.substring(0, uid.length() - 1);
@ -409,14 +477,12 @@ public class ProcessEndAfterEvent extends ExecuteListener {
list.addAll(h); list.addAll(h);
for (String userid:list for (String userid:list
) { ) {
if (userid.length()==8&&"00".equals(userid.substring(0,2))){
userid = userid.substring(2);
}
System.out.println("当前账户======》》》》"+userid); System.out.println("当前账户======》》》》"+userid);
System.out.println("bo>>>>>>>>>>>>>>"+bo_eu_oa_reson); // BO boEuOaReson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=", userid).detail();
if (bo_eu_oa_reson!=null){ // if (boEuOaReson!=null){
new_uid+=bo_eu_oa_reson.getString("LOGINID")+","; new_uid+=userid+",";
} // }
} }
} }
@ -427,7 +493,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
new_uid = new_uid.substring(0, new_uid.length() - 1); new_uid = new_uid.substring(0, new_uid.length() - 1);
} }
System.out.println("new_userid ==========>>>>>>>>>"+new_uid); System.out.println("new_userid ==========>>>>>>>>>"+new_uid);
jsonObject.put("userList",new_uid); jsonObject.put("userList",new_uid);
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n" + String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n" +
@ -440,7 +506,7 @@ public class ProcessEndAfterEvent extends ExecuteListener {
" </web:service>" + " </web:service>" +
" </soapenv:Body>" + " </soapenv:Body>" +
"</soapenv:Envelope>"; "</soapenv:Envelope>";
System.out.println("xmlStr>>>>>>>>"+xmlStr);
String postSoap = UtilUrl.doPostSoap("http://10.105.1.59:80/services/service_lcglpt", xmlStr, ""); String postSoap = UtilUrl.doPostSoap("http://10.105.1.59:80/services/service_lcglpt", xmlStr, "");
Document document = DocumentHelper.parseText(postSoap); Document document = DocumentHelper.parseText(postSoap);
Element rootElement = document.getRootElement(); Element rootElement = document.getRootElement();
@ -449,6 +515,8 @@ public class ProcessEndAfterEvent extends ExecuteListener {
String resultString = result.getData().toString(); String resultString = result.getData().toString();
JSONObject jsonObject1 = JSON.parseObject(resultString); JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("data"); String datas = jsonObject1.getString("data");
String status = jsonObject1.getString("status");
System.out.println("状态是什么》》》》》》》》》》》"+status);
JSONArray resultArray = JSONObject.parseArray(datas); JSONArray resultArray = JSONObject.parseArray(datas);
for (int i=0;i<resultArray.size();i++) { for (int i=0;i<resultArray.size();i++) {
JSONObject jsonObject2 = resultArray.getJSONObject(i); JSONObject jsonObject2 = resultArray.getJSONObject(i);