Merge remote-tracking branch 'origin/master' into dev
# Conflicts: # smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/Device.java
This commit is contained in:
commit
a5ed55768c
|
@ -13,10 +13,7 @@ import lombok.Data;
|
||||||
import org.hibernate.validator.constraints.Range;
|
import org.hibernate.validator.constraints.Range;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import javax.validation.constraints.Min;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import javax.validation.constraints.Past;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -200,6 +197,15 @@ public class Device extends BaseEntity
|
||||||
@JsonView(JsonViewProfile.App.class)
|
@JsonView(JsonViewProfile.App.class)
|
||||||
private BigDecimal surplusEle;
|
private BigDecimal surplusEle;
|
||||||
|
|
||||||
|
@Excel(name = "限制充值时间", readConverterExp = "到=期之前不允许充值")
|
||||||
|
@ApiModelProperty("限制充值时间")
|
||||||
|
private LocalDateTime limitRechargeTime;
|
||||||
|
|
||||||
|
@Excel(name = "限制充值原因")
|
||||||
|
@ApiModelProperty("限制充值原因")
|
||||||
|
@Size(max = 200, message = "限制充值原因长度不能超过200个字符")
|
||||||
|
private String limitRechargeReason;
|
||||||
|
|
||||||
@ApiModelProperty("上次恢复余额的时间戳")
|
@ApiModelProperty("上次恢复余额的时间戳")
|
||||||
private Long lastRecoverTime;
|
private Long lastRecoverTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,8 @@ public class DeviceBO extends Device {
|
||||||
bo.setOverPrice(getOverPrice());
|
bo.setOverPrice(getOverPrice());
|
||||||
bo.setOverUnit(getOverUnit());
|
bo.setOverUnit(getOverUnit());
|
||||||
bo.setSuitIds(getSuitIds());
|
bo.setSuitIds(getSuitIds());
|
||||||
|
bo.setLimitRechargeTime(getLimitRechargeTime());
|
||||||
|
bo.setLimitRechargeReason(getLimitRechargeReason());
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +61,8 @@ public class DeviceBO extends Device {
|
||||||
bo.setOverPrice(getOverPrice());
|
bo.setOverPrice(getOverPrice());
|
||||||
bo.setOverUnit(getOverUnit());
|
bo.setOverUnit(getOverUnit());
|
||||||
bo.setSuitIds(getSuitIds());
|
bo.setSuitIds(getSuitIds());
|
||||||
|
bo.setLimitRechargeTime(getLimitRechargeTime());
|
||||||
|
bo.setLimitRechargeReason(getLimitRechargeReason());
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
sd.rent_time,
|
sd.rent_time,
|
||||||
sd.lock_user_id,
|
sd.lock_user_id,
|
||||||
sd.surplus_ele,
|
sd.surplus_ele,
|
||||||
|
sd.limit_recharge_time,
|
||||||
|
sd.limit_recharge_reason,
|
||||||
sm.model_name as model,
|
sm.model_name as model,
|
||||||
sm.picture as picture,
|
sm.picture as picture,
|
||||||
sm.tags as model_tags,
|
sm.tags as model_tags,
|
||||||
|
@ -291,6 +293,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="rentTime != null">rent_time,</if>
|
<if test="rentTime != null">rent_time,</if>
|
||||||
<if test="lockUserId != null">lock_user_id,</if>
|
<if test="lockUserId != null">lock_user_id,</if>
|
||||||
<if test="surplusEle != null">surplus_ele,</if>
|
<if test="surplusEle != null">surplus_ele,</if>
|
||||||
|
<if test="limitRechargeTime != null">limit_recharge_time,</if>
|
||||||
|
<if test="limitRechargeReason != null">limit_recharge_reason,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="storeId != null">#{storeId},</if>
|
<if test="storeId != null">#{storeId},</if>
|
||||||
|
@ -331,6 +335,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="rentTime != null">#{rentTime},</if>
|
<if test="rentTime != null">#{rentTime},</if>
|
||||||
<if test="lockUserId != null">#{lockUserId},</if>
|
<if test="lockUserId != null">#{lockUserId},</if>
|
||||||
<if test="surplusEle != null">#{surplusEle},</if>
|
<if test="surplusEle != null">#{surplusEle},</if>
|
||||||
|
<if test="limitRechargeTime != null">#{limitRechargeTime},</if>
|
||||||
|
<if test="limitRechargeReason != null">#{limitRechargeReason},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -392,6 +398,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="rentTime != null">rent_time = #{rentTime},</if>
|
<if test="rentTime != null">rent_time = #{rentTime},</if>
|
||||||
<if test="lockUserId != null">lock_user_id = #{lockUserId},</if>
|
<if test="lockUserId != null">lock_user_id = #{lockUserId},</if>
|
||||||
<if test="surplusEle != null">surplus_ele = #{surplusEle},</if>
|
<if test="surplusEle != null">surplus_ele = #{surplusEle},</if>
|
||||||
|
<if test="limitRechargeTime != null">limit_recharge_time = #{limitRechargeTime},</if>
|
||||||
|
<if test="limitRechargeReason != null">limit_recharge_reason = #{limitRechargeReason},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where device_id = #{deviceId}
|
where device_id = #{deviceId}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
@ -86,6 +86,9 @@ public class TransactionBillValidatorImpl extends BaseValidator implements Trans
|
||||||
if (StringUtils.isEmpty(device.getMac())) {
|
if (StringUtils.isEmpty(device.getMac())) {
|
||||||
return error("当前设备Mac为空,无法充值");
|
return error("当前设备Mac为空,无法充值");
|
||||||
}
|
}
|
||||||
|
if (device.getLimitRechargeTime() != null && LocalDateTime.now().isBefore(device.getLimitRechargeTime())) {
|
||||||
|
return error("当前设备被限制充值:" + device.getLimitRechargeReason());
|
||||||
|
}
|
||||||
|
|
||||||
// 判断设备是否有正在使用中的订单
|
// 判断设备是否有正在使用中的订单
|
||||||
TransactionBillQuery query = new TransactionBillQuery();
|
TransactionBillQuery query = new TransactionBillQuery();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user