commit
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean
|
||||
public class Test2SysUserEventListener implements SysUserEventListener{
|
||||
|
||||
@Override
|
||||
public void onEvent(SysUserEvent event) {
|
||||
System.out.println("-----------------------------------");
|
||||
System.out.println(event);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.budwk.app.base.event.user;
|
||||
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean
|
||||
public class TestSysUserEventListener implements SysUserEventListener{
|
||||
|
||||
@Override
|
||||
public void onEvent(SysUserEvent event) {
|
||||
System.out.println("-----------------------------------");
|
||||
System.out.println(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 io.v.nutz.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.budwk.app.base.utils;
|
||||
|
||||
import org.nutz.ioc.Ioc;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:AppIocUtil
|
||||
* @Date 2025/8/26 17:40
|
||||
* @注释
|
||||
*/
|
||||
public class AppIocUtil {
|
||||
|
||||
private static Ioc ioc;
|
||||
|
||||
public static void setIoc(Ioc ioc) {
|
||||
AppIocUtil.ioc = ioc;
|
||||
}
|
||||
|
||||
public static Ioc get() {
|
||||
if (ioc == null) {
|
||||
throw new IllegalStateException("Ioc not initialized yet!");
|
||||
}
|
||||
return ioc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -292,7 +292,7 @@ public class SysUnitController {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
nodeList.add(new TreeNode<>(list.get(i).getId(), list.get(i).getParentId(), list.get(i).getName(), i));
|
||||
}
|
||||
List<Tree<String>> treeList = TreeUtil.build(nodeList, StrUtil.blankToDefault(pid, "1"));
|
||||
List<Tree<String>> treeList = TreeUtil.build(nodeList, StrUtil.blankToDefault(pid, "0000"));
|
||||
|
||||
// NutMap menuMap = NutMap.NEW();
|
||||
// for (Sys_unit unit : list) {
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public class MemberChangeApplyController {
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set("origin", "personType");
|
||||
args.set("origin", "person");
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, memberChangeRecord);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("HYBG", memberChangeRecord.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public class MemberBatchMakeController {
|
||||
}
|
||||
|
||||
dao.update(Sys_user.class, Chain.make("member", true)
|
||||
.addSpecial("memberTime", DateUtil.now()),
|
||||
.add("memberTime", DateUtil.now()),
|
||||
Cnd.where("id", "in", userIds));
|
||||
|
||||
// 添加会员角色
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 164 KiB |
@@ -243,6 +243,7 @@ layout("/layouts/v4/baseLayout.html"){
|
||||
|
||||
|
||||
try {
|
||||
debugger
|
||||
const app = JSON.parse(window.sessionStorage.getItem("zhgh_sub_app"))
|
||||
$("#sub-app-container #sidebar-menu .menu-header .menu-title").text(app?.name)
|
||||
} catch (e) {
|
||||
@@ -323,16 +324,53 @@ layout("/layouts/v4/baseLayout.html"){
|
||||
if (res.code === 0) {
|
||||
this.menus = res.data
|
||||
window.sessionStorage.setItem("zhgh_sub_app_menus", JSON.stringify(res.data))
|
||||
this.echoMenus()
|
||||
this.matchUrlToMenu()
|
||||
} else {
|
||||
this.menus = []
|
||||
}
|
||||
this.echoMenus()
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 按 URL 精准激活
|
||||
matchUrlToMenu() {
|
||||
// 跳转带过来的地址
|
||||
const pathname = window.location.pathname
|
||||
const find = (list, parentIds = []) => {
|
||||
for (const m of list) {
|
||||
if (m.href && pathname.includes(m.href.split('?')[0])) {
|
||||
return { menu: m, parentIds }
|
||||
}
|
||||
if (m.children?.length) {
|
||||
const hit = find(m.children, [...parentIds, m.id])
|
||||
if (hit) return hit
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
const hit = find(this.menus)
|
||||
if (hit) {
|
||||
// 激活跳转菜单
|
||||
this.activeMenuIndex = hit.menu.id
|
||||
this.openedMenus = hit.parentIds
|
||||
const app = JSON.parse(window.sessionStorage.getItem("zhgh_sub_app"))
|
||||
$("#sub-app-container #sidebar-menu .menu-header .menu-title").text(app?.name)
|
||||
this.$nextTick(() => {
|
||||
this.menuSelect(hit.menu.id, hit.parentIds)
|
||||
// 保证内容区对应
|
||||
commonUtil.pjaxPush(hit.menu.href)
|
||||
})
|
||||
} else if (!this.activeMenuIndex) {
|
||||
// 没命中且缓存也没有 → 再降级到第一个
|
||||
this.defaultSelect()
|
||||
}
|
||||
},
|
||||
|
||||
// 设置应用信息
|
||||
setAppInfo(app) {
|
||||
if (app) {
|
||||
debugger
|
||||
// 储存到缓存
|
||||
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(app))
|
||||
// 储存到div中
|
||||
|
||||
@@ -326,7 +326,7 @@ layout("/layouts/v4/baseLayout.html"){
|
||||
|
||||
<div class="apps-wrapper" id="app">
|
||||
<div class="apps-hero">
|
||||
<img src="https://i.cug.edu.cn/data/sys-attach/download/1i8hmpaq7wmewu9c7w3pt9qhu3gb8bkcvow0" alt="应用中心" />
|
||||
<img src="/assets/platform/img/v4/yyzx.png" alt="应用中心" />
|
||||
</div>
|
||||
|
||||
<div class="apps-container">
|
||||
|
||||
@@ -322,7 +322,7 @@ layout("/layouts/v4/baseLayout.html"){
|
||||
|
||||
<div class="apps-wrapper" id="app">
|
||||
<div class="apps-hero">
|
||||
<img src="https://i.cug.edu.cn/data/sys-attach/download/1i8hmpaqdwmvwajjvw2c8isi61jj0gkmosw0" alt="应用中心"/>
|
||||
<img src="/assets/platform/img/v4/lczx.png" alt="流程中心"/>
|
||||
</div>
|
||||
|
||||
<div class="apps-container">
|
||||
|
||||
@@ -13,11 +13,11 @@ layout("/layouts/platform.html"){
|
||||
ref="treeRef"
|
||||
:expand-on-click-node="false"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}"
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}"
|
||||
node-key="id"
|
||||
:default-expanded-keys="['1']"
|
||||
default-expand-all
|
||||
@node-click="treeNodeClick"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
|
||||
@@ -27,14 +27,14 @@ layout("/layouts/platform.html"){
|
||||
<dict-select v-model="pageForm.userState" placeholder="在职状态" @change="doSearch"
|
||||
code="USER_STATE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="教职工类别">
|
||||
<dict-select v-model="pageForm.personType" placeholder="教职工类别" @change="doSearch"
|
||||
code="USER_PERSON_TYPE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="编制类别">
|
||||
<dict-select v-model="pageForm.preparedBy" placeholder="编制类别" @change="doSearch"
|
||||
code="USER_PREPARED_BY_TYPE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="教职工类别">
|
||||
<dict-select v-model="pageForm.personType" placeholder="教职工类别" @change="doSearch"
|
||||
code="USER_PERSON_TYPE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="变更类型">
|
||||
<dict-select v-model="pageForm.changeType" placeholder="变更类型" @change="doSearch"
|
||||
code="MEMBER_CHANGE_TYPE"></dict-select>
|
||||
@@ -155,8 +155,8 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "sex", label: "性别", sortable: true, width: "100px" },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||
{ prop: "changeTypes", label: "变更类型", sortable: true },
|
||||
|
||||
Reference in New Issue
Block a user