细节优化
This commit is contained in:
parent
62865d9a6d
commit
3f08b1f54a
|
@ -90,4 +90,9 @@ public class CacheConstants
|
|||
* 提现渠道名称列表
|
||||
*/
|
||||
public static final String CHANNEL_WITHDRAW_NAME_LIST = "channel_withdraw_name_list";
|
||||
|
||||
/**
|
||||
* 所有APP信息
|
||||
*/
|
||||
public static final String ALL_APP_LIST = "all_app_list";
|
||||
}
|
||||
|
|
|
@ -272,4 +272,8 @@ public class SmUser extends BaseEntity
|
|||
|
||||
@ApiModelProperty("是否开启续单")
|
||||
private Boolean enabledRenew;
|
||||
|
||||
@ApiModelProperty("风控标签")
|
||||
private String riskTag;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package com.ruoyi.ss.app.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* APP信息对象 ss_app
|
||||
*
|
||||
|
@ -35,4 +36,9 @@ public class App extends BaseEntity
|
|||
@ApiModelProperty("应用配置")
|
||||
private AppConfig config;
|
||||
|
||||
@ApiModelProperty("SN码前缀")
|
||||
private String snPrefix;
|
||||
|
||||
@ApiModelProperty("合伙人前缀")
|
||||
private String staffPrefix;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.ss.app.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppAllVO {
|
||||
|
||||
@ApiModelProperty("应用ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("应用名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("应用类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("SN码前缀")
|
||||
private String snPrefix;
|
||||
|
||||
@ApiModelProperty("合伙人前缀")
|
||||
private String staffPrefix;
|
||||
}
|
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.ss.app.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.ss.app.domain.App;
|
||||
import com.ruoyi.ss.app.domain.AppQuery;
|
||||
import com.ruoyi.ss.app.domain.AppVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.app.domain.vo.AppAllVO;
|
||||
|
||||
/**
|
||||
* APP信息Mapper接口
|
||||
|
@ -62,4 +64,10 @@ public interface AppMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAppByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询所有APP信息
|
||||
* @return
|
||||
*/
|
||||
List<AppAllVO> selectAllList();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sa.name,
|
||||
sa.type,
|
||||
sa.config,
|
||||
sa.create_time
|
||||
sa.create_time,
|
||||
sa.sn_prefix,
|
||||
sa.staff_prefix
|
||||
from ss_app sa
|
||||
</sql>
|
||||
|
||||
|
@ -22,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.id != null "> and sa.id = #{query.id}</if>
|
||||
<if test="query.name != null and query.name != ''"> and sa.name like concat('%', #{query.name}, '%')</if>
|
||||
<if test="query.type != null and query.type != ''"> and sa.type = #{query.type}</if>
|
||||
<if test="query.snPrefix != null and query.snPrefix != ''"> and sa.sn_prefix like concat('%', #{query.snPrefix}, '%')</if>
|
||||
<if test="query.staffPrefix != null and query.staffPrefix != ''"> and sa.staff_prefix like concat('%', #{query.staffPrefix}, '%')</if>
|
||||
<if test="query.ids != null and query.ids.size() > 0">
|
||||
and sa.id in
|
||||
<foreach item="item" collection="query.ids" open="(" separator="," close=")">
|
||||
|
@ -50,12 +54,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="type != null">type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="config != null">config,</if>
|
||||
<if test="snPrefix != null">sn_prefix,</if>
|
||||
<if test="staffPrefix != null">staff_prefix,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="config != null">#{config,typeHandler=com.ruoyi.ss.app.mapper.typehandler.AppConfigJsonTypeHandler},</if>
|
||||
<if test="snPrefix != null">#{snPrefix},</if>
|
||||
<if test="staffPrefix != null">#{staffPrefix},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -72,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.type != null">type = #{data.type},</if>
|
||||
<if test="data.config != null">config = #{data.config,typeHandler=com.ruoyi.ss.app.mapper.typehandler.AppConfigJsonTypeHandler},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
<if test="data.snPrefix != null">sn_prefix = #{data.snPrefix},</if>
|
||||
<if test="data.staffPrefix != null">staff_prefix = #{data.staffPrefix},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteAppById" parameterType="Long">
|
||||
|
@ -84,4 +94,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectAllList" resultType="AppAllVO">
|
||||
select
|
||||
sa.id,
|
||||
sa.name,
|
||||
sa.type,
|
||||
sa.sn_prefix,
|
||||
sa.staff_prefix
|
||||
from ss_app sa
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package com.ruoyi.ss.app.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.ss.app.domain.App;
|
||||
import com.ruoyi.ss.app.domain.AppQuery;
|
||||
import com.ruoyi.ss.app.domain.AppVO;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.app.domain.vo.AppAllVO;
|
||||
|
||||
/**
|
||||
* APP信息Service接口
|
||||
|
@ -68,4 +69,10 @@ public interface AppService
|
|||
* @return
|
||||
*/
|
||||
List<AppVO> selectByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有APP信息
|
||||
* @return
|
||||
*/
|
||||
List<AppAllVO> selectAll();
|
||||
}
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
package com.ruoyi.ss.app.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
import com.ruoyi.ss.app.domain.App;
|
||||
import com.ruoyi.ss.app.domain.AppQuery;
|
||||
import com.ruoyi.ss.app.domain.AppVO;
|
||||
import com.ruoyi.ss.app.domain.vo.AppAllVO;
|
||||
import com.ruoyi.ss.app.mapper.AppMapper;
|
||||
import com.ruoyi.ss.app.service.AppService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP信息Service业务层处理
|
||||
|
@ -25,6 +30,12 @@ public class AppServiceImpl implements AppService
|
|||
@Autowired
|
||||
private AppMapper appMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private TransactionTemplate transactionTemplate;
|
||||
|
||||
/**
|
||||
* 查询APP信息
|
||||
*
|
||||
|
@ -58,8 +69,15 @@ public class AppServiceImpl implements AppService
|
|||
@Override
|
||||
public int insertApp(App app)
|
||||
{
|
||||
app.setCreateTime(DateUtils.getNowDate());
|
||||
return appMapper.insertApp(app);
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
app.setCreateTime(DateUtils.getNowDate());
|
||||
int insert = appMapper.insertApp(app);
|
||||
if (insert > 0) {
|
||||
clearCache();
|
||||
}
|
||||
return insert;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,7 +89,14 @@ public class AppServiceImpl implements AppService
|
|||
@Override
|
||||
public int updateApp(App app)
|
||||
{
|
||||
return appMapper.updateApp(app);
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
int update = appMapper.updateApp(app);
|
||||
if (update > 0) {
|
||||
clearCache();
|
||||
}
|
||||
return update;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +108,14 @@ public class AppServiceImpl implements AppService
|
|||
@Override
|
||||
public int deleteAppByIds(Long[] ids)
|
||||
{
|
||||
return appMapper.deleteAppByIds(ids);
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
int delete = appMapper.deleteAppByIds(ids);
|
||||
if (delete > 0) {
|
||||
clearCache();
|
||||
}
|
||||
return delete;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,7 +127,14 @@ public class AppServiceImpl implements AppService
|
|||
@Override
|
||||
public int deleteAppById(Long id)
|
||||
{
|
||||
return appMapper.deleteAppById(id);
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
int delete = appMapper.deleteAppById(id);
|
||||
if (delete > 0) {
|
||||
clearCache();
|
||||
}
|
||||
return delete;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,4 +146,23 @@ public class AppServiceImpl implements AppService
|
|||
query.setIds(ids);
|
||||
return appMapper.selectAppList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppAllVO> selectAll() {
|
||||
List<AppAllVO> list = redisCache.getCacheList(CacheConstants.ALL_APP_LIST);
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
list = appMapper.selectAllList();
|
||||
if (CollectionUtils.isNotEmptyElement(list)) {
|
||||
redisCache.setCacheList(CacheConstants.ALL_APP_LIST, list);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存
|
||||
*/
|
||||
private void clearCache() {
|
||||
redisCache.deleteObject(CacheConstants.ALL_APP_LIST);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.ruoyi.ss.device.domain;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/5/10
|
||||
|
@ -53,6 +53,8 @@ public class DeviceBO extends Device {
|
|||
bo.setDeviceId(getDeviceId());
|
||||
bo.setCustomPicture(getCustomPicture());
|
||||
bo.setModelId(getModelId());
|
||||
bo.setMac(getMac());
|
||||
bo.setMac2(getMac2());
|
||||
bo.setDeviceNo(getDeviceNo());
|
||||
bo.setDeviceName(getDeviceName());
|
||||
bo.setServiceRate(getServiceRate());
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package com.ruoyi.ss.device.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.ruoyi.common.core.domain.JsonViewProfile;
|
||||
|
@ -9,15 +15,10 @@ import com.ruoyi.ss.device.domain.Device;
|
|||
import com.ruoyi.ss.device.domain.DeviceView;
|
||||
import com.ruoyi.ss.device.utils.DeviceUtils;
|
||||
import com.ruoyi.ss.suit.domain.SuitVO;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/3/15
|
||||
|
@ -111,6 +112,9 @@ public class DeviceVO extends Device implements IotDevice {
|
|||
@ApiModelProperty("分成比例列表")
|
||||
private List<Bonus> bonusList;
|
||||
|
||||
@ApiModelProperty("型号APP ID列表")
|
||||
private List<Long> modelAppIds;
|
||||
|
||||
@Override
|
||||
public String iotMac1() {
|
||||
return getMac();
|
||||
|
|
|
@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="surplusEle" column="surplus_ele" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler" />
|
||||
<result property="initReading" column="init_reading" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler" />
|
||||
<result property="modelTags" column="model_tags" typeHandler="com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler" />
|
||||
<result property="modelAppIds" column="model_app_ids" typeHandler="com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectVo">
|
||||
|
@ -76,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sm.picture as picture,
|
||||
sm.tags as model_tags,
|
||||
sm.product_id as model_product_id,
|
||||
sm.app_ids as model_app_ids,
|
||||
ss.name as store_name,
|
||||
ss.contact_name as store_contact_name,
|
||||
ss.contact_mobile as store_contact_mobile,
|
||||
|
|
|
@ -204,16 +204,7 @@ public class DeviceServiceImpl implements DeviceService
|
|||
deviceValidator.afterCheck(vo);
|
||||
|
||||
// 注册到OneNet
|
||||
if (StringUtils.hasText(vo.getModelProductId())) {
|
||||
// 创建OneNet设备1
|
||||
int code = iotService.create(data.getMac(), vo.getModelProductId());
|
||||
ServiceUtil.assertion(!IotHttpStatus.SUCCESS.equalCode(code) && !IotHttpStatus.DEVICE_EXIST.equalCode(code), "MAC-1注册失败");
|
||||
// 创建OneNet设备2
|
||||
if (StringUtils.hasText(data.getMac2())) {
|
||||
code = iotService.create(data.getMac2(), vo.getModelProductId());
|
||||
ServiceUtil.assertion(!IotHttpStatus.SUCCESS.equalCode(code) && !IotHttpStatus.DEVICE_EXIST.equalCode(code), "MAC-2注册失败");
|
||||
}
|
||||
}
|
||||
this.registerToOneNet(vo);
|
||||
|
||||
return insert;
|
||||
});
|
||||
|
@ -223,6 +214,19 @@ public class DeviceServiceImpl implements DeviceService
|
|||
}
|
||||
}
|
||||
|
||||
private void registerToOneNet(DeviceVO vo) {
|
||||
if (StringUtils.hasText(vo.getModelProductId())) {
|
||||
// 创建OneNet设备1
|
||||
int code = iotService.create(vo.getMac(), vo.getModelProductId());
|
||||
ServiceUtil.assertion(!IotHttpStatus.SUCCESS.equalCode(code) && !IotHttpStatus.DEVICE_EXIST.equalCode(code), "MAC-1注册失败");
|
||||
// 创建OneNet设备2
|
||||
if (StringUtils.hasText(vo.getMac2())) {
|
||||
code = iotService.create(vo.getMac2(), vo.getModelProductId());
|
||||
ServiceUtil.assertion(!IotHttpStatus.SUCCESS.equalCode(code) && !IotHttpStatus.DEVICE_EXIST.equalCode(code), "MAC-2注册失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*
|
||||
|
@ -234,8 +238,8 @@ public class DeviceServiceImpl implements DeviceService
|
|||
|
||||
data.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
// 修改数据库
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
// 更新主表
|
||||
int update = deviceMapper.updateSmDevice(data);
|
||||
ServiceUtil.assertion(update != 1, "更新设备失败");
|
||||
|
||||
|
@ -243,6 +247,11 @@ public class DeviceServiceImpl implements DeviceService
|
|||
DeviceVO vo = this.selectById(data.getDeviceId());
|
||||
deviceAssembler.assembleBonusList(vo);
|
||||
deviceValidator.afterCheck(vo);
|
||||
|
||||
// 若修改了MAC或者型号,则需要重新注册到OneNet
|
||||
if (data.getMac() != null || data.getMac2() != null || data.getModelId() != null) {
|
||||
this.registerToOneNet(vo);
|
||||
}
|
||||
|
||||
// 更新套餐关联
|
||||
if (data.getSuitIds() != null) {
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
package com.ruoyi.ss.device.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseValidator;
|
||||
import com.ruoyi.common.core.domain.ValidateResult;
|
||||
import com.ruoyi.common.enums.ServiceCode;
|
||||
|
@ -23,11 +34,6 @@ import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillType;
|
|||
import com.ruoyi.ss.transactionBill.service.TransactionBillService;
|
||||
import com.ruoyi.ss.user.domain.SmUserVO;
|
||||
import com.ruoyi.ss.user.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
|
|
|
@ -79,5 +79,5 @@ public class SmModel extends BaseEntity
|
|||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("应用ID")
|
||||
private Long appId;
|
||||
private List<Long> appIds;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class SmModelBO extends SmModel {
|
|||
bo.setProductId(getProductId());
|
||||
bo.setSnPrefix(getSnPrefix());
|
||||
bo.setSort(getSort());
|
||||
bo.setAppId(getAppId());
|
||||
bo.setAppIds(getAppIds());
|
||||
return bo;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class SmModelBO extends SmModel {
|
|||
bo.setProductId(getProductId());
|
||||
bo.setSnPrefix(getSnPrefix());
|
||||
bo.setSort(getSort());
|
||||
bo.setAppId(getAppId());
|
||||
bo.setAppIds(getAppIds());
|
||||
return bo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="com.ruoyi.ss.model.domain.SmModelVO" id="SmModelResult" autoMapping="true">
|
||||
<result property="tags" column="tags" typeHandler="com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler"/>
|
||||
<result property="appIds" column="app_ids" typeHandler="com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSmModelVo">
|
||||
|
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sm.product_id,
|
||||
sm.sn_prefix,
|
||||
sm.sort,
|
||||
sm.app_id
|
||||
sm.app_ids
|
||||
from sm_model sm
|
||||
</sql>
|
||||
|
||||
|
@ -36,7 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="model != null and model != ''"> and sm.model = #{model}</if>
|
||||
<if test="serviceType != null and serviceType != ''"> and sm.service_type = #{serviceType}</if>
|
||||
<if test="productId != null and productId != ''"> and sm.product_id = #{productId}</if>
|
||||
<if test="appId != null and appId != ''"> and sm.app_id = #{appId}</if>
|
||||
<if test="deleted == null">and sm.deleted = false</if>
|
||||
<if test="deleted != null">and sm.deleted = #{deleted}</if>
|
||||
<if test="keyword != null">
|
||||
|
@ -94,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="productId != null">product_id,</if>
|
||||
<if test="snPrefix != null">sn_prefix,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="appIds != null">app_ids,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="modelName != null">#{modelName},</if>
|
||||
|
@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="productId != null">#{productId},</if>
|
||||
<if test="snPrefix != null">#{snPrefix},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="appIds != null">#{appIds,typeHandler=com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -136,7 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="snPrefix != null">sn_prefix = #{snPrefix},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="appIds != null">app_ids = #{appIds,typeHandler=com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler},</if>
|
||||
</trim>
|
||||
where model_id = #{modelId}
|
||||
</update>
|
||||
|
|
|
@ -16,4 +16,6 @@ public class RiskVO extends Risk{
|
|||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户风控标签")
|
||||
private String userRiskTag;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sr.submit_type,
|
||||
sr.video_words,
|
||||
<include refid="isFinished"/> as is_finished,
|
||||
if(su.is_real, su.real_name, su.user_name) as user_name
|
||||
if(su.is_real, su.real_name, su.user_name) as user_name,
|
||||
su.risk_tag as user_risk_tag
|
||||
from ss_risk sr
|
||||
left join sm_user su on su.user_id = sr.user_id
|
||||
</sql>
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.ss.riskInfo.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.Sensitive;
|
||||
import com.ruoyi.common.enums.DesensitizedType;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/11/25
|
||||
|
@ -49,4 +50,7 @@ public class RiskInfoVO extends RiskInfo {
|
|||
@ApiModelProperty("人脸图片")
|
||||
@Sensitive(desensitizedType = DesensitizedType.COMMON)
|
||||
private String realFace;
|
||||
|
||||
@ApiModelProperty("用户风控标签")
|
||||
private String userRiskTag;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
if(su.is_real, su.real_name, su.user_name) as user_name,
|
||||
srn.name as real_name,
|
||||
srn.id_card as real_id_card,
|
||||
srn.face_image as real_face
|
||||
srn.face_image as real_face,
|
||||
su.risk_tag as user_risk_tag
|
||||
from ss_risk_info sri
|
||||
left join ss_risk sr on sr.risk_id = sri.risk_id
|
||||
left join sm_user su on su.user_id = sr.user_id
|
||||
|
@ -54,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.verifyRemark != null and query.verifyRemark != ''"> and sri.verify_remark like concat('%', #{query.verifyRemark}, '%')</if>
|
||||
<if test="query.userId != null "> and sr.user_id = #{query.userId}</if>
|
||||
<if test="query.userName != null and query.userName != ''"> and if(su.is_real, su.real_name, su.user_name) like concat('%', #{query.userName}, '%')</if>
|
||||
<if test="query.userRiskTag != null and query.userRiskTag != ''"> and su.risk_tag = #{query.userRiskTag}</if>
|
||||
<if test="query.excludeInfoId != null">
|
||||
and sri.info_id != #{query.excludeInfoId}
|
||||
</if>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package com.ruoyi.ss.transactionBill.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.ruoyi.common.annotation.Sensitive;
|
||||
|
@ -10,14 +14,11 @@ import com.ruoyi.ss.bonus.domain.BonusVO;
|
|||
import com.ruoyi.ss.device.utils.DeviceUtils;
|
||||
import com.ruoyi.ss.transactionBill.domain.TransactionBill;
|
||||
import com.ruoyi.ss.transactionBill.utils.RechargeUtils;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 辉
|
||||
* 2024/3/4
|
||||
|
@ -83,6 +84,15 @@ public class TransactionBillVO extends TransactionBill implements IotDevice {
|
|||
|
||||
private Long suitSeconds;
|
||||
|
||||
@ApiModelProperty("用户风控标签")
|
||||
private String userRiskTag;
|
||||
|
||||
@ApiModelProperty("商户风控标签")
|
||||
private String mchRiskTag;
|
||||
|
||||
@ApiModelProperty("代理商风控标签")
|
||||
private String agentRiskTag;
|
||||
|
||||
@Override
|
||||
public String iotMac1() {
|
||||
return getDeviceMac();
|
||||
|
|
|
@ -103,7 +103,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sd.expire_time as device_expire_time,
|
||||
sd.expire_ele as device_expire_ele,
|
||||
su.phonenumber as user_mobile,
|
||||
sc.name as channel_name
|
||||
sc.name as channel_name,
|
||||
su.risk_tag as user_risk_tag,
|
||||
su1.risk_tag as mch_risk_tag,
|
||||
sua.risk_tag as agent_risk_tag
|
||||
from <include refid="rechargeTables"/>
|
||||
</sql>
|
||||
|
||||
|
@ -111,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sm_transaction_bill stb
|
||||
left join sm_user su on su.user_id = stb.user_id
|
||||
left join sm_user su1 on su1.user_id = stb.mch_id
|
||||
left join sm_user sua on sua.user_id = stb.agent_id
|
||||
left join sm_device sd on sd.device_id = stb.device_id
|
||||
left join sm_suit ss on ss.suit_id = stb.suit_id
|
||||
left join sm_channel sc on sc.channel_id = stb.channel_id
|
||||
|
@ -124,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
if(su1.is_real, su1.real_name, su1.user_name) as mch_name,
|
||||
su1.phonenumber as mch_mobile,
|
||||
su.phonenumber as user_mobile,
|
||||
su.risk_tag as user_risk_tag,
|
||||
su1.risk_tag as mch_risk_tag,
|
||||
sc.name as channel_name
|
||||
from sm_transaction_bill stb
|
||||
left join sm_user su on su.user_id = stb.user_id
|
||||
|
|
|
@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
su.app_id,
|
||||
su.vip_service_rate,
|
||||
su.enabled_renew,
|
||||
su.risk_tag,
|
||||
if(su.is_real, su.real_name, su.user_name) as real_or_user_name,
|
||||
sa.name as app_name
|
||||
from sm_user su
|
||||
|
@ -105,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="appId != null "> and su.app_id = #{appId}</if>
|
||||
<if test="isReal != null "> and su.is_real = #{isReal}</if>
|
||||
<if test="enabledRenew != null "> and su.enabled_renew = #{enabledRenew}</if>
|
||||
<if test="riskTag != null and riskTag != ''">and su.risk_tag = #{riskTag}</if>
|
||||
<if test="tenantDeviceId != null">
|
||||
and su.user_id in (
|
||||
select sdt.tenant_id
|
||||
|
@ -224,6 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="appId != null">app_id,</if>
|
||||
<if test="vipServiceRate != null">vip_service_rate,</if>
|
||||
<if test="enabledRenew != null">enabled_renew,</if>
|
||||
<if test="riskTag != null">risk_tag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
|
@ -277,6 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="appId != null">#{appId},</if>
|
||||
<if test="vipServiceRate != null">#{vipServiceRate},</if>
|
||||
<if test="enabledRenew != null">#{enabledRenew},</if>
|
||||
<if test="riskTag != null">#{riskTag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -346,6 +350,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="vipServiceRate != null">vip_service_rate = #{vipServiceRate},</if>
|
||||
<if test="enabledRenew != null">enabled_renew = #{enabledRenew},</if>
|
||||
<if test="riskTag != null">risk_tag = #{riskTag},</if>
|
||||
</trim>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
|
|
@ -58,6 +58,7 @@ public class UserConverterImpl implements UserConverter {
|
|||
po.setRemark(data.getRemark());
|
||||
po.setVipServiceRate(data.getVipServiceRate());
|
||||
po.setEnabledRenew(data.getEnabledRenew());
|
||||
po.setRiskTag(data.getRiskTag());
|
||||
|
||||
return po;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,21 @@
|
|||
package com.ruoyi.web.controller.ss;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
@ -10,14 +26,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|||
import com.ruoyi.ss.app.domain.App;
|
||||
import com.ruoyi.ss.app.domain.AppQuery;
|
||||
import com.ruoyi.ss.app.domain.AppVO;
|
||||
import com.ruoyi.ss.app.domain.vo.AppAllVO;
|
||||
import com.ruoyi.ss.app.service.AppService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP信息Controller
|
||||
|
@ -46,7 +56,17 @@ public class AppController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询APP信息列表
|
||||
* 查询所有APP信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public AjaxResult all() {
|
||||
List<AppAllVO> list = appService.selectAll();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id集合查询APP信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ss:app:list')")
|
||||
@PostMapping("/listByIds")
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package com.ruoyi.web.controller.ss;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.IotConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
@ -16,17 +35,9 @@ import com.ruoyi.ss.device.domain.vo.DeviceVO;
|
|||
import com.ruoyi.ss.device.service.DeviceAssembler;
|
||||
import com.ruoyi.ss.device.service.DeviceService;
|
||||
import com.ruoyi.ss.suit.domain.enums.SuitTimeUnit;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Controller
|
||||
|
|
Loading…
Reference in New Issue
Block a user