[fix]订单增加非租户过滤
This commit is contained in:
parent
d0f77f301f
commit
1cb41a326c
@ -49,7 +49,7 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://82.156.121.2:13306/loopin?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://82.156.121.2:13306/soopin?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: wzj
|
username: wzj
|
||||||
password: A085F27A43B0
|
password: A085F27A43B0
|
||||||
# # 从库数据源
|
# # 从库数据源
|
||||||
|
@ -97,7 +97,7 @@ public class FansServiceImpl extends ServiceImpl<FansMapper, Fans> implements IF
|
|||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("userID", follower.getId());
|
params.put("userID", follower.getId());
|
||||||
params.put("nickName", follower.getNickname() == null ? "" : follower.getNickname());
|
params.put("nickName", follower.getNickname() == null ? "" : follower.getNickname());
|
||||||
params.put("faceUrl", vlogger.getAvatar());
|
params.put("faceUrl", follower.getAvatar());
|
||||||
MQMessage message = MQMessage.builder()
|
MQMessage message = MQMessage.builder()
|
||||||
.messageType(MQMessageType.IM.name())
|
.messageType(MQMessageType.IM.name())
|
||||||
.data(params)
|
.data(params)
|
||||||
|
@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.wzj.soopin.goods.domain.entity.Product;
|
import com.wzj.soopin.goods.domain.entity.Product;
|
||||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||||
import com.wzj.soopin.goods.domain.entity.SkuSnapshot;
|
import com.wzj.soopin.goods.domain.entity.SkuSnapshot;
|
||||||
|
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||||
import com.wzj.soopin.goods.mapper.SkuSnapshotMapper;
|
import com.wzj.soopin.goods.mapper.SkuSnapshotMapper;
|
||||||
@ -235,8 +236,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
BigDecimal totalAmount = new BigDecimal(0);
|
BigDecimal totalAmount = new BigDecimal(0);
|
||||||
List<Sku> skus = skuMapper.selectByIds(map.keySet());
|
List<Sku> skus = skuMapper.selectByIds(map.keySet());
|
||||||
Assert.isTrue(skus.size() == skuItemBOList.size(), () -> new ServiceException("下单商品不存在"));
|
Assert.isTrue(skus.size() == skuItemBOList.size(), () -> new ServiceException("下单商品不存在"));
|
||||||
LinkedHashMap<Long, Product> productMap = productMapper.selectByIds(skus.stream().map(Sku::getProductId).collect(Collectors.toList()))
|
|
||||||
.stream().collect(Collectors.toMap(Product::getId, it -> it, (v1, v2) -> v2, LinkedHashMap::new));
|
LinkedHashMap<Long, Product> productMap = TenantHelper.ignore(() -> productMapper.selectByIds(skus.stream().map(Sku::getProductId).collect(Collectors.toList()))
|
||||||
|
.stream().collect(Collectors.toMap(Product::getId, it -> it, (v1, v2) -> v2, LinkedHashMap::new)));
|
||||||
for (Sku sku : skus) {
|
for (Sku sku : skus) {
|
||||||
Integer quantity = map.get(sku.getId());
|
Integer quantity = map.get(sku.getId());
|
||||||
Assert.isTrue(quantity < sku.getStock(), () -> new ServiceException("下单商品库存不足"));
|
Assert.isTrue(quantity < sku.getStock(), () -> new ServiceException("下单商品库存不足"));
|
||||||
|
@ -69,10 +69,10 @@ public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> i
|
|||||||
public boolean audit(WithdrawBO bo) {
|
public boolean audit(WithdrawBO bo) {
|
||||||
Withdraw withdraw = getById(bo.getId());
|
Withdraw withdraw = getById(bo.getId());
|
||||||
if (withdraw == null) {
|
if (withdraw == null) {
|
||||||
throw new RuntimeException("提现申请不存在");
|
throw new ServiceException("提现申请不存在");
|
||||||
}
|
}
|
||||||
if (!Objects.equals(WithdrawAuditStatus.PENDING.getCode(), withdraw.getStatus())) {
|
if (!Objects.equals(WithdrawAuditStatus.PENDING.getCode(), withdraw.getStatus())) {
|
||||||
throw new RuntimeException("提现申请已处理");
|
throw new ServiceException("提现申请已处理");
|
||||||
}
|
}
|
||||||
//发起提现
|
//发起提现
|
||||||
|
|
||||||
@ -139,10 +139,10 @@ public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> i
|
|||||||
|
|
||||||
Withdraw withdraw = getById(id);
|
Withdraw withdraw = getById(id);
|
||||||
if (withdraw == null) {
|
if (withdraw == null) {
|
||||||
throw new RuntimeException("提现申请不存在");
|
throw new ServiceException("提现申请不存在");
|
||||||
}
|
}
|
||||||
if (!Objects.equals(WithdrawStatus.PENDING.getCode(), withdraw.getStatus())) {
|
if (!Objects.equals(WithdrawStatus.PENDING.getCode(), withdraw.getStatus())) {
|
||||||
throw new RuntimeException("提现申请已处理");
|
throw new ServiceException("提现申请已处理");
|
||||||
}
|
}
|
||||||
withdraw.setStatus(WithdrawStatus.SUCCESS.getCode());
|
withdraw.setStatus(WithdrawStatus.SUCCESS.getCode());
|
||||||
updateById(withdraw);
|
updateById(withdraw);
|
||||||
@ -164,12 +164,12 @@ public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> i
|
|||||||
public InitiateBatchTransferResponseNew withdraw (Withdraw withdraw) {
|
public InitiateBatchTransferResponseNew withdraw (Withdraw withdraw) {
|
||||||
MemberAccount memberAccount = memberAccountService.getMemberAccount(withdraw.getMemberId());
|
MemberAccount memberAccount = memberAccountService.getMemberAccount(withdraw.getMemberId());
|
||||||
if (memberAccount == null) {
|
if (memberAccount == null) {
|
||||||
throw new RuntimeException("用户不存在");
|
throw new ServiceException("用户不存在");
|
||||||
}
|
}
|
||||||
//检查当前用于的账户余额是否充足
|
//检查当前用于的账户余额是否充足
|
||||||
BigDecimal balance = memberAccount.getWallet();
|
BigDecimal balance = memberAccount.getWallet();
|
||||||
if (balance==null||balance.compareTo(withdraw.getMoney()) < 0) {
|
if (balance==null||balance.compareTo(withdraw.getMoney()) < 0) {
|
||||||
throw new RuntimeException("用户余额不足");
|
throw new ServiceException("用户余额不足");
|
||||||
}
|
}
|
||||||
//检查提现次数是否超过限制
|
//检查提现次数是否超过限制
|
||||||
long count = this.count(new LambdaQueryWrapper<Withdraw>()
|
long count = this.count(new LambdaQueryWrapper<Withdraw>()
|
||||||
@ -179,7 +179,7 @@ public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> i
|
|||||||
|
|
||||||
);
|
);
|
||||||
if (count >= 3) {
|
if (count >= 3) {
|
||||||
throw new RuntimeException("提现次数超过限制");
|
throw new ServiceException("提现次数超过限制");
|
||||||
}
|
}
|
||||||
//生成费用
|
//生成费用
|
||||||
BigDecimal fee = withdraw.getMoney().multiply(new BigDecimal("0.00"));
|
BigDecimal fee = withdraw.getMoney().multiply(new BigDecimal("0.00"));
|
||||||
|
@ -220,7 +220,7 @@ http {
|
|||||||
location ^~ /file/ {
|
location ^~ /file/ {
|
||||||
proxy_pass http://43.143.227.203:9000/;
|
proxy_pass http://43.143.227.203:9000/;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
client_max_body_size 100M;
|
client_max_body_size 300M;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
# app分享
|
# app分享
|
||||||
@ -232,7 +232,7 @@ http {
|
|||||||
# app分享-接口代理
|
# app分享-接口代理
|
||||||
location /prod-api/ {
|
location /prod-api/ {
|
||||||
proxy_pass http://43.143.227.203:8880/;
|
proxy_pass http://43.143.227.203:8880/;
|
||||||
client_max_body_size 100M;
|
client_max_body_size 300M;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user