广播订阅
This commit is contained in:
+1
-3
@@ -1,6 +1,4 @@
|
||||
package io.v.nutz.base.event.user;
|
||||
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
package io.v.nutz.base.event.common;
|
||||
|
||||
public interface SysCommonDataChange {
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
package io.v.nutz.base.event.user;
|
||||
package io.v.nutz.base.event.common;
|
||||
|
||||
import io.v.nutz.base.event.user.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
import org.nutz.mvc.Mvcs;
|
||||
|
||||
/**
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package io.v.nutz.base.event.user;
|
||||
package io.v.nutz.base.event.common;
|
||||
|
||||
/**
|
||||
* 数据变更类型
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.v.nutz.base.event.user;
|
||||
|
||||
import org.nutz.mvc.Mvcs;
|
||||
import io.v.nutz.base.utils.AppIocUtil;
|
||||
import org.nutz.ioc.Ioc;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
@@ -13,9 +14,11 @@ public class UserChangePublisher {
|
||||
|
||||
// 发送消息给所有订阅者
|
||||
public static void broadcast(UserChangeMsg msg) {
|
||||
String[] names = Mvcs.getIoc().getNamesByType(UserChangeEventListener.class);
|
||||
Ioc ioc = AppIocUtil.get();
|
||||
|
||||
String[] names = ioc.getNamesByType(UserChangeEventListener.class);
|
||||
for (String listener : names) {
|
||||
UserChangeEventListener listenerBean = Mvcs.getIoc().get(UserChangeEventListener.class, listener);
|
||||
UserChangeEventListener listenerBean = ioc.get(UserChangeEventListener.class, listener);
|
||||
listenerBean.receive(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package io.v.nutz.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,8 +6,8 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeCenter;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeCenter;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.event.user.UserChangeMsg;
|
||||
import io.v.nutz.base.event.user.UserChangePublisher;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
|
||||
@@ -2,8 +2,8 @@ package io.v.nutz.sys.controllers.platform.sys;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeCenter;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeCenter;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package io.v.nutz.zhgh.activity.listener;
|
||||
|
||||
import io.v.nutz.base.event.user.UserChangeEventListener;
|
||||
import io.v.nutz.base.event.user.UserChangeMsg;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:ActivityCommonListener
|
||||
* @Date 2025/8/13 14:41
|
||||
* @注释 活动的广播监听
|
||||
*/
|
||||
@IocBean
|
||||
public class ActivityUserChangeListener implements UserChangeEventListener {
|
||||
|
||||
@Override
|
||||
public void receive(UserChangeMsg message) {
|
||||
System.out.println("=======================================================接收到消息=======================================================");
|
||||
System.out.println(message);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package io.v.nutz.zhgh.activity.listener;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeType;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityBasicUnion;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.v.nutz.zhgh.activity.listener;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeType;
|
||||
import io.v.nutz.sys.models.Sys_unit;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityBasicUnit;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.v.nutz.zhgh.proposal.listener;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.user.SysCommonDataChangeType;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChange;
|
||||
import io.v.nutz.base.event.common.SysCommonDataChangeType;
|
||||
import io.v.nutz.sys.models.Sys_unit;
|
||||
import io.v.nutz.zhgh.proposal.models.ProposalUndertake;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ public class WelfareEvaluateActivityController {
|
||||
|
||||
System.out.println(loginNames);
|
||||
|
||||
String link = Globals.AppDomain + "/platform/h5/welfare/evaluate?activityId=%s&type=welfare".formatted(activityId);
|
||||
String link = Globals.AppDomain + "/platform/h5/welfare/evaluate?id=%s&type=welfare".formatted(activityId);
|
||||
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, title, sendMsgValue, "", link);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
|
||||
+15
-3
@@ -33,6 +33,7 @@ import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
@@ -68,7 +69,13 @@ public class WelfareEvaluateStatisticsController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.evaluate.statistics")
|
||||
public Object pageData(PageForm pageForm, String projectId, String unionId, String unitId, String personType, String userState, String optionId) {
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "optionId", required = false) String optionId) {
|
||||
WelfareEvaluateActivity evaluate = dao.fetch(WelfareEvaluateActivity.class, Cnd.where("welfareId", "=", projectId));
|
||||
if (Lang.isEmpty(evaluate)) {
|
||||
return Result.error("未找到相应福利");
|
||||
@@ -201,8 +208,13 @@ public class WelfareEvaluateStatisticsController {
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("welfare.evaluate.statistics")
|
||||
public void exportXlsx(PageForm pageForm, String projectId, String unionId, String unitId,
|
||||
String personType, String userState, String optionId,
|
||||
public void exportXlsx(PageForm pageForm,
|
||||
@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "optionId", required = false) String optionId,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
WelfareEvaluateActivity evaluate = dao.fetch(WelfareEvaluateActivity.class, Cnd.where("welfareId", "=", projectId));
|
||||
|
||||
@@ -83,7 +83,7 @@ layout("/layouts/platform.html"){
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180px">
|
||||
<el-table-column fixed="right" label="操作" width="180px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openChangeInfo(row, true)" size="mini" type="primary">查看</el-button>
|
||||
<!-- <el-button v-if="row.isOperate" @click="doRevoke(row)" size="mini" type="warning">撤销</el-button>-->
|
||||
@@ -123,9 +123,9 @@ layout("/layouts/platform.html"){
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true, width: "100px" },
|
||||
{ prop: "personType", label: "人员类型", sortable: true, width: "120px" },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true, width: "160px" },
|
||||
{ prop: "changeInfosStr", label: "变更详细信息", sortable: true, width: "300px" },
|
||||
{ prop: "changeTypes", label: "变更类型", sortable: true, width: "180px" },
|
||||
{ prop: "changeTime", label: "变更时间", sortable: true, width: "150px" },
|
||||
|
||||
@@ -444,6 +444,10 @@ const USER_CHANGE_INFO = {
|
||||
this.formData = resp.data.middleTable
|
||||
this.viewData = resp.data.userData
|
||||
this.formData.unionid = resp.data.userData.unionid
|
||||
if (["事业编制(员额)", "事业编制"].includes(this.formData.personType) && ["在职"].includes(this.formData.userState)) {
|
||||
this.$set(this.formData, "member", 1)
|
||||
this.$set(this.formData, "welfareMember", 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user