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

This commit is contained in:
磷叶 2025-02-25 17:57:46 +08:00
commit cfd56deb7b
13 changed files with 97 additions and 24 deletions

View File

@ -26,16 +26,16 @@ public class ReceiveConstants {
public static final String DS_TIME = "TIME";
// 数据点ID型号
public static final String DS_FW = "FW";
// 数据点IDSSID的值创特
public static final String DSV_SSID_CT = "ChuangteA";
// 数据点IDCSQ
public static final String DS_CSQ = "CSQ";
// 数据点IDVER 版本号
public static final String DS_VER = "VER";
// 数据点IDVXS 电压系数
public static final String DS_VXS = "VXS";
// 数据点IDIMSI 物联网卡号IMSI
public static final String DS_IMSI = "IMSI";
// 数据点IDSSID的值创特
public static final String DSV_SSID_CT = "ChuangteA";
}

View File

@ -1,12 +1,14 @@
package com.ruoyi.iot.domain;
import com.ruoyi.ss.device.domain.enums.DeviceOutageWay;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.ruoyi.ss.device.domain.enums.DeviceOutageWay;
import lombok.Data;
/**
* 设备传来的数据
* @author wjh
@ -31,6 +33,7 @@ public class IotDeviceInfo {
private String wifi; // WIFI
private String version; // 版本号
private BigDecimal vxs; // 电压系数
private String imsi; // 物联网卡号IMSI
public static IotDeviceInfo newDefaultInstance() {
IotDeviceInfo info = new IotDeviceInfo();
@ -45,6 +48,7 @@ public class IotDeviceInfo {
info.setModel(null);
info.setVersion(null);
info.setVxs(BigDecimal.ONE);
info.setImsi(null);
return info;
}
}

View File

@ -1,5 +1,14 @@
package com.ruoyi.iot.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.NumberUtils;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.iot.constants.ReceiveConstants;
@ -7,14 +16,6 @@ import com.ruoyi.iot.domain.CurrentDatastream;
import com.ruoyi.iot.domain.CurrentDeviceData;
import com.ruoyi.iot.domain.IotDeviceInfo;
import com.ruoyi.iot.service.IotConverter;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
/**
* @author wjh
@ -103,6 +104,9 @@ public class IotConverterImpl implements IotConverter {
case ReceiveConstants.DS_VXS:
device.setVxs(NumberUtils.nonNullDecimal(value, BigDecimal.ZERO));
break;
case ReceiveConstants.DS_IMSI:
device.setImsi(value);
break;
default:
break;
}

View File

@ -0,0 +1,8 @@
package com.ruoyi.ss.account.mapper.typehandler;
import com.ruoyi.ss.account.domain.AccountVO;
import com.ruoyi.system.mapper.typehandler.AbstractJsonTypeHandler;
public class AccountJsonTypehandler extends AbstractJsonTypeHandler<AccountVO> {
}

View File

@ -25,7 +25,6 @@ import lombok.Data;
/**
* 设备对象 sm_device
*
* @author 邱贞招
* @date 2024-02-21
*/
@Data
@ -275,4 +274,8 @@ public class Device extends BaseEntity
@Excel(name = "用户手动操作时的总用电量")
@ApiModelProperty("用户手动操作时的总用电量")
private BigDecimal userOperaEle;
@Excel(name = "物联网卡号IMSI")
@ApiModelProperty("物联网卡号IMSI")
private String imsi;
}

View File

