Compare commits

6 Commits
master ... dev

Author SHA1 Message Date
zc
67d3a30584 消费改造-人员同步筛选 2026-06-05 17:22:41 +08:00
zc
2d77fb02f7 消费改造-人员同步筛选 2026-02-09 15:32:06 +08:00
zc
1d8f613999 消费改造-餐盘监测设备 2026-02-09 11:01:08 +08:00
zc
67d29ca51c 消费改造-餐盘监测设备 2026-02-09 10:41:35 +08:00
zc
0e1a3404dc 消费改造-餐盘监测设备 2026-02-06 15:46:59 +08:00
zc
8a51bd9ed7 优化 2026-02-06 15:20:25 +08:00
12 changed files with 1064 additions and 592 deletions

View File

@@ -0,0 +1,41 @@
package io.renren.dao;
import io.renren.entity.SysConfig;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 参数配置 数据层
*
* @author dcsoft
*/
@Mapper
public interface SysConfigMapper
{
/**
* 查询参数配置信息
*
* @param config 参数配置信息
* @return 参数配置信息
*/
public SysConfig selectConfig(SysConfig config);
/**
* 通过ID查询配置
*
* @param configId 参数ID
* @return 参数配置信息
*/
public SysConfig selectConfigById(Long configId);
/**
* 查询参数配置列表
*
* @param config 参数配置信息
* @return 参数配置集合
*/
public List<SysConfig> selectConfigList(SysConfig config);
}

View File

