用户签到为空时 无法签到问题

This commit is contained in:
17600048398 2023-04-18 10:57:41 +08:00
parent 05c3c8a80c
commit 1f21d80dc0
3 changed files with 48 additions and 36 deletions

View File

@ -24,13 +24,13 @@ spring:
boot:
admin:
client:
url: http://127.0.0.1:8000
url: http://192.168.0.108:8000
cache:
type: redis
# Redis
redis:
host: 127.0.0.1
port: 6379
host: 192.168.31.108
port: 30379
password: lilishop
lettuce:
pool:
@ -60,7 +60,7 @@ spring:
default-datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://192.168.31.108:30306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: lilishop
maxActive: 50
@ -241,16 +241,16 @@ lili:
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
#域名
domain:
pc: http://127.0.0.1:8888
wap: http://127.0.0.1:8888
seller: http://127.0.0.1:8888
admin: http://127.0.0.1:8888
pc: http://192.168.0.108:8888
wap: http://192.168.0.108:8888
seller: http://192.168.0.108:8888
admin: http://192.168.0.108:8888
#api地址
api:
buyer: https://z171l91606.51mypc.cn
base: http://127.0.0.1:8888
manager: http://127.0.0.1:8888
seller: http://127.0.0.1:8888
base: http://192.168.0.108:8888
manager: http://192.168.0.108:8888
seller: http://192.168.0.108:8888
# jwt 细节设定
jwt-setting:
@ -269,7 +269,7 @@ lili:
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: 127.0.0.1:9200
cluster-nodes: 192.168.31.108:30920
index:
number-of-replicas: 0
number-of-shards: 3
@ -282,26 +282,26 @@ lili:
logstash:
server: 127.0.0.1:4560
rocketmq:
promotion-topic: lili_promotion_topic
promotion-group: lili_promotion_group
msg-ext-topic: lili_msg_topic
msg-ext-group: lili_msg_group
goods-topic: lili_goods_topic
goods-group: lili_goods_group
order-topic: lili_order_topic
order-group: lili_order_group
member-topic: lili_member_topic
member-group: lili_member_group
other-topic: lili_other_topic
other-group: lili_other_group
notice-topic: lili_notice_topic
notice-group: lili_notice_group
notice-send-topic: lili_send_notice_topic
notice-send-group: lili_send_notice_group
after-sale-topic: lili_after_sale_topic
after-sale-group: lili_after_sale_group
promotion-topic: shop_lili_promotion_topic
promotion-group: shop_lili_promotion_group
msg-ext-topic: shop_lili_msg_topic
msg-ext-group: shop_lili_msg_group
goods-topic: shop_lili_goods_topic
goods-group: shop_lili_goods_group
order-topic: shop_lili_order_topic
order-group: shop_lili_order_group
member-topic: shop_lili_member_topic
member-group: shop_lili_member_group
other-topic: shop_lili_other_topic
other-group: shop_lili_other_group
notice-topic: shop_lili_notice_topic
notice-group: shop_lili_notice_group
notice-send-topic: shop_lili_send_notice_topic
notice-send-group: shop_lili_send_notice_group
after-sale-topic: shop_lili_after_sale_topic
after-sale-group: shop_lili_after_sale_group
rocketmq:
name-server: 127.0.0.1:9876
name-server: 192.168.31.108:30876
isVIPChannel: false
producer:
group: lili_group
@ -310,7 +310,7 @@ rocketmq:
xxl:
job:
admin:
addresses: http://127.0.0.1:9001/xxl-job-admin
addresses: http://192.168.31.108:30001/xxl-job-admin
executor:
appname: xxl-job-executor-lilishop
address:

View File

@ -189,10 +189,12 @@ public class ClerkServiceImpl extends ServiceImpl<ClerkMapper, Clerk> implements
clerk.setIsSuper(clerkAddDTO.getIsSuper());
//校验此会员是否已经是店员
Clerk temp = this.getClerkByMemberId(clerkAddDTO.getMemberId());
if (temp != null && !temp.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
//店员信息不为空
if (temp != null && !temp.getStoreId().equals(clerkAddDTO.getStoreId())) {
throw new ServiceException(ResultCode.CLERK_USER_ERROR);
}
if (temp != null && temp.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
if (temp != null && temp.getStoreId().equals(clerkAddDTO.getStoreId())) {
throw new ServiceException(ResultCode.CLERK_ALREADY_EXIT_ERROR);
}
//部门校验

View File

@ -1,5 +1,6 @@
package cn.lili.modules.member.serviceimpl;
import cn.hutool.core.util.ObjectUtil;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.properties.RocketmqCustomProperties;
@ -19,6 +20,7 @@ import cn.lili.modules.system.entity.enums.SettingEnum;
import cn.lili.modules.system.service.SettingService;
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
import cn.lili.rocketmq.tags.MemberTagsEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.gson.Gson;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
@ -62,8 +64,16 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
public Boolean memberSign() {
//获取当前会员信息
AuthUser authUser = UserContext.getCurrentUser();
if (authUser != null) {
if (ObjectUtil.isNotNull(authUser)) {
//获取当前用户当日签到日信息
LambdaQueryWrapper<MemberSign> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MemberSign::getMemberId, authUser.getId());
queryWrapper.eq(MemberSign::getDay,DateUtil.getDayOfStart().intValue());
List<MemberSign> signSize = this.baseMapper.getTodayMemberSign(queryWrapper);
//当日签到信息不为空
if (!signSize.isEmpty()) {
throw new ServiceException(ResultCode.MEMBER_SIGN_REPEAT);
}
//当前签到天数的前一天日期
List<MemberSign> signs = this.baseMapper.getBeforeMemberSign(authUser.getId());
//构建参数