1.流程创建时获取流程经理
2.地址簿过滤
This commit is contained in:
parent
4e6a3c0870
commit
be5f05ec12
@ -40,7 +40,7 @@ public class PublishLoadBefore extends ExecuteListener {
|
||||
String substring = sb.substring(0, sb.length()-1);
|
||||
// 可以为boData中的字段进行赋值
|
||||
Connection open = DBSql.open();
|
||||
RowMap data = DBSql.getMap(open,"select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGNAME in ("+substring+")");
|
||||
RowMap data = DBSql.getMap(open,"select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGDEPART in ("+substring+")");
|
||||
open.close();
|
||||
// RowMap data = DBSql.getMap(String.format("select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGNAME like'%s' and ORGDEPART like'%s'", allpath, allpath));
|
||||
if(data != null){
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.filter;
|
||||
import com.actionsoft.bpms.commons.security.high.HighSecurity;
|
||||
import com.actionsoft.bpms.org.model.CompanyModel;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.ui.dict.address.base.AddressUIFilterInterface;
|
||||
import com.actionsoft.bpms.ui.dict.address.base.AddressUISourceDataAbs;
|
||||
import com.actionsoft.bpms.ui.dict.address.model.AdvancedAddressModel;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 地址本UI组件的过滤事件
|
||||
*
|
||||
* 流程发布范围地址簿过滤
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class AddressUIFilterTest implements AddressUIFilterInterface {
|
||||
|
||||
@Override
|
||||
public boolean addressUIFlexCompanyFilter(UserContext uc, CompanyModel model, AdvancedAddressModel advancedAddressModel) {
|
||||
|
||||
if(model.getName().equals("内蒙古伊利实业集团股份有限公司")) {
|
||||
String choiceType = advancedAddressModel.getChoiceType();
|
||||
advancedAddressModel.setDisplayMap(false);
|
||||
advancedAddressModel.setDisplayOtherMap(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addressUIFlexDepartmentFilter(UserContext uc, DepartmentModel model,AdvancedAddressModel advancedAddressModel) {
|
||||
String userDempent = uc.getDepartmentModel().getPathNameOfCache().split("/")[0];
|
||||
|
||||
if(!model.isClosed()) {
|
||||
if(userDempent.equals("系统管理")) {
|
||||
String choiceType = advancedAddressModel.getChoiceType();
|
||||
advancedAddressModel.setLeafType("department");
|
||||
return true;
|
||||
}else if(userDempent.equals("伊利集团总部")||userDempent.equals("集团领导")) {
|
||||
if(model.getName().equals("系统管理")||model.getName().equals("项目开发人员部门")) {
|
||||
return false;
|
||||
}else {
|
||||
advancedAddressModel.setLeafType("department");
|
||||
return true;
|
||||
}
|
||||
}else {
|
||||
if(!model.getName().equals(userDempent)&&model.getParentDepartmentId().equals("0")) {
|
||||
//System.err.println(model.getName());
|
||||
return false;
|
||||
}else {
|
||||
if(model.getName().equals("系统管理")||model.getName().equals("项目开发人员部门")) {
|
||||
return false;
|
||||
}else {
|
||||
String choiceType = advancedAddressModel.getChoiceType();
|
||||
advancedAddressModel.setDisplayMap(true);
|
||||
advancedAddressModel.setDisplayOtherMap(true);
|
||||
advancedAddressModel.setLeafType("department");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addressUIFlexUserFilter(UserContext uc, UserModel userModel, AdvancedAddressModel aa) {
|
||||
if (HighSecurity.isON()) { // 判断是否开启密级设置
|
||||
int currSecurityLevel = uc.getUserModel().getSecurityLevel();
|
||||
if (currSecurityLevel <= userModel.getSecurityLevel()) {
|
||||
if (userModel.getUserName().equals("测试用户")) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
|
||||
String userDempent = uc.getDepartmentModel().getPathNameOfCache().split("/")[0];
|
||||
if (userDempent.equals("伊利集团总部") || userDempent.equals("集团领导")) {
|
||||
return true;
|
||||
} else {
|
||||
String modelDempent = SDK.getORGAPI().getDepartmentById(userModel.getDepartmentId())
|
||||
.getPathNameOfCache().split("/")[0];
|
||||
if (userDempent.equals(modelDempent)) {
|
||||
// System.err.println(modelDempent+"000000000000"+uc.getUserName()+uc.getUID());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.filter;
|
||||
import com.actionsoft.bpms.commons.security.high.HighSecurity;
|
||||
import com.actionsoft.bpms.org.model.CompanyModel;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.ui.dict.address.base.AddressUIFilterInterface;
|
||||
import com.actionsoft.bpms.ui.dict.address.base.AddressUISourceDataAbs;
|
||||
import com.actionsoft.bpms.ui.dict.address.model.AdvancedAddressModel;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 地址本UI组件的过滤事件
|
||||
*
|
||||
* 内部审核人等地址簿过滤
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class AddressUIFilterTest2 implements AddressUIFilterInterface {
|
||||
|
||||
@Override
|
||||
public boolean addressUIFlexCompanyFilter(UserContext uc, CompanyModel model, AdvancedAddressModel advancedAddressModel) {
|
||||
|
||||
if(model.getName().equals("内蒙古伊利实业集团股份有限公司")) {
|
||||
String choiceType = advancedAddressModel.getChoiceType();
|
||||
advancedAddressModel.setDisplayMap(false);
|
||||
advancedAddressModel.setDisplayOtherMap(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addressUIFlexDepartmentFilter(UserContext uc, DepartmentModel model,AdvancedAddressModel advancedAddressModel) {
|
||||
String userDempent = uc.getDepartmentModel().getPathNameOfCache().split("/")[0];
|
||||
|
||||
if(!model.isClosed()) {
|
||||
if(userDempent.equals("系统管理")) {
|
||||
String choiceType = advancedAddressModel.getChoiceType();
|
||||
advancedAddressModel.setLeafType("department");
|
||||
return true;
|
||||
}else if(userDempent.equals("伊利集团总部")||userDempent.equals("集团领导")) {
|
||||
if(model.getName().equals("系统管理")||model.getName().equals("项目开发人员部门")) {
|
||||
return false;
|
||||
}else {
|
||||
advancedAddressModel.setLeafType("department");
|
||||
return true;
|
||||
}
|
||||
}else {
|
||||
if(model.getName().equals("系统管理")||model.getName().equals("项目开发人员部门")||model.getName().equals("集团领导")) {
|
||||
return false;
|
||||
}else {
|
||||
advancedAddressModel.getChoiceType();
|
||||
advancedAddressModel.setLeafType("department");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addressUIFlexUserFilter(UserContext uc, UserModel userModel, AdvancedAddressModel aa) {
|
||||
if (HighSecurity.isON()) { // 判断是否开启密级设置
|
||||
int currSecurityLevel = uc.getUserModel().getSecurityLevel();
|
||||
if (currSecurityLevel <= userModel.getSecurityLevel()) {
|
||||
if (userModel.getUserName().equals("测试用户")) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
|
||||
String userDempent = uc.getDepartmentModel().getPathNameOfCache().split("/")[0];
|
||||
if (userDempent.equals("伊利集团总部") || userDempent.equals("集团领导")) {
|
||||
return true;
|
||||
} else {
|
||||
String modelDempent = SDK.getORGAPI().getDepartmentById(userModel.getDepartmentId())
|
||||
.getPathNameOfCache().split("/")[0];
|
||||
if (userDempent.equals(modelDempent)) {
|
||||
// System.err.println(modelDempent+"000000000000"+uc.getUserName()+uc.getUID());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,595 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.actionsoft.apps.coe.pal.publisher.filter;
|
||||
import com.actionsoft.bpms.org.cache.DepartmentCache;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.ui.dict.address.base.AddressUISourceDataAbs;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public class AddressUISourceDataTest extends AddressUISourceDataAbs {
|
||||
|
||||
/**
|
||||
* 获取地址簿树跟节点
|
||||
*
|
||||
* @param filter
|
||||
* @return
|
||||
*/
|
||||
public JSONArray getOrgTreeData(String appId, JSONObject filter, UserContext context) {
|
||||
JSONArray treeData = new JSONArray();
|
||||
//单位列表
|
||||
String companyList = filter.getString("companyList");
|
||||
JSONObject addressSetting = filter.getJSONObject("addressSetting");
|
||||
//部门根目录,多个用|隔开
|
||||
String rootDetpId = addressSetting.getString("rootDetpId");
|
||||
|
||||
//部门层级
|
||||
int layerFrom = -1;
|
||||
int layerTo = 9999;
|
||||
String layerFromStr = addressSetting.getString("layerFrom");
|
||||
if (!UtilString.isEmpty(layerFromStr)) {
|
||||
layerFrom = Integer.parseInt(layerFromStr);
|
||||
}
|
||||
String layerToStr = addressSetting.getString("layerTo");
|
||||
if (!UtilString.isEmpty(layerToStr)) {
|
||||
layerTo = Integer.parseInt(layerToStr);
|
||||
}
|
||||
//取值字段
|
||||
String sourceField = filter.getString("sourceField");
|
||||
//叶子节点
|
||||
String leafType = addressSetting.getString("leafType");
|
||||
/*//返回单位json
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", "单位id");
|
||||
json.put("name", "单位名称");
|
||||
json.put("iconCls", "company");
|
||||
json.put("iconFont", "");
|
||||
json.put("open", "是否展开 true|false");
|
||||
json.put("nocheck", true);
|
||||
json.put("type", "company");
|
||||
//以下内容用来回填数据
|
||||
json.put("COMPANYNAME", "单位名称");
|
||||
json.put("COMPANYID", "单位id");
|
||||
json.put("COMPANYNO", "单位编码");
|
||||
treeData.add(json);*/
|
||||
//返回部门json
|
||||
/*JSONObject json = new JSONObject();
|
||||
json.put("iconCls", "dept");
|
||||
json.put("iconFont", "");
|
||||
json.put("pid", "父节点id");
|
||||
json.put("type", "dept");
|
||||
if (leafType.equals("dept")) {
|
||||
json.put("leaf", true);//是否叶子节点
|
||||
}
|
||||
json.put("open", false);
|
||||
json.put("layer", "部门层级");
|
||||
json.put("size", "部门下人员个数");
|
||||
json.put("sourceId", "部门id");
|
||||
json.put("id", "部门id");
|
||||
json.put("name", "部门名称");
|
||||
json.put("type", "dept");
|
||||
json.put("fullPathName", "部门全路径");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "公司名称");
|
||||
temp.put("COMPANYID", "公司id");
|
||||
temp.put("COMPANYNO", "公司编码");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTNO", "部门代码");
|
||||
temp.put("DEPTZONE", "区域划分");
|
||||
temp.put("DEPTTYPE", "部门类型");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}*/
|
||||
/*//返回人员的json
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("sourceId", "用户帐号");
|
||||
json.put("id", "用户帐号");
|
||||
json.put("name", "用户姓名");
|
||||
json.put("type", "user");
|
||||
json.put("USERNAMEALIAS", "用户全名");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "单位名称");
|
||||
temp.put("COMPANYID", "单位id");
|
||||
temp.put("COMPANYNO", "单位编码");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("USERNAME", "用户姓名");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTFULLPATHNAMEWITHCOMPNAY", "部门全路径名称(含单位)");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTNO", "部门编码");
|
||||
temp.put("ROLEID", "角色id");
|
||||
temp.put("UID", "用户帐号");
|
||||
temp.put("USERID", "用户ID");
|
||||
temp.put("USERNO", "员工代码");
|
||||
temp.put("USERNAME", "用户姓名");
|
||||
temp.put("USERNAMEALIAS", "用户全名");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("OFFICETEL", "电话");
|
||||
temp.put("MOBILE", "手机");
|
||||
temp.put("OFFICEFAX", "传真");
|
||||
temp.put("POSITIONNAME", "职位名称");
|
||||
temp.put("POSITIONNO", "职位编码");
|
||||
temp.put("POSITIONLAYER", "职位等级");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}*/
|
||||
|
||||
return treeData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地址簿树子节点 移动端时从根目录开始pid=='' && pType == ''时是根目录
|
||||
*
|
||||
* @param filter
|
||||
* @return
|
||||
*/
|
||||
public JSONArray getSubJsonData(String appId, JSONObject filter, UserContext context, String pid, String pType) {
|
||||
JSONArray treeData = new JSONArray();
|
||||
//单位列表
|
||||
String companyList = filter.getString("companyList");
|
||||
JSONObject addressSetting = filter.getJSONObject("addressSetting");
|
||||
//部门根目录,多个用|隔开
|
||||
String rootDetpId = addressSetting.getString("rootDetpId");
|
||||
//部门层级
|
||||
int layerFrom = -1;
|
||||
int layerTo = 9999;
|
||||
String layerFromStr = addressSetting.getString("layerFrom");
|
||||
if (!UtilString.isEmpty(layerFromStr)) {
|
||||
layerFrom = Integer.parseInt(layerFromStr);
|
||||
}
|
||||
String layerToStr = addressSetting.getString("layerTo");
|
||||
if (!UtilString.isEmpty(layerToStr)) {
|
||||
layerTo = Integer.parseInt(layerToStr);
|
||||
}
|
||||
//取值字段
|
||||
String sourceField = filter.getString("sourceField");
|
||||
//叶子节点
|
||||
String leafType = addressSetting.getString("leafType");
|
||||
|
||||
/*//返回单位json
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", "单位id");
|
||||
json.put("name", "单位名称");
|
||||
json.put("iconCls", "company");
|
||||
json.put("iconFont", "");
|
||||
json.put("open", "是否展开 true|false");
|
||||
json.put("nocheck", true);
|
||||
json.put("type", "company");
|
||||
json.put("fullPathName", "公司全路径");
|
||||
//以下内容用来回填数据
|
||||
json.put("COMPANYNAME", "单位名称");
|
||||
json.put("COMPANYID", "单位id");
|
||||
json.put("COMPANYNO", "单位编码");
|
||||
treeData.add(json);*/
|
||||
//返回部门json
|
||||
/*JSONObject json = new JSONObject();
|
||||
json.put("iconCls", "dept");
|
||||
json.put("iconFont", "");
|
||||
json.put("pid", "父节点id");
|
||||
json.put("type", "dept");
|
||||
if (leafType.equals("dept")) {
|
||||
json.put("leaf", true);//是否叶子节点
|
||||
}
|
||||
json.put("open", false);
|
||||
json.put("layer", "部门层级");
|
||||
json.put("size", "部门下人员个数");
|
||||
json.put("sourceId", "部门id");
|
||||
json.put("id", "部门id");
|
||||
json.put("name", "部门名称");
|
||||
json.put("type", "dept");
|
||||
json.put("fullPathName", "部门全路径");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "公司名称");
|
||||
temp.put("COMPANYID", "公司id");
|
||||
temp.put("COMPANYNO", "公司编码");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTNO", "部门代码");
|
||||
temp.put("DEPTZONE", "区域划分");
|
||||
temp.put("DEPTTYPE", "部门类型");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}*/
|
||||
/*//返回人员的json
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("pid", pid);
|
||||
if (部门主管) {
|
||||
json.put("iconFont", UtilSerialize.parseObject("{'code':'','color':'#DA2912'}"));
|
||||
} else {
|
||||
json.put("iconFont", "");
|
||||
}
|
||||
json.put("sourceName", "用户姓名");
|
||||
json.put("type", "user");
|
||||
json.put("leaf", true);
|
||||
json.put("sourceId", "用户帐号");
|
||||
json.put("id", "用户帐号"+ "_" + pid);
|
||||
json.put("name", "用户姓名");
|
||||
json.put("type", "user");
|
||||
json.put("USERNAMEALIAS", "用户全名");
|
||||
json.put("fullPathName", "所在部门全路径");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "单位名称");
|
||||
temp.put("COMPANYID", "单位id");
|
||||
temp.put("COMPANYNO", "单位编码");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("USERNAME", "用户姓名");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTFULLPATHNAMEWITHCOMPNAY", "部门全路径名称(含单位)");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTNO", "部门编码");
|
||||
temp.put("ROLEID", "角色id");
|
||||
temp.put("UID", "用户帐号");
|
||||
temp.put("USERID", "用户ID");
|
||||
temp.put("USERNO", "员工代码");
|
||||
temp.put("USERNAME", "用户姓名");
|
||||
temp.put("USERNAMEALIAS", "用户全名");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("OFFICETEL", "电话");
|
||||
temp.put("MOBILE", "手机");
|
||||
temp.put("OFFICEFAX", "传真");
|
||||
temp.put("POSITIONNAME", "职位名称");
|
||||
temp.put("POSITIONNO", "职位编码");
|
||||
temp.put("POSITIONLAYER", "职位等级");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}*/
|
||||
|
||||
return treeData;
|
||||
}
|
||||
|
||||
public JSONObject search(String appId, JSONObject filter, UserContext context, String sourceField, String type, String keyWord, int limit, int start) {
|
||||
JSONObject result = new JSONObject();
|
||||
String companyList = filter.getString("companyList");
|
||||
JSONObject addressSetting = filter.getJSONObject("addressSetting");
|
||||
//部门根目录,多个用|隔开
|
||||
String rootDetpId = addressSetting.getString("rootDetpId");
|
||||
//部门层级
|
||||
int layerFrom = -1;
|
||||
int layerTo = 9999;
|
||||
String layerFromStr = addressSetting.getString("layerFrom");
|
||||
if (!UtilString.isEmpty(layerFromStr)) {
|
||||
layerFrom = Integer.parseInt(layerFromStr);
|
||||
}
|
||||
String layerToStr = addressSetting.getString("layerTo");
|
||||
if (!UtilString.isEmpty(layerToStr)) {
|
||||
layerTo = Integer.parseInt(layerToStr);
|
||||
}
|
||||
//叶子节点
|
||||
String leafType = addressSetting.getString("leafType");
|
||||
JSONArray array = new JSONArray();
|
||||
String currentCompanyId = context.getCompanyModel().getId();
|
||||
String uid = context.getUID();
|
||||
int listSize = 0;
|
||||
/*//返回人员json
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", "用户帐号");
|
||||
json.put("text", "用户姓名");
|
||||
json.put("showtextsuffix", "显示后缀");
|
||||
json.put("sourceId", "用户帐号");
|
||||
json.put("name", "用户姓名");
|
||||
json.put("type", "user");
|
||||
json.put("USERNAMEALIAS", "用户全名");
|
||||
json.put("deptId", "所属部门ID"); 移动端使用
|
||||
json.put("deptName", "所属部门名称"); 移动端使用
|
||||
json.put("deptFullName", "所属部门全路径"); 移动端使用
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "单位名称");
|
||||
temp.put("COMPANYID", "单位id");
|
||||
temp.put("COMPANYNO", "单位编码");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("USERNAME", "用户姓名");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTFULLPATHNAMEWITHCOMPNAY", "部门全路径名称(含单位)");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTNO", "部门编码");
|
||||
temp.put("ROLEID", "角色id");
|
||||
temp.put("UID", "用户帐号");
|
||||
temp.put("USERID", "用户ID");
|
||||
temp.put("USERNO", "员工代码");
|
||||
temp.put("USERNAME", "用户姓名");
|
||||
temp.put("USERNAMEALIAS", "用户全名");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("OFFICETEL", "电话");
|
||||
temp.put("MOBILE", "手机");
|
||||
temp.put("OFFICEFAX", "传真");
|
||||
temp.put("POSITIONNAME", "职位名称");
|
||||
temp.put("POSITIONNO", "职位编码");
|
||||
temp.put("POSITIONLAYER", "职位等级");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
array.add(json);
|
||||
}*/
|
||||
//返回部门JSON
|
||||
/*JSONObject json = new JSONObject();
|
||||
json.put("id", "部门id");
|
||||
json.put("text", "部门名称");
|
||||
json.put("showtextsuffix", "显示后缀");
|
||||
json.put("sourceId", "部门id");
|
||||
json.put("id", "部门id");
|
||||
json.put("name", "部门名称");
|
||||
json.put("type", "dept");
|
||||
json.put("fullPathName", "部门全路径");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "公司名称");
|
||||
temp.put("COMPANYID", "公司id");
|
||||
temp.put("COMPANYNO", "公司编码");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTNO", "部门代码");
|
||||
temp.put("DEPTZONE", "区域划分");
|
||||
temp.put("DEPTTYPE", "部门类型");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}*/
|
||||
//返回团队json
|
||||
/*JSONObject json = new JSONObject();
|
||||
json.put("id", "团队ID");
|
||||
json.put("text","团队名称");
|
||||
json.put("showtextsuffix", "显示后缀");
|
||||
json.put("sourceId", "团队ID");
|
||||
json.put("id", "团队ID");
|
||||
json.put("name", "团队名称");
|
||||
json.put("type", "team");
|
||||
json.put("TEAMID", "团队ID");
|
||||
json.put("TEAMNAME", "团队名称");*/
|
||||
result.put("totalPageNum", listSize);
|
||||
result.put("list", array);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址簿显示值(主要是返回值中有uid 或deptid 或 teamID 显示值需要具体信息用来显示)
|
||||
*
|
||||
* @param appId 应用id
|
||||
* @param filter 地址簿配置
|
||||
* @param context 用户上下文
|
||||
* @param value 用户账号或部门id
|
||||
* @return 用户或部门信息
|
||||
*/
|
||||
public JSONObject addressDisplayValue(String appId, JSONObject filter, UserContext context, String value) {
|
||||
JSONObject addressSetting = filter.getJSONObject("addressSetting");
|
||||
//叶子节点
|
||||
String leafType = addressSetting.getString("leafType");
|
||||
//地址簿回填字段
|
||||
String[] sourceFields = filter.getString("sourceField").split(",");
|
||||
boolean hasUID = false; //是否是员工账号
|
||||
boolean hasDeptId = false; //是否是部门id
|
||||
boolean hasTeamId = false; //是否是团队id
|
||||
JSONObject json = new JSONObject();
|
||||
for (int i = 0; i < sourceFields.length; i++) {
|
||||
if (leafType.equals("user") && ("UID".equals(sourceFields[i]) || "USERNAMEALIAS".equals(sourceFields[i]))) {
|
||||
hasUID = true;
|
||||
} else if (leafType.equals("dept") && "DEPTID".equals(sourceFields[i])) {
|
||||
hasDeptId = true;
|
||||
} else if ("TEAMID".equals(sourceFields[i])) {
|
||||
hasTeamId = true;
|
||||
}
|
||||
}
|
||||
if (hasUID) {//value 是 uid
|
||||
json.put("sourceId", "xinren1");
|
||||
json.put("id", "xinren1");
|
||||
json.put("name", "新人1");
|
||||
json.put("type", "user");
|
||||
json.put("USERNAMEALIAS", "新人1");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(filter.getString("sourceField"))) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "单位名称");
|
||||
temp.put("COMPANYID", "单位id");
|
||||
temp.put("COMPANYNO", "单位编码");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTFULLPATHNAMEWITHCOMPNAY", "部门全路径名称(含单位)");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTNO", "部门编码");
|
||||
temp.put("ROLEID", "角色id");
|
||||
temp.put("UID", "xinren1");
|
||||
temp.put("USERID", "55555");
|
||||
temp.put("USERNO", "员工代码");
|
||||
temp.put("USERNAME", "新人1");
|
||||
temp.put("USERNAMEALIAS", "新人1");
|
||||
temp.put("EMAIL", "邮箱");
|
||||
temp.put("OFFICETEL", "电话");
|
||||
temp.put("MOBILE", "手机");
|
||||
temp.put("OFFICEFAX", "传真");
|
||||
temp.put("POSITIONNAME", "职位名称");
|
||||
temp.put("POSITIONNO", "职位编码");
|
||||
temp.put("POSITIONLAYER", "职位等级");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}
|
||||
} else if (hasDeptId) {
|
||||
DepartmentModel dept = DepartmentCache.getModel(value);
|
||||
if (dept != null) {
|
||||
json.put("id", dept.getId());
|
||||
json.put("name", dept.getPathNameI18NOfCache());
|
||||
} else {
|
||||
json.put("id", value);
|
||||
json.put("name", value);
|
||||
}
|
||||
}
|
||||
// 返回用户信息
|
||||
// JSONObject json = new JSONObject();
|
||||
// json.put("sourceId", "用户帐号");
|
||||
// json.put("id", "用户帐号");
|
||||
// json.put("name", "用户姓名");
|
||||
// json.put("type", "user");
|
||||
// json.put("USERNAMEALIAS", "用户全名");
|
||||
// //以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
// if (!UtilString.isEmpty(sourceField)) {
|
||||
// JSONObject temp = new JSONObject();
|
||||
// temp.put("COMPANYNAME", "单位名称");
|
||||
// temp.put("COMPANYID", "单位id");
|
||||
// temp.put("COMPANYNO", "单位编码");
|
||||
// temp.put("EMAIL", "邮箱");
|
||||
// temp.put("USERNAME", "用户姓名");
|
||||
// temp.put("DEPTID", "部门id");
|
||||
// temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
// temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
// temp.put("DEPTFULLPATHNAMEWITHCOMPNAY", "部门全路径名称(含单位)");
|
||||
// temp.put("DEPTNAME", "部门名称");
|
||||
// temp.put("DEPTNO", "部门编码");
|
||||
// temp.put("ROLEID", "角色id");
|
||||
// temp.put("UID", "用户帐号");
|
||||
// temp.put("USERID", "用户ID");
|
||||
// temp.put("USERNO", "员工代码");
|
||||
// temp.put("USERNAME", "用户姓名");
|
||||
// temp.put("USERNAMEALIAS", "用户全名");
|
||||
// temp.put("EMAIL", "邮箱");
|
||||
// temp.put("OFFICETEL", "电话");
|
||||
// temp.put("MOBILE", "手机");
|
||||
// temp.put("OFFICEFAX", "传真");
|
||||
// temp.put("POSITIONNAME", "职位名称");
|
||||
// temp.put("POSITIONNO", "职位编码");
|
||||
// temp.put("POSITIONLAYER", "职位等级");
|
||||
// temp.put("EXT1", "扩展标记1");
|
||||
// temp.put("EXT2", "扩展标记2");
|
||||
// temp.put("EXT3", "扩展标记3");
|
||||
// temp.put("EXT4", "扩展标记4");
|
||||
// temp.put("EXT5", "扩展标记5");
|
||||
// String[] sourceFields = sourceField.split(",");
|
||||
// for (String field : sourceFields) {
|
||||
// json.put(field, temp.getString(field));
|
||||
// }
|
||||
// }
|
||||
//返回部门信息
|
||||
/*JSONObject json = new JSONObject();
|
||||
json.put("sourceId", "部门id");
|
||||
json.put("id", "部门id");
|
||||
json.put("name", "部门名称");
|
||||
json.put("type", "dept");
|
||||
json.put("fullPathName", "部门全路径");
|
||||
//以下内容用来回填数据,根据sourceField值确定返回哪些数据
|
||||
if (!UtilString.isEmpty(sourceField)) {
|
||||
JSONObject temp = new JSONObject();
|
||||
temp.put("COMPANYNAME", "公司名称");
|
||||
temp.put("COMPANYID", "公司id");
|
||||
temp.put("COMPANYNO", "公司编码");
|
||||
temp.put("DEPTNAME", "部门名称");
|
||||
temp.put("DEPTID", "部门id");
|
||||
temp.put("DEPTFULLPATHID", "部门id全路径");
|
||||
temp.put("DEPTFULLPATHNAME", "部门名称全路径");
|
||||
temp.put("DEPTNO", "部门代码");
|
||||
temp.put("DEPTZONE", "区域划分");
|
||||
temp.put("DEPTTYPE", "部门类型");
|
||||
temp.put("EXT1", "扩展标记1");
|
||||
temp.put("EXT2", "扩展标记2");
|
||||
temp.put("EXT3", "扩展标记3");
|
||||
temp.put("EXT4", "扩展标记4");
|
||||
temp.put("EXT5", "扩展标记5");
|
||||
String[] sourceFields = sourceField.split(",");
|
||||
for (String field : sourceFields) {
|
||||
json.put(field, temp.getString(field));
|
||||
}
|
||||
}*/
|
||||
return json;
|
||||
}
|
||||
/**
|
||||
* @param appId 应用id
|
||||
* @param filter 地址簿配置
|
||||
* @param context 用户上下文
|
||||
* @param nodeId 当前节点id
|
||||
* @param nodeType 当前节点类型
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getParentTreeNode(String appId, JSONObject filter, UserContext context, String nodeId, String nodeType) {
|
||||
JSONObject result = null;
|
||||
if ("company".equals(nodeType)) {
|
||||
} else if ("dept".equals(nodeType)) {
|
||||
if ("dept1".equals(nodeId) || "dept2".equals(nodeId)) {//上一级是公司
|
||||
result = new JSONObject();
|
||||
result.put("id", "comppany1");
|
||||
result.put("name", "公司1");
|
||||
result.put("type", "company");
|
||||
result.put("fullPathName", "/公司1");
|
||||
} else if ("dept3".equals(nodeId)) {//上一级是部门
|
||||
result = new JSONObject();
|
||||
result.put("id", "dept1");
|
||||
result.put("name", "研发");
|
||||
result.put("type", "dept");
|
||||
result.put("fullPathName", "/研发");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.read;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
import org.jdesktop.application.TaskListener;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
|
||||
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener;
|
||||
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;
|
||||
|
||||
public class ProcessEndAfterEvent extends ExecuteListener
|
||||
{
|
||||
private Logger logger = LogAPI.getLogger(TaskListener.class);
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return "0.0.1";
|
||||
}
|
||||
|
||||
public String getProvider()
|
||||
{
|
||||
return "ActionSoft";
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return "流程结束后发送代阅任务";
|
||||
}
|
||||
|
||||
public void execute(ProcessExecutionContext processExecutionContext) throws Exception
|
||||
{
|
||||
Connection open = DBSql.open();
|
||||
String processInstId = processExecutionContext.getProcessInstance().getId();
|
||||
String startTaskInstId = processExecutionContext.getProcessInstance().getStartTaskInstId();
|
||||
BO byProcess = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", processInstId);
|
||||
if (byProcess != null) {
|
||||
String send_scop = byProcess.getString("SEND_SCOP");
|
||||
String send_scope_org = byProcess.getString("SEND_SCOPE_ORG");
|
||||
String send_scop_post = byProcess.getString("SEND_SCOPE_POST");
|
||||
String send_level = byProcess.getString("SEND_SCOPE_LEVEL");
|
||||
"1".equals(send_scop);
|
||||
}
|
||||
|
||||
System.err.println("");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.read;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
|
||||
import com.actionsoft.bpms.server.RequestParams;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
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.actionsoft.sdk.local.api.BOQueryAPI;
|
||||
|
||||
@Controller
|
||||
public class TaskController
|
||||
{
|
||||
@Mapping("com.yili_process_page")
|
||||
public String processTest(UserContext me, RequestParams params)
|
||||
throws IOException
|
||||
{
|
||||
String sid = me.getSessionId();
|
||||
String processInstId = params.get("processInstId");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
LinkedHashMap<String,Object> map = new LinkedHashMap();
|
||||
map.put("sid", sid);
|
||||
String html = "previewProcess.html";
|
||||
List<BO> list = ((BOQueryAPI)SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("BINDID=", processInstId)).list();
|
||||
int num = 1;
|
||||
Connection conn = DBSql.open();
|
||||
for (BO bo : list) {
|
||||
String is_not_publish_sql = "SELECT id,PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME ='" + bo.get("PUBLISHFILENAME") + "'";
|
||||
List<RowMap> Row_maps_is_not_publish = DBSql.getMaps(conn, is_not_publish_sql, new Object[0]);
|
||||
|
||||
sb.append("<li id=\"openForm" + num + "\"");
|
||||
sb.append(" procname=\"Test\"");
|
||||
|
||||
sb.append(">");
|
||||
sb.append("<span class=");
|
||||
sb.append("\"procimg\"");
|
||||
sb.append("style=");
|
||||
sb.append("\"width: 2000px; background: url("../commons/img/model/biz/work.jpeg") no-repeat;\">");
|
||||
sb.append("</span>");
|
||||
sb.append("<a href=" + SDK.getPortalAPI().getPortalUrl() + "/r/w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + ((RowMap)Row_maps_is_not_publish.get(0)).getString("id") + "&sid=" + sid + " target=\"_blank\" style=");
|
||||
sb.append("\"width: 670px;\">");
|
||||
sb.append(bo.get("PUBLISHFILENAME") + " ");
|
||||
sb.append("<span style=");
|
||||
sb.append("\"display: inline; color: rgb(153, 153, 153); font-size: 10px; width: 670px;\">");
|
||||
BigDecimal big = new BigDecimal(((RowMap)Row_maps_is_not_publish.get(0)).getString("PLVER"));
|
||||
big = big.setScale(2, 4);
|
||||
sb.append("(v" + big + " " + ")</span>");
|
||||
sb.append("</a>");
|
||||
sb.append("</li>");
|
||||
num++;
|
||||
}
|
||||
map.put("processList", sb);
|
||||
map.put("processNum", Integer.valueOf(num - 1));
|
||||
DBSql.close(conn);
|
||||
return HtmlPageTemplate.merge("com.actionsoft.apps.coe.pal", html, map);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user