From 89b914877f9d1f91b89bfa202d116e8a82bdbeb9 Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Tue, 7 Apr 2026 15:31:39 +0800 Subject: [PATCH] commit --- pom.xml | 2 +- .../app/base/sms/impl/SmsWhcpServiceImpl.java | 11 +++- .../sms/util/WechatEnterpriseTokenUtil.java | 19 ++++-- .../controller/CondolenceApplyController.java | 4 +- src/main/resources/application-dev.yaml | 11 +++- .../views/platform/sys/union/index.html | 65 ++++++++++++++----- 6 files changed, 81 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index 6db6494..bef51b8 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 jar com.budwk - zhgh-whcp + zhgh_whcp 5.6.0-plus 2.6.0-SNAPSHOT diff --git a/src/main/java/com/budwk/app/base/sms/impl/SmsWhcpServiceImpl.java b/src/main/java/com/budwk/app/base/sms/impl/SmsWhcpServiceImpl.java index fb496ca..70753d8 100644 --- a/src/main/java/com/budwk/app/base/sms/impl/SmsWhcpServiceImpl.java +++ b/src/main/java/com/budwk/app/base/sms/impl/SmsWhcpServiceImpl.java @@ -8,11 +8,14 @@ import com.budwk.app.base.sms.SmsService; import com.budwk.app.web.commons.base.Globals; import com.google.common.net.MediaType; import lombok.extern.slf4j.Slf4j; +import org.nutz.ioc.impl.PropertiesProxy; +import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.json.Json; import org.nutz.lang.Lang; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -26,6 +29,9 @@ import java.util.stream.Collectors; @IocBean public class SmsWhcpServiceImpl implements SmsService { + @Inject + private PropertiesProxy conf; + @Override public void send(String mobile, String content) { this.doSend(mobile, content); @@ -41,6 +47,7 @@ public class SmsWhcpServiceImpl implements SmsService { } private void doSend(String mobile, String content) { + Map all = conf.toMap(); if (!Globals.sso) { log.info("【log】本地开发环境,不允许调用短信消息接口"); return; @@ -54,8 +61,8 @@ public class SmsWhcpServiceImpl implements SmsService { long tKey = System.currentTimeMillis() / 1000; JSONObject json = new JSONObject(); - json.put("username", "whszyxy"); - json.put("password", SecureUtil.md5(SecureUtil.md5("Whszyxy123") + tKey)); + json.put("username", all.get("sms.username")); + json.put("password", SecureUtil.md5(SecureUtil.md5("sms.password") + tKey)); json.put("tKey", tKey + ""); json.put("mobile", mobile); json.put("content", "智慧工会:" + content); diff --git a/src/main/java/com/budwk/app/base/sms/util/WechatEnterpriseTokenUtil.java b/src/main/java/com/budwk/app/base/sms/util/WechatEnterpriseTokenUtil.java index c14a6e6..176708e 100644 --- a/src/main/java/com/budwk/app/base/sms/util/WechatEnterpriseTokenUtil.java +++ b/src/main/java/com/budwk/app/base/sms/util/WechatEnterpriseTokenUtil.java @@ -9,6 +9,7 @@ import cn.hutool.json.JSONUtil; import com.budwk.app.base.constant.RedisConstant; import lombok.extern.slf4j.Slf4j; import org.nutz.integration.jedis.RedisService; +import org.nutz.ioc.impl.PropertiesProxy; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.json.Json; @@ -30,20 +31,26 @@ public class WechatEnterpriseTokenUtil { @Inject private RedisService redisService; + @Inject + private PropertiesProxy conf; + + + private static final String TOKEN_URL = "http://xxzx.whcp.edu.cn/api/v4/oauth/token"; - private static final String CLINT_ID = "gh"; - private static final String CLINT_SECRET = "0a5fb006ee64060799aec6403707eb4d"; - private static final String GRANT_TYPE = "authorization_code"; + private static final String CLINT_ID = "XXXXX"; + private static final String CLINT_SECRET = "XXXXXX"; + private static final String GRANT_TYPE = "XXXXX"; public String getToken() { String key = RedisConstant.REDIS_WECHAT_ENTERPRISE_TOKEN_KEY; String token = redisService.get(key); if (StrUtil.isBlank(token)) { + Map all = conf.toMap(); // 构造表单参数 Map param = new HashMap<>(); - param.put("client_id", CLINT_ID); - param.put("client_secret", CLINT_SECRET); - param.put("grant_type", GRANT_TYPE); + param.put("client_id", all.get("wechat.client_id")); + param.put("client_secret", all.get("wechat.client_secret")); + param.put("grant_type", "authorization_code"); String body = HttpUtil.createGet(TOKEN_URL).formStr(param).execute().body(); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java index 8aedd09..75c49b6 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java @@ -145,14 +145,14 @@ public class CondolenceApplyController { seg.or(View_user::getUsername, "like", "%" + keyword + "%"); cnd.and(seg); } - if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { + /*if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if(AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId()); } else { cnd.and(View_user::getId, "=", SecurityUtil.getUserId()); } - } + }*/ sql.setCondition(cnd); Pagination pagination = condolenceService.listPageMap(1, 50, sql); return Result.success(pagination.getList()); diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index 9369f13..eaf208c 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -5,7 +5,7 @@ nutz: ignore: ^(.+[.])(jsp|png|gif|jpg|js|css|jspx|jpeg|html|mp3|mp4|ico|svg|vue)$ exclusions: /favicon/*,/assets/*,/druid/*,/upload/*,/components/* server: - port: 8080 + port: 80 host: 0.0.0.0 jetty: @@ -71,7 +71,7 @@ redis: #nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378 jdbc: - url: jdbc:mysql://192.168.21.203:3306/zhgh_whcp?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true + url: jdbc:mysql://192.168.21.203:3306/zhgh_whcp_new?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true username: root password: root validationQuery: select 1 @@ -175,3 +175,10 @@ data-center: teacher: https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/get/JZGJCSJZLB unit: https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/get/YXSDWJBSJZLB +sms: + username: xxxxxx + password: xxxxxx +wechat: + client_id: xxxxx + client_secret: xxxxx + diff --git a/src/main/resources/views/platform/sys/union/index.html b/src/main/resources/views/platform/sys/union/index.html index a357cb7..106c759 100644 --- a/src/main/resources/views/platform/sys/union/index.html +++ b/src/main/resources/views/platform/sys/union/index.html @@ -2,6 +2,33 @@ layout("/layouts/platform.html"){ #--> + +