提交修改
This commit is contained in:
parent
37ead7237a
commit
5a23850204
@ -40,7 +40,7 @@ public interface VvBuyerDao extends BaseMapper<VvBuyerEntity> {
|
||||
int deleteVvBuyerById(@Param("id") Long id);
|
||||
|
||||
|
||||
@OrderBy(VvBuyerEntity.id_)
|
||||
@OrderBy(VvBuyerEntity.id_ )
|
||||
List<VvBuyerEntity> selectBuyerByCondition(IPage page,
|
||||
@IF @LIKE String buyerName,
|
||||
@IF @LIKE String buyerPhone,
|
||||
|
||||
@ -7,10 +7,12 @@ package com.heyu.api.data.dao.vv;
|
||||
* @author quyixiao
|
||||
* @since 2025-10-25
|
||||
*/
|
||||
import com.heyu.api.data.entity.vv.VvPromoterEntity;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.mybatis.plugin.annotations.IFNullReturnEmpty;
|
||||
import com.lz.mybatis.plugin.annotations.IN;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.data.entity.vv.VvBuyerEntity;
|
||||
import com.heyu.api.data.entity.vv.VvPromoterEntity;
|
||||
import com.lz.mybatis.plugin.annotations.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -38,8 +40,16 @@ public interface VvPromoterDao extends BaseMapper<VvPromoterEntity> {
|
||||
int deleteVvPromoterById(@Param("id")Long id);
|
||||
|
||||
|
||||
List<VvPromoterEntity> selectVvPromoterByPromoteIds(@IFNullReturnEmpty @IN List<String> promoterId);
|
||||
|
||||
|
||||
|
||||
List<VvPromoterEntity> selectVvPromoterByPromoteIds(@IFNullReturnEmpty @IN List<String> promoterId);
|
||||
@OrderBy(VvBuyerEntity.id_)
|
||||
List<VvPromoterEntity> selectBuyerByCondition(IPage page,
|
||||
@IF String promoterId,
|
||||
@IF Long promoterBuyerId,
|
||||
@IF @LIKE String promoterBuyerName,
|
||||
@IF @LIKE String promoterBuyerWeixin,
|
||||
@IF @LIKE String promoterBuyerPhone,
|
||||
@IF @Column(VvPromoterEntity.create_timestamp) Long minCreateTimestamp,
|
||||
@IF @Column(VvPromoterEntity.create_timestamp) Long maxCreateTimestamp,
|
||||
@OrderBy @IF @Column(VvPromoterEntity.create_timestamp) String createTimestampSort);
|
||||
}
|
||||
@ -26,14 +26,15 @@ private static final long serialVersionUID = 1L;
|
||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||
public final static String promoter_id = CLASS_NAME + "promoter_id"; // 推广者id,唯一值
|
||||
public final static String promoter_buyer_name = CLASS_NAME + "promoter_buyer_name"; // 买家名称
|
||||
public final static String promoter_buyer_weixin = CLASS_NAME + "promoter_buyer_weixin"; // 买家微信
|
||||
public final static String promoter_buyer_phone = CLASS_NAME + "promoter_buyer_phone"; // 买家微信
|
||||
public final static String promoter_buyer_id = CLASS_NAME + "promoter_buyer_id"; // 买家id
|
||||
public final static String promoter_buyer_name = CLASS_NAME + "promoter_buyer_name"; // 推广者买家名称
|
||||
public final static String promoter_buyer_weixin = CLASS_NAME + "promoter_buyer_weixin"; // 推广者买家微信
|
||||
public final static String promoter_buyer_phone = CLASS_NAME + "promoter_buyer_phone"; // 推广者买家微信
|
||||
public final static String promoter_buyer_id = CLASS_NAME + "promoter_buyer_id"; // 推广者买家id
|
||||
public final static String was_buyer_name = CLASS_NAME + "was_buyer_name"; // 被推荐买家名称
|
||||
public final static String was_buyer_weixin = CLASS_NAME + "was_buyer_weixin"; // 被推荐买家微信
|
||||
public final static String was_buyer_phone = CLASS_NAME + "was_buyer_phone"; // 被推荐者手机号
|
||||
public final static String was_promoter_buyer_id = CLASS_NAME + "was_promoter_buyer_id"; // 被推荐者买家id
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 时间毫秒值
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@ -45,13 +46,13 @@ private static final long serialVersionUID = 1L;
|
||||
private Date modifyTime;
|
||||
//推广者id,唯一值
|
||||
private String promoterId;
|
||||
//买家名称
|
||||
//推广者买家名称
|
||||
private String promoterBuyerName;
|
||||
//买家微信
|
||||
//推广者买家微信
|
||||
private String promoterBuyerWeixin;
|
||||
//买家微信
|
||||
//推广者买家微信
|
||||
private String promoterBuyerPhone;
|
||||
//买家id
|
||||
//推广者买家id
|
||||
private Long promoterBuyerId;
|
||||
//被推荐买家名称
|
||||
private String wasBuyerName;
|
||||
@ -61,6 +62,8 @@ private static final long serialVersionUID = 1L;
|
||||
private String wasBuyerPhone;
|
||||
//被推荐者买家id
|
||||
private Long wasPromoterBuyerId;
|
||||
//时间毫秒值
|
||||
private Long createTimestamp;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -137,14 +140,14 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 买家名称
|
||||
* 推广者买家名称
|
||||
* @return
|
||||
*/
|
||||
public String getPromoterBuyerName() {
|
||||
return promoterBuyerName;
|
||||
}
|
||||
/**
|
||||
* 买家名称
|
||||
* 推广者买家名称
|
||||
* @param promoterBuyerName
|
||||
*/
|
||||
public void setPromoterBuyerName(String promoterBuyerName) {
|
||||
@ -152,14 +155,14 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 买家微信
|
||||
* 推广者买家微信
|
||||
* @return
|
||||
*/
|
||||
public String getPromoterBuyerWeixin() {
|
||||
return promoterBuyerWeixin;
|
||||
}
|
||||
/**
|
||||
* 买家微信
|
||||
* 推广者买家微信
|
||||
* @param promoterBuyerWeixin
|
||||
*/
|
||||
public void setPromoterBuyerWeixin(String promoterBuyerWeixin) {
|
||||
@ -167,14 +170,14 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 买家微信
|
||||
* 推广者买家微信
|
||||
* @return
|
||||
*/
|
||||
public String getPromoterBuyerPhone() {
|
||||
return promoterBuyerPhone;
|
||||
}
|
||||
/**
|
||||
* 买家微信
|
||||
* 推广者买家微信
|
||||
* @param promoterBuyerPhone
|
||||
*/
|
||||
public void setPromoterBuyerPhone(String promoterBuyerPhone) {
|
||||
@ -182,14 +185,14 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 买家id
|
||||
* 推广者买家id
|
||||
* @return
|
||||
*/
|
||||
public Long getPromoterBuyerId() {
|
||||
return promoterBuyerId;
|
||||
}
|
||||
/**
|
||||
* 买家id
|
||||
* 推广者买家id
|
||||
* @param promoterBuyerId
|
||||
*/
|
||||
public void setPromoterBuyerId(Long promoterBuyerId) {
|
||||
@ -256,6 +259,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.wasPromoterBuyerId = wasPromoterBuyerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间毫秒值
|
||||
* @return
|
||||
*/
|
||||
public Long getCreateTimestamp() {
|
||||
return createTimestamp;
|
||||
}
|
||||
/**
|
||||
* 时间毫秒值
|
||||
* @param createTimestamp
|
||||
*/
|
||||
public void setCreateTimestamp(Long createTimestamp) {
|
||||
this.createTimestamp = createTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VvPromoterEntity{" +
|
||||
@ -272,6 +290,7 @@ private static final long serialVersionUID = 1L;
|
||||
",wasBuyerWeixin=" + wasBuyerWeixin +
|
||||
",wasBuyerPhone=" + wasBuyerPhone +
|
||||
",wasPromoterBuyerId=" + wasPromoterBuyerId +
|
||||
",createTimestamp=" + createTimestamp +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -55,11 +55,6 @@ public class RedisUtils {
|
||||
*/
|
||||
public final static long DEFAULT_EXPIRE = 60 * 60 * 24;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 不设置过期时长
|
||||
*/
|
||||
@ -102,36 +97,29 @@ public class RedisUtils {
|
||||
|
||||
public <T> T get(String key, Class<T> clazz, long expire) {
|
||||
String value = valueOperations.get(key);
|
||||
if (expire != NOT_EXPIRE) {
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
}
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
return value == null ? null : fromJson(value, clazz);
|
||||
}
|
||||
|
||||
public <T> T get(String key, Class<T> clazz) {
|
||||
return get(key, clazz, NOT_EXPIRE);
|
||||
String value = valueOperations.get(key);
|
||||
return value == null ? null : fromJson(value, clazz);
|
||||
}
|
||||
|
||||
public String get(String key, long expire) {
|
||||
String value = valueOperations.get(key);
|
||||
if (expire != NOT_EXPIRE) {
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
}
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
return value;
|
||||
}
|
||||
|
||||
public String get(String key) {
|
||||
try {
|
||||
return get(key, NOT_EXPIRE);
|
||||
return valueOperations.get(key);
|
||||
} catch (Exception e) {
|
||||
logger.error("redis获取值异常", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getAndSet(String key, String value) {
|
||||
return getAndSet(key, value, NOT_EXPIRE);
|
||||
}
|
||||
|
||||
public String getAndSet(String key, String value, long expire) {
|
||||
value = valueOperations.getAndSet(key, value);
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package com.heyu.api.alibaba.request.mm;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VvPromoterRequest extends VVAdminBaseRequest {
|
||||
|
||||
//推广者id,唯一值
|
||||
private String promoterId;
|
||||
//推广者买家名称
|
||||
private String promoterBuyerName;
|
||||
//推广者买家微信
|
||||
private String promoterBuyerWeixin;
|
||||
//推广者买家微信
|
||||
private String promoterBuyerPhone;
|
||||
//推广者买家id
|
||||
private Long promoterBuyerId;
|
||||
|
||||
//创建时间撮
|
||||
private Long minCreateTimestamp;
|
||||
// 创建时间最小值
|
||||
private Long maxCreateTimestamp;
|
||||
/***
|
||||
* 按创建时间排序,,传 ASC 或 DESC
|
||||
*/
|
||||
private String createTimestampSort;
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
|
||||
package com.heyu.api.controller.mm;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.alibaba.request.mm.VvPromoterRequest;
|
||||
import com.heyu.api.data.dao.vv.VvPromoterDao;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.utils.ISelect;
|
||||
import com.heyu.api.utils.PPageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/mm/promoter")
|
||||
public class AdminPromoterController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private VvPromoterDao vvPromoterDao;
|
||||
|
||||
/***
|
||||
* 列表
|
||||
* http://localhost:8888/mm/promoter/list
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestBody VvPromoterRequest vvPromoterRequest) {
|
||||
PPageUtils pageUtils = PPageUtils.startPage(vvPromoterRequest.getPageNum(), vvPromoterRequest.getPageSize())
|
||||
.doSelect(new ISelect() {
|
||||
@Override
|
||||
public List doSelect(IPage page) {
|
||||
return vvPromoterDao.selectBuyerByCondition(page,
|
||||
vvPromoterRequest.getPromoterId(),
|
||||
vvPromoterRequest.getPromoterBuyerId(),
|
||||
vvPromoterRequest.getPromoterBuyerName(),
|
||||
vvPromoterRequest.getPromoterBuyerWeixin(),
|
||||
vvPromoterRequest.getPromoterBuyerPhone(),
|
||||
vvPromoterRequest.getMinCreateTimestamp(),
|
||||
vvPromoterRequest.getMaxCreateTimestamp(),
|
||||
vvPromoterRequest.getCreateTimestampSort()
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return R.ok().setData(pageUtils);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user