|
|
@ -278,83 +278,83 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService |
|
|
|
baseMapper.updateCurRecMoneyBySid(curRecMoney, sid); |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<CustomerBillSummaryVo> listPageVo(PagerQuery<FinUncollectedReceivablesDetailedQuery> pq) { |
|
|
|
FinUncollectedReceivablesDetailedQuery params = pq.getParams(); |
|
|
|
String staffSid = params.getCreateBySid(); |
|
|
|
ResultBean<List<SysStaffOrgVo>> sysStaffOrgListByStaffSid = sysStaffOrgFeign.getSysStaffOrgListByStaffSid(staffSid); |
|
|
|
List<SysStaffOrgVo> data2 = sysStaffOrgListByStaffSid.getData(); |
|
|
|
String orgSidPath = ""; |
|
|
|
for (SysStaffOrgVo datum : data2) { |
|
|
|
orgSidPath = datum.getOrgSidPath(); |
|
|
|
String[] split = orgSidPath.split("/"); |
|
|
|
for (String s : split) { |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(s); |
|
|
|
SysOrganizationVo data1 = sysOrganizationVoResultBean.getData(); |
|
|
|
Integer isDept = data1.getIsDept(); |
|
|
|
String psid = data1.getPsid(); |
|
|
|
if (isDept == 0 && !psid.equals(0)) { |
|
|
|
orgSidPath = s; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
params.setUseOrgSid(orgSidPath); |
|
|
|
QueryWrapper<FinUncollectedReceivablesDetailed> qw = createQueryWrapper(params); |
|
|
|
IPage<FinUncollectedReceivablesDetailed> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinUncollectedReceivablesDetailedVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
List<FinUncollectedReceivablesDetailedVo> records = pagging.getRecords(); |
|
|
|
for (FinUncollectedReceivablesDetailedVo record : records) { |
|
|
|
BigDecimal totalDeposit = new BigDecimal(0); |
|
|
|
BigDecimal totalPrice = new BigDecimal(0); |
|
|
|
BigDecimal noSubscriptionMoney = new BigDecimal(0); |
|
|
|
String sid = record.getContractSid(); |
|
|
|
String contractNo = record.getContractNo(); |
|
|
|
String receivablesName = record.getReceivablesName(); |
|
|
|
String paymentTypeValue = record.getPaymentTypeValue(); |
|
|
|
ResultBean<CommonContractVo> commonContractVoResultBean = commonContractFeign.fetchBySid(sid); |
|
|
|
CommonContractVo data = commonContractVoResultBean.getData(); |
|
|
|
if (receivablesName.equals("订金")) { |
|
|
|
BigDecimal oneDeposit = new BigDecimal(data.getOneDeposit()); |
|
|
|
BigDecimal num = new BigDecimal(data.getNum()); |
|
|
|
totalDeposit = oneDeposit.multiply(num); |
|
|
|
record.setCurrentReceivableMoney(String.valueOf(totalDeposit)); |
|
|
|
} else if (receivablesName.equals("车款")) { |
|
|
|
BigDecimal price = new BigDecimal(data.getPrice()); |
|
|
|
BigDecimal num = new BigDecimal(data.getNum()); |
|
|
|
totalPrice = price.multiply(num); |
|
|
|
record.setCurrentReceivableMoney(String.valueOf(totalPrice)); |
|
|
|
} |
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.selectGroupConAndRecAndPay(); |
|
|
|
for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos) { |
|
|
|
String receivablesName1 = finSelectedReceivablesDetailedVo.getReceivablesName(); |
|
|
|
String subscriptionMoney = finSelectedReceivablesDetailedVo.getSubscriptionMoney(); |
|
|
|
if (receivablesName1.equals("订金")) { |
|
|
|
record.setSubscriptionMoney(subscriptionMoney); |
|
|
|
noSubscriptionMoney = totalDeposit.subtract(new BigDecimal(subscriptionMoney)); |
|
|
|
record.setNoSubscriptionMoney(String.valueOf(noSubscriptionMoney)); |
|
|
|
if (subscriptionMoney.equals(0)) { |
|
|
|
record.setSubscriptionState("未认款"); |
|
|
|
} else if (subscriptionMoney.equals(totalDeposit)) { |
|
|
|
record.setSubscriptionState("已认款"); |
|
|
|
} else { |
|
|
|
record.setSubscriptionState("部分认款"); |
|
|
|
} |
|
|
|
} else if (receivablesName1.equals("车款")) { |
|
|
|
noSubscriptionMoney = totalPrice.subtract(new BigDecimal(subscriptionMoney)); |
|
|
|
record.setNoSubscriptionMoney(String.valueOf(noSubscriptionMoney)); |
|
|
|
if (subscriptionMoney.equals(0)) { |
|
|
|
record.setSubscriptionState("未认款"); |
|
|
|
} else if (subscriptionMoney.equals(totalPrice)) { |
|
|
|
record.setSubscriptionState("已认款"); |
|
|
|
} else { |
|
|
|
record.setSubscriptionState("部分认款"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<CustomerBillSummaryVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
// public PagerVo<CustomerBillSummaryVo> listPageVo(PagerQuery<CustomerBillSummaryQuery> pq) {
|
|
|
|
// FinUncollectedReceivablesDetailedQuery params = pq.getParams();
|
|
|
|
// String staffSid = params.getCreateBySid();
|
|
|
|
// ResultBean<List<SysStaffOrgVo>> sysStaffOrgListByStaffSid = sysStaffOrgFeign.getSysStaffOrgListByStaffSid(staffSid);
|
|
|
|
// List<SysStaffOrgVo> data2 = sysStaffOrgListByStaffSid.getData();
|
|
|
|
// String orgSidPath = "";
|
|
|
|
// for (SysStaffOrgVo datum : data2) {
|
|
|
|
// orgSidPath = datum.getOrgSidPath();
|
|
|
|
// String[] split = orgSidPath.split("/");
|
|
|
|
// for (String s : split) {
|
|
|
|
// ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(s);
|
|
|
|
// SysOrganizationVo data1 = sysOrganizationVoResultBean.getData();
|
|
|
|
// Integer isDept = data1.getIsDept();
|
|
|
|
// String psid = data1.getPsid();
|
|
|
|
// if (isDept == 0 && !psid.equals(0)) {
|
|
|
|
// orgSidPath = s;
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// params.setUseOrgSid(orgSidPath);
|
|
|
|
// QueryWrapper<FinUncollectedReceivablesDetailed> qw = createQueryWrapper(params);
|
|
|
|
// IPage<FinUncollectedReceivablesDetailed> page = PagerUtil.queryToPage(pq);
|
|
|
|
// IPage<FinUncollectedReceivablesDetailedVo> pagging = baseMapper.selectPageVo(page, qw);
|
|
|
|
// List<FinUncollectedReceivablesDetailedVo> records = pagging.getRecords();
|
|
|
|
// for (FinUncollectedReceivablesDetailedVo record : records) {
|
|
|
|
// BigDecimal totalDeposit = new BigDecimal(0);
|
|
|
|
// BigDecimal totalPrice = new BigDecimal(0);
|
|
|
|
// BigDecimal noSubscriptionMoney = new BigDecimal(0);
|
|
|
|
// String sid = record.getContractSid();
|
|
|
|
// String contractNo = record.getContractNo();
|
|
|
|
// String receivablesName = record.getReceivablesName();
|
|
|
|
// String paymentTypeValue = record.getPaymentTypeValue();
|
|
|
|
// ResultBean<CommonContractVo> commonContractVoResultBean = commonContractFeign.fetchBySid(sid);
|
|
|
|
// CommonContractVo data = commonContractVoResultBean.getData();
|
|
|
|
// if (receivablesName.equals("订金")) {
|
|
|
|
// BigDecimal oneDeposit = new BigDecimal(data.getOneDeposit());
|
|
|
|
// BigDecimal num = new BigDecimal(data.getNum());
|
|
|
|
// totalDeposit = oneDeposit.multiply(num);
|
|
|
|
// record.setCurrentReceivableMoney(String.valueOf(totalDeposit));
|
|
|
|
// } else if (receivablesName.equals("车款")) {
|
|
|
|
// BigDecimal price = new BigDecimal(data.getPrice());
|
|
|
|
// BigDecimal num = new BigDecimal(data.getNum());
|
|
|
|
// totalPrice = price.multiply(num);
|
|
|
|
// record.setCurrentReceivableMoney(String.valueOf(totalPrice));
|
|
|
|
// }
|
|
|
|
// List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.selectGroupConAndRecAndPay();
|
|
|
|
// for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos) {
|
|
|
|
// String receivablesName1 = finSelectedReceivablesDetailedVo.getReceivablesName();
|
|
|
|
// String subscriptionMoney = finSelectedReceivablesDetailedVo.getSubscriptionMoney();
|
|
|
|
// if (receivablesName1.equals("订金")) {
|
|
|
|
// record.setSubscriptionMoney(subscriptionMoney);
|
|
|
|
// noSubscriptionMoney = totalDeposit.subtract(new BigDecimal(subscriptionMoney));
|
|
|
|
// record.setNoSubscriptionMoney(String.valueOf(noSubscriptionMoney));
|
|
|
|
// if (subscriptionMoney.equals(0)) {
|
|
|
|
// record.setSubscriptionState("未认款");
|
|
|
|
// } else if (subscriptionMoney.equals(totalDeposit)) {
|
|
|
|
// record.setSubscriptionState("已认款");
|
|
|
|
// } else {
|
|
|
|
// record.setSubscriptionState("部分认款");
|
|
|
|
// }
|
|
|
|
// } else if (receivablesName1.equals("车款")) {
|
|
|
|
// noSubscriptionMoney = totalPrice.subtract(new BigDecimal(subscriptionMoney));
|
|
|
|
// record.setNoSubscriptionMoney(String.valueOf(noSubscriptionMoney));
|
|
|
|
// if (subscriptionMoney.equals(0)) {
|
|
|
|
// record.setSubscriptionState("未认款");
|
|
|
|
// } else if (subscriptionMoney.equals(totalPrice)) {
|
|
|
|
// record.setSubscriptionState("已认款");
|
|
|
|
// } else {
|
|
|
|
// record.setSubscriptionState("部分认款");
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// PagerVo<CustomerBillSummaryVo> p = PagerUtil.pageToVo(pagging, null);
|
|
|
|
// return p;
|
|
|
|
// }
|
|
|
|
|
|
|
|
private QueryWrapper<FinUncollectedReceivablesDetailed> myCreateQueryWrapper(FinUncollectedReceivablesDetailedQuery query) { |
|
|
|
QueryWrapper<FinUncollectedReceivablesDetailed> qw = new QueryWrapper<>(); |
|
|
@ -1233,4 +1233,83 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService |
|
|
|
BigDecimal ysMoney = baseMapper.selYsByBillSid(billSid); |
|
|
|
return rb.success().setData(ysMoney); |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<CustomerBillSummaryVo> listPageVo(PagerQuery<CustomerBillSummaryQuery> pq) { |
|
|
|
QueryWrapper<FinUncollectedReceivablesDetailed> qw = new QueryWrapper<>(); |
|
|
|
CustomerBillSummaryQuery query = pq.getParams(); |
|
|
|
String orgPath = query.getOrgPath(); |
|
|
|
//授权
|
|
|
|
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 (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("b.orgSidPath", orgPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i2); |
|
|
|
qw.like("b.orgSidPath", orgPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i3); |
|
|
|
qw.like("b.orgSidPath", orgPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i4); |
|
|
|
qw.like("b.orgSidPath", orgPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
orgPath = orgPath.substring(0, i4); |
|
|
|
qw.like("b.orgSidPath", orgPath); |
|
|
|
} else { |
|
|
|
PagerVo<CustomerBillSummaryVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<CustomerBillSummaryVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNoSubscriptionMoneyStart())) { |
|
|
|
qw.apply("( b.reveivableMoney - b.subscriptionMoney ) >=" + query.getNoSubscriptionMoneyStart()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNoSubscriptionMoneyEnd())) { |
|
|
|
qw.apply("( b.reveivableMoney - b.subscriptionMoney ) <=" + query.getNoSubscriptionMoneyEnd()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
|
|
|
qw.like("b.contractNo",query.getContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
qw.like("b.customerName",query.getCustomerName()); |
|
|
|
} |
|
|
|
IPage<FinUncollectedReceivablesDetailed> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<CustomerBillSummaryVo> pagging = baseMapper.getCustomerSummaryList(page, qw); |
|
|
|
PagerVo<CustomerBillSummaryVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<CustomerDetailsVo>> customerBillDetailsList(String contractNo) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
List<CustomerDetailsVo> vos = baseMapper.customerBillDetailsList(contractNo); |
|
|
|
return rb.success().setData(vos); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<CustomerThreeVo> customerBillThreeDetails(String receivablesSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
CustomerThreeVo vo = baseMapper.selCustomerThreeDetails(receivablesSid); |
|
|
|
if (vo != null) { |
|
|
|
List<CustomerThreeListVo> list = baseMapper.selCustomerThreeListDetails(receivablesSid); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
vo.setList(list); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
} |
|
|
|