This commit is contained in:
2026-04-07 15:31:39 +08:00
parent 5cdfaa6b12
commit 89b914877f
6 changed files with 81 additions and 31 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<groupId>com.budwk</groupId>
<artifactId>zhgh-whcp</artifactId>
<artifactId>zhgh_whcp</artifactId>
<version>5.6.0-plus</version>
<properties>
<nutzboot.version>2.6.0-SNAPSHOT</nutzboot.version>
@@ -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<String, String> 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);
@@ -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<String, String> all = conf.toMap();
// 构造表单参数
Map<String, String> 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();
@@ -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());
+9 -2
View File
@@ -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
@@ -2,6 +2,33 @@
layout("/layouts/platform.html"){
#-->
<style>
.union-tree .el-tree-node__content {
height: auto;
align-items: flex-start;
padding: 4px 0;
}
.union-tree-node-label {
display: inline-flex;
align-items: flex-start;
gap: 8px;
width: 100%;
white-space: normal;
word-break: break-all;
line-height: 1.3;
}
.union-tree-node-label i {
margin-top: 3px;
flex-shrink: 0;
}
.union-tree-node-text {
flex: 1;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
@@ -10,30 +37,32 @@ layout("/layouts/platform.html"){
<el-card shadow="never" style="height: 100%" body-style="{ height: '100%' }">
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
<div style="max-height: calc(100vh - 200px); overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
children: 'children',
label: 'name'
}"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
>
<template slot-scope="{ node, data }">
<span class="el-tree-node__label">
<el-tree
class="union-tree"
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
children: 'children',
label: 'name'
}"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
>
<template slot-scope="{ node, data }">
<span class="union-tree-node-label">
<i class="el-icon-folder-opened" v-if="node.level===1"></i>
<i class="el-icon-folder" v-else></i>
{{node.label}}
<span class="union-tree-node-text">{{node.label}}</span>
</span>
</template>
</el-tree>
</template>
</el-tree>
</div>
</el-card>
</el-col>
<el-col :span="19">
<el-card shadow="never">
<el-tabs v-model="schoolUnionTabActive" type="card" v-if="currentTreeNode==null || currentTreeNode.level===1">