perf(lb-qms): 优化查询功能和时间范围筛选
- 为 LbBatch 和 LbSensorResult 查询添加降序排序- 改进 LbTestResult 查询的时间范围筛选逻辑
-调整数据库连接参数和 Redis 配置
- 禁用 Spring Boot Admin 客户端和 Snail-Job
| | |
| | | --- # 临时文件存储位置 避免临时文件被系统清理报错 |
| | | spring.servlet.multipart.location: /ruoyi/server/temp |
| | | spring.servlet.multipart.location: /data/server/temp |
| | | |
| | | --- # 监控中心配置 |
| | | spring.boot.admin.client: |
| | | # 增加客户端开关 |
| | | enabled: true |
| | | enabled: false |
| | | url: http://localhost:9090/admin |
| | | instance: |
| | | service-host-type: IP |
| | |
| | | |
| | | --- # snail-job 配置 |
| | | snail-job: |
| | | enabled: true |
| | | enabled: false |
| | | # 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务 |
| | | group: "ruoyi_group" |
| | | # SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config`表 |
| | |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 |
| | | # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
| | | url: jdbc:mysql://192.168.0.23:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: root |
| | | password: 123456 |
| | | # # 从库数据源 |
| | | # slave: |
| | | # lazy: true |
| | |
| | | # 数据库索引 |
| | | database: 0 |
| | | # redis 密码必须配置 |
| | | password: ruoyi123 |
| | | #password: ruoyi123 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | # 是否开启ssl |
| | |
| | | redirect-uri: ${justauth.address}/social-callback?source=maxkey |
| | | topiam: |
| | | # topiam 服务器地址 |
| | | server-url: http://127.0.0.1:1989/api/v1/authorize/y0q************spq***********8ol |
| | | server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol |
| | | client-id: 449c4*********937************759 |
| | | client-secret: ac7***********1e0************28d |
| | | redirect-uri: ${justauth.address}/social-callback?source=topiam |
| | | scopes: [ openid, email, phone, profile ] |
| | | scopes: [openid, email, phone, profile] |
| | | qq: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | |
| | | lqw.eq(StringUtils.isNotBlank(bo.getDeviceCode()), LbBatch::getDeviceCode, bo.getDeviceCode()); |
| | | lqw.eq(bo.getUserId() != null, LbBatch::getUserId, bo.getUserId()); |
| | | lqw.eq(bo.getNum() != null, LbBatch::getNum, bo.getNum()); |
| | | lqw.orderByDesc(LbBatch::getBatchCode); |
| | | return lqw; |
| | | } |
| | | |
| | |
| | | lqw.eq(bo.getTotalCount() != null, LbSensorResult::getTotalCount, bo.getTotalCount()); |
| | | lqw.eq(bo.getOkCount() != null, LbSensorResult::getOkCount, bo.getOkCount()); |
| | | lqw.eq(bo.getNgCount() != null, LbSensorResult::getNgCount, bo.getNgCount()); |
| | | lqw.orderByDesc(LbSensorResult::getTestNum); |
| | | return lqw; |
| | | } |
| | | |
| | |
| | | import cn.shlanbao.qms.mapper.LbTestResultMapper; |
| | | import cn.shlanbao.qms.service.ILbTestResultService; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public List<LbTestResultVo> queryList(LbTestResultBo bo) { |
| | | if (StringUtils.isNotBlank(bo.getProdModel())) { |
| | | |
| | | return baseMapper.selectByProdModelAndConditions(bo); |
| | | } else { |
| | | LambdaQueryWrapper<LbTestResult> lqw = buildQueryWrapper(bo); |
| | |
| | | lqw.eq(bo.getTestValue() != null, LbTestResult::getTestValue, bo.getTestValue()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getJudgeDetail()), LbTestResult::getJudgeDetail, bo.getJudgeDetail()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getTestResult()), LbTestResult::getTestResult, bo.getTestResult()); |
| | | lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, |
| | | LbTestResult::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); |
| | | // 设置开始时间和结束时间的时分秒 |
| | | if (params.get("beginCreateTime") != null && params.get("endCreateTime") != null) { |
| | | LocalDateTime beginTime = ((LocalDateTime) params.get("beginCreateTime")).with(LocalTime.MIN); |
| | | LocalDateTime endTime = ((LocalDateTime) params.get("endCreateTime")).with(LocalTime.MAX); |
| | | lqw.between(LbTestResult::getCreateTime, beginTime, endTime); |
| | | } |
| | | |
| | | lqw.orderByAsc(LbTestResult::getCreateTime); |
| | | return lqw; |
| | | } |
| | |
| | | </choose> |
| | | </if> |
| | | <if test="ew.params.beginCreateTime != null and ew.params.endCreateTime != null"> |
| | | AND tr.create_time BETWEEN #{ew.params.beginCreateTime} AND #{ew.params.endCreateTime} |
| | | AND tr.create_time BETWEEN |
| | | DATE_FORMAT(#{ew.params.beginCreateTime}, '%Y-%m-%d 00:00:00') AND |
| | | DATE_FORMAT(#{ew.params.endCreateTime}, '%Y-%m-%d 23:59:59') |
| | | </if> |
| | | |
| | | </where> |
| | | ORDER BY tr.create_time ASC |
| | | </select> |