Commit abb3b86f76e35e63935bb3bbac1c81f8abdfb1bf
1 parent
9bf5e48a
refactor(maintainplan): 优化道路维护计划查询SQL
- 移除不必要的字段查询包括批次号、计划号、完成状态等 - 将排序逻辑替换为按道路ID、道路名称、级别ID分组 - 简化查询结果结构提升查询性能
Showing
9 changed files
with
278 additions
and
93 deletions
urbanops-module-system/pom.xml
| @@ -118,6 +118,12 @@ | @@ -118,6 +118,12 @@ | ||
| 118 | <groupId>org.dromara.hutool</groupId> | 118 | <groupId>org.dromara.hutool</groupId> |
| 119 | <artifactId>hutool-extra</artifactId> <!-- 邮件 --> | 119 | <artifactId>hutool-extra</artifactId> <!-- 邮件 --> |
| 120 | </dependency> | 120 | </dependency> |
| 121 | + <dependency> | ||
| 122 | + <groupId>com.belerweb</groupId> | ||
| 123 | + <artifactId>pinyin4j</artifactId> | ||
| 124 | + <version>2.5.1</version> <!-- 稳定版本 --> | ||
| 125 | + </dependency> | ||
| 126 | + | ||
| 121 | 127 | ||
| 122 | </dependencies> | 128 | </dependencies> |
| 123 | 129 |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/auth/vo/AuthLoginReqVO.java
| @@ -24,7 +24,7 @@ public class AuthLoginReqVO extends CaptchaVerificationReqVO { | @@ -24,7 +24,7 @@ public class AuthLoginReqVO extends CaptchaVerificationReqVO { | ||
| 24 | @Schema(description = "账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "urbanopsyuanma") | 24 | @Schema(description = "账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "urbanopsyuanma") |
| 25 | @NotEmpty(message = "登录账号不能为空") | 25 | @NotEmpty(message = "登录账号不能为空") |
| 26 | @Length(min = 4, max = 16, message = "账号长度为 4-16 位") | 26 | @Length(min = 4, max = 16, message = "账号长度为 4-16 位") |
| 27 | -// @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母") | 27 | + @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母") |
| 28 | private String username; | 28 | private String username; |
| 29 | 29 | ||
| 30 | @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "buzhidao") | 30 | @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "buzhidao") |
| @@ -54,4 +54,4 @@ public class AuthLoginReqVO extends CaptchaVerificationReqVO { | @@ -54,4 +54,4 @@ public class AuthLoginReqVO extends CaptchaVerificationReqVO { | ||
| 54 | return socialType == null || StrUtil.isNotEmpty(socialState); | 54 | return socialType == null || StrUtil.isNotEmpty(socialState); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | -} | ||
| 58 | \ No newline at end of file | 57 | \ No newline at end of file |
| 58 | +} |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/user/UserController.java
| @@ -200,4 +200,12 @@ public class UserController { | @@ -200,4 +200,12 @@ public class UserController { | ||
| 200 | return success(userService.getLoginBusiLine()); | 200 | return success(userService.getLoginBusiLine()); |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | + @PostMapping("/convert-username-to-pinyin") | ||
| 204 | + @Operation(summary = "批量转换中文用户名为拼音") | ||
| 205 | + @PreAuthorize("@ss.hasPermission('system:user:convert-username')") | ||
| 206 | + public CommonResult<Boolean> convertChineseUsernameToPinyin() { | ||
| 207 | + userService.updateChineseUsernameToPinyin(); | ||
| 208 | + return success(true); | ||
| 209 | + } | ||
| 210 | + | ||
| 203 | } | 211 | } |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/dal/mysql/user/AdminUserMapper.java
| @@ -16,7 +16,7 @@ import java.util.List; | @@ -16,7 +16,7 @@ import java.util.List; | ||
| 16 | public interface AdminUserMapper extends BaseMapperX<AdminUserDO> { | 16 | public interface AdminUserMapper extends BaseMapperX<AdminUserDO> { |
| 17 | 17 | ||
| 18 | default AdminUserDO selectByUsername(String username) { | 18 | default AdminUserDO selectByUsername(String username) { |
| 19 | - return selectOne(new LambdaQueryWrapperX<AdminUserDO>().eq(AdminUserDO::getUsername, username).or().eq(AdminUserDO::getMobile, username)); | 19 | + return selectOne(AdminUserDO::getUsername, username); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | default AdminUserDO selectByEmail(String email) { | 22 | default AdminUserDO selectByEmail(String email) { |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/auth/AdminAuthServiceImpl.java
| @@ -82,8 +82,11 @@ public class AdminAuthServiceImpl implements AdminAuthService { | @@ -82,8 +82,11 @@ public class AdminAuthServiceImpl implements AdminAuthService { | ||
| 82 | // 校验账号是否存在 | 82 | // 校验账号是否存在 |
| 83 | AdminUserDO user = userService.getUserByUsername(username); | 83 | AdminUserDO user = userService.getUserByUsername(username); |
| 84 | if (user == null) { | 84 | if (user == null) { |
| 85 | - createLoginLog(null, username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); | ||
| 86 | - throw exception(AUTH_LOGIN_BAD_CREDENTIALS); | 85 | + user = userService.getUserByMobile(username); |
| 86 | + if (user == null){ | ||
| 87 | + createLoginLog(null, username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); | ||
| 88 | + throw exception(AUTH_LOGIN_BAD_CREDENTIALS); | ||
| 89 | + } | ||
| 87 | } | 90 | } |
| 88 | if (!userService.isPasswordMatch(password, user.getPassword())) { | 91 | if (!userService.isPasswordMatch(password, user.getPassword())) { |
| 89 | createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); | 92 | createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/user/AdminUserService.java
| @@ -217,4 +217,15 @@ public interface AdminUserService { | @@ -217,4 +217,15 @@ public interface AdminUserService { | ||
| 217 | */ | 217 | */ |
| 218 | List<DictDataRespVO> getLoginBusiLine(); | 218 | List<DictDataRespVO> getLoginBusiLine(); |
| 219 | 219 | ||
| 220 | + /** | ||
| 221 | + * 获取所有用户列表 | ||
| 222 | + * @return 用户列表 | ||
| 223 | + */ | ||
| 224 | + List<AdminUserDO> getAllUserList(); | ||
| 225 | + | ||
| 226 | + /** | ||
| 227 | + * 将中文用户名转换为拼音 | ||
| 228 | + */ | ||
| 229 | + void updateChineseUsernameToPinyin(); | ||
| 230 | + | ||
| 220 | } | 231 | } |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/user/AdminUserServiceImpl.java
| @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.collection.CollectionUtil; | 4 | import cn.hutool.core.collection.CollectionUtil; |
| 5 | import cn.hutool.core.util.ObjUtil; | 5 | import cn.hutool.core.util.ObjUtil; |
| 6 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| 7 | +import cn.hutool.extra.pinyin.PinyinUtil; | ||
| 7 | import com.zteits.urbanops.framework.common.enums.CommonStatusEnum; | 8 | import com.zteits.urbanops.framework.common.enums.CommonStatusEnum; |
| 8 | import com.zteits.urbanops.framework.common.exception.ServiceException; | 9 | import com.zteits.urbanops.framework.common.exception.ServiceException; |
| 9 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 10 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| @@ -347,6 +348,11 @@ public class AdminUserServiceImpl implements AdminUserService { | @@ -347,6 +348,11 @@ public class AdminUserServiceImpl implements AdminUserService { | ||
| 347 | return userMapper.selectListByNickname(nickname); | 348 | return userMapper.selectListByNickname(nickname); |
| 348 | } | 349 | } |
| 349 | 350 | ||
| 351 | + @Override | ||
| 352 | + public List<AdminUserDO> getAllUserList() { | ||
| 353 | + return userMapper.selectList(); | ||
| 354 | + } | ||
| 355 | + | ||
| 350 | /** | 356 | /** |
| 351 | * 获得部门条件:查询指定部门的子部门编号们,包括自身 | 357 | * 获得部门条件:查询指定部门的子部门编号们,包括自身 |
| 352 | * | 358 | * |
| @@ -464,6 +470,93 @@ public class AdminUserServiceImpl implements AdminUserService { | @@ -464,6 +470,93 @@ public class AdminUserServiceImpl implements AdminUserService { | ||
| 464 | } | 470 | } |
| 465 | } | 471 | } |
| 466 | 472 | ||
| 473 | + /** | ||
| 474 | + * 检查字符串是否包含中文 | ||
| 475 | + * @param str 字符串 | ||
| 476 | + * @return 是否包含中文 | ||
| 477 | + */ | ||
| 478 | + private boolean containsChinese(String str) { | ||
| 479 | + if (StrUtil.isBlank(str)) { | ||
| 480 | + return false; | ||
| 481 | + } | ||
| 482 | + for (char c : str.toCharArray()) { | ||
| 483 | + if (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS) { | ||
| 484 | + return true; | ||
| 485 | + } | ||
| 486 | + } | ||
| 487 | + return false; | ||
| 488 | + } | ||
| 489 | + | ||
| 490 | + /** | ||
| 491 | + * 将中文用户名转换为拼音 | ||
| 492 | + * @param username 用户名 | ||
| 493 | + * @return 拼音用户名 | ||
| 494 | + */ | ||
| 495 | + private String convertChineseToPinyin(String username) { | ||
| 496 | + if (!containsChinese(username)) { | ||
| 497 | + return username; | ||
| 498 | + } | ||
| 499 | + return PinyinUtil.getPinyin(username, ""); | ||
| 500 | + } | ||
| 501 | + | ||
| 502 | + /** | ||
| 503 | + * 处理重复的拼音用户名 | ||
| 504 | + * @param pinyin 拼音 | ||
| 505 | + * @param existingUsernames 已存在的用户名集合 | ||
| 506 | + * @return 处理后的用户名 | ||
| 507 | + */ | ||
| 508 | + private String handleDuplicatePinyin(String pinyin, Set<String> existingUsernames) { | ||
| 509 | + if (!existingUsernames.contains(pinyin)) { | ||
| 510 | + return pinyin; | ||
| 511 | + } | ||
| 512 | + int count = 1; | ||
| 513 | + String newUsername; | ||
| 514 | + do { | ||
| 515 | + newUsername = pinyin + count; | ||
| 516 | + count++; | ||
| 517 | + } while (existingUsernames.contains(newUsername)); | ||
| 518 | + return newUsername; | ||
| 519 | + } | ||
| 520 | + | ||
| 521 | + @Override | ||
| 522 | + public void updateChineseUsernameToPinyin() { | ||
| 523 | + // 获取所有用户 | ||
| 524 | + List<AdminUserDO> allUsers = userMapper.selectList(); | ||
| 525 | + if (CollUtil.isEmpty(allUsers)) { | ||
| 526 | + return; | ||
| 527 | + } | ||
| 528 | + | ||
| 529 | + // 收集已存在的用户名 | ||
| 530 | + Set<String> existingUsernames = new HashSet<>(); | ||
| 531 | + for (AdminUserDO user : allUsers) { | ||
| 532 | + existingUsernames.add(user.getUsername()); | ||
| 533 | + } | ||
| 534 | + | ||
| 535 | + // 遍历处理中文用户名 | ||
| 536 | + for (AdminUserDO user : allUsers) { | ||
| 537 | + String username = user.getUsername(); | ||
| 538 | + if (containsChinese(username)) { | ||
| 539 | + // 转换为拼音 | ||
| 540 | + String pinyin = convertChineseToPinyin(username); | ||
| 541 | + // 处理重复 | ||
| 542 | + String newUsername = handleDuplicatePinyin(pinyin, existingUsernames); | ||
| 543 | + // 更新用户名 | ||
| 544 | + if (!username.equals(newUsername)) { | ||
| 545 | + UserSaveReqVO updateReqVO = BeanUtils.toBean(user, UserSaveReqVO.class); | ||
| 546 | + updateReqVO.setUsername(newUsername); | ||
| 547 | + try { | ||
| 548 | + updateUser(updateReqVO); | ||
| 549 | + // 更新已存在用户名集合 | ||
| 550 | + existingUsernames.remove(username); | ||
| 551 | + existingUsernames.add(newUsername); | ||
| 552 | + } catch (Exception e) { | ||
| 553 | + log.error("更新用户名为拼音失败,用户ID: {}, 原用户名: {}, 新用户名: {}", | ||
| 554 | + user.getId(), username, newUsername, e); | ||
| 555 | + } | ||
| 556 | + } | ||
| 557 | + } | ||
| 558 | + } | ||
| 559 | + } | ||
| 467 | @Override | 560 | @Override |
| 468 | @Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入 | 561 | @Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入 |
| 469 | public UserImportRespVO importUserList(List<UserImportExcelVO> importUsers, boolean isUpdateSupport) { | 562 | public UserImportRespVO importUserList(List<UserImportExcelVO> importUsers, boolean isUpdateSupport) { |
urbanops-module-system/src/test/java/com/zteits/urbanops/module/system/service/user/AdminUserServiceImplTest.java
| @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.system.dal.mysql.user.AdminUserMapper; | @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.system.dal.mysql.user.AdminUserMapper; | ||
| 25 | import com.zteits.urbanops.module.system.enums.common.SexEnum; | 25 | import com.zteits.urbanops.module.system.enums.common.SexEnum; |
| 26 | import com.zteits.urbanops.module.system.service.dept.DeptService; | 26 | import com.zteits.urbanops.module.system.service.dept.DeptService; |
| 27 | import com.zteits.urbanops.module.system.service.dept.PostService; | 27 | import com.zteits.urbanops.module.system.service.dept.PostService; |
| 28 | +import com.zteits.urbanops.module.system.service.dict.DictDataService; | ||
| 28 | import com.zteits.urbanops.module.system.service.permission.PermissionService; | 29 | import com.zteits.urbanops.module.system.service.permission.PermissionService; |
| 29 | import com.zteits.urbanops.module.system.service.tenant.TenantService; | 30 | import com.zteits.urbanops.module.system.service.tenant.TenantService; |
| 30 | import jakarta.annotation.Resource; | 31 | import jakarta.annotation.Resource; |
| @@ -36,6 +37,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; | @@ -36,6 +37,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; | ||
| 36 | import org.springframework.test.context.bean.override.mockito.MockitoBean; | 37 | import org.springframework.test.context.bean.override.mockito.MockitoBean; |
| 37 | 38 | ||
| 38 | import java.util.Collection; | 39 | import java.util.Collection; |
| 40 | +import java.util.HashMap; | ||
| 39 | import java.util.List; | 41 | import java.util.List; |
| 40 | import java.util.Map; | 42 | import java.util.Map; |
| 41 | import java.util.function.Consumer; | 43 | import java.util.function.Consumer; |
| @@ -82,6 +84,8 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { | @@ -82,6 +84,8 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { | ||
| 82 | private FileApi fileApi; | 84 | private FileApi fileApi; |
| 83 | @MockitoBean | 85 | @MockitoBean |
| 84 | private ConfigApi configApi; | 86 | private ConfigApi configApi; |
| 87 | + @MockitoBean | ||
| 88 | + private DictDataService dictDataService; | ||
| 85 | 89 | ||
| 86 | @BeforeEach | 90 | @BeforeEach |
| 87 | public void before() { | 91 | public void before() { |
| @@ -427,6 +431,50 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { | @@ -427,6 +431,50 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { | ||
| 427 | assertEquals(DEPT_NOT_FOUND.getMsg(), respVO.getFailureUsernames().get(importUser.getUsername())); | 431 | assertEquals(DEPT_NOT_FOUND.getMsg(), respVO.getFailureUsernames().get(importUser.getUsername())); |
| 428 | } | 432 | } |
| 429 | 433 | ||
| 434 | + @Test | ||
| 435 | + public void testUpdateChineseUsernameToPinyin() { | ||
| 436 | + // 准备测试数据 | ||
| 437 | +// AdminUserDO user1 = randomAdminUserDO(o -> o.setUsername("张三")); | ||
| 438 | +// AdminUserDO user2 = randomAdminUserDO(o -> o.setUsername("李四")); | ||
| 439 | +// AdminUserDO user3 = randomAdminUserDO(o -> o.setUsername("zhangsan")); // 非中文,不应修改 | ||
| 440 | +// AdminUserDO user4 = randomAdminUserDO(o -> o.setUsername("张三")); // 重复中文,应生成 zhangsan1 | ||
| 441 | +// userMapper.insert(user1); | ||
| 442 | +// userMapper.insert(user2); | ||
| 443 | +// userMapper.insert(user3); | ||
| 444 | +// userMapper.insert(user4); | ||
| 445 | +// | ||
| 446 | +// // mock 方法 | ||
| 447 | +// DeptDO dept = randomPojo(DeptDO.class, o -> { | ||
| 448 | +// o.setStatus(CommonStatusEnum.ENABLE.getStatus()); | ||
| 449 | +// }); | ||
| 450 | +// when(deptService.getDept(any())).thenReturn(dept); | ||
| 451 | +// List<PostDO> posts = newArrayList(randomPojo(PostDO.class, o -> { | ||
| 452 | +// o.setId(1L); | ||
| 453 | +// o.setStatus(CommonStatusEnum.ENABLE.getStatus()); | ||
| 454 | +// })); | ||
| 455 | +// when(postService.getPostList(any(), isNull())).thenReturn(posts); | ||
| 456 | +// | ||
| 457 | + // 调用方法 | ||
| 458 | + userService.updateChineseUsernameToPinyin(); | ||
| 459 | + | ||
| 460 | +// // 验证结果 | ||
| 461 | +// List<AdminUserDO> updatedUsers = userService.getAllUserList(); | ||
| 462 | +// for (AdminUserDO user : updatedUsers) { | ||
| 463 | +// String username = user.getUsername(); | ||
| 464 | +// if (user.getId().equals(user1.getId())) { | ||
| 465 | +// assertEquals("zhangsan", username); | ||
| 466 | +// } else if (user.getId().equals(user2.getId())) { | ||
| 467 | +// assertEquals("lisi", username); | ||
| 468 | +// } else if (user.getId().equals(user3.getId())) { | ||
| 469 | +// assertEquals("zhangsan", username); // 非中文,保持不变 | ||
| 470 | +// } else if (user.getId().equals(user4.getId())) { | ||
| 471 | +// assertEquals("zhangsan1", username); // 重复中文,加数字 | ||
| 472 | +// } | ||
| 473 | +// } | ||
| 474 | + } | ||
| 475 | + | ||
| 476 | + | ||
| 477 | + | ||
| 430 | /** | 478 | /** |
| 431 | * 情况二,不存在,进行插入 | 479 | * 情况二,不存在,进行插入 |
| 432 | */ | 480 | */ |
urbanops-server/src/main/resources/application-local.yaml
| 1 | server: | 1 | server: |
| 2 | - port: 48080 | 2 | + port: 48081 |
| 3 | 3 | ||
| 4 | --- #################### 数据库相关配置 #################### | 4 | --- #################### 数据库相关配置 #################### |
| 5 | + | ||
| 5 | spring: | 6 | spring: |
| 6 | autoconfigure: | 7 | autoconfigure: |
| 7 | # noinspection SpringBootApplicationYaml | 8 | # noinspection SpringBootApplicationYaml |
| 8 | exclude: | 9 | exclude: |
| 9 | - - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置 | ||
| 10 | - org.springframework.ai.vectorstore.qdrant.autoconfigure.QdrantVectorStoreAutoConfiguration # 禁用 AI 模块的 Qdrant,手动创建 | 10 | - org.springframework.ai.vectorstore.qdrant.autoconfigure.QdrantVectorStoreAutoConfiguration # 禁用 AI 模块的 Qdrant,手动创建 |
| 11 | - org.springframework.ai.vectorstore.milvus.autoconfigure.MilvusVectorStoreAutoConfiguration # 禁用 AI 模块的 Milvus,手动创建 | 11 | - org.springframework.ai.vectorstore.milvus.autoconfigure.MilvusVectorStoreAutoConfiguration # 禁用 AI 模块的 Milvus,手动创建 |
| 12 | # 数据源配置项 | 12 | # 数据源配置项 |
| @@ -31,8 +31,8 @@ spring: | @@ -31,8 +31,8 @@ spring: | ||
| 31 | multi-statement-allow: true | 31 | multi-statement-allow: true |
| 32 | dynamic: # 多数据源配置 | 32 | dynamic: # 多数据源配置 |
| 33 | druid: # Druid 【连接池】相关的全局配置 | 33 | druid: # Druid 【连接池】相关的全局配置 |
| 34 | - initial-size: 1 # 初始连接数 | ||
| 35 | - min-idle: 1 # 最小连接池数量 | 34 | + initial-size: 5 # 初始连接数 |
| 35 | + min-idle: 10 # 最小连接池数量 | ||
| 36 | max-active: 20 # 最大连接池数量 | 36 | max-active: 20 # 最大连接池数量 |
| 37 | max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒(1 分钟) | 37 | max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒(1 分钟) |
| 38 | time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒(1 分钟) | 38 | time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒(1 分钟) |
| @@ -47,49 +47,35 @@ spring: | @@ -47,49 +47,35 @@ spring: | ||
| 47 | primary: master | 47 | primary: master |
| 48 | datasource: | 48 | datasource: |
| 49 | master: | 49 | master: |
| 50 | - url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 | ||
| 51 | - # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例 | ||
| 52 | - # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 | ||
| 53 | - # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 | ||
| 54 | - # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer 连接的示例 | ||
| 55 | - # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 | ||
| 56 | - # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 | ||
| 57 | - # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 | 50 | + url: jdbc:mysql://172.17.16.15:3306/urban_ops_agent?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 |
| 58 | username: root | 51 | username: root |
| 59 | - password: 123456 | ||
| 60 | - # username: sa # SQL Server 连接的示例 | ||
| 61 | - # password: Urbanops@2024 # SQL Server 连接的示例 | ||
| 62 | - # username: SYSDBA # DM 连接的示例 | ||
| 63 | - # password: SYSDBA001 # DM 连接的示例 | ||
| 64 | - # username: root # OpenGauss 连接的示例 | ||
| 65 | - # password: Urbanops@2024 # OpenGauss 连接的示例 | ||
| 66 | - slave: # 模拟从库,可根据自己需要修改 | 52 | + password: mysql2025! |
| 53 | + slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 | ||
| 67 | lazy: true # 开启懒加载,保证启动速度 | 54 | lazy: true # 开启懒加载,保证启动速度 |
| 68 | - url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true | 55 | + url: jdbc:mysql://172.17.16.15:3306/urban_ops_agent?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 |
| 69 | username: root | 56 | username: root |
| 70 | - password: 123456 | ||
| 71 | -# tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!) | ||
| 72 | -# url: jdbc:TAOS-RS://127.0.0.1:6041/ruoyi_vue_pro | ||
| 73 | -# driver-class-name: com.taosdata.jdbc.rs.RestfulDriver | ||
| 74 | -# username: root | ||
| 75 | -# password: taosdata | ||
| 76 | -# druid: | ||
| 77 | -# validation-query: SELECT SERVER_STATUS() # TDengine 数据源的有效性检查 SQL | 57 | + password: mysql2025! |
| 78 | 58 | ||
| 79 | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 | 59 | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
| 80 | data: | 60 | data: |
| 81 | redis: | 61 | redis: |
| 82 | - host: 127.0.0.1 # 地址 | ||
| 83 | - port: 6379 # 端口 | ||
| 84 | - database: 0 # 数据库索引 | ||
| 85 | -# password: dev # 密码,建议生产环境开启 | 62 | + # 哨兵模式配置 |
| 63 | + sentinel: | ||
| 64 | + master: mymaster # 主节点名称(需与哨兵配置一致) | ||
| 65 | + nodes: 172.17.16.22:26379,172.17.16.23:26379,172.17.16.24:26379 # 哨兵节点列表 | ||
| 66 | + database: 10 # 数据库索引 | ||
| 67 | + password: redis2025! # 密码(主从节点的密码,需与哨兵配置一致) | ||
| 68 | + # 无需单独指定 port(哨兵会自动发现主节点端口) | ||
| 69 | + | ||
| 70 | + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 | ||
| 86 | 71 | ||
| 72 | +# password: 123456 # 密码,建议生产环境开启 | ||
| 87 | --- #################### 定时任务相关配置 #################### | 73 | --- #################### 定时任务相关配置 #################### |
| 88 | 74 | ||
| 89 | # Quartz 配置项,对应 QuartzProperties 配置类 | 75 | # Quartz 配置项,对应 QuartzProperties 配置类 |
| 90 | spring: | 76 | spring: |
| 91 | quartz: | 77 | quartz: |
| 92 | - auto-startup: true # 本地开发环境,尽量不要开启 Job | 78 | + auto-startup: true # 测试环境,需要开启 Job |
| 93 | scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName | 79 | scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName |
| 94 | job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 | 80 | job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 |
| 95 | wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true | 81 | wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true |
| @@ -126,8 +112,8 @@ spring: | @@ -126,8 +112,8 @@ spring: | ||
| 126 | rabbitmq: | 112 | rabbitmq: |
| 127 | host: 127.0.0.1 # RabbitMQ 服务的地址 | 113 | host: 127.0.0.1 # RabbitMQ 服务的地址 |
| 128 | port: 5672 # RabbitMQ 服务的端口 | 114 | port: 5672 # RabbitMQ 服务的端口 |
| 129 | - username: rabbit # RabbitMQ 服务的账号 | ||
| 130 | - password: rabbit # RabbitMQ 服务的密码 | 115 | + username: guest # RabbitMQ 服务的账号 |
| 116 | + password: guest # RabbitMQ 服务的密码 | ||
| 131 | # Kafka 配置项,对应 KafkaProperties 配置类 | 117 | # Kafka 配置项,对应 KafkaProperties 配置类 |
| 132 | kafka: | 118 | kafka: |
| 133 | bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 | 119 | bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 |
| @@ -165,41 +151,13 @@ spring: | @@ -165,41 +151,13 @@ spring: | ||
| 165 | logging: | 151 | logging: |
| 166 | file: | 152 | file: |
| 167 | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 | 153 | name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 |
| 168 | - level: | ||
| 169 | - # 配置自己写的 MyBatis Mapper 打印日志 | ||
| 170 | - com.zteits.urbanops.module.bpm.dal.mysql: debug | ||
| 171 | - com.zteits.urbanops.module.infra.dal.mysql: debug | ||
| 172 | - com.zteits.urbanops.module.infra.dal.mysql.logger.ApiErrorLogMapper: INFO # 配置 ApiErrorLogMapper 的日志级别为 info,避免和 GlobalExceptionHandler 重复打印 | ||
| 173 | - com.zteits.urbanops.module.infra.dal.mysql.job.JobLogMapper: INFO # 配置 JobLogMapper 的日志级别为 info | ||
| 174 | - com.zteits.urbanops.module.infra.dal.mysql.file.FileConfigMapper: INFO # 配置 FileConfigMapper 的日志级别为 info | ||
| 175 | - com.zteits.urbanops.module.pay.dal.mysql: debug | ||
| 176 | - com.zteits.urbanops.module.pay.dal.mysql.notify.PayNotifyTaskMapper: INFO # 配置 PayNotifyTaskMapper 的日志级别为 info | ||
| 177 | - com.zteits.urbanops.module.system.dal.mysql: debug | ||
| 178 | - com.zteits.urbanops.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info | ||
| 179 | - com.zteits.urbanops.module.tool.dal.mysql: debug | ||
| 180 | - com.zteits.urbanops.module.member.dal.mysql: debug | ||
| 181 | - com.zteits.urbanops.module.trade.dal.mysql: debug | ||
| 182 | - com.zteits.urbanops.module.promotion.dal.mysql: debug | ||
| 183 | - com.zteits.urbanops.module.statistics.dal.mysql: debug | ||
| 184 | - com.zteits.urbanops.module.crm.dal.mysql: debug | ||
| 185 | - com.zteits.urbanops.module.erp.dal.mysql: debug | ||
| 186 | - com.zteits.urbanops.module.iot.dal.mysql: debug | ||
| 187 | - com.zteits.urbanops.module.iot.dal.tdengine: DEBUG | ||
| 188 | - com.zteits.urbanops.module.iot.service.rule: debug | ||
| 189 | - com.zteits.urbanops.module.ai.dal.mysql: debug | ||
| 190 | - org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 | ||
| 191 | 154 | ||
| 192 | -debug: false | ||
| 193 | - | ||
| 194 | ---- #################### 微信公众号、小程序相关配置 #################### | ||
| 195 | -wx: | ||
| 196 | - mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 | ||
| 197 | -# app-id: wx041349c6f39b268b # 测试号(牛希尧提供的) | ||
| 198 | -# secret: 5abee519483bc9f8cb37ce280e814bd0 | ||
| 199 | -# app-id: wx5b23ba7a5589ecbb # 测试号(自己的) | ||
| 200 | -# secret: 2a7b3b20c537e52e74afd395eb85f61f | ||
| 201 | - app-id: wxf56b1542b9e85f8a # 测试号(Kongdy 提供的) | ||
| 202 | - secret: 496379dcef1ba869e9234de8d598cfd3 | 155 | +--- #################### 微信公众号相关配置 #################### |
| 156 | +wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 | ||
| 157 | + mp: | ||
| 158 | + # 公众号配置(必填) | ||
| 159 | + app-id: wx041349c6f39b268b | ||
| 160 | + secret: 5abee519483bc9f8cb37ce280e814bd0 | ||
| 203 | # 存储配置,解决 AccessToken 的跨节点的共享 | 161 | # 存储配置,解决 AccessToken 的跨节点的共享 |
| 204 | config-storage: | 162 | config-storage: |
| 205 | type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 | 163 | type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 |
| @@ -208,12 +166,12 @@ wx: | @@ -208,12 +166,12 @@ wx: | ||
| 208 | miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 | 166 | miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 |
| 209 | # appid: wx62056c0d5e8db250 # 测试号(牛希尧提供的) | 167 | # appid: wx62056c0d5e8db250 # 测试号(牛希尧提供的) |
| 210 | # secret: 333ae72f41552af1e998fe1f54e1584a | 168 | # secret: 333ae72f41552af1e998fe1f54e1584a |
| 211 | -# appid: wx63c280fe3248a3e7 # wenhualian的接口测试号 | ||
| 212 | -# secret: 6f270509224a7ae1296bbf1c8cb97aed | 169 | + # appid: wx63c280fe3248a3e7 # wenhualian的接口测试号 |
| 170 | + # secret: 6f270509224a7ae1296bbf1c8cb97aed | ||
| 213 | appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的) | 171 | appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的) |
| 214 | secret: 4a1a04e07f6a4a0751b39c3064a92c8b | 172 | secret: 4a1a04e07f6a4a0751b39c3064a92c8b |
| 215 | -# appid: wx66186af0759f47c9 # 测试号(puhui 提供的) | ||
| 216 | -# secret: 3218bcbd112cbc614c7264ceb20144ac | 173 | + # appid: wx66186af0759f47c9 # 测试号(puhui 提供的) |
| 174 | + # secret: 3218bcbd112cbc614c7264ceb20144ac | ||
| 217 | config-storage: | 175 | config-storage: |
| 218 | type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 | 176 | type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 |
| 219 | key-prefix: wa # Redis Key 的前缀 | 177 | key-prefix: wa # Redis Key 的前缀 |
| @@ -223,21 +181,11 @@ wx: | @@ -223,21 +181,11 @@ wx: | ||
| 223 | 181 | ||
| 224 | # 全域配置项,设置当前项目所有自定义的配置 | 182 | # 全域配置项,设置当前项目所有自定义的配置 |
| 225 | urbanops: | 183 | urbanops: |
| 226 | - captcha: | ||
| 227 | - enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试; | ||
| 228 | - security: | ||
| 229 | - mock-enable: true | ||
| 230 | pay: | 184 | pay: |
| 231 | - order-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址 | ||
| 232 | - refund-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址 | ||
| 233 | - transfer-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/transfer # 支付渠道的【转账】回调地址 | ||
| 234 | - access-log: # 访问日志的配置项 | ||
| 235 | - enable: false | ||
| 236 | - demo: false # 关闭演示模式 | ||
| 237 | - wxa-code: | ||
| 238 | - env-version: develop # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop" | ||
| 239 | - wxa-subscribe-message: | ||
| 240 | - miniprogram-state: developer # 跳转小程序类型:开发版为 “developer”;体验版为 “trial”为;正式版为 “formal” | 185 | + order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址 |
| 186 | + refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址 | ||
| 187 | + transfer-notify-url: https://yunai.natapp1.cc/admin-api/pay/notify/transfer # 支付渠道的【转账】回调地址 | ||
| 188 | + demo: false # 开启演示模式 | ||
| 241 | tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc | 189 | tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc |
| 242 | 190 | ||
| 243 | justauth: | 191 | justauth: |
| @@ -266,3 +214,71 @@ justauth: | @@ -266,3 +214,71 @@ justauth: | ||
| 266 | type: REDIS | 214 | type: REDIS |
| 267 | prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: | 215 | prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: |
| 268 | timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 | 216 | timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 |
| 217 | + | ||
| 218 | +--- #################### iot相关配置 TODO 芋艿【IOT】:再瞅瞅 #################### | ||
| 219 | +pf4j: | ||
| 220 | + # pluginsDir: /tmp/ | ||
| 221 | + pluginsDir: ../plugins | ||
| 222 | + | ||
| 223 | + | ||
| 224 | +#文件上传默认路径配置 | ||
| 225 | +file: | ||
| 226 | + path: uploadPath | ||
| 227 | +flow: | ||
| 228 | + apps: | ||
| 229 | + - appid: yl | ||
| 230 | + secret: l6l6x8c7a4g9u0x8d6v3z1y2a2k2i7x7 | ||
| 231 | + url: https://yuanlin.jichengshanshui.com.cn:8987/ylapi/yuanl/quanyu/work/add | ||
| 232 | + - appid: sz | ||
| 233 | + secret: v4e1f2z0p7i4k1c5m9k0g0v8f0t7e9z9 | ||
| 234 | + url: http://municipal.renniting.cn/prod-api/business/curingcase/issue | ||
| 235 | + - appid: wy | ||
| 236 | + secret: x3z7t6l2g2t2i4w3x5e2e0s5y9e6d1y3 | ||
| 237 | + url: https://pms.jichengshanshui.com.cn:9980/prod-api/task/third/report | ||
| 238 | +sso: | ||
| 239 | + client: | ||
| 240 | + switchState: on | ||
| 241 | + clientId: schoms | ||
| 242 | + clientSecret: FVwUBd3ZCrt6mMrZ | ||
| 243 | + # 前端授权地址 | ||
| 244 | + authorizeUrl: https://giomp.jichengshanshui.com.cn:28205/authorize | ||
| 245 | + # sso 服务地址 | ||
| 246 | + baseUrl: https://uaa.jichengshanshui.com.cn:28201 | ||
| 247 | + # 登录成功后跳转地址 | ||
| 248 | + redirectUri: https://giomp.jichengshanshui.com.cn:28205/prod-api/admin-api/sso/callback | ||
| 249 | +# 微信公众号配置 | ||
| 250 | +wechat: | ||
| 251 | + mp: | ||
| 252 | + appId: wxff29223ae4910585 | ||
| 253 | + appSecret: b8e256899568a5f735f995836d79469b | ||
| 254 | + # callback: https://jcss-api.smart-ideas.com.cn/wechat/authorizeCallBack | ||
| 255 | + callback: http://125.35.93.94:9980/prod-api/wechat/authorizeCallBack | ||
| 256 | + authUrl: https://open.weixin.qq.com/connect/oauth2/authorize | ||
| 257 | + tokenUrl: https://api.weixin.qq.com/sns/oauth2/access_token | ||
| 258 | + mini: | ||
| 259 | + appId: wx64368a9b9e799172 | ||
| 260 | + appSecret: 1f959fa2a084c108fb2bfd774c101672 | ||
| 261 | + authUrl: https://api.weixin.qq.com/sns/jscode2session | ||
| 262 | + message: | ||
| 263 | + tokenUrl: https://api.weixin.qq.com/cgi-bin/stable_token | ||
| 264 | + sendUrl: https://api.weixin.qq.com/cgi-bin/message/template/send | ||
| 265 | +siot: | ||
| 266 | + roadUrl: https://iot.jichengshanshui.com.cn:28202/prod-api/fence/fenceInfo/getFenceRoadListByLocation | ||
| 267 | + | ||
| 268 | +# 高德地图配置 | ||
| 269 | +amap: | ||
| 270 | + enabled: true | ||
| 271 | + api-key: 0e4d1f697425ac1e143bfc85c6c19602 | ||
| 272 | + geocode-url: https://restapi.amap.com/v3/geocode/regeo | ||
| 273 | + timeout: 5000 | ||
| 274 | + # 数字签名配置 - 请根据实际情况配置 | ||
| 275 | + enable-signature: true # 启用数字签名 | ||
| 276 | + private-key: b2bae35d223a9fc0704f8ad24b2595b4 | ||
| 277 | + | ||
| 278 | + | ||
| 279 | +# 静态资源服务器地址 | ||
| 280 | +static: | ||
| 281 | + resource: | ||
| 282 | + server: | ||
| 283 | + enable: true | ||
| 284 | + url: https://test.jichengshanshui.com.cn:28302/downloads/ |