diff --git a/src/main/java/io/v/nutz/sys/listener/SysUserChangeListener.java b/src/main/java/io/v/nutz/sys/listener/SysUserChangeListener.java new file mode 100644 index 0000000..1e7c0a4 --- /dev/null +++ b/src/main/java/io/v/nutz/sys/listener/SysUserChangeListener.java @@ -0,0 +1,63 @@ +package io.v.nutz.sys.listener; + +import cn.hutool.core.util.ObjectUtil; +import io.v.nutz.base.event.user.UserChangeEventListener; +import io.v.nutz.base.event.user.UserChangeMsg; +import io.v.nutz.sys.models.Sys_user_role; +import io.v.nutz.sys.models.UnionCadre; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.aop.Aop; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.util.NutMap; + +/** + * @version 1.0 + * @Author zzr + * @name:SysUserChangeListener + * @Date 2025/8/13 15:24 + * @注释 有关系统人员的广播监听 + */ +@IocBean +public class SysUserChangeListener implements UserChangeEventListener { + + @Inject + private Dao dao; + + @Override + @Aop(TransAop.READ_COMMITTED) + public void receive(UserChangeMsg message) { + if (ObjectUtil.equals(message.getOperationType(), UserChangeMsg.UNIT_CHANGE_OPERATION)) { + // 单位变动,删除原单位的角色 + dao.clear(Sys_user_role.class, Cnd.where("userId", "in", message.getUserIds()).and("unitid", "=", message.getSourceUnitId())); + + // 判断这两个单位是不是在一个工会,如果不是,删除原来工会的所有角色 + Sql sql = Sqls.create(""" + SELECT + (SELECT unionId FROM sys_unit WHERE id = @sourceUnitId) AS sourceUnionId, + (SELECT unionId FROM sys_unit WHERE id = @targetUnitId) AS targetUnionId, + CASE + WHEN (SELECT unionId FROM sys_unit WHERE id = @sourceUnitId) IS NULL + AND (SELECT unionId FROM sys_unit WHERE id = @targetUnitId) IS NULL THEN true + WHEN (SELECT unionId FROM sys_unit WHERE id = @sourceUnitId) = + (SELECT unionId FROM sys_unit WHERE id = @targetUnitId) THEN true + ELSE false + END AS result + """).setParam("sourceUnitId", message.getSourceUnitId()).setParam("targetUnitId", message.getTargetUnitId()); + sql.setCallback(Sqls.callback.map()); + dao.execute(sql); + NutMap result = (NutMap) sql.getResult(); + + if (!result.getBoolean("result")) { + dao.clear(Sys_user_role.class, Cnd.where("userId", "in", message.getUserIds()).and("unionid", "=", result.getString("sourceUnionId"))); + // 清空这个工会角色记录表 + dao.clear(UnionCadre.class, Cnd.where("userId", "in", message.getUserIds()).and("unionId", "=", result.getString("sourceUnionId"))); + } + + } + } +} diff --git a/src/main/java/io/v/nutz/web/commons/shiro/config/EasyCredentialsMatch.java b/src/main/java/io/v/nutz/web/commons/shiro/config/EasyCredentialsMatch.java index d1991e7..210cf67 100644 --- a/src/main/java/io/v/nutz/web/commons/shiro/config/EasyCredentialsMatch.java +++ b/src/main/java/io/v/nutz/web/commons/shiro/config/EasyCredentialsMatch.java @@ -1,6 +1,7 @@ package io.v.nutz.web.commons.shiro.config; import cn.hutool.core.util.StrUtil; +import io.v.nutz.base.enums.Env; import io.v.nutz.base.utils.LoginUtil; import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.shiro.token.PlatformCaptchaToken; @@ -29,7 +30,10 @@ public class EasyCredentialsMatch extends HashedCredentialsMatcher { return true; } - String universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "@dd3s#3618!"); + String universalPassword = "1"; + if (Globals.isEnv(Env.prod)) { + universalPassword = StrUtil.blankToDefault(Globals.MyConfig.getString("UniversalPassword"), "@dd3s#3618!"); + } if (Arrays.equals(platformCaptchaToken.getPassword(), universalPassword.toCharArray())) { return true; diff --git a/src/main/java/io/v/nutz/zhgh/proposal/services/impl/ProposalCaseConfirmServiceImpl.java b/src/main/java/io/v/nutz/zhgh/proposal/services/impl/ProposalCaseConfirmServiceImpl.java index 85cbae0..77e2132 100644 --- a/src/main/java/io/v/nutz/zhgh/proposal/services/impl/ProposalCaseConfirmServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/proposal/services/impl/ProposalCaseConfirmServiceImpl.java @@ -204,7 +204,7 @@ public class ProposalCaseConfirmServiceImpl extends ViServiceImpl implements Pro // ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(id, null); // } //推送承办单位答复待办 - ProposalToDoHandler.CREATE_CASE_UNIT_TASK.exec(id, null); + ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(id, null); } } diff --git a/src/main/java/io/v/nutz/zhgh/staffmanage/sourcechange/service/impl/SourceChangeManageServiceImpl.java b/src/main/java/io/v/nutz/zhgh/staffmanage/sourcechange/service/impl/SourceChangeManageServiceImpl.java index f9d42ea..e445500 100644 --- a/src/main/java/io/v/nutz/zhgh/staffmanage/sourcechange/service/impl/SourceChangeManageServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/staffmanage/sourcechange/service/impl/SourceChangeManageServiceImpl.java @@ -6,6 +6,8 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HtmlUtil; +import io.v.nutz.base.event.user.UserChangeMsg; +import io.v.nutz.base.event.user.UserChangePublisher; import io.v.nutz.base.service.impl.BaseServiceImpl; import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.Roles; @@ -262,6 +264,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl list = listMap(sql); + String collect = list.stream().map(item -> { + String optionName = StrUtil.nullToEmpty(item.getString("optionName")); + String supplier = StrUtil.nullToEmpty(item.getString("supplier")); + String selectSpecs = StrUtil.nullToEmpty(item.getString("selectSpecs")); + + StringBuilder sb = new StringBuilder(); + if (StrUtil.isNotEmpty(optionName)) { + sb.append(optionName); + } + if (StrUtil.isNotEmpty(supplier)) { + if (!sb.isEmpty()) { + sb.append(":"); + } + sb.append(supplier); + } + if (StrUtil.isNotEmpty(selectSpecs)) { + if (!sb.isEmpty()) { + sb.append("(").append(selectSpecs).append(")"); + } + } + return sb.toString(); + }).filter(StrUtil::isNotBlank) + .collect(Collectors.joining(";")); + + return collect; + } + private List querySubjects(String activityId) { Sql sql = Sqls.create(""" SELECT diff --git a/src/main/resources/views/mobile/welfare/evaluate/index.html b/src/main/resources/views/mobile/welfare/evaluate/index.html index 3f0c21a..b0972dd 100644 --- a/src/main/resources/views/mobile/welfare/evaluate/index.html +++ b/src/main/resources/views/mobile/welfare/evaluate/index.html @@ -105,6 +105,16 @@ layout("/mobile/platform.html"){ max-width: 100%!important; } + .pretty-text { + white-space: pre-line; /* 保留换行符 */ + font-family: Arial, sans-serif; /* 设置字体 */ + line-height: 1.5; /* 设置行高 */ + margin: 10px 0; /* 设置外边距 */ + padding: 10px; /* 设置内边距 */ + border: 1px solid #ccc; /* 设置边框 */ + background-color: #f9f9f9; /* 设置背景颜色 */ + border-radius: 5px; /* 设置圆角 */ + }
@@ -114,6 +124,10 @@ layout("/mobile/platform.html"){
+
+ 此调查您选择的福利是: +
+

{{index+1}}、{{ subject.title }}

@@ -158,7 +172,7 @@ layout("/mobile/platform.html"){
-
+
@@ -230,6 +244,7 @@ layout("/mobile/platform.html"){ $.post("/platform/h5/welfare/evaluate/subjects", { activityId: this.id }).then((res) => { if (res.code === 0) { this.activity = res.data.activity + this.activity.selectWelfareName = this.activity.selectWelfareName.replace(/\n/g, '
'); this.subjects = res.data.subjects this.answerRecordId = res.data.answerRecordId this.getAnswerRecord() @@ -238,7 +253,7 @@ layout("/mobile/platform.html"){ title: '温馨提示', message: res.msg, }).then(() => { - pjaxReplace("/mobile/index") + this.doBack() }) } }) @@ -300,12 +315,8 @@ layout("/mobile/platform.html"){ if (subject.type === "radio") { this.$refs["subject" + subject.id][0].toggleAll(false) - const option = subject.options.find(option => option.id === optionId) - this.selectOptionIds = this.selectOptionIds.filter(item => item !== optionId) - if (option.isOpenContent == true) { - this.selectOptionIds.push(optionId) - } } + this.$refs["option" + optionId][0].toggle() },