first commit
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.base.event.flow.jumptofirsttask;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:FlowJumpToFirstTaskNodeListener
|
||||
* @Date 2025/12/20 14:10
|
||||
* @注释
|
||||
*/
|
||||
public interface FlowJumpToFirstTaskNodeListener {
|
||||
|
||||
void receive(Long processTaskId);
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.budwk.app.base.event.flow.jumptofirsttask;
|
||||
|
||||
import com.budwk.app.base.event.user.UserChangeEventListener;
|
||||
import com.budwk.app.base.utils.AppIocUtil;
|
||||
import org.nutz.ioc.Ioc;
|
||||
import org.nutz.mvc.Mvcs;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:FlowJumpToFirstTaskNodeEvent
|
||||
* @Date 2025/12/20 14:09
|
||||
* @注释
|
||||
*/
|
||||
public class FlowJumpToFirstTaskNodePublisher {
|
||||
|
||||
public static void broadcast(Long processTaskId) {
|
||||
String[] names = Mvcs.getIoc().getNamesByType(FlowJumpToFirstTaskNodeListener.class);
|
||||
for (String listener : names) {
|
||||
FlowJumpToFirstTaskNodeListener listenerBean = Mvcs.getIoc().get(FlowJumpToFirstTaskNodeListener.class, listener);
|
||||
listenerBean.receive(processTaskId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.budwk.app.base.event.role;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:RoleEventListener
|
||||
* @Date 2025/9/3 17:13
|
||||
* @注释
|
||||
*/
|
||||
public interface RoleEventListener {
|
||||
|
||||
void receive(RoleEventMsg message);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.budwk.app.base.event.role;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:RoleEventMsg
|
||||
* @Date 2025/9/3 17:14
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RoleEventMsg {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private List<String> userIds;
|
||||
|
||||
/**
|
||||
* 角色code
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
private String unitId;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private Integer operationType;
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
*/
|
||||
public static final int ADD_ROLE = 1;
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
public static final int REMOVE_ROLE = 2;
|
||||
|
||||
/**
|
||||
* 更新角色
|
||||
*/
|
||||
public static final int RENEW_ROLE = 3;
|
||||
|
||||
|
||||
public RoleEventMsg(String unitId, String roleCode, Integer operationType){
|
||||
this.unitId = unitId;
|
||||
this.roleCode = roleCode;
|
||||
this.operationType = operationType;
|
||||
}
|
||||
|
||||
public RoleEventMsg(List<String> userIds, String roleCode, Integer operationType){
|
||||
this.userIds = userIds;
|
||||
this.roleCode = roleCode;
|
||||
this.operationType = operationType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.budwk.app.base.event.role;
|
||||
|
||||
import org.nutz.mvc.Mvcs;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:RoleEventPublisher
|
||||
* @Date 2025/9/3 17:14
|
||||
* @注释
|
||||
*/
|
||||
public class RoleEventPublisher {
|
||||
|
||||
public static void broadcast(RoleEventMsg event){
|
||||
String[] names = Mvcs.getIoc().getNamesByType(RoleEventListener.class);
|
||||
for (String name : names) {
|
||||
RoleEventListener listener = Mvcs.getIoc().get(RoleEventListener.class, name);
|
||||
listener.receive(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeType;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class SysUserEvent {
|
||||
|
||||
//变更类型
|
||||
private MemberChangeType memberChangeType;
|
||||
|
||||
//userId
|
||||
private String userId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
public interface SysUserEventListener {
|
||||
|
||||
void onEvent(SysUserEvent event);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
import org.nutz.mvc.Mvcs;
|
||||
|
||||
public class SysUserPublisher {
|
||||
public static void notify(SysUserEvent event){
|
||||
String[] names = Mvcs.getIoc().getNamesByType(SysUserEventListener.class);
|
||||
for (String name : names) {
|
||||
SysUserEventListener listener = Mvcs.getIoc().get(SysUserEventListener.class, name);
|
||||
listener.onEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:UserChangeEventListener
|
||||
* @Date 2025/8/13 14:18
|
||||
* @注释
|
||||
*/
|
||||
public interface UserChangeEventListener {
|
||||
|
||||
void receive(UserChangeMsg message);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:UserChangeMsg
|
||||
* @Date 2025/8/13 11:51
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserChangeMsg {
|
||||
|
||||
/**
|
||||
* 变更资源,用户Id
|
||||
*/
|
||||
private List<String> userIds;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private Integer operationType;
|
||||
|
||||
/**
|
||||
* 变更前的单位Id,当operationType值为1时,该字段有效
|
||||
*/
|
||||
private String sourceUnitId;
|
||||
|
||||
/**
|
||||
* 变更后的单位Id,当operationType值为1时,该字段有效
|
||||
*/
|
||||
private String targetUnitId;
|
||||
|
||||
/**
|
||||
* 单位变动
|
||||
*/
|
||||
public final static int UNIT_CHANGE_OPERATION = 1;
|
||||
|
||||
/**
|
||||
* 退休
|
||||
*/
|
||||
public final static int RETIRE_OPERATION = 2;
|
||||
|
||||
/**
|
||||
* 入会
|
||||
*/
|
||||
public final static int RESTORE_OPERATION = 3;
|
||||
|
||||
|
||||
public UserChangeMsg(List<String> userIds, Integer operationType) {
|
||||
super();
|
||||
this.userIds = userIds;
|
||||
this.operationType = operationType;
|
||||
}
|
||||
|
||||
|
||||
public UserChangeMsg(List<String> userIds, Integer operationType, String sourceUnitId) {
|
||||
super();
|
||||
this.userIds = userIds;
|
||||
this.operationType = operationType;
|
||||
this.sourceUnitId = sourceUnitId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
import com.budwk.app.base.utils.AppIocUtil;
|
||||
import org.nutz.ioc.Ioc;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:UserChangePublisher
|
||||
* @Date 2025/8/13 14:23
|
||||
* @注释
|
||||
*/
|
||||
public class UserChangePublisher {
|
||||
|
||||
// 发送消息给所有订阅者
|
||||
public static void broadcast(UserChangeMsg msg) {
|
||||
Ioc ioc = AppIocUtil.get();
|
||||
|
||||
String[] names = ioc.getNamesByType(UserChangeEventListener.class);
|
||||
for (String listener : names) {
|
||||
UserChangeEventListener listenerBean = ioc.get(UserChangeEventListener.class, listener);
|
||||
listenerBean.receive(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user