修改用户与多公司关系

pull/93/head
admin 1 year ago
parent 5291bb5c9f
commit 1b564c8c0a

@ -196,8 +196,10 @@ public class UserController extends BaseController{
//角色主键数组 //角色主键数组
String[] rolesid = request.getParameterValues("rolesid"); String[] rolesid = request.getParameterValues("rolesid");
String departmentIds = request.getParameter("departmentIds");
//保存用户信息 //保存用户信息
int isok = this.userService.save(tab, rolesid); int isok = this.userService.save(tab, rolesid,departmentIds);
if (isok > 0) { if (isok > 0) {
String[] tenantselect = request.getParameterValues("tenantselect"); String[] tenantselect = request.getParameterValues("tenantselect");
@ -252,8 +254,10 @@ public class UserController extends BaseController{
//角色主键数组 //角色主键数组
String[] rolesid = request.getParameterValues("rolesid"); String[] rolesid = request.getParameterValues("rolesid");
String departmentIds = request.getParameter("departmentIds");
//保存用户信息 //保存用户信息
int isok = this.userService.editUser(tab, rolesid); int isok = this.userService.editUser(tab, rolesid,departmentIds);
if (isok > 0) { if (isok > 0) {
String[] tenantselect = request.getParameterValues("tenantselect"); String[] tenantselect = request.getParameterValues("tenantselect");

@ -52,6 +52,7 @@ public class Department implements BaseDto,java.io.Serializable {
@Schema(description = "上一级部门主键默认为0表示为第一级数据对象非0情况表示为有上一级数据对象") @Schema(description = "上一级部门主键默认为0表示为第一级数据对象非0情况表示为有上一级数据对象")
@TableField(value="PARENTID") @TableField(value="PARENTID")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentid; private Long parentid;
@Schema(description = "记录根级部门主键用于记录子部门所属根节点主键默认为0只有一层节点记录上一级节点主键") @Schema(description = "记录根级部门主键用于记录子部门所属根节点主键默认为0只有一层节点记录上一级节点主键")
@ -129,7 +130,38 @@ public class Department implements BaseDto,java.io.Serializable {
@Schema(description = "更新时间") @Schema(description = "更新时间")
@TableField(value="UPDATETIME") @TableField(value="UPDATETIME")
private Long updatetime; private Long updatetime;
@Schema(description = "对应的Service名主要是spring的service名")
@TableField(value="SERVICENAME")
private String servicename;
@Schema(description = "内置表单使用flowable表单0使用本地数据1使用flowable表单3:外置表单4其他自定义表单")
@TableField(value="BUILTFORM")
private Integer builtform;
@Schema(description = "表单地址,用户展示用户表单使用")
@TableField(value="FORMURL")
private String formurl;
@Schema(description = "表单详情")
@TableField(value="FORMDETAIL")
private String formdetail;
@Schema(description = "表单分类")
@TableField(value="FORMTYPE")
private String formtype;
@Schema(description = "流程定义id")
@TableField(value="PROCESSDEFINITIONID")
private String processdefinitionid;
@Schema(description = "公司类型0租户1主体")
@TableField(value="TYPEDEPT")
private Integer typedept;
@Schema(description = "对应的工作流编码,与工作流中的命名空间对应")
@TableField(value="CATEGORY")
private String category;
//子集机构的集合 //子集机构的集合
@TableField(exist = false) @TableField(exist = false)
private List<Department> listchilddept; private List<Department> listchilddept;
@ -165,7 +197,15 @@ public class Department implements BaseDto,java.io.Serializable {
new SimpleEntry<>("CREATEUSER","createuser"), new SimpleEntry<>("CREATEUSER","createuser"),
new SimpleEntry<>("CREATEDATE","createdate"), new SimpleEntry<>("CREATEDATE","createdate"),
new SimpleEntry<>("UPDATEUSER","updateuser"), new SimpleEntry<>("UPDATEUSER","updateuser"),
new SimpleEntry<>("UPDATETIME","updatetime") new SimpleEntry<>("UPDATETIME","updatetime"),
new SimpleEntry<>("SERVICENAME","servicename"),
new SimpleEntry<>("BUILTFORM","builtform"),
new SimpleEntry<>("FORMURL","formurl"),
new SimpleEntry<>("FORMDETAIL","formdetail"),
new SimpleEntry<>("FORMTYPE","formtype"),
new SimpleEntry<>("PROCESSDEFINITIONID","processdefinitionid"),
new SimpleEntry<>("TYPEDEPT","typedept"),
new SimpleEntry<>("CATEGORY","category")
) )
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue)); .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override @Override

@ -172,12 +172,12 @@ public class User implements BaseDto,java.io.Serializable {
//用于记录用户对应的顶级机构主键 //用于记录用户对应的顶级机构主键
@TableField(exist = false) @TableField(exist = false)
private Long departmentRootId = 0L; private Long departmentRootId = 0L;
//
//租户关系 // //租户关系
@TableField(exist = false) // @TableField(exist = false)
List<Tenant> tenantList; // List<Tenant> tenantList;
//用户对应的部门信息,映射文件中对应的字段信息 //用户对应的部门信息,映射文件中对应的字段信息
@JsonIgnore
@TableField(exist = false) @TableField(exist = false)
private List<Department> deptlist = new ArrayList<Department>(0); private List<Department> deptlist = new ArrayList<Department>(0);
@ -215,7 +215,7 @@ public class User implements BaseDto,java.io.Serializable {
Iterator<Department> it = deptlist.iterator(); Iterator<Department> it = deptlist.iterator();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if (it.hasNext()) { while (it.hasNext()) {
Department dept = it.next(); Department dept = it.next();
if (null != sb && sb.length() > 0) { if (null != sb && sb.length() > 0) {

@ -32,7 +32,13 @@ public interface DepartmentService extends BaseService<Department> {
* ,false * ,false
*/ */
public List<Department> listDepartByUser(User user, boolean enabled); public List<Department> listDepartByUser(User user, boolean enabled);
/**
*
* @param category
* @return
*/
List<Department> listByDeptNo(String deptno);
/** /**
* , * ,
* @param id * @param id

@ -87,7 +87,7 @@ public interface UserService extends BaseService<User> {
* @param rolesid * @param rolesid
* @return * @return
*/ */
int save(User user, String[] rolesid); int save(User user, String[] rolesid,String departmentIds);
/** /**
* , * ,
@ -108,7 +108,7 @@ public interface UserService extends BaseService<User> {
* @param user * @param user
* @return * @return
*/ */
int editUser(User user, String[] rolesid); int editUser(User user, String[] rolesid,String departmentIds);
/** /**
* userDefaultPassword123456 * userDefaultPassword123456

@ -205,7 +205,18 @@ public class DepartmentServiceImpl extends BaseServiceImpl<DepartmentMybatisDao,
return list; return list;
} }
/**
*
* @param category
* @return
*/
public List<Department> listByDeptNo(String deptno){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("DEPTNO",deptno);
return this.selectSearchList(queryWrapper);
}
/** /**
* *
* @param roleid * @param roleid

@ -105,7 +105,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId()); List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList); user.formatDeptlist(departmentList);
user.setTenantList(this.userTenantService.listUserTenant(user.getId())); //user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//返回用户前端菜单权限列表 //返回用户前端菜单权限列表
List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname()); List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname());
@ -136,7 +136,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId()); List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList); user.formatDeptlist(departmentList);
user.setTenantList(this.userTenantService.listUserTenant(user.getId())); //user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//返回用户前端菜单权限列表 //返回用户前端菜单权限列表
List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname()); List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname());
@ -283,7 +283,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
*/ */
@Override @Override
@Transactional @Transactional
public int save(User user, String[] rolesid){ public int save(User user, String[] rolesid,String departmentIds){
//spring密码加密啊算法 //spring密码加密啊算法
BCryptPasswordEncoder bcryptPasswordEncoder = new BCryptPasswordEncoder(); BCryptPasswordEncoder bcryptPasswordEncoder = new BCryptPasswordEncoder();
@ -299,12 +299,18 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
isok = this.usermybatisdao.insert(user); isok = this.usermybatisdao.insert(user);
//保存用户是否成功 //保存用户是否成功
if(isok > 0){ if(isok > 0){
Userobject uo = new Userobject();
uo.setUserid(user.getId()); String[] deptids = departmentIds.split(",");
uo.setDepartid(user.getDepartmentId());
//保存用户与部门的关系 for(String dids:deptids){
Userobject uo = new Userobject();
uo.setUserid(user.getId());
uo.setDepartid(Long.parseLong(dids));
//保存用户与部门的关系
this.userobjectMybatisDao.insert(uo);
}
this.userobjectMybatisDao.insert(uo);
//判断接收的角色是否为空,如果为空用户角色使用默认角色 //判断接收的角色是否为空,如果为空用户角色使用默认角色
if(null != rolesid && rolesid.length > 0){ if(null != rolesid && rolesid.length > 0){
@ -426,7 +432,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
*/ */
@Override @Override
@Transactional @Transactional
public int editUser(User user,String[] rolesid){ public int editUser(User user,String[] rolesid,String departmentIds){
//获得数据库中用户信息 //获得数据库中用户信息
User olduser = this.usermybatisdao.selectById(user.getId()); User olduser = this.usermybatisdao.selectById(user.getId());
@ -442,17 +448,27 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
queryWrapper.eq("USERID",user.getId()); queryWrapper.eq("USERID",user.getId());
//判断修改前用户的机构主键是否一致,如果不一致需要修改 //判断修改前用户的机构主键是否一致,如果不一致需要修改
if(!user.getDepartmentId().equals(olduser.getDepartmentId())){ // if(!user.getDepartmentId().equals(olduser.getDepartmentId())){
//删除原有用户与机构的关联关系 //删除原有用户与机构的关联关系
this.userobjectMybatisDao.delete(queryWrapper); this.userobjectMybatisDao.delete(queryWrapper);
Userobject uo = new Userobject(); String[] deptids = departmentIds.split(",");
uo.setUserid(user.getId());
uo.setDepartid(user.getDepartmentId()); for(String dids:deptids){
//保存用户与部门的关系 Userobject uo = new Userobject();
this.userobjectMybatisDao.insert(uo); uo.setUserid(user.getId());
} uo.setDepartid(Long.parseLong(dids));
//保存用户与部门的关系
this.userobjectMybatisDao.insert(uo);
}
// Userobject uo = new Userobject();
// uo.setUserid(user.getId());
// uo.setDepartid(user.getDepartmentId());
// //保存用户与部门的关系
// this.userobjectMybatisDao.insert(uo);
// }
//判断接收的角色是否为空 //判断接收的角色是否为空
if(null != rolesid && rolesid.length > 0){ if(null != rolesid && rolesid.length > 0){
@ -616,7 +632,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
if(null != user){ if(null != user){
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId()); List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList); user.formatDeptlist(departmentList);
user.setTenantList(this.userTenantService.listUserTenant(user.getId())); //user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
} }
return user; return user;

@ -238,7 +238,7 @@ public class UserTokenServiceImpl implements UserTokenService {
Map<String,Object> rolesShowleave = this.rolesService.getRolesConditionMap(user); Map<String,Object> rolesShowleave = this.rolesService.getRolesConditionMap(user);
SearchQuery searchQueryrolesShowleave = this.rolesService.getRolesCondition(rolesShowleave); SearchQuery searchQueryrolesShowleave = this.rolesService.getRolesCondition(rolesShowleave);
user.setRolesShowleave(rolesShowleave); user.setRolesShowleave(rolesShowleave);
user.setTenantList(this.userTenantService.listUserTenant(user.getId())); //user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
user.setSearchQueryrolesShowleave(searchQueryrolesShowleave); user.setSearchQueryrolesShowleave(searchQueryrolesShowleave);
userVo = BeanUtil.copyProperties(user,User.class); userVo = BeanUtil.copyProperties(user,User.class);

@ -26,6 +26,14 @@
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/> <result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/> <result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/> <result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<result column="SERVICENAME" property="servicename" jdbcType="VARCHAR"/>
<result column="BUILTFORM" property="builtform" jdbcType="INTEGER"/>
<result column="FORMURL" property="formurl" jdbcType="VARCHAR"/>
<result column="FORMDETAIL" property="formdetail" jdbcType="VARCHAR"/>
<result column="FORMTYPE" property="formtype" jdbcType="VARCHAR"/>
<result column="PROCESSDEFINITIONID" property="processdefinitionid" jdbcType="VARCHAR"/>
<result column="TYPEDEPT" property="typedept" jdbcType="INTEGER"/>
<result column="CATEGORY" property="category" jdbcType="VARCHAR"/>
<collection property="listchilddept" select="selectChildDeptEnabled" javaType="java.util.ArrayList" column="{id=id}"/> <collection property="listchilddept" select="selectChildDeptEnabled" javaType="java.util.ArrayList" column="{id=id}"/>
</resultMap> </resultMap>
<resultMap id="BaseResultMap_only" type="cn.jyjz.xiaoyao.admin.dataobject.Department"> <resultMap id="BaseResultMap_only" type="cn.jyjz.xiaoyao.admin.dataobject.Department">
@ -53,6 +61,14 @@
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/> <result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/> <result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/> <result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<result column="SERVICENAME" property="servicename" jdbcType="VARCHAR"/>
<result column="BUILTFORM" property="builtform" jdbcType="INTEGER"/>
<result column="FORMURL" property="formurl" jdbcType="VARCHAR"/>
<result column="FORMDETAIL" property="formdetail" jdbcType="VARCHAR"/>
<result column="FORMTYPE" property="formtype" jdbcType="VARCHAR"/>
<result column="PROCESSDEFINITIONID" property="processdefinitionid" jdbcType="VARCHAR"/>
<result column="TYPEDEPT" property="typedept" jdbcType="INTEGER"/>
<result column="CATEGORY" property="category" jdbcType="VARCHAR"/>
<collection property="listchilddept" select="selectChildDeptEnabled" javaType="java.util.ArrayList" column="{id=id}"/> <collection property="listchilddept" select="selectChildDeptEnabled" javaType="java.util.ArrayList" column="{id=id}"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -79,7 +95,15 @@
CREATEUSER AS createuser, CREATEUSER AS createuser,
CREATEDATE AS createdate, CREATEDATE AS createdate,
UPDATEUSER AS updateuser, UPDATEUSER AS updateuser,
UPDATETIME AS updatetime UPDATETIME AS updatetime,
SERVICENAME AS servicename,
BUILTFORM AS builtform,
FORMURL AS formurl,
FORMDETAIL AS formdetail,
FORMTYPE AS formtype,
PROCESSDEFINITIONID AS processdefinitionid,
TYPEDEPT AS typedept,
CATEGORY AS category
</sql> </sql>
<sql id="Base_Where"> <sql id="Base_Where">
@ -109,6 +133,14 @@
<if test="createdate != null"> and CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}</if> <if test="createdate != null"> and CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}</if>
<if test="updateuser != null"> and UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}</if> <if test="updateuser != null"> and UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}</if>
<if test="updatetime != null"> and UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}</if> <if test="updatetime != null"> and UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}</if>
<if test="servicename != null"> and SERVICENAME ${servicename.dataOp} ${servicename.likestar}#{servicename.value}${servicename.likeend}</if>
<if test="builtform != null"> and BUILTFORM ${builtform.dataOp} ${builtform.likestar}#{builtform.value}${builtform.likeend}</if>
<if test="formurl != null"> and FORMURL ${formurl.dataOp} ${formurl.likestar}#{formurl.value}${formurl.likeend}</if>
<if test="formdetail != null"> and FORMDETAIL ${formdetail.dataOp} ${formdetail.likestar}#{formdetail.value}${formdetail.likeend}</if>
<if test="formtype != null"> and FORMTYPE ${formtype.dataOp} ${formtype.likestar}#{formtype.value}${formtype.likeend}</if>
<if test="processdefinitionid != null"> and PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}</if>
<if test="typedept != null"> and TYPEDEPT ${typedept.dataOp} ${typedept.likestar}#{typedept.value}${typedept.likeend}</if>
<if test="category != null"> and CATEGORY ${category.dataOp} ${category.likestar}#{category.value}${category.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if> <if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null"> <if test="listdept != null">
and DEPARTID in and DEPARTID in
@ -187,7 +219,15 @@
d.CREATEUSER AS createuser, d.CREATEUSER AS createuser,
d.CREATEDATE AS createdate, d.CREATEDATE AS createdate,
d.UPDATEUSER AS updateuser, d.UPDATEUSER AS updateuser,
d.UPDATETIME AS updatetime d.UPDATETIME AS updatetime,
d.SERVICENAME AS servicename,
d.BUILTFORM AS builtform,
d.FORMURL AS formurl,
d.FORMDETAIL AS formdetail,
d.FORMTYPE AS formtype,
d.PROCESSDEFINITIONID AS processdefinitionid,
d.TYPEDEPT AS typedept,
d.CATEGORY AS category
from S_DEPARTMENT_T d,S_USEROBJECT_T uo where uo.DEPARTID=d.ID and uo.USERID=#{id} from S_DEPARTMENT_T d,S_USEROBJECT_T uo where uo.DEPARTID=d.ID and uo.USERID=#{id}
</select> </select>
<!-- 查询机构启用的子集的机构信息 start--> <!-- 查询机构启用的子集的机构信息 start-->
@ -216,7 +256,15 @@
dm.CREATEUSER AS createuser, dm.CREATEUSER AS createuser,
dm.CREATEDATE AS createdate, dm.CREATEDATE AS createdate,
dm.UPDATEUSER AS updateuser, dm.UPDATEUSER AS updateuser,
dm.UPDATETIME AS updatetime dm.UPDATETIME AS updatetime,
dm.SERVICENAME AS servicename,
dm.BUILTFORM AS builtform,
dm.FORMURL AS formurl,
dm.FORMDETAIL AS formdetail,
dm.FORMTYPE AS formtype,
dm.PROCESSDEFINITIONID AS processdefinitionid,
dm.TYPEDEPT AS typedept,
dm.CATEGORY AS category
from S_DEPARTMENT_T dm,S_DEPARTMENTCHILD_T dmc where dm.ID = dmc.CHILDID and dmc.PARENTID = #{id} ORDER BY dm.SORTING DESC from S_DEPARTMENT_T dm,S_DEPARTMENTCHILD_T dmc where dm.ID = dmc.CHILDID and dmc.PARENTID = #{id} ORDER BY dm.SORTING DESC
</select> </select>
</mapper> </mapper>

@ -107,7 +107,7 @@
u.UPDATEUSER AS updateuser, u.UPDATEUSER AS updateuser,
u.UPDATETIME AS updatetime, u.UPDATETIME AS updatetime,
u.PSDUPDATETIME AS psdupdatetime u.PSDUPDATETIME AS psdupdatetime
from S_USER_T u RIGHT JOIN S_USEROBJECT_T uo ON uo.USERID = u.ID from S_USER_T u
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>

@ -1,5 +1,7 @@
package cn.jyjz.flowable.config; package cn.jyjz.flowable.config;
import cn.jyjz.xiaoyao.admin.dataobject.Department;
import cn.jyjz.xiaoyao.admin.service.DepartmentService;
import cn.jyjz.xiaoyao.oa.from.dataobject.Category; import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
import cn.jyjz.xiaoyao.oa.from.service.CategoryService; import cn.jyjz.xiaoyao.oa.from.service.CategoryService;
import org.flowable.common.engine.api.delegate.event.FlowableEvent; import org.flowable.common.engine.api.delegate.event.FlowableEvent;
@ -21,11 +23,13 @@ public class GlobalEntityInitListener implements FlowableEventListener {
@Autowired @Autowired
private CategoryService categoryService; private CategoryService categoryService;
@Autowired
private DepartmentService departmentService;
@Override @Override
public void onEvent(FlowableEvent flowableEvent) { public void onEvent(FlowableEvent flowableEvent) {
FlowableEventType type = flowableEvent.getType(); FlowableEventType type = flowableEvent.getType();
FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) flowableEvent; FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) flowableEvent;
Object object = flowableEntityEvent.getEntity(); Object object = flowableEntityEvent.getEntity();
if(object instanceof ProcessDefinitionEntity){ if(object instanceof ProcessDefinitionEntity){
ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity)object; ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity)object;
@ -37,9 +41,17 @@ public class GlobalEntityInitListener implements FlowableEventListener {
categoryService.updateById(category); categoryService.updateById(category);
} }
} }
//更新机构与审批流的关联,使用“业务主体编码”与流程的“目标命名空间”字段保持一致
List<Department> departmentList = departmentService.listByDeptNo(processDefinitionEntity.getCategory());
if(null != departmentList && !departmentList.isEmpty()){
for (Department department:departmentList){
department.setServicename("taskchildPictureService");
department.setProcessdefinitionid(processDefinitionEntity.getId());
departmentService.updateDept(department);
}
}
} }
} }

Loading…
Cancel
Save