@@ -0,0 +1,104 @@
package io.renren.entity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 参数配置表 sys_config
*
* @author dcsoft
*/
public class SysConfig extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 参数主键 */
private Long configId;
/** 参数名称 */
private String configName;
/** 参数键名 */
private String configKey;
/** 参数键值 */
private String configValue;
/** 系统内置Y是 N否 */
private String configType;
public Long getConfigId()
{
return configId;
}
public void setConfigId(Long configId)
{
this.configId = configId;
}
@NotBlank(message = "参数名称不能为空")
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
public String getConfigName()
{
return configName;
}
public void setConfigName(String configName)
{
this.configName = configName;
}
@NotBlank(message = "参数键名长度不能为空")
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
public String getConfigKey()
{
return configKey;
}
public void setConfigKey(String configKey)
{
this.configKey = configKey;
}
@NotBlank(message = "参数键值不能为空")
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
public String getConfigValue()
{
return configValue;
}
public void setConfigValue(String configValue)
{
this.configValue = configValue;
}
public String getConfigType()
{
return configType;
}
public void setConfigType(String configType)
{
this.configType = configType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("configId", getConfigId())
.append("configName", getConfigName())
.append("configKey", getConfigKey())
.append("configValue", getConfigValue())
.append("configType", getConfigType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -100,6 +100,15 @@ public class SysPeople extends BaseEntity {
private String isConsume; private String isConsume;
private Integer consumeStats;
public Integer getConsumeStats() {
return consumeStats;
}
public void setConsumeStats(Integer consumeStats) {
this.consumeStats = consumeStats;
}
public String getOpenid() { public String getOpenid() {
return openid; return openid;

View File

@@ -0,0 +1,38 @@
package io.renren.service;
import io.renren.entity.SysConfig;
import java.util.List;
/**
* 参数配置 服务层
*
* @author dcsoft
*/
public interface ISysConfigService {
/**
* 查询参数配置信息
*
* @param configId 参数配置ID
* @return 参数配置信息
*/
public SysConfig selectConfigById(Long configId);
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @return 参数键值
*/
public String selectConfigByKey(String configKey);
/**
* 查询参数配置列表
*
* @param config 参数配置信息
* @return 参数配置集合
*/
public List<SysConfig> selectConfigList(SysConfig config);
}

View File

@@ -0,0 +1,90 @@
package io.renren.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.renren.common.redis.RedisUtils;
import io.renren.dao.SysConfigMapper;
import io.renren.entity.SysConfig;
import io.renren.service.ISysConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 参数配置 服务层实现
*
* @author dcsoft
*/
@Service
public class SysConfigServiceImpl implements ISysConfigService
{
@Autowired
private SysConfigMapper configMapper;
@Autowired
private RedisUtils redisService;
/**
* 查询参数配置信息
*
* @param configId 参数配置ID
* @return 参数配置信息
*/
@Override
public SysConfig selectConfigById(Long configId)
{
SysConfig config = new SysConfig();
config.setConfigId(configId);
return configMapper.selectConfig(config);
}
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数key
* @return 参数键值
*/
@Override
public String selectConfigByKey(String configKey) {
Object configValue = redisService.get(getCacheKey(configKey));
if (ObjectUtil.isNotNull(configValue) && StrUtil.isNotEmpty(configValue.toString())) {
return configValue.toString();
}
SysConfig config = new SysConfig();
config.setConfigKey(configKey);
SysConfig retConfig = configMapper.selectConfig(config);
if (ObjectUtil.isNotNull(retConfig)) {
redisService.set(getCacheKey(configKey), retConfig.getConfigValue());
return retConfig.getConfigValue();
}
return StringUtils.EMPTY;
}
/**
* 查询参数配置列表
*
* @param config 参数配置信息
* @return 参数配置集合
*/
@Override
public List<SysConfig> selectConfigList(SysConfig config)
{
return configMapper.selectConfigList(config);
}
/**
* 设置cache key
*
* @param configKey 参数键
* @return 缓存键key
*/
private String getCacheKey(String configKey)
{
return "sys_config:" + configKey;
}
}

View File

@@ -2,15 +2,9 @@ spring:
datasource: datasource:
druid: druid:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
#url: jdbc:mysql://127.0.0.1:3306/fk_cloud?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true url: jdbc:mysql://127.0.0.1:3306/xa_cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#username: root
#password: 111111
url: jdbc:mysql://192.168.124.185:3306/taihe_cloud?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: root username: root
password: SQLsql123 password: root
#url: jdbc:mysql://127.0.0.1:8123/chungu?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
#username: root
#password: 3dxz2023
initial-size: 10 initial-size: 10
max-active: 100 max-active: 100
min-idle: 10 min-idle: 10
@@ -37,3 +31,16 @@ spring:
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
redis:
host: 192.168.2.30
password: redis2025
database: 5
port: 6379
timeout: 6000ms # 连接超时时长(毫秒)
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 5 # 连接池中的最小空闲连接

View File

@@ -31,3 +31,15 @@ spring:
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
redis:
database: 0
host: 127.0.0.1
port: 6379
password: # 密码(默认为空)
timeout: 6000ms # 连接超时时长(毫秒)
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 5 # 连接池中的最小空闲连接

View File

@@ -25,6 +25,7 @@ spring:
# 环境 dev|test|prod # 环境 dev|test|prod
profiles: profiles:
active: prod active: prod
# active: dev
messages: messages:
encoding: UTF-8 encoding: UTF-8
basename: i18n/messages basename: i18n/messages
@@ -40,18 +41,18 @@ spring:
max-file-size: 100MB max-file-size: 100MB
max-request-size: 100MB max-request-size: 100MB
enabled: true enabled: true
redis: # redis:
database: 0 # database: 0
host: 127.0.0.1 # host: 127.0.0.1
port: 6379 # port: 6379
password: # 密码(默认为空) # password: # 密码(默认为空)
timeout: 6000ms # 连接超时时长(毫秒) # timeout: 6000ms # 连接超时时长(毫秒)
jedis: # jedis:
pool: # pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) # max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) # max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接 # max-idle: 10 # 连接池中的最大空闲连接
min-idle: 5 # 连接池中的最小空闲连接 # min-idle: 5 # 连接池中的最小空闲连接
renren: renren:
redis: redis:

View File

@@ -1,21 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration scan="true" scanPeriod="60 seconds" debug="false">
<include resource="org/springframework/boot/logging/logback/base.xml" /> <!-- 日志存放路径 -->
<logger name="org.springframework.web" level="INFO"/> <property name="log.path" value="logs/thxf" />
<logger name="org.springboot.sample" level="TRACE" /> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 开发、测试环境 --> <!-- 控制台输出 -->
<springProfile name="dev,test"> <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<logger name="org.springframework.web" level="INFO"/> <encoder>
<logger name="org.springboot.sample" level="INFO" /> <pattern>${log.pattern}</pattern>
<logger name="io.renren" level="DEBUG" /> </encoder>
</springProfile> </appender>
<!-- 生产环境 --> <!-- 系统日志输出 -->
<springProfile name="prod"> <appender name="file_all" class="ch.qos.logback.core.rolling.RollingFileAppender">
<logger name="org.springframework.web" level="ERROR"/> <file>${log.path}/xf.log</file>
<logger name="org.springboot.sample" level="ERROR" /> <!-- 循环政策:基于时间创建日志文件 -->
<logger name="io.renren" level="ERROR" /> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
</springProfile> <!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/xf.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="io.renren" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_all" />
</root>
</configuration> </configuration>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.renren.dao.SysConfigMapper">
<resultMap type="SysConfig" id="SysConfigResult">
<id property="configId" column="config_id" />
<result property="configName" column="config_name" />
<result property="configKey" column="config_key" />
<result property="configValue" column="config_value" />
<result property="configType" column="config_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectConfigVo">
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
from sys_config
</sql>
<!-- 查询条件 -->
<sql id="sqlwhereSearch">
<where>
<if test="configId !=null">
and config_id = #{configId}
</if>
<if test="configKey !=null and configKey != ''">
and config_key = #{configKey}
</if>
</where>
</sql>
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<include refid="sqlwhereSearch"/>
</select>
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<where>
<if test="configName != null and configName != ''">
AND config_name like concat('%', #{configName}, '%')
</if>
<if test="configType != null and configType != ''">
AND config_type = #{configType}
</if>
<if test="configKey != null and configKey != ''">
AND config_key like concat('%', #{configKey}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
where config_id = #{configId}
</select>
</mapper>

View File

@@ -69,6 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="branchId != null "> <if test="branchId != null ">
AND (p.branch_id = #{branchId} OR p.branch_id IN ( SELECT t.id FROM sys_branch t WHERE find_in_set(#{branchId}, ancestors) )) AND (p.branch_id = #{branchId} OR p.branch_id IN ( SELECT t.id FROM sys_branch t WHERE find_in_set(#{branchId}, ancestors) ))
</if> </if>
<if test="consumeStats != null ">
AND (p.avatar is not null or p.door_no is not null)
</if>
<if test="delFlag != null"> <if test="delFlag != null">
<if test="delFlag == 0"> <if test="delFlag == 0">
<if test="equipmentId != null and equipmentId != ''"> and spe.equipment_id is null </if> <if test="equipmentId != null and equipmentId != ''"> and spe.equipment_id is null </if>