Compare commits

..

4 Commits

Author SHA1 Message Date
irving
6153e6e4f1 fix: 创建提现时不再校验收款码确认时效
Some checks failed
Build and Push Backend / docker (push) Failing after 4s
2025-10-18 21:05:22 -04:00
irving
d681635394 adjust logic, avoide race condition 2025-10-18 21:05:22 -04:00
irving
b9779e7436 feat: 店员收益明细支持条件筛选并返回订单信息 2025-10-18 21:05:22 -04:00
huchuansai
07a86fbe66 fix: 用æ店员头像bug 2025-10-16 16:56:44 +08:00
2 changed files with 9 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package com.starry.admin.modules.weichat.service;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.starry.admin.common.exception.ServiceException;
import com.starry.admin.common.oss.service.IOssFileService;
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
@@ -14,9 +15,11 @@ import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
import com.starry.admin.utils.SecurityUtils;
import com.starry.common.utils.ConvertUtil;
import com.starry.common.utils.IdUtils;
import java.io.InputStream;
import java.util.Date;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
@@ -68,12 +71,16 @@ public class WxOauthService {
if (item == null) {
PlayClerkUserInfoEntity entity = ConvertUtil.entityToVo(userInfo, PlayClerkUserInfoEntity.class);
entity.setAvatar(generateAvatar(userInfo.getHeadImgUrl()));
entity.setWeiChatAvatar(generateAvatar(userInfo.getHeadImgUrl()));
entity.setWeiChatAvatar(entity.getAvatar());
entity.setId(IdUtils.getUuid());
entity.setLevelId(playClerkLevelInfoService.getDefaultLevel().getId());
clerkUserInfoService.create(entity);
return entity.getId();
} else {
if (StrUtil.isEmpty(item.getAvatar())) {
clerkUserInfoService.update(Wrappers.lambdaUpdate(PlayClerkUserInfoEntity.class).eq(PlayClerkUserInfoEntity::getId, item.getId())
.set(PlayClerkUserInfoEntity::getAvatar, generateAvatar(userInfo.getHeadImgUrl())));
}
return item.getId();
}
}

View File

@@ -28,8 +28,6 @@ import org.springframework.util.StringUtils;
public class WithdrawalServiceImpl extends ServiceImpl<WithdrawalRequestMapper, WithdrawalRequestEntity>
implements IWithdrawalService {
private static final long PAYEE_CONFIRMATION_MAX_MINUTES = 10L;
@Resource
private IEarningsService earningsService;
@Resource
@@ -49,13 +47,10 @@ public class WithdrawalServiceImpl extends ServiceImpl<WithdrawalRequestMapper,
if (payeeProfile == null || !StringUtils.hasText(payeeProfile.getQrCodeUrl())) {
throw new CustomException("请先上传支付宝收款码");
}
if (payeeProfile.getLastConfirmedAt() == null) {
throw new CustomException("请确认本次使用的收款码");
}
Duration sinceConfirm = Duration.between(payeeProfile.getLastConfirmedAt(), now);
if (sinceConfirm.isNegative() || sinceConfirm.toMinutes() > PAYEE_CONFIRMATION_MAX_MINUTES) {
throw new CustomException("收款码确认已过期,请重新确认");
}
// pick and reserve lines
List<EarningsLineEntity> lines = earningsService.findWithdrawable(clerkId, amount, now);