commit
6d0dd09b5b
@ -20,6 +20,6 @@ public class MemberExecute implements MemberLoginEvent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void memberLogin(Member member) {
|
public void memberLogin(Member member) {
|
||||||
memberService.updateById(member);
|
memberService.updateMemberLoginTime(member.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class SensitiveJsonSerializer extends JsonSerializer<String>
|
|||||||
AuthUser authUser = UserContext.getCurrentUser();
|
AuthUser authUser = UserContext.getCurrentUser();
|
||||||
//默认脱敏
|
//默认脱敏
|
||||||
if (authUser == null) {
|
if (authUser == null) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果是店铺
|
//如果是店铺
|
||||||
|
@ -227,4 +227,12 @@ public interface MemberService extends IService<Member> {
|
|||||||
* @return 所有会员的手机号
|
* @return 所有会员的手机号
|
||||||
*/
|
*/
|
||||||
List<String> getAllMemberMobile();
|
List<String> getAllMemberMobile();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新会员登录时间为最新时间
|
||||||
|
*
|
||||||
|
* @param memberId 会员id
|
||||||
|
* @return 是否更新成功
|
||||||
|
*/
|
||||||
|
boolean updateMemberLoginTime(String memberId);
|
||||||
}
|
}
|
@ -50,8 +50,8 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -595,6 +595,20 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
return this.baseMapper.getAllMemberMobile();
|
return this.baseMapper.getAllMemberMobile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新会员登录时间为最新时间
|
||||||
|
*
|
||||||
|
* @param memberId 会员id
|
||||||
|
* @return 是否更新成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateMemberLoginTime(String memberId) {
|
||||||
|
LambdaUpdateWrapper<Member> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(Member::getId, memberId);
|
||||||
|
updateWrapper.set(Member::getLastLoginDate, new Date());
|
||||||
|
return this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测会员
|
* 检测会员
|
||||||
*
|
*
|
||||||
|
@ -43,6 +43,19 @@ public class BasePromotionsSearchParams {
|
|||||||
private String storeId;
|
private String storeId;
|
||||||
|
|
||||||
public <T> QueryWrapper<T> queryWrapper() {
|
public <T> QueryWrapper<T> queryWrapper() {
|
||||||
|
QueryWrapper<T> queryWrapper = this.baseQueryWrapper();
|
||||||
|
|
||||||
|
if (CharSequenceUtil.isNotEmpty(promotionStatus)) {
|
||||||
|
queryWrapper.and(i -> {
|
||||||
|
for (String status : promotionStatus.split(",")) {
|
||||||
|
i.or(PromotionTools.queryPromotionStatus(PromotionsStatusEnum.valueOf(status)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> QueryWrapper<T> baseQueryWrapper() {
|
||||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
if (CharSequenceUtil.isNotEmpty(id)) {
|
if (CharSequenceUtil.isNotEmpty(id)) {
|
||||||
@ -54,13 +67,6 @@ public class BasePromotionsSearchParams {
|
|||||||
if (endTime != null) {
|
if (endTime != null) {
|
||||||
queryWrapper.le("end_time", new Date(endTime));
|
queryWrapper.le("end_time", new Date(endTime));
|
||||||
}
|
}
|
||||||
if (CharSequenceUtil.isNotEmpty(promotionStatus)) {
|
|
||||||
queryWrapper.and(i -> {
|
|
||||||
for (String status : promotionStatus.split(",")) {
|
|
||||||
i.or(PromotionTools.queryPromotionStatus(PromotionsStatusEnum.valueOf(status)));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (CharSequenceUtil.isNotEmpty(scopeType)) {
|
if (CharSequenceUtil.isNotEmpty(scopeType)) {
|
||||||
queryWrapper.eq("scope_type", scopeType);
|
queryWrapper.eq("scope_type", scopeType);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class CouponSearchParams extends BasePromotionsSearchParams implements Se
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> QueryWrapper<T> queryWrapper() {
|
public <T> QueryWrapper<T> queryWrapper() {
|
||||||
QueryWrapper<T> queryWrapper = super.queryWrapper();
|
QueryWrapper<T> queryWrapper = super.baseQueryWrapper();
|
||||||
if (CharSequenceUtil.isNotEmpty(couponName)) {
|
if (CharSequenceUtil.isNotEmpty(couponName)) {
|
||||||
queryWrapper.like("coupon_name", couponName);
|
queryWrapper.like("coupon_name", couponName);
|
||||||
}
|
}
|
||||||
@ -80,24 +80,27 @@ public class CouponSearchParams extends BasePromotionsSearchParams implements Se
|
|||||||
queryWrapper.eq("get_type", CouponGetEnum.valueOf(getType).name());
|
queryWrapper.eq("get_type", CouponGetEnum.valueOf(getType).name());
|
||||||
}
|
}
|
||||||
if (CharSequenceUtil.isNotEmpty(this.getPromotionStatus())) {
|
if (CharSequenceUtil.isNotEmpty(this.getPromotionStatus())) {
|
||||||
switch (PromotionsStatusEnum.valueOf(this.getPromotionStatus())) {
|
queryWrapper.and(p -> {
|
||||||
case NEW:
|
switch (PromotionsStatusEnum.valueOf(this.getPromotionStatus())) {
|
||||||
queryWrapper.nested(i -> i.gt(PromotionTools.START_TIME_COLUMN, new Date()).gt(PromotionTools.END_TIME_COLUMN, new Date()));
|
case NEW:
|
||||||
break;
|
p.nested(i -> i.gt(PromotionTools.START_TIME_COLUMN, new Date()).gt(PromotionTools.END_TIME_COLUMN, new Date()));
|
||||||
case START:
|
break;
|
||||||
queryWrapper.nested(i -> i.le(PromotionTools.START_TIME_COLUMN, new Date()).ge(PromotionTools.END_TIME_COLUMN, new Date()))
|
case START:
|
||||||
.or(i -> i.gt("effective_days", 0).eq(RANGE_DAY_TYPE_COLUMN, CouponRangeDayEnum.DYNAMICTIME.name()));
|
p.nested(i -> i.le(PromotionTools.START_TIME_COLUMN, new Date()).ge(PromotionTools.END_TIME_COLUMN, new Date()))
|
||||||
break;
|
.or(i -> i.gt("effective_days", 0).eq(RANGE_DAY_TYPE_COLUMN, CouponRangeDayEnum.DYNAMICTIME.name()));
|
||||||
case END:
|
break;
|
||||||
queryWrapper.nested(i -> i.lt(PromotionTools.START_TIME_COLUMN, new Date()).lt(PromotionTools.END_TIME_COLUMN, new Date()));
|
case END:
|
||||||
break;
|
p.nested(i -> i.lt(PromotionTools.START_TIME_COLUMN, new Date()).lt(PromotionTools.END_TIME_COLUMN, new Date()));
|
||||||
case CLOSE:
|
break;
|
||||||
queryWrapper.nested(n -> n.nested(i -> i.isNull(PromotionTools.START_TIME_COLUMN).isNull(PromotionTools.END_TIME_COLUMN)
|
case CLOSE:
|
||||||
.eq(RANGE_DAY_TYPE_COLUMN, CouponRangeDayEnum.FIXEDTIME.name())).
|
p.nested(n -> n.nested(i -> i.isNull(PromotionTools.START_TIME_COLUMN).isNull(PromotionTools.END_TIME_COLUMN)
|
||||||
or(i -> i.le("effective_days", 0).eq(RANGE_DAY_TYPE_COLUMN, CouponRangeDayEnum.DYNAMICTIME.name())));
|
.eq(RANGE_DAY_TYPE_COLUMN, CouponRangeDayEnum.FIXEDTIME.name())).
|
||||||
break;
|
or(i -> i.le("effective_days", 0).eq(RANGE_DAY_TYPE_COLUMN, CouponRangeDayEnum.DYNAMICTIME.name())));
|
||||||
default:
|
break;
|
||||||
}
|
default:
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
if (this.getStartTime() != null) {
|
if (this.getStartTime() != null) {
|
||||||
queryWrapper.ge("start_time", new Date(this.getEndTime()));
|
queryWrapper.ge("start_time", new Date(this.getEndTime()));
|
||||||
@ -105,7 +108,6 @@ public class CouponSearchParams extends BasePromotionsSearchParams implements Se
|
|||||||
if (this.getEndTime() != null) {
|
if (this.getEndTime() != null) {
|
||||||
queryWrapper.le("end_time", new Date(this.getEndTime()));
|
queryWrapper.le("end_time", new Date(this.getEndTime()));
|
||||||
}
|
}
|
||||||
queryWrapper.eq("delete_flag", false);
|
|
||||||
this.betweenWrapper(queryWrapper);
|
this.betweenWrapper(queryWrapper);
|
||||||
queryWrapper.orderByDesc("create_time");
|
queryWrapper.orderByDesc("create_time");
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package cn.lili.modules.promotion.entity.dto.search;
|
package cn.lili.modules.promotion.entity.dto.search;
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.modules.promotion.entity.enums.*;
|
import cn.lili.modules.promotion.entity.enums.CouponGetEnum;
|
||||||
import cn.lili.modules.promotion.tools.PromotionTools;
|
import cn.lili.modules.promotion.entity.enums.CouponTypeEnum;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.PromotionsScopeTypeEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -78,9 +80,6 @@ public class MemberCouponSearchParams extends BasePromotionsSearchParams impleme
|
|||||||
if (CharSequenceUtil.isNotEmpty(memberCouponStatus)) {
|
if (CharSequenceUtil.isNotEmpty(memberCouponStatus)) {
|
||||||
queryWrapper.eq("member_coupon_status", MemberCouponStatusEnum.valueOf(memberCouponStatus).name());
|
queryWrapper.eq("member_coupon_status", MemberCouponStatusEnum.valueOf(memberCouponStatus).name());
|
||||||
}
|
}
|
||||||
if (CharSequenceUtil.isNotEmpty(this.getPromotionStatus())) {
|
|
||||||
queryWrapper.and(PromotionTools.queryPromotionStatus(PromotionsStatusEnum.valueOf(getPromotionStatus())));
|
|
||||||
}
|
|
||||||
if (CharSequenceUtil.isNotEmpty(price)) {
|
if (CharSequenceUtil.isNotEmpty(price)) {
|
||||||
String[] s = price.split("_");
|
String[] s = price.split("_");
|
||||||
if (s.length > 1) {
|
if (s.length > 1) {
|
||||||
|
@ -23,8 +23,7 @@ public class ManagerApiApplication {
|
|||||||
@Primary
|
@Primary
|
||||||
@Bean
|
@Bean
|
||||||
public TaskExecutor primaryTask() {
|
public TaskExecutor primaryTask() {
|
||||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
return new ThreadPoolTaskExecutor();
|
||||||
return executor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user