fix: 修改分润计算逻辑,确认问题。
This commit is contained in:
@@ -45,16 +45,14 @@ public class FieldMetaObjectHandler implements MetaObjectHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateFill(MetaObject metaObject) {
|
public void updateFill(MetaObject metaObject) {
|
||||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
||||||
LoginUser loginUser = null;
|
LoginUser loginUser = null;
|
||||||
try{
|
try{
|
||||||
loginUser = SecurityUtils.getLoginUser();
|
loginUser = SecurityUtils.getLoginUser();
|
||||||
// 更新者
|
|
||||||
strictUpdateFill(metaObject, UPDATE_BY, String.class, loginUser.getUsername());
|
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("获取用户信息失败");
|
// 定时任务等后台任务无用户上下文,使用系统默认值
|
||||||
}
|
}
|
||||||
|
// 更新者
|
||||||
|
strictUpdateFill(metaObject, UPDATE_BY, String.class, loginUser == null ? "系统修改" : loginUser.getUsername());
|
||||||
// 更新时间
|
// 更新时间
|
||||||
strictUpdateFill(metaObject, UPDATE_TIME, Date.class, new Date());
|
strictUpdateFill(metaObject, UPDATE_TIME, Date.class, new Date());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectInfoByHour" resultType="com.limap.core.basic.domain.AquPayDevice">
|
<select id="selectInfoByHour" resultType="com.limap.core.basic.domain.AquPayDevice">
|
||||||
select * from aqu_pay_device where create_time >= now() - interval '${hour} hour'
|
select * from aqu_pay_device
|
||||||
|
where create_time >= now() - interval '${hour} hour'
|
||||||
|
AND create_time <= now() - interval '1 hour'
|
||||||
|
AND (profit_status IS NULL OR profit_status = 0)
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -2,37 +2,42 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.limap.core.basic.mapper.BasicUserBindInfoMapper">
|
<mapper namespace="com.limap.core.basic.mapper.BasicProfitSharingUserMapper">
|
||||||
|
|
||||||
|
<!-- 查询分润用户基础信息列表,关联用户绑定设备信息 -->
|
||||||
|
<select id="selectBasicInfoList" resultType="com.limap.core.basic.vo.SharingUserTaskVo">
|
||||||
|
SELECT
|
||||||
|
bpsu.user_id as userId,
|
||||||
|
su.dept_id as deptId,
|
||||||
|
su.user_name as userName,
|
||||||
|
su.nick_name as nickName,
|
||||||
|
su.phonenumber as tel,
|
||||||
|
su.parent_id as parentId,
|
||||||
|
bpsu.sharing_code as sharingCode,
|
||||||
|
bpsu.om_ratio as omRatio,
|
||||||
|
bpsu.control_ratio as controlRatio,
|
||||||
|
bibi.device_name as deviceName,
|
||||||
|
bibi.type as type
|
||||||
|
FROM basic_profit_sharing_user bpsu
|
||||||
|
LEFT JOIN sys_user su ON bpsu.user_id = su.user_id
|
||||||
|
LEFT JOIN basic_user_bind_info bibi ON bpsu.user_id = bibi.user_id
|
||||||
|
WHERE bibi.device_name IS NOT NULL
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectAppUserInfo" resultType="com.limap.core.basic.domain.BasicUserBindInfo">
|
<!-- 查询缓存用的分润用户列表 -->
|
||||||
SELECT serial_num as device_name,iot_id as iot_id,device_type as type,bind_time as bind_time,ad.id as device_id,
|
<select id="selectCacheList" resultType="com.limap.core.basic.vo.SharingUserTaskVo">
|
||||||
au.id app_user,user_name app_user_name,mobile_phone app_user_tel
|
SELECT
|
||||||
FROM aqu_device ad
|
bpsu.user_id as userId,
|
||||||
left join aqu_user au on ad.user_id = au.id
|
su.dept_id as deptId,
|
||||||
<where>
|
su.user_name as userName,
|
||||||
<if test="deviceName != null and deviceName != ''"> and serial_num = #{deviceName}</if>
|
su.nick_name as nickName,
|
||||||
</where>
|
su.phonenumber as tel,
|
||||||
|
su.parent_id as parentId,
|
||||||
|
bpsu.sharing_code as sharingCode,
|
||||||
|
bpsu.om_ratio as omRatio,
|
||||||
|
bpsu.control_ratio as controlRatio
|
||||||
|
FROM basic_profit_sharing_user bpsu
|
||||||
|
LEFT JOIN sys_user su ON bpsu.user_id = su.user_id
|
||||||
</select>
|
</select>
|
||||||
<select id="getcControlInfo" resultType="com.limap.core.screen.vo.ControlSwitch">
|
|
||||||
SELECT a.id id,a.device_id deviceId ,a."index" "index",a.switch_name switchName, a.detect_electric_value detectElectricValue,
|
|
||||||
a.detect_voltage_value detectVoltageValue,a.connect_voltage_type connectVoltageType,a.pond_id pondId,a.rate_electric_value rateElectricValue,
|
|
||||||
a.is_open openStatus
|
|
||||||
FROM aqu_device_switch a
|
|
||||||
left join aqu_device ad on a.device_id = ad.id
|
|
||||||
<where>
|
|
||||||
<if test="deviceId!= null"> and ad.serial_num = #{deviceName} </if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
<select id="selectBasicUserBindInfoList" resultType="com.limap.core.basic.domain.BasicUserBindInfo">
|
|
||||||
select *
|
|
||||||
from basic_user_bind_info
|
|
||||||
<where>
|
|
||||||
<if test="userId != null "> and user_id in ( SELECT dept_id FROM sys_dept WHERE dept_id = #{userId} or find_in_set( #{userId} , ancestors ) )</if>
|
|
||||||
<if test="deviceName != null and deviceName != ''"> and device_name = #{deviceName}</if>
|
|
||||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
||||||
<if test="appUserTel != null and appUserTel != ''"> and app_user_tel = #{appUserTel}</if>
|
|
||||||
</where>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,22 +6,22 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectAppUserInfo" resultType="com.limap.core.basic.domain.BasicUserBindInfo">
|
<select id="selectAppUserInfo" resultType="com.limap.core.basic.domain.BasicUserBindInfo">
|
||||||
SELECT SerialNum as device_name,IotId as iot_id,DeviceType as type,BindTime as bind_time,ad.Id as device_id,
|
SELECT serial_num as device_name,iot_id as iot_id,device_type as type,bind_time as bind_time,ad.id as device_id,
|
||||||
au.Id app_user,UserName app_user_name,MobilePhone app_user_tel
|
au.id app_user,user_name app_user_name,mobile_phone app_user_tel
|
||||||
FROM `aqu_device` ad
|
FROM aqu_device ad
|
||||||
left join aqu_user au on ad.UserId = au.Id
|
left join aqu_user au on ad.user_id = au.id
|
||||||
<where>
|
<where>
|
||||||
<if test="deviceName != null and deviceName != ''"> and SerialNum = #{deviceName}</if>
|
<if test="deviceName != null and deviceName != ''"> and serial_num = #{deviceName}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getcControlInfo" resultType="com.limap.core.screen.vo.ControlSwitch">
|
<select id="getcControlInfo" resultType="com.limap.core.screen.vo.ControlSwitch">
|
||||||
SELECT a.Id id,a.DeviceId deviceId ,a.`Index` `index`,a.SwitchName switchName, a.DetectElectricValue detectElectricValue,
|
SELECT a.id id,a.device_id deviceId ,a."index" "index",a.switch_name switchName, a.detect_electric_value detectElectricValue,
|
||||||
a.DetectVoltageValue detectVoltageValue,a.ConnectVoltageType connectVoltageType,a.PondId pondId,a.RateElectricValue rateElectricValue,
|
a.detect_voltage_value detectVoltageValue,a.connect_voltage_type connectVoltageType,a.pond_id pondId,a.rate_electric_value rateElectricValue,
|
||||||
a.IsOpen openStatus
|
a.is_open openStatus
|
||||||
FROM `aqu_device_switch` a
|
FROM aqu_device_switch a
|
||||||
left join aqu_device ad on a.DeviceId = ad.Id
|
left join aqu_device ad on a.device_id = ad.id
|
||||||
<where>
|
<where>
|
||||||
<if test="deviceId!= null"> and ad.SerialNum = #{deviceName} </if>
|
<if test="deviceId!= null"> and ad.serial_num = #{deviceName} </if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectBasicUserBindInfoList" resultType="com.limap.core.basic.domain.BasicUserBindInfo">
|
<select id="selectBasicUserBindInfoList" resultType="com.limap.core.basic.domain.BasicUserBindInfo">
|
||||||
|
|||||||
Reference in New Issue
Block a user