Compare commits
13 Commits
ecc03229bd
...
ba510ac671
Author | SHA1 | Date |
---|---|---|
|
ba510ac671 | |
|
2bcef6635e | |
|
34962cae82 | |
|
e39f863f6c | |
|
f2c09097fe | |
|
e19f77a6d0 | |
|
b30a70cbae | |
|
e1aa7302a9 | |
|
0e114c87c0 | |
|
1bf1ab1619 | |
|
41bdbfaa81 | |
|
4b60032c5e | |
|
3f19cd60ea |
|
@ -18,7 +18,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/***
|
||||
* 模型评论
|
||||
* 会员等级
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("memberLevel")
|
||||
|
|
|
@ -2,13 +2,11 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.resource.domain.SysUserInfo;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.service.SysUserAttentionService;
|
||||
import com.mcwl.resource.service.impl.SysUserAttentionServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -76,7 +74,7 @@ public class SysUserAttentionController {
|
|||
*/
|
||||
@ApiOperation(value = "查询关注列表")
|
||||
@PostMapping("/selectAttention")
|
||||
public R<PageInfo<SysUser>> selectAttention(PageVo pageVo){
|
||||
public R<PageInfo<SysUser>> selectAttention(@RequestBody PageVo pageVo){
|
||||
|
||||
PageInfo<SysUser> sysUserList = sysUserAttentionService.selectAttentionPage(pageVo);
|
||||
|
||||
|
@ -90,7 +88,7 @@ public class SysUserAttentionController {
|
|||
*/
|
||||
@ApiOperation(value = "查询粉丝列表")
|
||||
@PostMapping("/selectToAttention")
|
||||
public R<PageInfo<SysUser>> selectToAttention(PageVo pageVo){
|
||||
public R<PageInfo<SysUser>> selectToAttention(@RequestBody PageVo pageVo){
|
||||
|
||||
PageInfo<SysUser> sysUserList = sysUserAttentionService.selectToAttentionPage(pageVo);
|
||||
|
||||
|
|
|
@ -99,6 +99,16 @@ spring:
|
|||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 43200
|
||||
|
||||
# 公众号配置
|
||||
wechat:
|
||||
# 应用ID
|
||||
|
|
|
@ -99,6 +99,16 @@ spring:
|
|||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
# 公众号配置
|
||||
wechat:
|
||||
# 应用ID
|
||||
|
|
|
@ -66,16 +66,6 @@ spring:
|
|||
# 热部署开关
|
||||
enabled: true
|
||||
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
# MyBatis Plus配置
|
||||
mybatis-plus:
|
||||
# 不支持多包, 如有需要可在注解配置 或 提升扫包等级
|
||||
|
|
|
@ -163,7 +163,11 @@ public class Constants
|
|||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.mcwl.quartz.task" };
|
||||
public static final String[] JOB_WHITELIST_STR = {
|
||||
"com.mcwl.quartz.task",
|
||||
"com.mcwl.memberCenter.task",
|
||||
"com.mcwl.pay.task"
|
||||
};
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
|
|
|
@ -120,6 +120,8 @@ public class SysUser extends BaseEntity
|
|||
*/
|
||||
private Double wallet;
|
||||
|
||||
private Boolean isAttention;
|
||||
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
@ -405,4 +407,12 @@ public class SysUser extends BaseEntity
|
|||
", freePoints=" + freePoints +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Boolean getAttention() {
|
||||
return isAttention;
|
||||
}
|
||||
|
||||
public void setAttention(Boolean attention) {
|
||||
isAttention = attention;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,6 +135,9 @@ public class SecurityConfig {
|
|||
"/file/**",
|
||||
"/model/modelSquare",
|
||||
"/model/selectModelById",
|
||||
"/model/selectByUserIdModel",
|
||||
"/model/selectByUserIdWorkFlow",
|
||||
"/model/selectByUserIdImage",
|
||||
"/model/finbyid",
|
||||
"/ModelVersion/finbyid",
|
||||
"/ModelComment/getComment",
|
||||
|
@ -142,13 +145,18 @@ public class SecurityConfig {
|
|||
"/WorkFlow/workFlowList",
|
||||
"/WorkFlow/selectWorkFlowById",
|
||||
"/WorkFlowComment/getComment",
|
||||
"/WorkFlowComment/commentCount",
|
||||
"/image/imageList",
|
||||
"/image/detail",
|
||||
"/imageComment/getComment",
|
||||
"/imageComment/commentCount",
|
||||
"/system/user/selectUserById",
|
||||
"/system/dict/data/type/**",
|
||||
"/attention/selectAttention",
|
||||
"/attention/selectUserInfo"
|
||||
"/attention/selectUserInfo",
|
||||
"/WorkFlowVersion/selectVersionByWorkId",
|
||||
"/memberLevel/list",
|
||||
"/memberLevel/getMemberBenefitList"
|
||||
).permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
|
|
|
@ -39,7 +39,7 @@ public class EmptyPointsRemindConsumer {
|
|||
SysAdvice sysAdvice = new SysAdvice();
|
||||
sysAdvice.setSenderId(sysUser.getUserId());
|
||||
sysAdvice.setReceiverId(member.getUserId());
|
||||
sysAdvice.setType(AdviceEnum.NEW_MESSAGE_REMIND);
|
||||
sysAdvice.setType(AdviceEnum.SYSTEM_NOTICE);
|
||||
sysAdvice.setTitle("积分清零提醒");
|
||||
sysAdvice.setContent("您的积分即将清零,请及时消费");
|
||||
sysAdvice.setCreateBy(sysUser.getUserName());
|
||||
|
|
|
@ -39,7 +39,7 @@ public class MemberBillingConsumer {
|
|||
SysAdvice sysAdvice = new SysAdvice();
|
||||
sysAdvice.setSenderId(sysUser.getUserId());
|
||||
sysAdvice.setReceiverId(member.getUserId());
|
||||
sysAdvice.setType(AdviceEnum.NEW_MESSAGE_REMIND);
|
||||
sysAdvice.setType(AdviceEnum.SYSTEM_NOTICE);
|
||||
sysAdvice.setTitle("会员账单");
|
||||
sysAdvice.setContent("您的会员即将到期,请及时支付");
|
||||
sysAdviceService.save(sysAdvice);
|
||||
|
|
|
@ -29,7 +29,7 @@ public class UserMemberTask {
|
|||
|
||||
|
||||
/**
|
||||
* 积分清零提醒 月底前五天
|
||||
* 积分清零提醒 月底前五天 0 0 9 L-5 * ?
|
||||
*/
|
||||
public void emptyPointsRemindTask() {
|
||||
List<Member> memberList = memberService.getUseUserMember();
|
||||
|
@ -45,7 +45,7 @@ public class UserMemberTask {
|
|||
|
||||
|
||||
/**
|
||||
* 清空积分 每月月底前两天
|
||||
* 清空积分 每月月底前两天 0 0 9 L-2 * ?
|
||||
*/
|
||||
@Transactional
|
||||
public void emptyPointsTsk() {
|
||||
|
@ -57,7 +57,6 @@ public class UserMemberTask {
|
|||
}
|
||||
for (Member member : memberList) {
|
||||
member.setPoints(0.0);
|
||||
member.setUpdateTime(new Date());
|
||||
userIdList.add(member.getUserId());
|
||||
}
|
||||
sysUserList = sysUserService.listByIds(userIdList);
|
||||
|
@ -69,7 +68,7 @@ public class UserMemberTask {
|
|||
}
|
||||
|
||||
/**
|
||||
* 更新会员状态 间隔1h检查
|
||||
* 更新会员状态 间隔1h检查 0 0 0/1 * * ?
|
||||
*/
|
||||
public void updateSubscriptionStatusTask() {
|
||||
LambdaQueryWrapper<Member> qw = new LambdaQueryWrapper<>();
|
||||
|
@ -82,8 +81,6 @@ public class UserMemberTask {
|
|||
return;
|
||||
}
|
||||
|
||||
System.out.println("userMemberList = " + memberList);
|
||||
|
||||
for (Member member : memberList) {
|
||||
MemberEnum subscriptionStatus = member.getSubscriptionStatus();
|
||||
if (subscriptionStatus == MemberEnum.MEMBER_CENTER_ACTIVE) {
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package com.mcwl.pay.task;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mcwl.common.constant.QueueConstants;
|
||||
import com.mcwl.memberCenter.domain.Member;
|
||||
import com.mcwl.pay.domain.OrderTrade;
|
||||
import com.mcwl.pay.service.AliPayService;
|
||||
import com.mcwl.pay.service.OrderTradeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.joda.time.LocalDateTime;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Component("payTask")
|
||||
@RequiredArgsConstructor
|
||||
public class PayTask {
|
||||
|
||||
private final OrderTradeService orderTradeService;
|
||||
|
||||
|
||||
/**
|
||||
* 删除失效订单 间隔1h检查 0 0 0/1 * * ?
|
||||
*/
|
||||
public void deleteInvalidOrderTask() {
|
||||
|
||||
Date date = LocalDateTime.now().plusMinutes(-15).toDate();
|
||||
|
||||
List<OrderTrade> orderTradeList = orderTradeService.lambdaQuery()
|
||||
.le(OrderTrade::getCreateTime, date)
|
||||
.and(wrapper -> wrapper
|
||||
.eq(OrderTrade::getOrderStatus, 4)
|
||||
.or()
|
||||
.eq(OrderTrade::getPayStatus, 1)
|
||||
)
|
||||
.list();
|
||||
|
||||
orderTradeService.removeBatchByIds(orderTradeList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -31,5 +31,5 @@ public class PageVo {
|
|||
@ApiModelProperty(value = "排序")
|
||||
private Integer order;
|
||||
@ApiModelProperty(value = "条件过滤")
|
||||
private Integer type;
|
||||
private Long type;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelIm
|
|||
@Override
|
||||
public TableDataInfo listByPage(ModelImagePageRes imagePageRes) {
|
||||
if (Objects.isNull(imagePageRes.getUserId())) {
|
||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
||||
imagePageRes.setUserId(SecurityUtils.getUserIdMax());
|
||||
}
|
||||
Page<ModelImage> page = new Page<>(imagePageRes.getPageNum(), imagePageRes.getPageSize());
|
||||
if (StringUtils.isEmpty(imagePageRes.getOrderByColumn())) {
|
||||
|
|
|
@ -159,7 +159,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
public TableDataInfo listByPage(ModelImagePageRes imagePageRes) {
|
||||
|
||||
if (Objects.isNull(imagePageRes.getUserId())) {
|
||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
||||
imagePageRes.setUserId(SecurityUtils.getUserIdMax());
|
||||
}
|
||||
|
||||
Page<ModelProduct> page = new Page<>(imagePageRes.getPageNum(), imagePageRes.getPageSize());
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.mcwl.common.core.domain.R;
|
|||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelLike;
|
||||
import com.mcwl.resource.domain.SysAdvice;
|
||||
import com.mcwl.resource.domain.SysUserAttention;
|
||||
import com.mcwl.resource.domain.SysUserInfo;
|
||||
|
@ -19,6 +18,7 @@ import com.mcwl.system.mapper.SysUserMapper;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -37,9 +37,6 @@ public class SysUserAttentionServiceImpl extends ServiceImpl<SysUserAttentionMap
|
|||
@Autowired
|
||||
private ModelMapper modelMapper;
|
||||
|
||||
@Autowired
|
||||
private MallProductLikeMapper mallProductLikeMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserAttentionMapper sysUserAttentionMapper;
|
||||
|
||||
|
@ -97,7 +94,7 @@ public class SysUserAttentionServiceImpl extends ServiceImpl<SysUserAttentionMap
|
|||
public SysUserInfo selectUserInfo(Long userId) {
|
||||
|
||||
if (userId == null) {
|
||||
userId = SecurityUtils.getUserId();
|
||||
userId = SecurityUtils.getUserIdMax();
|
||||
}
|
||||
|
||||
|
||||
|
@ -139,11 +136,31 @@ public class SysUserAttentionServiceImpl extends ServiceImpl<SysUserAttentionMap
|
|||
public PageInfo<SysUser> selectAttentionPage(PageVo pageVo) {
|
||||
|
||||
PageHelper pageHelper = new PageHelper();
|
||||
pageHelper.startPage(pageVo.getPageNumber(),pageVo.getPageSize());
|
||||
pageHelper.startPage(pageVo.getPageNumber(), pageVo.getPageSize());
|
||||
|
||||
Long userIdMax = SecurityUtils.getUserIdMax();
|
||||
|
||||
if (userIdMax == 0L) {
|
||||
|
||||
return new PageInfo<SysUser>(new ArrayList<SysUser>());
|
||||
}
|
||||
|
||||
if (pageVo.getType() == null) {
|
||||
|
||||
pageVo.setType(userIdMax);
|
||||
|
||||
}
|
||||
//条件构造器
|
||||
List<SysUser> sysUserList = sysUserMapper.selectUserPage(SecurityUtils.getUserId());
|
||||
List<SysUser> sysUserList = sysUserMapper.selectUserPage(pageVo.getType());
|
||||
|
||||
for (SysUser sysUser : sysUserList) {
|
||||
|
||||
if (sysUser != null){
|
||||
sysUser.setAttention(selectAttention(sysUser.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return new PageInfo<SysUser>(sysUserList);
|
||||
}
|
||||
|
@ -152,10 +169,32 @@ public class SysUserAttentionServiceImpl extends ServiceImpl<SysUserAttentionMap
|
|||
public PageInfo<SysUser> selectToAttentionPage(PageVo pageVo) {
|
||||
|
||||
PageHelper pageHelper = new PageHelper();
|
||||
pageHelper.startPage(pageVo.getPageNumber(),pageVo.getPageSize());
|
||||
pageHelper.startPage(pageVo.getPageNumber(), pageVo.getPageSize());
|
||||
|
||||
Long userIdMax = SecurityUtils.getUserIdMax();
|
||||
|
||||
if (userIdMax == 0L) {
|
||||
|
||||
return new PageInfo<SysUser>(new ArrayList<SysUser>());
|
||||
}
|
||||
|
||||
if (pageVo.getType() == null) {
|
||||
|
||||
pageVo.setType(userIdMax);
|
||||
|
||||
}
|
||||
|
||||
//条件构造器
|
||||
List<SysUser> sysUserList = sysUserMapper.selectToUserPage(SecurityUtils.getUserId());
|
||||
List<SysUser> sysUserList = sysUserMapper.selectToUserPage(pageVo.getType());
|
||||
|
||||
for (SysUser sysUser : sysUserList) {
|
||||
|
||||
if (sysUser != null){
|
||||
sysUser.setAttention(selectAttention(sysUser.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return new PageInfo<SysUser>(sysUserList);
|
||||
|
|
|
@ -409,7 +409,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
public TableDataInfo listByPage(ModelImagePageRes imagePageRes) {
|
||||
|
||||
if (Objects.isNull(imagePageRes.getUserId())) {
|
||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
||||
imagePageRes.setUserId(SecurityUtils.getUserIdMax());
|
||||
}
|
||||
|
||||
Page<WorkFlow> page = new Page<>(imagePageRes.getPageNum(), imagePageRes.getPageSize());
|
||||
|
|
Loading…
Reference in New Issue