|
@@ -68,7 +68,6 @@ public class KxsMachineAdvanceServiceImpl extends ServiceImpl<KxsMachineAdvanceM
|
|
|
|
|
|
|
|
private final RemoteUserMsgService remoteUserMsgService;
|
|
private final RemoteUserMsgService remoteUserMsgService;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
private final KxsMachineAdvanceInfoMapper kxsMachineAdvanceInfoMapper;
|
|
private final KxsMachineAdvanceInfoMapper kxsMachineAdvanceInfoMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -208,11 +207,31 @@ public class KxsMachineAdvanceServiceImpl extends ServiceImpl<KxsMachineAdvanceM
|
|
|
.orElseThrow(() -> new GlobalCustomerException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
|
|
.orElseThrow(() -> new GlobalCustomerException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
|
|
|
|
|
|
|
|
String pidPath = toUser.getPidPath();
|
|
String pidPath = toUser.getPidPath();
|
|
|
|
|
+
|
|
|
//判断是否是下级
|
|
//判断是否是下级
|
|
|
boolean contains = pidPath.contains("," + userId + ",");
|
|
boolean contains = pidPath.contains("," + userId + ",");
|
|
|
if (!contains) {
|
|
if (!contains) {
|
|
|
return R.failed(StoreErrorTypeEnum.USER_IS_NOT_FIND.getDescription());
|
|
return R.failed(StoreErrorTypeEnum.USER_IS_NOT_FIND.getDescription());
|
|
|
}
|
|
}
|
|
|
|
|
+ //判断用户是否具备小分仓
|
|
|
|
|
+ KxsWarehouseLimit kxsWarehouseLimit = kxsWarehouseLimitMapper.selectOne(Wrappers.<KxsWarehouseLimit>query().lambda().eq(KxsWarehouseLimit::getUserId, toUser.getId()));
|
|
|
|
|
+ //当用户不存在小分仓时为用户构建小分仓
|
|
|
|
|
+ if (kxsWarehouseLimit == null){
|
|
|
|
|
+ //构建用户小分仓
|
|
|
|
|
+ //todo 此时需同步用户上月分润金额作为小分仓额度,暂时无法实现 初始化为0
|
|
|
|
|
+ kxsWarehouseLimit = new KxsWarehouseLimit();
|
|
|
|
|
+ kxsWarehouseLimit.setCreateTime(LocalDateTime.now());
|
|
|
|
|
+ kxsWarehouseLimit.setDelFlag("0");
|
|
|
|
|
+ kxsWarehouseLimit.setUserId(toUser.getId());
|
|
|
|
|
+ kxsWarehouseLimit.setValidAmount(BigDecimal.ZERO);
|
|
|
|
|
+ kxsWarehouseLimit.setFixedAmount(BigDecimal.ZERO);
|
|
|
|
|
+ kxsWarehouseLimit.setForAmount(BigDecimal.ZERO);
|
|
|
|
|
+ kxsWarehouseLimit.setCreditAmount(BigDecimal.ZERO);
|
|
|
|
|
+ kxsWarehouseLimit.setYueForAmount(BigDecimal.ZERO);
|
|
|
|
|
+ kxsWarehouseLimit.setUsedAmount(BigDecimal.ZERO);
|
|
|
|
|
+ kxsWarehouseLimit.setWarehouseType(1);
|
|
|
|
|
+ kxsWarehouseLimitMapper.insert(kxsWarehouseLimit);
|
|
|
|
|
+ }
|
|
|
//预发数量
|
|
//预发数量
|
|
|
Long advanceCount = baseMapper.selectUserByCount(toUser.getId());
|
|
Long advanceCount = baseMapper.selectUserByCount(toUser.getId());
|
|
|
//预发数量+本次申请数量不能超过10
|
|
//预发数量+本次申请数量不能超过10
|