|
@@ -228,21 +228,15 @@ public class BillServiceImpl implements BillService {
|
|
|
//获取登录租户
|
|
|
Long tenantId = TenantContextHolder.getTenantId();
|
|
|
//查询是否门店登录
|
|
|
- LoginUser loginUser = agencyAuthUtils.getLoginUser();
|
|
|
+ LoginUser loginUser = agencyAuthUtils.getAgencyLoginUser();
|
|
|
//是否旅行社登录
|
|
|
DistributorRespVO distributor = new DistributorRespVO();
|
|
|
- if(loginUser != null){
|
|
|
- distributor = distributorMapper.getById(loginUser.getId());
|
|
|
+ if(loginUser.getDistributorId() != null){
|
|
|
+ distributor = distributorMapper.getById(loginUser.getDistributorId());
|
|
|
billGenerator = 3;
|
|
|
}else{
|
|
|
- distributor = distributorMapper.getByTenantId(tenantId);
|
|
|
- if(distributor == null){
|
|
|
- //平台登录
|
|
|
- billGenerator = 1;
|
|
|
- distributor = distributorMapper.getById(createReqVO.getDistributorId());
|
|
|
- } else {
|
|
|
- billGenerator = 2;
|
|
|
- }
|
|
|
+ distributor = distributorMapper.getById(createReqVO.getDistributorId());
|
|
|
+ billGenerator = 1;
|
|
|
}
|
|
|
|
|
|
//判断是否部分生成账单
|
|
@@ -664,9 +658,9 @@ public class BillServiceImpl implements BillService {
|
|
|
IPage<BillRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
|
|
//获取登录租户
|
|
|
Long tenantId = TenantContextHolder.getTenantId();
|
|
|
- pageReqVO.setOtaTenantId(tenantId);
|
|
|
+// pageReqVO.setOtaTenantId(tenantId);
|
|
|
//查询当前旅行社门店
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
+ LoginUser loginUser = agencyAuthUtils.getAgencyLoginUser();
|
|
|
Long storeId = loginUser.getStoreId();
|
|
|
Long distributorId = loginUser.getDistributorId();
|
|
|
if(storeId == null){
|
|
@@ -675,6 +669,7 @@ public class BillServiceImpl implements BillService {
|
|
|
DistributorRespVO distributor = distributorMapper.getDistributorById(distributorId);
|
|
|
//旅行社
|
|
|
if (distributor != null) {
|
|
|
+ pageReqVO.setAgencyId(distributor.getId());
|
|
|
IPage<BillRespVO> iPage = billMapper.getBillPage(page, pageReqVO);
|
|
|
return new PageResult<>(iPage.getRecords(), iPage.getTotal());
|
|
|
}
|
|
@@ -686,6 +681,7 @@ public class BillServiceImpl implements BillService {
|
|
|
}
|
|
|
//门店
|
|
|
else{
|
|
|
+ pageReqVO.setStoreId(storeId);
|
|
|
IPage<BillRespVO> iPage = billMapper.getBillStorePage(page,pageReqVO);
|
|
|
return new PageResult<>(iPage.getRecords(), iPage.getTotal());
|
|
|
}
|