[fix]撤销核销码逻辑,增加会员信息的空值判断
This commit is contained in:
parent
f9cf42b9a8
commit
400196b480
@ -84,6 +84,9 @@ public class MemberBusinessImpl extends BusinessImpl<IMemberService, MemberConve
|
||||
@Override
|
||||
public MemberVO info(Serializable id) {
|
||||
MemberVO vo= super.info(id);
|
||||
if(vo==null){
|
||||
return vo;
|
||||
}
|
||||
Integer score = service.getMyVlogLikeCount(Long.valueOf(id.toString()));
|
||||
vo.setVlogLikeCount(score);
|
||||
Integer myFansCount= fansService.myFansCount(Long.valueOf(id.toString()));
|
||||
|
@ -113,17 +113,6 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
|
||||
verificationCodes.setUsedMerchantId(tenantId);
|
||||
verificationCodes.setVerificationTime(LocalDateTime.now());
|
||||
codeMapper.updateById(verificationCodes);
|
||||
|
||||
//先检查订单明细的核销码是否都已经核销
|
||||
boolean allUsed = codeMapper.selectCount(Wrappers.lambdaQuery(VerificationCodes.class)
|
||||
.eq(VerificationCodes::getOrderItemId, verificationCodes.getOrderItemId())
|
||||
.eq(VerificationCodes::getStatus, VerificationCodeStatus.TO_BE_USED.getCode())) == 0;
|
||||
if (allUsed) {
|
||||
// 更新订单状态为已核销
|
||||
orderMapper.update(Wrappers.lambdaUpdate(Order.class)
|
||||
.eq(Order::getId, verificationCodes.getOrderId())
|
||||
.set(Order::getStatus, OrderStatusEnum.CLOSED.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user