|
@@ -545,10 +545,7 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
List<Integer> permissions = receiptUser.getPermissions();
|
|
|
//协销与自身相关的订单款
|
|
|
if (!permissions.contains(10) && permissions.contains(13)) {
|
|
|
- // 获取该协销收款用户下的机构userIds
|
|
|
- Integer spId = receiptMapper.getServiceProviderId(receiptUser.getUnionId());
|
|
|
- List<Integer> clubUserIds = receiptMapper.getClubUserIdBySpId(spId);
|
|
|
- paramsBo.setUserIds(clubUserIds);
|
|
|
+ setClubUserIds(paramsBo, receiptUser);
|
|
|
}
|
|
|
}
|
|
|
// 非订单款
|
|
@@ -570,9 +567,7 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
//协销与自身相关的返佣款
|
|
|
if (!permissions.contains(11) && permissions.contains(14)) {
|
|
|
// 获取该协销收款用户下的机构userIds
|
|
|
- Integer spId = receiptMapper.getServiceProviderId(receiptUser.getUnionId());
|
|
|
- List<Integer> clubUserIds = receiptMapper.getClubUserIdBySpId(spId);
|
|
|
- paramsBo.setUserIds(clubUserIds);
|
|
|
+ setClubUserIds(paramsBo, receiptUser);
|
|
|
}
|
|
|
}
|
|
|
// 供应商退款
|
|
@@ -584,11 +579,9 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
}
|
|
|
List<Integer> permissions = receiptUser.getPermissions();
|
|
|
//协销与自身相关的供应商退款
|
|
|
- if (!permissions.contains(11) && permissions.contains(14)) {
|
|
|
+ if (!permissions.contains(12) && permissions.contains(15)) {
|
|
|
// 获取该协销收款用户下的机构userIds
|
|
|
- Integer spId = receiptMapper.getServiceProviderId(receiptUser.getUnionId());
|
|
|
- List<Integer> clubUserIds = receiptMapper.getClubUserIdBySpId(spId);
|
|
|
- paramsBo.setUserIds(clubUserIds);
|
|
|
+ setClubUserIds(paramsBo, receiptUser);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -612,6 +605,22 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
return ResponseJson.success(pageInfo);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置协销用户下的机构userIds
|
|
|
+ */
|
|
|
+ private void setClubUserIds(ReceiptParamsBo paramsBo, ReceiptUserVo receiptUser) {
|
|
|
+ List<Integer> clubUserIds = new ArrayList<>();
|
|
|
+ if (1 == receiptUser.getUserType()) {
|
|
|
+ // 获取该协销收款用户下的机构userIds
|
|
|
+ Integer spId = receiptMapper.getServiceProviderId(receiptUser.getUnionId());
|
|
|
+ clubUserIds = receiptMapper.getClubUserIdBySpId(spId);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(clubUserIds)) {
|
|
|
+ clubUserIds.add(0);
|
|
|
+ }
|
|
|
+ paramsBo.setUserIds(clubUserIds);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 收款详情(订单/非订单)
|
|
|
*
|