|
|
@ -29,6 +29,7 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstateFeign; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.BusVehicleApplyVo; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractFeign; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderDetailsVo; |
|
|
@ -50,6 +51,7 @@ import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutionsFeign; |
|
|
@ -371,19 +373,77 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService |
|
|
|
params.setBusVinSids(busVinSids); |
|
|
|
} |
|
|
|
String orgPath = params.getOrgPath(); |
|
|
|
String orgSidPath = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
params.setUseOrgSid(orgSidPath); |
|
|
|
QueryWrapper<FinUncollectedReceivablesDetailed> qw = myCreateQueryWrapper(params); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
params.setUseOrgSid(useOrgSid); |
|
|
|
QueryWrapper<FinUncollectedReceivablesDetailed> qw = new QueryWrapper<>(); |
|
|
|
//授权
|
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(params.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(params.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(params.getCreateBySid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if(StringUtils.isNotBlank(defaultIdReltBean.getData())){ |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
orgPath = orgPath + "/"; |
|
|
|
int i1 = orgPath.indexOf("/"); |
|
|
|
int i2 = orgPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = defaultIdReltBean.getData(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i1); |
|
|
|
qw.like("orgSidPath", orgPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i2); |
|
|
|
qw.like("orgSidPath", orgPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i3); |
|
|
|
qw.like("orgSidPath", orgPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i4); |
|
|
|
qw.like("orgSidPath", orgPath); |
|
|
|
} else if("5".equals(orgLevelKey)){ |
|
|
|
qw.eq("createBySid",params.getCreateBySid()); |
|
|
|
}else{ |
|
|
|
PagerVo<FinUncollectedReceivablesDetailedVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
PagerVo<FinUncollectedReceivablesDetailedVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(params.getVinNo())) { |
|
|
|
if (!params.getBusVinSids().isEmpty()) { |
|
|
|
List<String> busVinSids = params.getBusVinSids(); |
|
|
|
for (int i = 0; i < busVinSids.size(); i++) { |
|
|
|
qw.eq("busVinSid", busVinSids.get(i)); |
|
|
|
if (i < busVinSids.size() - 1) { |
|
|
|
qw.or(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(params.getContractNo())) { |
|
|
|
qw.like("contractNo", params.getContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(params.getCustomerName())) { |
|
|
|
qw.like("customerName", params.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(params.getReceivablesName())) { |
|
|
|
qw.like("receivablesName", params.getReceivablesName()); |
|
|
|
} |
|
|
|
String createStartTime = params.getCreateStartTime(); |
|
|
|
String createEndTime = params.getCreateEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(createEndTime), "date_format (createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
qw.eq("isDelete", "0"); |
|
|
|
IPage<FinUncollectedReceivablesDetailed> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinUncollectedReceivablesDetailedVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
//=============================分页结束======================================
|
|
|
|
List<FinUncollectedReceivablesDetailedVo> records = pagging.getRecords(); |
|
|
|
for (FinUncollectedReceivablesDetailedVo record : records) { |
|
|
|
if (record.getCreateBySid().equals(params.getCreateBySid())){ |
|
|
|
record.setIsCZ(true); |
|
|
|
}else { |
|
|
|
record.setIsCZ(false); |
|
|
|
} |
|
|
|
record.setDownload(false); |
|
|
|
//获取单条对应的应收未收sid
|
|
|
|
String sid = record.getSid(); |
|
|
|