feat:内部超市数据权限过滤
This commit is contained in:
1 parent
735bb70996
commit
2ac75f4424
3 files changed
+13
-11
No files matched your search
+1
-1
@@ -92,7 +92,7 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
|
||||
List<HardOrderCsVo> listCsByDay(@Param("dto") HardOrderDto totalDto);
|
||||
|
||||
List<HardOrderPayTypeVo> listOrerPayType(@Param("dto") HardOrderDto dto);
|
||||
List<HardOrderPayTypeVo> listOrerPayType(@Param("dto") HardOrderDto dto, DataScope dataScope);
|
||||
|
||||
List<HardOrderSumAndCountVo> sumAndCount(@Param("dto") HardOrderSumAndCountDto dto);
|
||||
|
||||
|
||||
+9
-10
@@ -66,8 +66,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
@Override
|
||||
public List<HardOrderSbVo> listSb(HardOrderDto dto) {
|
||||
DataScope dataScope = DataScope.of();
|
||||
dataScope.setScopeDeptName("user_dept_id");
|
||||
|
||||
dataScope.setScopeDeptName("merchant_dept_id");
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
|
||||
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
|
||||
@@ -129,22 +128,22 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
@Override
|
||||
public List<HardOrderCsVo> listCs(HardOrderDto dto) {
|
||||
DataScope dataScope = DataScope.of();
|
||||
dataScope.setScopeDeptName("user_dept_id");
|
||||
dataScope.setScopeDeptName("merchant_dept_id");
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
|
||||
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
|
||||
// 查询总流水
|
||||
HardOrderDto totalDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
totalDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
|
||||
List<HardOrderCsVo> totalList = hardOrderMapper.listCs(totalDto, DataScope.of());
|
||||
List<HardOrderCsVo> totalList = hardOrderMapper.listCs(totalDto, dataScope);
|
||||
// 扣款总流水
|
||||
HardOrderDto refundDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPayErrorCodes());
|
||||
List<HardOrderCsVo> refundList = hardOrderMapper.listCs(refundDto, DataScope.of());
|
||||
List<HardOrderCsVo> refundList = hardOrderMapper.listCs(refundDto, dataScope);
|
||||
// 盈利
|
||||
HardOrderDto profitDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
profitDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
List<HardOrderCsVo> profitList = hardOrderMapper.listCs(profitDto, DataScope.of());
|
||||
List<HardOrderCsVo> profitList = hardOrderMapper.listCs(profitDto, dataScope);
|
||||
for (HardOrderCsVo v : totalList) {
|
||||
// 退款
|
||||
if (ObjectUtil.isNotEmpty(refundList)) {
|
||||
@@ -424,7 +423,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
// 获取所有支付方式
|
||||
List<String> payTypeList = HardPayTypeEnum.payTypeTotalDisplayList.stream().map(HardPayTypeEnum::getType).toList();
|
||||
DataScope dataScope = DataScope.of();
|
||||
dataScope.setScopeDeptName("user_dept_id");
|
||||
dataScope.setScopeDeptName("merchant_dept_id");
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
|
||||
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
|
||||
@@ -432,17 +431,17 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
HardOrderDto totalDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
totalDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
|
||||
totalDto.setOrderPayTypeCodes(payTypeList);
|
||||
List<HardOrderPayTypeVo> totalList = hardOrderMapper.listOrerPayType(totalDto);
|
||||
List<HardOrderPayTypeVo> totalList = hardOrderMapper.listOrerPayType(totalDto, dataScope);
|
||||
// 扣款总流水
|
||||
HardOrderDto refundDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPayErrorCodes());
|
||||
refundDto.setOrderPayTypeCodes(payTypeList);
|
||||
List<HardOrderPayTypeVo> refundList = hardOrderMapper.listOrerPayType(refundDto);
|
||||
List<HardOrderPayTypeVo> refundList = hardOrderMapper.listOrerPayType(refundDto, dataScope);
|
||||
// 盈利
|
||||
HardOrderDto profitDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
profitDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
profitDto.setOrderPayTypeCodes(payTypeList);
|
||||
List<HardOrderPayTypeVo> profitList = hardOrderMapper.listOrerPayType(profitDto);
|
||||
List<HardOrderPayTypeVo> profitList = hardOrderMapper.listOrerPayType(profitDto, dataScope);
|
||||
for (HardOrderPayTypeVo v : totalList) {
|
||||
// 退款
|
||||
if (ObjectUtil.isNotEmpty(refundList)) {
|
||||
|
||||
+3
@@ -200,6 +200,7 @@
|
||||
a.hard_id,
|
||||
a.merchant_id,
|
||||
a.user_dept_id,
|
||||
a.merchant_dept_id,
|
||||
sum(a.pay_price) as totalPayPrice,
|
||||
count(0) as totalPayCount
|
||||
from hard_order a
|
||||
@@ -220,6 +221,7 @@
|
||||
select
|
||||
a.merchant_id,
|
||||
a.user_dept_id,
|
||||
a.merchant_dept_id,
|
||||
sum(a.pay_price) as totalPayPrice,
|
||||
count(0) as totalPayCount
|
||||
from hard_order a
|
||||
@@ -250,6 +252,7 @@
|
||||
<select id="listOrerPayType" resultType="com.bsd.pjcloud.hard.api.vo.order.HardOrderPayTypeVo">
|
||||
select
|
||||
a.pay_type,
|
||||
a.merchant_dept_id,
|
||||
sum(a.pay_price) as totalPayPrice,
|
||||
count(0) as totalPayCount
|
||||
from hard_order a
|
||||
|
||||
Reference in new issue
Block a user