|
|
@ -29,14 +29,20 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.yxt.anrui.base.common.enums.VehicleState; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.AppFinSelectedReceivablesPaymentDetailsQuery; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.AppFinSelectedReceivablesPaymentDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmation; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmationJYDDKYDJVo; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.app.AppBusArrearsCarryMoneyVo; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.*; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.AppFinUncollectedReceivablesDetailedVo; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
@ -71,6 +77,10 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService<Fi |
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
@Autowired |
|
|
|
private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; |
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
@Autowired |
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
|
|
|
|
public PagerVo<FinSelectedReceivablesDetailed> listPage(PagerQuery<FinSelectedReceivablesDetailedQuery> pq) { |
|
|
|
FinSelectedReceivablesDetailedQuery query = pq.getParams(); |
|
|
@ -362,13 +372,13 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService<Fi |
|
|
|
for (FinSelectReceivablesDetailedVo record : collList) { |
|
|
|
BigDecimal currentMoney = new BigDecimal(record.getCurrentReceivableMoney()); |
|
|
|
BigDecimal subscriptionMoney = new BigDecimal(record.getSubscriptionMoney()); |
|
|
|
if(currentMoney.compareTo(BigDecimal.ZERO)<=0){ |
|
|
|
if (currentMoney.compareTo(BigDecimal.ZERO) <= 0) { |
|
|
|
record.setReveivableMoney("0"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
BigDecimal bigDecimal1 = currentMoney.subtract(subscriptionMoney); |
|
|
|
if(bigDecimal1.compareTo(BigDecimal.ZERO)<=0){ |
|
|
|
if (bigDecimal1.compareTo(BigDecimal.ZERO) <= 0) { |
|
|
|
record.setReveivableMoney("0"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
record.setReveivableMoney(bigDecimal1.toString()); |
|
|
|
} |
|
|
|
} |
|
|
@ -398,13 +408,13 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService<Fi |
|
|
|
for (FinSelectReceivablesDetailedVo record : collList) { |
|
|
|
BigDecimal currentMoney = new BigDecimal(record.getCurrentReceivableMoney()); |
|
|
|
BigDecimal subscriptionMoney = new BigDecimal(record.getSubscriptionMoney()); |
|
|
|
if(currentMoney.compareTo(BigDecimal.ZERO)<=0){ |
|
|
|
if (currentMoney.compareTo(BigDecimal.ZERO) <= 0) { |
|
|
|
record.setReveivableMoney("0"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
BigDecimal bigDecimal1 = currentMoney.subtract(subscriptionMoney); |
|
|
|
if(bigDecimal1.compareTo(BigDecimal.ZERO)<=0){ |
|
|
|
if (bigDecimal1.compareTo(BigDecimal.ZERO) <= 0) { |
|
|
|
record.setReveivableMoney("0"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
record.setReveivableMoney(bigDecimal1.toString()); |
|
|
|
} |
|
|
|
} |
|
|
@ -446,4 +456,82 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService<Fi |
|
|
|
page1.setSize(pagerQuery.getSize()); |
|
|
|
return page1; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<FinSelectReceivablesDetailedWCKCLRKVo> noOutVehRecPageList(PagerQuery<FinSelectedReceivablesPaymentDetailsWCKCLRKQuery> pagerQuery) { |
|
|
|
FinSelectedReceivablesPaymentDetailsWCKCLRKQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<FinSelectReceivablesDetailedWCKCLRKVo> qw = new QueryWrapper<>(); |
|
|
|
//========================================数据授权开始
|
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl()) || StringUtils.isNotBlank(query.getMenuSid())) { |
|
|
|
//=======================
|
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
|
|
privilegeQuery.setMenuSid(query.getMenuSid()); |
|
|
|
privilegeQuery.setUserSid(query.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (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("fcc.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("fcc.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("fcc.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("fcc.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("fcc.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<FinSelectReceivablesDetailedWCKCLRKVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<FinSelectReceivablesDetailedWCKCLRKVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
qw.eq("ferd.auditState", 3); |
|
|
|
qw.ne("bv.vehicleState", VehicleState.StockEnum.OUT_STOCK.getCode()); |
|
|
|
if (StringUtils.isNotBlank(query.getStaffDeptName())){ |
|
|
|
qw.like("fcc.staffDeptName",query.getStaffDeptName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getStaffName())){ |
|
|
|
qw.like("fcc.staffName",query.getStaffName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getContractNo())){ |
|
|
|
qw.like("ferd.contractNo",query.getContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())){ |
|
|
|
qw.like("ferd.customerName",query.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getMobile())){ |
|
|
|
qw.like("ferd.customerPhone",query.getMobile()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())){ |
|
|
|
qw.like("ferd.VIN",query.getVinNo()); |
|
|
|
} |
|
|
|
String balanceSmallMoney = query.getBalanceSmallMoney(); |
|
|
|
String balanceBigMoney = query.getBalanceBigMoney(); |
|
|
|
//TODO 缺少可用余额查询条件
|
|
|
|
IPage<FinSelectedReceivablesDetailed> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<FinSelectReceivablesDetailedWCKCLRKVo> pagging = baseMapper.noOutVehRecPageList(page, qw); |
|
|
|
for (FinSelectReceivablesDetailedWCKCLRKVo record : pagging.getRecords()) { |
|
|
|
String useOrgSid = record.getUseOrgSid(); |
|
|
|
String useOrgName = sysOrganizationFeign.fetchBySid(useOrgSid).getData().getName(); |
|
|
|
record.setUseOrgName(useOrgName); |
|
|
|
} |
|
|
|
PagerVo<FinSelectReceivablesDetailedWCKCLRKVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |