|
|
@ -2,6 +2,9 @@ package com.yxt.anrui.riskcenter.biz.loanfundday; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.BusVehicleApplyVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfundday.LoanFundDay; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfundday.LoanFundDayQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfundday.LoanFundDayVo; |
|
|
@ -9,7 +12,9 @@ import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
/** |
|
|
@ -19,6 +24,11 @@ import org.springframework.stereotype.Service; |
|
|
|
**/ |
|
|
|
@Service |
|
|
|
public class LoanFundDayService extends MybatisBaseService<LoanFundDayMapper, LoanFundDay> { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
|
|
|
|
public PagerVo<LoanFundDayVo> listPage(PagerQuery<LoanFundDayQuery> pagerQuery) { |
|
|
|
LoanFundDayQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<LoanFundDay> qw = new QueryWrapper<>(); |
|
|
@ -54,6 +64,46 @@ public class LoanFundDayService extends MybatisBaseService<LoanFundDayMapper, Lo |
|
|
|
if (StringUtils.isNotBlank(query.getBorrowerName())) { |
|
|
|
qw.like("lrd.borrowerName", query.getBorrowerName()); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
//=======================
|
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(query.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = query.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
int i1 = orgSidPath.indexOf("/"); |
|
|
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = defaultIdReltBean.getData(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i1); |
|
|
|
qw.like("lrd.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("lrd.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("lrd.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("lrd.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("lrd.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<LoanFundDayVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<LoanFundDayVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
IPage<LoanFundDay> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<LoanFundDayVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
PagerVo<LoanFundDayVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|