@ -73,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sd.user_opera_type,
sd.user_opera_time,
sd.user_opera_ele,
sd.imsi,
sm.model_name as model,
sm.picture as picture,
sm.tags as model_tags,
@ -138,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.modelTag != null and query.modelTag != ''"> and find_in_set(#{query.modelTag}, sm.tags)</if>
<if test="query.excludeDeviceId != null"> and sd.device_id != #{query.excludeDeviceId}</if>
<if test="query.userOperaType != null and query.userOperaType != ''"> and user_opera_type = #{query.userOperaType}</if>
<if test="query.imsi != null and query.imsi != ''"> and sd.imsi like concat('%', #{query.imsi}, '%')</if>
<if test="query.inStaff != null">
and sd.store_id
<if test="!query.inStaff">not</if>
@ -413,6 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userOperaType != null">user_opera_type,</if>
<if test="userOperaTime != null">user_opera_time,</if>
<if test="userOperaEle != null">user_opera_ele,</if>
<if test="imsi != null">imsi,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="storeId != null">#{storeId},</if>
@ -471,6 +474,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userOperaType != null">#{userOperaType},</if>
<if test="userOperaTime != null">#{userOperaTime},</if>
<if test="userOperaEle != null">#{userOperaEle},</if>
<if test="imsi != null">#{imsi},</if>
</trim>
</insert>
@ -562,6 +566,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userOperaType != null">user_opera_type = #{userOperaType},</if>
<if test="userOperaTime != null">user_opera_time = #{userOperaTime},</if>
<if test="userOperaEle != null">user_opera_ele = #{userOperaEle},</if>
<if test="imsi != null">imsi = #{imsi},</if>
</trim>
where device_id = #{deviceId}
</update>

View File

@ -992,6 +992,7 @@ public class DeviceServiceImpl implements DeviceService
device.setElectricity(deviceInfo.getA());
device.setVersion(deviceInfo.getVersion());
device.setVxs(deviceInfo.getVxs());
device.setImsi(deviceInfo.getImsi());
// 判断是否支持WIFI支持则更新
if (ModelTag.hasTag(device.getModelTags(), ModelTag.WIFI)) {
@ -1067,6 +1068,7 @@ public class DeviceServiceImpl implements DeviceService
data.setOnlineStatus2(device.getOnlineStatus2());
data.setLastOnlineTime(device.getLastOnlineTime());
data.setVersion(device.getVersion());
data.setImsi(device.getImsi());
return deviceMapper.updateSmDevice(data);
}

View File

@ -1,19 +1,22 @@
package com.ruoyi.ss.mchApply.domain;
import java.time.LocalDateTime;
import java.util.List;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.utils.RegexpUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
/**
* 商家合作申请对象 ss_mch_apply
*
@ -91,4 +94,19 @@ public class MchApply extends BaseEntity
@Excel(name = "审核意见")
@JsonView(JsonViewProfile.App.class)
private String verifyRemark;
@ApiModelProperty("是否有设备")
@Excel(name = "是否有设备")
@JsonView(JsonViewProfile.App.class)
private Boolean hasDevice;
@ApiModelProperty("经营模式")
@Excel(name = "经营模式")
@JsonView(JsonViewProfile.App.class)
private String operateMode;
@ApiModelProperty("使用场景列表")
@Excel(name = "使用场景列表")
@JsonView(JsonViewProfile.App.class)
private List<String> scenes;
}

View File

@ -23,6 +23,9 @@ public class MchApplyBO extends MchApply {
bo.setName(getName());
bo.setMobile(getMobile());
bo.setContent(getContent());
bo.setOperateMode(getOperateMode());
bo.setHasDevice(getHasDevice());
bo.setScenes(getScenes());
return bo;
}

View File

@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.ss.mchApply.mapper.MchApplyMapper">
<resultMap type="MchApplyVO" id="MchApplyResult" autoMapping="true">
<result property="scenes" column="scenes" typeHandler="com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler"/>
</resultMap>
<sql id="selectMchApplyVo">
@ -23,6 +24,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sma.create_time,
sma.update_time,
sma.deleted,
sma.has_device,
sma.operate_mode,
sma.scenes,
su.user_name as user_name,
sy_u.user_name as verify_name
from ss_mch_apply sma
@ -41,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.deleted == null">and sma.deleted = false</if>
<if test="query.deleted != null">and sma.deleted = #{query.deleted}</if>
<if test="query.applyId != null">and sma.apply_id = #{query.applyId}</if>
<if test="query.hasDevice != null">and sma.has_device = #{query.hasDevice}</if>
<if test="query.operateMode != null">and sma.operate_mode = #{query.operateMode}</if>
</sql>
<sql id="updateColumns">
@ -57,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="data.createTime != null">create_time = #{data.createTime},</if>
<if test="data.updateTime != null">update_time = #{data.updateTime},</if>
<if test="data.deleted != null">deleted = #{data.deleted},</if>
<if test="data.hasDevice != null">has_device = #{data.hasDevice},</if>
<if test="data.operateMode != null">operate_mode = #{data.operateMode},</if>
<if test="data.scenes != null">scenes = #{data.scenes, typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
</sql>
<select id="selectMchApplyList" parameterType="MchApplyQuery" resultMap="MchApplyResult">
@ -96,6 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="deleted != null">deleted,</if>
<if test="hasDevice != null">has_device,</if>
<if test="operateMode != null">operate_mode,</if>
<if test="scenes != null">scenes,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
@ -111,6 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="deleted != null">#{deleted},</if>
<if test="hasDevice != null">#{hasDevice},</if>
<if test="operateMode != null">#{operateMode},</if>
<if test="scenes != null">#{scenes, typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
</trim>
</insert>

View File

@ -16,6 +16,7 @@ import com.ruoyi.common.constants.DictTypeConstants;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.ss.account.domain.AccountVO;
import com.ruoyi.system.valid.DictValid;
import io.swagger.annotations.ApiModelProperty;
@ -360,4 +361,8 @@ public class TransactionBill extends BaseEntity
@ApiModelProperty("优惠金额退款")
@JsonView(JsonViewProfile.App.class)
private BigDecimal discountRefundAmount;
@Excel(name = "提现账户")
@ApiModelProperty("提现账户")
private AccountVO withdrawAccount;
}

View File

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="suitGearAmount" column="suit_gear_amount" typeHandler="com.ruoyi.system.mapper.typehandler.DecimalSplitListTypeHandler"/>
<result property="suitGearTime" column="suit_gear_time" typeHandler="com.ruoyi.system.mapper.typehandler.IntegerSplitListTypeHandler"/>
<result property="deviceTotalEle" column="device_total_ele" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler"/>
<result property="withdrawAccount" column="withdraw_account" typeHandler="com.ruoyi.ss.account.mapper.typehandler.AccountJsonTypehandler"/>
</resultMap>
<sql id="BaseColumns">
@ -124,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectWithdrawVo">
select
<include refid="BaseColumns"/>
stb.withdraw_account,
if(su.is_real, su.real_name, su.user_name) as user_name,
if(su1.is_real, su1.real_name, su1.user_name) as mch_name,
su1.phonenumber as mch_mobile,
@ -652,6 +654,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="vipName != null">vip_name,</if>
<if test="discountAmount != null">discount_amount,</if>
<if test="discountRefundAmount != null">discount_refund_amount,</if>
<if test="withdrawAccount != null">withdraw_account,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billNo != null">#{billNo},</if>
@ -728,6 +731,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="vipName != null">#{vipName},</if>
<if test="discountAmount != null">#{discountAmount},</if>
<if test="discountRefundAmount != null">#{discountRefundAmount},</if>
<if test="withdrawAccount != null">#{withdrawAccount,typeHandler=com.ruoyi.ss.account.mapper.typehandler.AccountJsonTypehandler},</if>
</trim>
</insert>
@ -820,6 +824,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="data.vipName != null">stb.vip_name = #{data.vipName},</if>
<if test="data.discountAmount != null">stb.discount_amount = #{data.discountAmount},</if>
<if test="data.discountRefundAmount != null">stb.discount_refund_amount = #{data.discountRefundAmount},</if>
<if test="data.withdrawAccount != null">stb.withdraw_account = #{data.withdrawAccount,typeHandler=com.ruoyi.ss.account.mapper.typehandler.AccountJsonTypehandler},</if>
</sql>
<update id="updateByQuery">

View File

@ -601,6 +601,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
bill.setChannelCost(channel.getCostRate().multiply(bill.getMoney()).divide(new BigDecimal(100), 2,
RoundingMode.HALF_UP)); // 渠道成本
bill.setAfterBalance(user.getBalance().subtract(dto.getMoney())); // 剩余金额
bill.setWithdrawAccount(account);
transactionTemplate.execute(status -> {
// 提现申请