Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2f2eaf7edf
|
|
@ -9,6 +9,7 @@ import com.czg.account.dto.shopuser.*;
|
||||||
import com.czg.account.entity.*;
|
import com.czg.account.entity.*;
|
||||||
import com.czg.account.service.*;
|
import com.czg.account.service.*;
|
||||||
import com.czg.config.RedisCst;
|
import com.czg.config.RedisCst;
|
||||||
|
import com.czg.enums.ShopUserFlowBizEnum;
|
||||||
import com.czg.exception.ApiNotPrintException;
|
import com.czg.exception.ApiNotPrintException;
|
||||||
import com.czg.order.entity.OrderDetail;
|
import com.czg.order.entity.OrderDetail;
|
||||||
import com.czg.order.entity.OrderInfo;
|
import com.czg.order.entity.OrderInfo;
|
||||||
|
|
@ -107,10 +108,10 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||||
ShopUserFlow userFlow = new ShopUserFlow();
|
ShopUserFlow userFlow = new ShopUserFlow();
|
||||||
int flag;
|
int flag;
|
||||||
if (shopUserEditDTO.getType() == 0) {
|
if (shopUserEditDTO.getType() == 0) {
|
||||||
if(shopUserEditDTO.getMoney().compareTo(userInfo.getAmount()) > 0){
|
if (shopUserEditDTO.getMoney().compareTo(userInfo.getAmount()) > 0) {
|
||||||
//如果超额退款 则退为0
|
//如果超额退款 则退为0
|
||||||
flag = mapper.decrAccount(shopId, shopUserEditDTO.getId(), DateUtil.date().toLocalDateTime(), userInfo.getAmount());
|
flag = mapper.decrAccount(shopId, shopUserEditDTO.getId(), DateUtil.date().toLocalDateTime(), userInfo.getAmount());
|
||||||
}else {
|
} else {
|
||||||
flag = mapper.decrAccount(shopId, shopUserEditDTO.getId(), DateUtil.date().toLocalDateTime(), shopUserEditDTO.getMoney());
|
flag = mapper.decrAccount(shopId, shopUserEditDTO.getId(), DateUtil.date().toLocalDateTime(), shopUserEditDTO.getMoney());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -132,6 +133,14 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||||
userFlow.setRelationId(shopUserEditDTO.getRelationId());
|
userFlow.setRelationId(shopUserEditDTO.getRelationId());
|
||||||
userFlow.setRechargeId(shopUserEditDTO.getRechargeId());
|
userFlow.setRechargeId(shopUserEditDTO.getRechargeId());
|
||||||
shopUserFlowService.save(userFlow);
|
shopUserFlowService.save(userFlow);
|
||||||
|
//次数
|
||||||
|
if (shopUserEditDTO.getType() == 0 && shopUserEditDTO.getBizEnum().equals(ShopUserFlowBizEnum.ORDER_PAY)) {
|
||||||
|
ShopUser shopUser = new ShopUser();
|
||||||
|
shopUser.setId(userInfo.getId());
|
||||||
|
shopUser.setConsumeCount(userInfo.getConsumeCount() + 1);
|
||||||
|
shopUser.setConsumeAmount(userInfo.getConsumeAmount().add(shopUserEditDTO.getMoney()));
|
||||||
|
updateById(shopUser);
|
||||||
|
}
|
||||||
return userFlow.getId();
|
return userFlow.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,7 +254,6 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean join(Long shopId, Long userId, ShopUserAddDTO shopUserAddDTO) {
|
public boolean join(Long shopId, Long userId, ShopUserAddDTO shopUserAddDTO) {
|
||||||
|
|
@ -309,7 +317,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||||
shopUser.setUserId(userId);
|
shopUser.setUserId(userId);
|
||||||
save(shopUser);
|
save(shopUser);
|
||||||
shopUser = getById(shopUser.getId());
|
shopUser = getById(shopUser.getId());
|
||||||
}else {
|
} else {
|
||||||
couponNum = shopActivateCouponRecordService.count(new QueryWrapper().eq(ShopActivateCouponRecord::getShopUserId, shopUser.getId()).eq(ShopActivateCouponRecord::getStatus, 0));
|
couponNum = shopActivateCouponRecordService.count(new QueryWrapper().eq(ShopActivateCouponRecord::getShopUserId, shopUser.getId()).eq(ShopActivateCouponRecord::getStatus, 0));
|
||||||
}
|
}
|
||||||
ShopUserDetailDTO shopUserDetailDTO = BeanUtil.copyProperties(shopUser, ShopUserDetailDTO.class);
|
ShopUserDetailDTO shopUserDetailDTO = BeanUtil.copyProperties(shopUser, ShopUserDetailDTO.class);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue