Browse Source

Merge remote-tracking branch 'origin/dev' into dev

phoenix 1 year ago
parent
commit
4280fe8e54

+ 1 - 1
Makefile

@@ -2,7 +2,7 @@ merge:
 	git checkout master;git merge dev;git push;git checkout dev;
 
 create-tag:
-	git checkout master;git tag v1.1.9;git push origin --tags;git checkout dev;
+	git checkout master;git tag v1.2.0;git push origin --tags;git checkout dev;
 
 remove-tag:
 	git tag -d v1.1.8;git push origin :refs/tags/v1.1.8;

+ 1 - 1
src/main/java/com/xjrsoft/common/xss/XssHttpServletRequestWrapper.java

@@ -29,7 +29,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
      */
     HttpServletRequest orgRequest;
 
-    private final List<String> ignoreXssUrl = ListUtil.toList("/magic-api/**");
+    private final List<String> ignoreXssUrl = ListUtil.toList("/magic-api/**","/magic/web/**");
     //html过滤
     private final static HTMLFilter HTML_FILTER = new HTMLFilter();
 

+ 5 - 0
src/main/java/com/xjrsoft/config/CommonPropertiesConfig.java

@@ -31,6 +31,11 @@ public class CommonPropertiesConfig {
      */
     private String domainWeb;
 
+    /**
+     * app域名地址
+     */
+    private String domainApp;
+
     private List<String> excludeUrls;
 
     private List<String> whiteList;

+ 3 - 2
src/main/java/com/xjrsoft/config/MybatisPlusConfig.java

@@ -135,7 +135,7 @@ public class MybatisPlusConfig {
                     }
                     druidConfig.setTestWhileIdle(true);
                     druidConfig.setTestOnReturn(false);
-                    druidConfig.setTestOnBorrow(false);
+                    druidConfig.setTestOnBorrow(true);
                     druidConfig.setFilters("stat,slf4j"); // #   配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
                     druidConfig.setUseGlobalDataSourceStat(true);
                     Properties properties = new Properties();
@@ -159,9 +159,10 @@ public class MybatisPlusConfig {
                     druidConfig.setMaxActive(100);// 最大连接池
                     druidConfig.setMinIdle(10);// 最小连接池
                     druidConfig.setMaxWait(60000); //最大等待超时时间
+                    druidConfig.setValidationQueryTimeout(10);//是检测连接是否有效的超时时间,单位:秒
                     druidConfig.setPoolPreparedStatements(false); // 是否缓存preparedStatement,也就是PSCache  官方建议MySQL下建议关闭   个人建议如果想用SQL防火墙 建议打开
                     druidConfig.setMaxPoolPreparedStatementPerConnectionSize(20);//是否缓存preparedStatement,也就是PSCache  官方建议MySQL下建议关闭   个人建议如果想用SQL防火墙 建议打开
-                    druidConfig.setTimeBetweenEvictionRunsMillis(60000L);// 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                    druidConfig.setTimeBetweenEvictionRunsMillis(2000L);// 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
                     druidConfig.setMinEvictableIdleTimeMillis(300000L); //  配置一个连接在池中最小生存的时间,单位是毫秒
                     if (dataSourceProperty.getUrl().contains("oracle")) {
                         druidConfig.setValidationQuery("SELECT 1 FROM DUAL"); //测试链接 如果是oracle 语句不一样

+ 4 - 1
src/main/java/com/xjrsoft/module/oa/utils/SendMessageUtil.java

@@ -13,6 +13,7 @@ import com.xjrsoft.common.sms.SmsSender;
 import com.xjrsoft.common.utils.LocalDateTimeUtil;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.WeChatUtil;
+import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.oa.entity.Message;
 import com.xjrsoft.module.oa.service.IMessageService;
 import com.xjrsoft.module.organization.entity.User;
@@ -71,6 +72,8 @@ public class SendMessageUtil {
 
         WeChatUtil weChatUtil = SpringUtil.getBean(WeChatUtil.class);
 
+        CommonPropertiesConfig cpConfig = SpringUtil.getBean(CommonPropertiesConfig.class);
+
         //获取用户相关信息
         List<User> userList = redisUtil.get(GlobalConstant.USER_CACHE_KEY, new TypeReference<List<User>>() {
         });
@@ -112,7 +115,7 @@ public class SendMessageUtil {
                 object.put("template_id", "sHsmz7LRj7HLd7GSTS3r2jCLvK-4Wp19iGzEvYK8n_I");
                 object.put("miniprogram", new JSONObject() {{
                     put("appid", weChatUtil.getAppletAppKey());
-                    put("pagepath", StrUtil.format("/xjrsoft/pages/workflow/approval?taskId={}&processId={}&type=todo", param.getTaskId(), param.getProcessId()));
+                    put("pagepath", StrUtil.format("{}/xjrsoft/pages/workflow/approval?taskId={}&processId={}&type=todo",cpConfig.getDomainApp(), param.getTaskId(), param.getProcessId()));
                 }});
                 object.put("client_msg_id", param.getTaskId());
                 object.put("data", data);

+ 30 - 3
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -386,16 +386,16 @@ public class UserController {
         return RT.ok(userService.resetPassword(dto));
     }
 
-    @PostMapping("/bind-openid")
+    @PostMapping("/bind-unionid")
     @ApiOperation(value = "绑定微信 UnionId")
-    public  R bindOpenid(@RequestBody BindOpenidDto dto) {
+    public  R bindUnionId(@RequestBody BindOpenidDto dto) {
         User user = userService.getOne(Wrappers.<User>query().lambda().select(User::getId, User::getOpenId,User::getUnionId).eq(User::getId, dto.getId()), false);
         if (user != null) {
             if (StrUtil.isNotBlank(user.getUnionId())) {
                 return R.error("该用户已经绑定微信!");
             }
 
-            long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
+            long count = userService.count(Wrappers.<User>query().lambda().eq(User::getUnionId, dto.getOpenid()));
             if(count > 0){
                 return R.error("该用户已经绑定微信!");
             }
@@ -414,6 +414,33 @@ public class UserController {
         return R.error("该用户不存在!");
     }
 
+    @PostMapping("/bind-openid")
+    @ApiOperation(value = "绑定微信 Openid")
+    public  R bindOpenid(@RequestBody BindOpenidDto dto) {
+        User user = userService.getOne(Wrappers.<User>query().lambda().select(User::getId, User::getOpenId,User::getUnionId).eq(User::getId, dto.getId()), false);
+        if (user != null) {
+            if (StrUtil.isNotBlank(user.getOpenId())) {
+                return R.error("该用户已经绑定微信!");
+            }
+
+            long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
+            if(count > 0){
+                return R.error("该用户已经绑定微信!");
+            }
+
+            User updateUser = new User();
+            updateUser.setId(dto.getId());
+            updateUser.setOpenId(dto.getOpenid());
+            return R.ok(userService.updateById(updateUser));
+        }else{
+            long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
+            if(count > 0){
+                return R.error("该用户已经绑定微信!");
+            }
+        }
+        return R.error("该用户不存在!");
+    }
+
     @GetMapping("/unbind-openid")
     @ApiOperation(value = "取消绑定微信 UnionId")
     public  R unbindOpenid(@RequestParam Long id) {

+ 1 - 1
src/main/java/com/xjrsoft/module/system/service/impl/DatabaselinkServiceImpl.java

@@ -280,7 +280,7 @@ public class DatabaselinkServiceImpl extends ServiceImpl<DatabaselinkMapper, Dat
         }
         druidConfig.setTestWhileIdle(true);
         druidConfig.setTestOnReturn(false);
-        druidConfig.setTestOnBorrow(false);
+        druidConfig.setTestOnBorrow(true);
         druidConfig.setFilters("stat,slf4j"); // #   配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
         druidConfig.setUseGlobalDataSourceStat(true);
         Properties properties =new Properties();

+ 3 - 0
src/main/resources/application-dev.yml

@@ -14,6 +14,8 @@ spring:
           password: Zwr~-f6H,u6QE^]C-AD_
 
 
+
+
   redis:
     database: 11
     host: 10.150.10.139
@@ -62,6 +64,7 @@ xjrsoft:
     druid-password: admin # druid 监控密码
     default-password: "cqtlzjzx2023" #默认密码(用户重置密码后为该密码)
     domain-api: http://10.150.10.139:8888/api #api域名地址
+    domain-app: http://10.150.10.139:8003/# #app域名地址
     domain-web: http://10.150.10.139:8888 #web域名地址
 #    domain-api: http://127.0.0.1:9000/api #api域名地址
 #    domain-web: http://127.0.0.1:9000 #web域名地址

+ 1 - 0
src/main/resources/application-prod.yml

@@ -62,6 +62,7 @@ xjrsoft:
     druid-password: admin # druid 监控密码
     default-password: "cqtlzjzx2023" #默认密码(用户重置密码后为该密码)
     domain-api: https://zhxy.cqtlzjzx.com/api #api域名地址
+    domain-app: https://zhxy.cqtlzjzx.com/app/# #app域名地址
     domain-web: https://zhxy.cqtlzjzx.com #web域名地址
     white-list:
       - 192.168.0.139

+ 39 - 0
src/main/resources/sqlScript/20231211_sql.sql

@@ -0,0 +1,39 @@
+-- ----------------------------
+-- 班主任事项请假
+-- ----------------------------
+DROP TABLE IF EXISTS wf_head_teacher_leave;
+CREATE TABLE wf_head_teacher_leave
+(
+    id BIGINT NOT NULL COMMENT '主键编号',
+    `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',
+    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id` BIGINT NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark` INT NOT NULL COMMENT '删除标记',
+    `enabled_mark` INT NOT NULL COMMENT '有效标志',
+    `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
+    `applicant_user_id` bigint NULL DEFAULT NULL COMMENT '申请人',
+    `leave_reason`varchar(20) NULL DEFAULT NULL COMMENT '请假原因(xjr_dictionary_item[leave_reason])',
+    `start_time` date NULL DEFAULT NULL COMMENT '开始时间',
+    `end_time` date NULL DEFAULT NULL COMMENT '结束时间',
+    `is_substitute` INT NOT NULL default 0 COMMENT '是否有替班教师(1:是 0:否)',
+    `substitute_user_id` bigint NULL DEFAULT NULL COMMENT '替换教师',
+    `remark` varchar(1000) COMMENT '备注',
+    `status` int not null default 0 COMMENT '状态(1:结束 0:未结束)',
+    PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '班主任事项请假';
+
+DROP TABLE IF EXISTS `wf_mealrequest`;
+CREATE TABLE `wf_mealrequest` (
+      `id` bigint NOT NULL,
+      `user_id` longtext COMMENT '申请人',
+      `declaration_department` varchar(500) DEFAULT NULL COMMENT '申报部门',
+      `reception_date` datetime DEFAULT NULL COMMENT '接待日期',
+      `meal_category` varchar(500) DEFAULT NULL COMMENT '用餐类别',
+      `number_of_visitors` double DEFAULT NULL COMMENT '来访人数',
+      `dining_location` varchar(500) DEFAULT NULL COMMENT '用餐地点',
+      `official_letter` varchar(500) DEFAULT NULL COMMENT '公函',
+      `meal_reasons` varchar(500) DEFAULT NULL COMMENT '用餐事由',
+      `file` longtext COMMENT '附件',
+      PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='公务接待审批';