Browse Source

Merge remote-tracking branch 'origin/master'

master
yunuo970428 2 years ago
parent
commit
17a856177b
  1. 3
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java
  2. 2
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finselectedreceivablesdetailed/FinSelectedReceivablesDetailed.java
  3. 4
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/AppFinUncollectedReceivablesDetailedVo.java
  4. 2
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/DetailsOfReceivablesAndUncollectedItemsVo.java
  5. 2
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/KingDeeBillId.java
  6. 557
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  7. 8
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardapply/FinFundsCarriedForwardApplyService.java
  8. 2
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java
  9. 28
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml
  10. 4
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java
  11. 13
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedService.java
  12. 52
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java
  13. 2
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data.json
  14. 254
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/remarks.txt
  15. BIN
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/其他应收单的参数必填备注.xlsx
  16. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/deliveryPlan/HandoverPrepareVehicleInfoVo.java
  17. 1
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/arrearsTakeCar/AppBusArrearsCarryVehicleApplyService.java

3
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

@ -802,6 +802,9 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
Future future5 = pool.submit(() -> {
pushHandoverPrepare(busDeliveredApply, detailsList, orderDetailsVoResultBean.getData(), userVoResultBean.getData());
});
//推送合格证管理员站内信提醒有待移交的合格证,同时自动更改出库车辆的合格证移交状态为“待移交”。
//ToDo:合格证管理员、随车资料管理员、发票管理员创建并查询该角色的用户推送消息有待移交的资料等等。
} catch (Exception e) {
e.printStackTrace();
log.error("推送数据失败=========================" + e.getMessage());

2
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finselectedreceivablesdetailed/FinSelectedReceivablesDetailed.java

@ -98,4 +98,6 @@ public class FinSelectedReceivablesDetailed extends BaseEntity {
private String balance;
@ApiModelProperty("款项状态")
private String kxState;
private String selectSid;
}

4
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/AppFinUncollectedReceivablesDetailedVo.java

@ -18,7 +18,7 @@ public class AppFinUncollectedReceivablesDetailedVo implements Vo {
@ApiModelProperty("客户名称")
private String name;
@ApiModelProperty("应收金额")
@ApiModelProperty("应收金额:动态")
private String receivable;
@ApiModelProperty("合同sid")
@ -58,4 +58,6 @@ public class AppFinUncollectedReceivablesDetailedVo implements Vo {
@ApiModelProperty("采购系统sid")
private String purchaseSystemSid;
@ApiModelProperty("应收金额:不变")
private String reveivableMoney;
}

2
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/DetailsOfReceivablesAndUncollectedItemsVo.java

@ -69,7 +69,7 @@ public class DetailsOfReceivablesAndUncollectedItemsVo implements Vo {
@ApiModelProperty("当前应收金额")
private String currentReceivableMoney; // 当前应收金额
@ApiModelProperty("剩余应收金额")
@ApiModelProperty("应收金额")
private String reveivableMoney;
@ApiModelProperty("业务车辆sid")
private String busVinSid;

2
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/KingDeeBillId.java

@ -3,7 +3,7 @@ package com.yxt.anrui.fin.api.kingdee;
public enum KingDeeBillId {
AP_PAYABLE("AP_Payable", "应付单"),
AR_RECEIVABLE("AR_receivable", "应收单"),
OTHER_RECEIVABLE("OTHER_RECEIVABLE", "其他应收单"),
AR_OTHERRECEIVABLE("AR_OTHERRECEIVABLE", "其他应收单"),
AP_PAYBILL("AP_PAYBILL", "付款单"),
AR_RECEIVEBILL("AR_RECEIVEBILL", "收款单"),
STK_INSTOCK("STK_InStock", "采购入库单"),

557
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java

@ -490,6 +490,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
finSelectedReceivablesDetailed.setCreateBySid(dto.getUserSid());
//认款日期默认为当天的日期
finSelectedReceivablesDetailed.setSubscriptionDate(DateUtil.today());
finSelectedReceivablesDetailed.setBalance(v.getSubscriptionMoney());
finSelectedReceivablesDetailedService.insert(finSelectedReceivablesDetailed);
if (v.getSubscribedOf() == 0) {
//应收未收减去相应的认款
@ -534,6 +535,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
finSelectedReceivablesDetailed.setAuditState(1);
finSelectedReceivablesDetailed.setCreateBySid(dto.getUserSid());
finSelectedReceivablesDetailed.setSubscriptionDate(DateUtil.today());
finSelectedReceivablesDetailed.setBalance(v.getSubscriptionMoney());
finSelectedReceivablesDetailedService.insert(finSelectedReceivablesDetailed);
if (v.getSubscribedOf() == 0) {
//应收未收减去相应的认款
@ -1004,6 +1006,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
finSelectedReceivablesDetailed.setUseOrgSid(paymentDetail.getUseOrgSid());
finSelectedReceivablesDetailed.setCustomerSid(paymentDetail.getCustomerSid());
finSelectedReceivablesDetailed.setSubscribedOf(paymentDetail.getSubscribedOf());
finSelectedReceivablesDetailed.setBalance(paymentDetail.getConfirmMoney().toString());
finSelectedReceivablesDetailedService.save(finSelectedReceivablesDetailed);
if (paymentDetail.getSubscribedOf() == 0) {
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(finSelectedReceivablesDetailed.getReceivablesSid());
@ -1090,6 +1093,12 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
}
}
}
//查询当前应收:应收金额-所有认款的余额=剩余应收金额
String receivablesSid = record.getReceivablesSid();
String balanceSum = finSelectedReceivablesDetailedService.selectBalanceByReceivedSid(receivablesSid);
String reveivableMoney = record.getReveivableMoney();
String currentReceivableMoney = new BigDecimal(reveivableMoney).subtract(new BigDecimal(balanceSum)).toString();
record.setReceivable(currentReceivableMoney);
}
if (StringUtils.isNotBlank(pagerQuery.getParams().getName())) {
collList = collList.stream().filter(v -> v.getVin().contains(pagerQuery.getParams().getName())).collect(Collectors.toList());
@ -1117,11 +1126,16 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
}
}
}
//查询当前应收:应收金额-所有认款的余额=剩余应收金额
String receivablesSid = record.getReceivablesSid();
String balanceSum = finSelectedReceivablesDetailedService.selectBalanceByReceivedSid(receivablesSid);
String reveivableMoney = record.getReveivableMoney();
String currentReceivableMoney = new BigDecimal(reveivableMoney).subtract(new BigDecimal(balanceSum)).toString();
record.setReceivable(currentReceivableMoney);
}
if (StringUtils.isNotBlank(pagerQuery.getParams().getName())) {
collList = collList.stream().filter(v -> v.getVin().contains(pagerQuery.getParams().getName())).collect(Collectors.toList());
// List<AppFinUncollectedReceivablesDetailedVo> cll = collList.stream().filter(v -> v.getVin().contains(pagerQuery.getParams().getName())).collect(Collectors.toList());
// collList = Stream.of(collList, cll).flatMap(Collection::stream).collect(Collectors.toList());
}
}
//将collList根据sid去重
@ -1129,14 +1143,6 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
-> new TreeSet<>(Comparator.comparing(AppFinUncollectedReceivablesDetailedVo::getSid))), ArrayList::new));
//根据合同编号倒序排序
collList = collList.stream().sorted(Comparator.comparing(AppFinUncollectedReceivablesDetailedVo::getContractId).reversed()).collect(Collectors.toList());
/*//分页
IPage<AppFinUncollectedReceivablesDetailedVo> page1 = new Page<>();
page1.setRecords(collList);
page1.setTotal(collList.size());
page1.setPages((collList.size() / pagerQuery.getSize()) + 1);
page1.setCurrent(pagerQuery.getCurrent());
page1.setSize(pagerQuery.getSize());
return page1;*/
//分页
IPage<AppFinUncollectedReceivablesDetailedVo> page1 = new Page<>();
page1.setTotal(collList.size());
@ -1224,7 +1230,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
* @param userSid
* @return
*/
public ResultBean cashierConfirm(String sid, String userSid) {
public ResultBean cashierConfirmOld(String sid, String userSid) {
ResultBean rb = ResultBean.fireFail();
FinCollectionConfirmation confirmation = fetchBySid(sid);
if (confirmation == null) {
@ -1433,115 +1439,113 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
finSelectedReceivablesDetailedService.updateById(finSelectedReceivablesDetailed);
//ToDo:查询是否符合待出库的条件
//该合同编号下的该车架号的所有认款金额
if (v.getSubscribedOf() == 0) {
List<FinSelectedReceivablesDetailedVo> voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3);
BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
//查询该合同编号下的销售订单的单车成交价
ResultBean<CommonContract> commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo());
if (commonContractResultBean.getSuccess()) {
CommonContract commonContract = commonContractResultBean.getData();
if (commonContract != null) {
ResultBean<AppOrderDetailsVo> orderDetails = busSalesOrderFeign.getSaleOrderDetails(commonContract.getBusSid());
AppOrderDetailsVo vo = orderDetails.getData();
if (vo != null) {
AppOrderPriceInfoVo priceInfoVo = vo.getPriceInfo();
AppOrderDepositInfoVo depositInfo = vo.getDepositInfo();
if (depositInfo != null) {
if ("02".equals(depositInfo.getDepositTypeKey())) {//订金结转
BigDecimal decimalDeposit = BigDecimal.ZERO;
if (StringUtils.isNotBlank(depositInfo.getDepositTotal())) {
decimalDeposit = new BigDecimal(depositInfo.getDepositTotal());
}
if (StringUtils.isNotBlank(depositInfo.getMakeUpDeposit())) {
decimalDeposit = decimalDeposit.subtract(new BigDecimal(depositInfo.getMakeUpDeposit()));
}
decimalDeposit = decimalDeposit.divide(new BigDecimal(priceInfoVo.getNumber()), BigDecimal.ROUND_CEILING);
bigDecimalVinAll = bigDecimalVinAll.add(decimalDeposit);
List<FinSelectedReceivablesDetailedVo> voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3);
BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
//查询该合同编号下的销售订单的单车成交价
ResultBean<CommonContract> commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo());
if (commonContractResultBean.getSuccess()) {
CommonContract commonContract = commonContractResultBean.getData();
if (commonContract != null) {
ResultBean<AppOrderDetailsVo> orderDetails = busSalesOrderFeign.getSaleOrderDetails(commonContract.getBusSid());
AppOrderDetailsVo vo = orderDetails.getData();
if (vo != null) {
AppOrderPriceInfoVo priceInfoVo = vo.getPriceInfo();
AppOrderDepositInfoVo depositInfo = vo.getDepositInfo();
if (depositInfo != null) {
if ("02".equals(depositInfo.getDepositTypeKey())) {//订金结转
BigDecimal decimalDeposit = BigDecimal.ZERO;
if (StringUtils.isNotBlank(depositInfo.getDepositTotal())) {
decimalDeposit = new BigDecimal(depositInfo.getDepositTotal());
}
if (StringUtils.isNotBlank(depositInfo.getMakeUpDeposit())) {
decimalDeposit = decimalDeposit.subtract(new BigDecimal(depositInfo.getMakeUpDeposit()));
}
decimalDeposit = decimalDeposit.divide(new BigDecimal(priceInfoVo.getNumber()), BigDecimal.ROUND_CEILING);
bigDecimalVinAll = bigDecimalVinAll.add(decimalDeposit);
}
//单台整体成交价
BigDecimal singleFinalPrice = new BigDecimal(priceInfoVo.getSingleFinalPrice());
BigDecimal leftAll = BigDecimal.ZERO;
BigDecimal rightAll = BigDecimal.ZERO;
if ("2".equals(vo.getFinancePlan()) || "2".equals(vo.getPayTypeKey())) {
//根据销售订单sid查询金融方案
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(commonContract.getBusSid());
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData();
if (solutionsDetailsVo != null) {
if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) {
if ("02".equals(solutionsDetailsVo.getTypeKey())) {
//外部金融:成交价 = 订金+车款+厂家贴息-服务费
leftAll = leftAll.add(singleFinalPrice);
if (StringUtils.isNotBlank(solutionsDetailsVo.getFactoryDiscount())) {
leftAll = leftAll.subtract(new BigDecimal(solutionsDetailsVo.getFactoryDiscount()));
}
if (StringUtils.isNotBlank(solutionsDetailsVo.getServiceAmount())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getServiceAmount()));
}
rightAll = rightAll.add(bigDecimalVinAll);
} else {
//自营非担保: 实收订金 = 首付款及费用+订金
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal()));
}
rightAll = rightAll.add(bigDecimalVinAll);
}
//单台整体成交价
BigDecimal singleFinalPrice = new BigDecimal(priceInfoVo.getSingleFinalPrice());
BigDecimal leftAll = BigDecimal.ZERO;
BigDecimal rightAll = BigDecimal.ZERO;
if ("2".equals(vo.getFinancePlan()) || "2".equals(vo.getPayTypeKey())) {
//根据销售订单sid查询金融方案
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(commonContract.getBusSid());
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData();
if (solutionsDetailsVo != null) {
if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) {
if ("02".equals(solutionsDetailsVo.getTypeKey())) {
//外部金融:成交价 = 订金+车款+厂家贴息-服务费
leftAll = leftAll.add(singleFinalPrice);
if (StringUtils.isNotBlank(solutionsDetailsVo.getFactoryDiscount())) {
leftAll = leftAll.subtract(new BigDecimal(solutionsDetailsVo.getFactoryDiscount()));
}
} else {//担保贷款: 实收订金 = 首付款及费用+订金
if (StringUtils.isNotBlank(solutionsDetailsVo.getServiceAmount())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getServiceAmount()));
}
rightAll = rightAll.add(bigDecimalVinAll);
} else {
//自营非担保: 实收订金 = 首付款及费用+订金
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal()));
}
rightAll = rightAll.add(bigDecimalVinAll);
}
} else {
// 成交价 = 车款+订金
leftAll = leftAll.add(singleFinalPrice);
} else {//担保贷款: 实收订金 = 首付款及费用+订金
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal()));
}
rightAll = rightAll.add(bigDecimalVinAll);
}
} else {
// 成交价 = 车款+订金
// 成交价 = 车款+订金
leftAll = leftAll.add(singleFinalPrice);
rightAll = rightAll.add(bigDecimalVinAll);
}
//根据busVinSid查询待出库中是否存在该数据
ResultBean<BusDelivered> busDeliveredResultBean = busDeliveredFeign.selectByBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid());
if (busDeliveredResultBean.getData() == null) {
if (leftAll.compareTo(rightAll) <= 0) {//推送待出库
BusDeliveredDto busDeliveredDto = new BusDeliveredDto();
busDeliveredDto.setSubscriptionKey(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getCode());
busDeliveredDto.setSubscription(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getRemarks());
busDeliveredDto.setPaymentMethodKey(vo.getPayTypeKey());
busDeliveredDto.setPaymentMethod(vo.getPayType());
busDeliveredDto.setContractNo(v.getContractNo());
busDeliveredDto.setName(v.getCustomerName());
busDeliveredDto.setVinNo(v.getVIN());
busDeliveredDto.setMobile(v.getCustomerPhone());
busDeliveredDto.setPrice(priceInfoVo.getSingleFinalPrice());
busDeliveredDto.setCreateBySid(confirmation.getStaffUserSid());
SubmitVo intermediary1 = vo.getIntermediary1();
if (intermediary1 != null) {
busDeliveredDto.setDistributorName(intermediary1.getIntermediaryName());
busDeliveredDto.setDistributorPrice(intermediary1.getAgencyFee());
}
SubmitVo intermediary2 = vo.getIntermediary2();
if (intermediary2 != null) {
busDeliveredDto.setDistributorNameTwo(intermediary2.getIntermediaryName());
busDeliveredDto.setDistributorPriceTwo(intermediary2.getAgencyFee());
}
busDeliveredDto.setSingleCarDiscountPrice(priceInfoVo.getSingleCarDiscountPrice());
//根据客户sid查询客户的身份证号
AppOrderModelInfoVo appOrderModelInfoVo = vo.getModelInfo();
busDeliveredDto.setModelName(appOrderModelInfoVo.getModelName());
busDeliveredDto.setUseOrgSid(confirmation.getUseOrgSid());
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid());
if (sysOrganizationVoResultBean.getData() != null) {
busDeliveredDto.setUseOrgName(sysOrganizationVoResultBean.getData().getName());
}
busDeliveredDto.setBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid());
ResultBean resultBean1 = busDeliveredFeign.save(busDeliveredDto);
} else {
// 成交价 = 车款+订金
leftAll = leftAll.add(singleFinalPrice);
rightAll = rightAll.add(bigDecimalVinAll);
}
//根据busVinSid查询待出库中是否存在该数据
ResultBean<BusDelivered> busDeliveredResultBean = busDeliveredFeign.selectByBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid());
if (busDeliveredResultBean.getData() == null) {
if (leftAll.compareTo(rightAll) <= 0) {//推送待出库
BusDeliveredDto busDeliveredDto = new BusDeliveredDto();
busDeliveredDto.setSubscriptionKey(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getCode());
busDeliveredDto.setSubscription(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getRemarks());
busDeliveredDto.setPaymentMethodKey(vo.getPayTypeKey());
busDeliveredDto.setPaymentMethod(vo.getPayType());
busDeliveredDto.setContractNo(v.getContractNo());
busDeliveredDto.setName(v.getCustomerName());
busDeliveredDto.setVinNo(v.getVIN());
busDeliveredDto.setMobile(v.getCustomerPhone());
busDeliveredDto.setPrice(priceInfoVo.getSingleFinalPrice());
busDeliveredDto.setCreateBySid(confirmation.getStaffUserSid());
SubmitVo intermediary1 = vo.getIntermediary1();
if (intermediary1 != null) {
busDeliveredDto.setDistributorName(intermediary1.getIntermediaryName());
busDeliveredDto.setDistributorPrice(intermediary1.getAgencyFee());
}
SubmitVo intermediary2 = vo.getIntermediary2();
if (intermediary2 != null) {
busDeliveredDto.setDistributorNameTwo(intermediary2.getIntermediaryName());
busDeliveredDto.setDistributorPriceTwo(intermediary2.getAgencyFee());
}
busDeliveredDto.setSingleCarDiscountPrice(priceInfoVo.getSingleCarDiscountPrice());
//根据客户sid查询客户的身份证号
AppOrderModelInfoVo appOrderModelInfoVo = vo.getModelInfo();
busDeliveredDto.setModelName(appOrderModelInfoVo.getModelName());
busDeliveredDto.setUseOrgSid(confirmation.getUseOrgSid());
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid());
if (sysOrganizationVoResultBean.getData() != null) {
busDeliveredDto.setUseOrgName(sysOrganizationVoResultBean.getData().getName());
}
busDeliveredDto.setBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid());
ResultBean resultBean1 = busDeliveredFeign.save(busDeliveredDto);
}
}
}
}
}
@ -1571,6 +1575,351 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
return rb.success().setMsg("款项确认成功");
}
public ResultBean cashierConfirm(String sid, String userSid) {
ResultBean rb = ResultBean.fireFail();
FinCollectionConfirmation confirmation = fetchBySid(sid);
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
finSelectedReceivablesDetailedService.updateAuditStateBySid(1, sid);
//推送收款单
ARReceivebill arReceivebill = new ARReceivebill();
//业务日期
arReceivebill.setFDATE(DateUtil.today());
//收款日期
arReceivebill.setF_PAEZ_Date(confirmation.getCollectionDate());
//收款组织
ResultBean<SysOrganizationVo> resultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid());
BasePurchaseSystemDetailsVo data = basePurchaseSystemFeign.fetchDetailsByDeptSid(confirmation.getPurchaseSystemSid()).getData();
String orgCode = "";
if (data != null) {
arReceivebill.setFPAYORGID(data.getOrgCode());
orgCode = data.getOrgCode();
} else {
if (resultBean.getSuccess()) {
SysOrganizationVo vo = resultBean.getData();
if (vo != null) {
arReceivebill.setFPAYORGID(vo.getOrgCode());
orgCode = vo.getOrgCode();
}
}
}
//销售部门
if (StringUtils.isNotBlank(confirmation.getStaffDeptSid())) {
resultBean = sysOrganizationFeign.fetchBySid(confirmation.getStaffDeptSid());
if (resultBean.getSuccess()) {
SysOrganizationVo vo = resultBean.getData();
if (vo != null) {
arReceivebill.setFSALEDEPTID(vo.getOrgCode());
}
}
}
arReceivebill.setFREMARK("付款人:" + confirmation.getPayerName());
//物料列表
List<ARReceivebill.FRECEIVEBILLENTRY> fEntityList = new ArrayList<>();
ARReceivebill.FRECEIVEBILLENTRY freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY();
//推送全款车款
//根据合同编号分组-车款-待审核-全款-收款单明细
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1_1(sid, 1, "车款", "1");
finSelectedReceivablesDetailedVos1.removeAll(Collections.singleton(null));
//全款推送车款(应收未收中为首付款的)
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1_1_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1_1(sid, 1, "首付款及费用", "1");
finSelectedReceivablesDetailedVos1_1_1.removeAll(Collections.singleton(null));
//推送全款订金
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2 = finSelectedReceivablesDetailedService.fetchByAuditState1_1_1(sid, 1, "订金", "1");
finSelectedReceivablesDetailedVos2.removeAll(Collections.singleton(null));
//贷款推送车款
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "车款", "2");
finSelectedReceivablesDetailedVos1_1.removeAll(Collections.singleton(null));
//贷款推送订金
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos2_1 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "订金", "2");
finSelectedReceivablesDetailedVos2_1.removeAll(Collections.singleton(null));
//贷款推送车款(应收未收中为首付款的)
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos1_1_2 = finSelectedReceivablesDetailedService.fetchByAuditState1_1(sid, 1, "首付款及费用", "2");
finSelectedReceivablesDetailedVos1_1_2.removeAll(Collections.singleton(null));
int carSize = 0;
//全款推送车款
if (finSelectedReceivablesDetailedVos1.size() > 0) {
boolean one = false;
if (finSelectedReceivablesDetailedVos1.size() == 1 &&
finSelectedReceivablesDetailedVos1_1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2.size() == 0 &&
finSelectedReceivablesDetailedVos1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2_1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_2.size() == 0) {
one = true;
}
carSize = fullPaymentPushCar(confirmation, arReceivebill, carSize, finSelectedReceivablesDetailedVos1, freceivebillentry, one, orgCode);
}
//全款推送车款(首付款及费用)
if (finSelectedReceivablesDetailedVos1_1_1.size() > 0) {
boolean one = false;
if (finSelectedReceivablesDetailedVos1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_1.size() == 1 &&
finSelectedReceivablesDetailedVos2.size() == 0 &&
finSelectedReceivablesDetailedVos1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2_1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_2.size() == 0) {
one = true;
}
carSize = fullPaymentPushCarFirst(confirmation, arReceivebill, carSize, finSelectedReceivablesDetailedVos1_1_1, freceivebillentry, one, orgCode);
}
//全款推送订金
if (finSelectedReceivablesDetailedVos2.size() > 0) {
boolean one = false;
if (finSelectedReceivablesDetailedVos1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2.size() == 1 &&
finSelectedReceivablesDetailedVos1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2_1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_2.size() == 0) {
one = true;
}
carSize = fullPaymentPushDeposit(confirmation, arReceivebill, carSize, finSelectedReceivablesDetailedVos2, freceivebillentry, one, orgCode);
}
//担保贷款推送车款
if (finSelectedReceivablesDetailedVos1_1.size() > 0) {
boolean one = false;
if (finSelectedReceivablesDetailedVos1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2.size() == 0 &&
finSelectedReceivablesDetailedVos1_1.size() == 1 &&
finSelectedReceivablesDetailedVos2_1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_2.size() == 0) {
one = true;
}
carSize = loanPushCar(confirmation, arReceivebill, carSize, finSelectedReceivablesDetailedVos1_1, freceivebillentry, one, orgCode);
}
//担保贷款推送车款(首付款及费用)
if (finSelectedReceivablesDetailedVos1_1_2.size() > 0) {
boolean one = false;
if (finSelectedReceivablesDetailedVos1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2.size() == 0 &&
finSelectedReceivablesDetailedVos1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2_1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_2.size() == 1) {
one = true;
}
carSize = loanPushCarFirst(confirmation, arReceivebill, carSize, finSelectedReceivablesDetailedVos1_1_2, freceivebillentry, one, orgCode);
}
//担保贷款推送订金
if (finSelectedReceivablesDetailedVos2_1.size() > 0) {
boolean one = false;
if (finSelectedReceivablesDetailedVos1.size() == 0 &&
finSelectedReceivablesDetailedVos1_1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2.size() == 0 &&
finSelectedReceivablesDetailedVos1_1.size() == 0 &&
finSelectedReceivablesDetailedVos2_1.size() == 1 &&
finSelectedReceivablesDetailedVos1_1_2.size() == 0) {
one = true;
}
carSize = loanPushDeposit(confirmation, arReceivebill, carSize, finSelectedReceivablesDetailedVos2_1, freceivebillentry, one, orgCode);
}
//简易订单-订金收取
if (finSelectedReceivablesDetailedVos1.isEmpty() &&
finSelectedReceivablesDetailedVos2.isEmpty() &&
finSelectedReceivablesDetailedVos1_1.isEmpty() &&
finSelectedReceivablesDetailedVos2_1.isEmpty() &&
finSelectedReceivablesDetailedVos1_1_1.isEmpty() &&
finSelectedReceivablesDetailedVos1_1_2.isEmpty() && confirmation.getPushMessgae() == 1) {
//先推送客户
AppBusDepositBuscenterDetailVo busDeposit = busDepositFeign.getDepositInfoDetails(confirmation.getBusSid()).getData();
BdCustomer bdCustomer = createBdCustomer(confirmation.getUseOrgSid(), busDeposit.getPayName(), busDeposit.getPhone(), "", sid);
//推送金蝶客户,修改目标组织为采购系统对应的金蝶分公司code
if (data != null) {
bdCustomer.setTOrgIds(data.getOrgCode());
}
ResultBean resultBeanMiddle = bdCustomerService.draftBdCustomer(bdCustomer);
log.info("客户推送:" + resultBeanMiddle.getMsg());
//往来单位
arReceivebill.setFCONTACTUNIT(bdCustomer.getFNumber());
fEntityList = new ArrayList<>();
freceivebillentry = new ARReceivebill.FRECEIVEBILLENTRY();
//结算方式
freceivebillentry.setFSETTLETYPEIDKey(confirmation.getCollectionTypeKey());
freceivebillentry.setFSETTLETYPEIDType("customerPayType");
BigDecimal bigAll = confirmation.getCollectionMoney();
//收款金额
freceivebillentry.setFRECTOTALAMOUNTFOR(bigAll.toString());
//登记日期
freceivebillentry.setFPOSTDATE(confirmation.getCollectionDate());
//收款用途:订金
freceivebillentry.setFPURPOSEIDKey("002");
freceivebillentry.setFPURPOSEIDType("cw_skyt");
freceivebillentry.setFACCOUNTID(confirmation.getCollectionBankNum());
fEntityList.add(freceivebillentry);
arReceivebill.setFRECEIVEBILLENTRY(fEntityList);
//项目类别key、value
arReceivebill.setF_PAEZ_AssistantType("cw_sklb");
arReceivebill.setF_PAEZ_AssistantKey("006");
arReceivebill.setFBillNo(confirmation.getBillNo());
ResultBean resultBean2 = arReceivebillService.draftArReceivebill(arReceivebill);
log.info("收款单推送:" + resultBean2.getMsg());
}
//===========================================
//查询该申请下的所有待审核的款项明细
BigDecimal subscriptionMoneyAll = new BigDecimal("0");
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.fetchByAuditState(sid, 1);
if (finSelectedReceivablesDetailedVos.size() > 0) {
finSelectedReceivablesDetailedVos.stream().forEach(v -> {
//已选款项明细sid
String selectSid = v.getSid();
//应收未收款项明细sid
String receivablesSid = v.getReceivablesSid();
FinUncollectedReceivablesDetailed finUncollectedReceivablesDetailed = finUncollectedReceivablesDetailedService.fetchBySid(receivablesSid);
if (v.getSubscribedOf() == 0) {
//更新认款状态
finUncollectedReceivablesDetailed.setSubscriptionState(finUncollectedReceivablesDetailed.getCurrentReceivableMoney().compareTo(BigDecimal.ZERO) == 0 ? 3 : 2);
finUncollectedReceivablesDetailedService.updateById(finUncollectedReceivablesDetailed);
}
FinSelectedReceivablesDetailed finSelectedReceivablesDetailed = finSelectedReceivablesDetailedService.fetchBySid(selectSid);
//更新已选款项明细的审核状态1待审核/2已驳回/3已审核
finSelectedReceivablesDetailed.setAuditState(3);
//更新审核时间
finSelectedReceivablesDetailed.setAuditDate(DateUtil.today());
finSelectedReceivablesDetailedService.updateById(finSelectedReceivablesDetailed);
/*//ToDo:查询是否符合待出库的条件
//该合同编号下的该车架号的所有认款金额
List<FinSelectedReceivablesDetailedVo> voList = finSelectedReceivablesDetailedService.selectListByVin(v.getContractNo(), finUncollectedReceivablesDetailed.getBusVinSid(), 3);
BigDecimal bigDecimalVinAll = voList.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
//查询该合同编号下的销售订单的单车成交价
ResultBean<CommonContract> commonContractResultBean = commonContractFeign.selectByNo(v.getContractNo());
if (commonContractResultBean.getSuccess()) {
CommonContract commonContract = commonContractResultBean.getData();
if (commonContract != null) {
ResultBean<AppOrderDetailsVo> orderDetails = busSalesOrderFeign.getSaleOrderDetails(commonContract.getBusSid());
AppOrderDetailsVo vo = orderDetails.getData();
if (vo != null) {
AppOrderPriceInfoVo priceInfoVo = vo.getPriceInfo();
AppOrderDepositInfoVo depositInfo = vo.getDepositInfo();
if (depositInfo != null) {
if ("02".equals(depositInfo.getDepositTypeKey())) {//订金结转
BigDecimal decimalDeposit = BigDecimal.ZERO;
if (StringUtils.isNotBlank(depositInfo.getDepositTotal())) {
decimalDeposit = new BigDecimal(depositInfo.getDepositTotal());
}
if (StringUtils.isNotBlank(depositInfo.getMakeUpDeposit())) {
decimalDeposit = decimalDeposit.subtract(new BigDecimal(depositInfo.getMakeUpDeposit()));
}
decimalDeposit = decimalDeposit.divide(new BigDecimal(priceInfoVo.getNumber()), BigDecimal.ROUND_CEILING);
bigDecimalVinAll = bigDecimalVinAll.add(decimalDeposit);
}
}
//单台整体成交价
BigDecimal singleFinalPrice = new BigDecimal(priceInfoVo.getSingleFinalPrice());
BigDecimal leftAll = BigDecimal.ZERO;
BigDecimal rightAll = BigDecimal.ZERO;
if ("2".equals(vo.getFinancePlan()) || "2".equals(vo.getPayTypeKey())) {
//根据销售订单sid查询金融方案
ResultBean<SolutionsDetailsVo> solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(commonContract.getBusSid());
SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData();
if (solutionsDetailsVo != null) {
if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) {
if ("02".equals(solutionsDetailsVo.getTypeKey())) {
//外部金融:成交价 = 订金+车款+厂家贴息-服务费
leftAll = leftAll.add(singleFinalPrice);
if (StringUtils.isNotBlank(solutionsDetailsVo.getFactoryDiscount())) {
leftAll = leftAll.subtract(new BigDecimal(solutionsDetailsVo.getFactoryDiscount()));
}
if (StringUtils.isNotBlank(solutionsDetailsVo.getServiceAmount())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getServiceAmount()));
}
rightAll = rightAll.add(bigDecimalVinAll);
} else {
//自营非担保: 实收订金 = 首付款及费用+订金
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal()));
}
rightAll = rightAll.add(bigDecimalVinAll);
}
} else {//担保贷款: 实收订金 = 首付款及费用+订金
if (StringUtils.isNotBlank(solutionsDetailsVo.getRealTotal())) {
leftAll = leftAll.add(new BigDecimal(solutionsDetailsVo.getRealTotal()));
}
rightAll = rightAll.add(bigDecimalVinAll);
}
} else {
// 成交价 = 车款+订金
leftAll = leftAll.add(singleFinalPrice);
rightAll = rightAll.add(bigDecimalVinAll);
}
} else {
// 成交价 = 车款+订金
leftAll = leftAll.add(singleFinalPrice);
rightAll = rightAll.add(bigDecimalVinAll);
}
//根据busVinSid查询待出库中是否存在该数据
ResultBean<BusDelivered> busDeliveredResultBean = busDeliveredFeign.selectByBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid());
if (busDeliveredResultBean.getData() == null) {
if (leftAll.compareTo(rightAll) <= 0) {//推送待出库
BusDeliveredDto busDeliveredDto = new BusDeliveredDto();
busDeliveredDto.setSubscriptionKey(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getCode());
busDeliveredDto.setSubscription(VehicleStateTempOrLast.PaymentEnum.PAY_MODELS.getRemarks());
busDeliveredDto.setPaymentMethodKey(vo.getPayTypeKey());
busDeliveredDto.setPaymentMethod(vo.getPayType());
busDeliveredDto.setContractNo(v.getContractNo());
busDeliveredDto.setName(v.getCustomerName());
busDeliveredDto.setVinNo(v.getVIN());
busDeliveredDto.setMobile(v.getCustomerPhone());
busDeliveredDto.setPrice(priceInfoVo.getSingleFinalPrice());
busDeliveredDto.setCreateBySid(confirmation.getStaffUserSid());
SubmitVo intermediary1 = vo.getIntermediary1();
if (intermediary1 != null) {
busDeliveredDto.setDistributorName(intermediary1.getIntermediaryName());
busDeliveredDto.setDistributorPrice(intermediary1.getAgencyFee());
}
SubmitVo intermediary2 = vo.getIntermediary2();
if (intermediary2 != null) {
busDeliveredDto.setDistributorNameTwo(intermediary2.getIntermediaryName());
busDeliveredDto.setDistributorPriceTwo(intermediary2.getAgencyFee());
}
busDeliveredDto.setSingleCarDiscountPrice(priceInfoVo.getSingleCarDiscountPrice());
//根据客户sid查询客户的身份证号
AppOrderModelInfoVo appOrderModelInfoVo = vo.getModelInfo();
busDeliveredDto.setModelName(appOrderModelInfoVo.getModelName());
busDeliveredDto.setUseOrgSid(confirmation.getUseOrgSid());
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(confirmation.getUseOrgSid());
if (sysOrganizationVoResultBean.getData() != null) {
busDeliveredDto.setUseOrgName(sysOrganizationVoResultBean.getData().getName());
}
busDeliveredDto.setBusVinSid(finUncollectedReceivablesDetailed.getBusVinSid());
ResultBean resultBean1 = busDeliveredFeign.save(busDeliveredDto);
}
}
}
}
}*/
});
//查询该申请已认款金额总数
subscriptionMoneyAll = finSelectedReceivablesDetailedVos.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
}
//查询该申请所有的款项明细
finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.fetchByAuditState(sid, 3);
//与收款金额作比较:更新认款状态 1未认款/2部分认款/3已认款
confirmation.setPaymentState(confirmation.getCollectionMoney().compareTo(subscriptionMoneyAll) <= 0 ? 3 : subscriptionMoneyAll.compareTo(BigDecimal.ZERO) == 0 ? 1 : 2);
//更新收款申请的余额以及审核状态
BigDecimal balanceBigDecimal = confirmation.getCollectionMoney().subtract(subscriptionMoneyAll);
confirmation.setBalance(balanceBigDecimal);
confirmation.setAuditState(3);
//查询当前登录人信息并更新审核人和审核时间
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(userSid);
if (userVoResultBean.getData() != null) {
confirmation.setConfirmName(userVoResultBean.getData().getName());
}
confirmation.setConfirmDate(DateUtil.today());
confirmation.setConfirmNameSid(userSid);
baseMapper.updateById(confirmation);
//删除临时表的数据
ResultBean deleteResult = baseVehicleTempstateFeign.delByBusSid(sid);
return rb.success().setMsg("款项确认成功");
}
//组装客户推送
private BdCustomer createBdCustomer(String useOrgSid, String name, String mobile, String customerSid, String collSid) {
BdCustomer bdCustomer = new BdCustomer();
@ -2370,6 +2719,6 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
}
public void updateYeBySid(String balance, String busSid) {
baseMapper.updateYeBySid(balance,busSid);
baseMapper.updateYeBySid(balance, busSid);
}
}

8
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardapply/FinFundsCarriedForwardApplyService.java

@ -83,8 +83,6 @@ import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import static java.util.Comparator.comparing;
/**
* Project: anrui-fin(款项结转申请) <br/>
* File: FinFundsCarriedForwardApplyService.java <br/>
@ -451,6 +449,9 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu
finSelectedReceivablesDetailed.setAuditState(3);
}
finSelectedReceivablesDetailed.setAuditDate(DateUtil.formatDate(new Date()));
if(finSelectedReceivablesDetailed.getSubscribedOf() == 1){
finSelectedReceivablesDetailed.setSelectSid(yxysFinFundsCarriedForwardYXYSKXVo.getSid());
}
finSelectedReceivablesDetailedService.save(finSelectedReceivablesDetailed);
}
return rb.success().setData(finFundsCarriedForwardApply.getSid());
@ -492,6 +493,9 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu
finSelectedReceivablesDetailed.setUseOrgSid(yxysFinFundsCarriedForwardYXYSKXVo.getUseOrgSid());
finSelectedReceivablesDetailed.setSubscribedOf(yxysFinFundsCarriedForwardYXYSKXVo.getSubscribedOf());
finSelectedReceivablesDetailed.setCollSid(dtoSid);
if(finSelectedReceivablesDetailed.getSubscribedOf() == 1){
finSelectedReceivablesDetailed.setSelectSid(yxysFinFundsCarriedForwardYXYSKXVo.getSid());
}
finSelectedReceivablesDetailedService.save(finSelectedReceivablesDetailed);
}
return rb.success().setData(dtoSid);

2
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java

@ -155,4 +155,6 @@ public interface FinSelectedReceivablesDetailedMapper extends BaseMapper<FinSele
@Update("update fin_selected_receivables_detailed set balance = #{balance} where sid = #{busSid}")
void updateYeBySid(@Param("balance") String balance,@Param("busSid") String busSid);
String selectBalanceByReceivedSid(String receivablesSid);
}

28
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml

@ -67,7 +67,8 @@
furd.payType,
furd.payTypeKey,
furd.customerSid,
furd.useOrgSid
furd.useOrgSid,
furd.reveivableMoney
FROM fin_uncollected_receivables_detailed furd
<where>
${ew.sqlSegment}
@ -181,7 +182,7 @@
where collSid = #{sid}
and auditState = #{state}
and receivablesName = #{type}
and payTypeKey = #{payTypeKey} and subscribedOf = 0
and payTypeKey = #{payTypeKey}
group by contractNo
</select>
@ -192,7 +193,7 @@
where collSid = #{sid}
and auditState = #{state}
and receivablesName = #{type}
and payTypeKey = #{payTypeKey} and subscribedOf = 0
and payTypeKey = #{payTypeKey}
</select>
<select id="selectCustomerList" resultType="com.yxt.anrui.fin.api.finselectedreceivablesdetailed.SelectCustomerVo">
@ -200,7 +201,7 @@
from fin_selected_receivables_detailed
where collSid = #{sid}
and auditState = #{state}
and receivablesName = #{type} and subscribedOf = 0
and receivablesName = #{type}
group by concat(customerName, customerPhone)
</select>
@ -209,7 +210,7 @@
select *
from fin_selected_receivables_detailed
where collSid = #{sid}
and auditState = #{state} and subscribedOf = 0
and auditState = #{state}
and receivablesName = #{type}
</select>
@ -221,7 +222,7 @@
and auditState = #{state}
and receivablesName = #{type}
and customerName = #{customerName}
and customerPhone = #{customerPhone} and subscribedOf = 0
and customerPhone = #{customerPhone}
and length(VIN) > 0
</select>
@ -232,7 +233,7 @@
where collSid = #{sid}
and auditState = #{state}
and receivablesName = #{type}
and contractNo = #{contractNo} and subscribedOf = 0
and contractNo = #{contractNo}
and length(VIN) > 0
</select>
@ -243,7 +244,7 @@
where collSid = #{sid}
and auditState = #{state}
and receivablesName = #{type}
and contractNo = #{contractNo} and subscribedOf = 0
and contractNo = #{contractNo}
and length(VIN) = 0
</select>
@ -255,16 +256,16 @@
and auditState = #{state}
and receivablesName = #{type}
and customerName = #{customerName}
and customerPhone = #{customerPhone} and subscribedOf = 0
and customerPhone = #{customerPhone}
and length(VIN) = 0
</select>
<select id="selectByVinSid" resultType="java.lang.String">
select sum(fd.subscriptionMoney)
select sum(fd.balance)
from fin_selected_receivables_detailed fd
left join fin_uncollected_receivables_detailed ff on ff.sid = fd.receivablesSid
where ff.busVinSid = #{busVinSid}
and fd.auditState = 3 and subscribedOf = 0
and fd.auditState = 3
</select>
<update id="updateAuditStateBySid">
@ -350,4 +351,9 @@
${ew.sqlSegment}
</where>
</select>
<select id="selectBalanceByReceivedSid"
resultType="java.lang.String">
select ifnull(sum(balance),0) from fin_selected_receivables_detailed where receivablesSid = #{receivablesSid} and (auditState =1 or auditState = 3)
</select>
</mapper>

4
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java

@ -571,4 +571,8 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService<Fi
public void updateYeBySid(String balance, String busSid) {
baseMapper.updateYeBySid(balance,busSid);
}
public String selectBalanceByReceivedSid(String receivablesSid) {
return baseMapper.selectBalanceByReceivedSid(receivablesSid);
}
}

13
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedService.java

@ -218,6 +218,13 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService
}
}
}
//查询当前应收:应收金额-所有认款的余额=剩余应收金额
String receivablesSid = v.getReceivablesSid();
String balanceSum = finSelectedReceivablesDetailedService.selectBalanceByReceivedSid(receivablesSid);
String reveivableMoney = v.getReveivableMoney();
String currentReceivableMoney = new BigDecimal(reveivableMoney).subtract(new BigDecimal(balanceSum)).toString();
v.setCurrentReceivableMoney(currentReceivableMoney);
}
}
if (StringUtils.isNotBlank(query.getVinNo())) {
@ -538,7 +545,7 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService
QueryWrapper<FinUncollectedReceivablesDetailed> qw = new QueryWrapper<>();
AppFinUncollectedReceivablesDetailedQuery query = pq.getParams();
String orgPath = query.getOrgPath();
if (StringUtils.isNotBlank(query.getMenuSid())){
if (StringUtils.isNotBlank(query.getMenuSid())) {
//授权
PrivilegeQuery privilegeQuery = new PrivilegeQuery();
privilegeQuery.setOrgPath(query.getOrgPath());
@ -575,7 +582,7 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService
PagerVo<AppCustomerBillSummaryDetailsVo> p = new PagerVo<>();
return p;
}
}else {
} else {
qw.eq("useOrgSid", query.getUseOrgSid());
}
if (StringUtils.isNotBlank(query.getName())) {
@ -918,7 +925,7 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService
for (int i = 0; i < receiveSeleteVoList.size(); i++) {
ReceiveSeleteVo receiveSeleteVo = receiveSeleteVoList.get(i);
BigDecimal subscriptionMoneyAll = BigDecimal.ZERO;
if(StringUtils.isNotBlank(receiveSeleteVo.getSubscriptionMoneyAll())){
if (StringUtils.isNotBlank(receiveSeleteVo.getSubscriptionMoneyAll())) {
subscriptionMoneyAll = new BigDecimal(receiveSeleteVo.getSubscriptionMoneyAll());
}
BigDecimal notSubscriptionMoney = new BigDecimal(receiveSeleteVo.getReveivableMoney()).subtract(subscriptionMoneyAll);

52
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java

@ -25,53 +25,45 @@ public class OtherReceivableBillService extends FinKingDeeService {
public ResultBean otherReceivableBillService(OtherReceivable otherReceivable) {
ResultBean rb=ResultBean.fireFail();
//业务表的主表数据集合
/*Map<String,String> map_fEntityModel_=new HashMap<>();
Map<String,String> map_fEntityModel_=new HashMap<>();
//物料的数组集合
if(aRReceivable.getApplicationDate()==null){
return rb.setMsg("业务日期 不能为空");
if(otherReceivable.getBussDate()==null){
return rb.setMsg("业务日期不能为空");
}
//业务日期
map_fEntityModel_.put("FDATE",aRReceivable.getApplicationDate());
map_fEntityModel_.put("FCUSTOMERID",aRReceivable.getFcustomerid());
//供应商:FSUPPLIERID (必填项)
if(aRReceivable.getApplicationDate()==null){
return rb.setMsg("供应商 不能为空");
}
// map_fEntityModel_.put("FSUPPLIERID","010001");
List<ARReceivable.ScmApplyInboundVehicleDto> vehicleList = aRReceivable.getVehicleList()==null?new ArrayList<>(): aRReceivable.getVehicleList();
map_fEntityModel_.put("FDATE",otherReceivable.getBussDate());
List<OtherReceivable.CollectionDetailDto> collectionDetails = otherReceivable.getCollectionDetails()==null?new ArrayList<>(): otherReceivable.getCollectionDetails();
//准备 物料列表的数据
ResultBean<List<Map<String, String>>> vehicleListMap = createVehicleListsForReceivableBill(vehicleList);
ResultBean<List<Map<String, String>>> vehicleListMap = createVehicleListsForReceivableBill(collectionDetails);
if(!vehicleListMap.getSuccess()){
return rb.setMsg(vehicleListMap.getMsg());
}
String kingDeeData = OtherReceivableBillCastToKingDeeBillFields.getKingDeeData(map_fEntityModel_,vehicleListMap.getData());
try {
return accessKingDeeInterface(KingDeeBillId.AP_PAYABLE.getID(),kingDeeData, KingDeeBillUrl.DRAFT_URL.getURL());
return accessKingDeeInterface(KingDeeBillId.AR_OTHERRECEIVABLE.getID(),kingDeeData, KingDeeBillUrl.DRAFT_URL.getURL());
} catch (Exception e) {
e.printStackTrace();
}*/
}
return rb;
}
/**
* 准备 物料列表的数据 ForReceivableBill
*/
public ResultBean<List<Map<String, String>>> createVehicleListsForReceivableBill(List<ARReceivable.ScmApplyInboundVehicleDto> vehicleList) {
public ResultBean<List<Map<String, String>>> createVehicleListsForReceivableBill(List<OtherReceivable.CollectionDetailDto> collectionDetails) {
ResultBean<List<Map<String, String>>> rb=ResultBean.fireFail();
List<Map<String,String>> vehicleListMap=new ArrayList<>();
for(int i = 0; i< vehicleList.size(); i++){
ARReceivable.ScmApplyInboundVehicleDto f= vehicleList.get(i);
List<Map<String,String>> collectionDetailMap=new ArrayList<>();
for(int i = 0; i< collectionDetails.size(); i++){
OtherReceivable.CollectionDetailDto c = collectionDetails.get(i);
Map<String,String> m=new HashMap<>();
if(StringUtils.isBlank(f.getVinNo())){
return rb.setMsg("物料编码 不能为空");
if(StringUtils.isBlank(c.getDearDept())){
return rb.setMsg("承担部门不能为空");
}
if(StringUtils.isBlank(f.getRemarks())){
return rb.setMsg("物料名称 不能为空");
if(StringUtils.isBlank(c.getExTaxMoney())){
return rb.setMsg("不含税金额不能为空");
}
m.put("FMATERIALID",f.getVinNo());
m.put("FMaterialDesc",f.getRemarks());
m.put("FPRICEUNITID","liang");
vehicleListMap.add(m);
m.put("FCOSTDEPARTMENTID",c.getDearDept());
m.put("FNOTAXAMOUNTFOR",c.getExTaxMoney());
collectionDetailMap.add(m);
}
return rb.success().setData(vehicleListMap);
return rb.success().setData(collectionDetailMap);
}
}

2
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data.json

@ -1,4 +1,4 @@
{
"formId": "AR_receivable",
"formId": "AR_OTHERRECEIVABLE",
"data": "@KD_data"
}

254
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/remarks.txt

@ -1,6 +1,6 @@
一、请求参数说明:
1.formid:业务对象表单Id,字符串类型(必录)
2.data:Json格式数据(详情参考Json格式数据)(必录)
请求参数说明:
formid:业务对象表单Id,字符串类型(必录)
data:Json格式数据(详情参考Json格式数据)(必录)
2.1.Creator:创建者内码(非必录)
2.2.NeedUpDateFields:需要更新的字段,数组类型,格式:[key1,key2,...](非必录),注(更新单据体字段得加上单据体key)
2.3.NeedReturnFields:需返回结果的字段集合,数组类型,格式:[key,entitykey.key,...](非必录),注(返回单据体字段格式:entitykey.key)
@ -13,209 +13,75 @@
2.10.InterationFlags:交互标志集合,字符串类型,分号分隔,格式:"flag1;flag2;..."(非必录),例如(允许负库存标识:STK_InvCheckResult)
2.11.Model:表单数据包,Json类型(必录)
五、字段说明:
销售单位:FSalUnitId
库存基本数量:FStockBaseQty
库存数量:FStockQty
销售基本数量:FSalBaseQty
库存基本分子:FStockBaseNum
销售基本分子:FSalBaseNum
计价基本分母:FPriceBaseDen
库存单位:FStockUnitId
工序号:FOPERNUMBER
序列号:FSEQNUMBER
工序计划号:FOPNO
作业:FPROCESSID
是否赠品:FIsFree
源单行内码:FSRCROWID
生产车间:FFPRODEPARTMENTID
销售基本数量(财务):FSALFINBASEQTY
已下推负数财务应收数量:FPushRedQty
销售发票价税合计期初:FIVINIALLAMOUNTFOR
客户物料编码:FCustMatID
车辆类型:F_PAEZ_BaseProperty
优惠额:F_PAEZ_Decimal
客户物料名称:FCustMatName
销售发票数量(基本单位)期初:FBUYIVINIBASICQTY
销售订单行内码:FORDERENTRYID
成本金额:FCOSTAMTSUM
销售数量:FSalQty
源单单据类型:FSOURCEBILLTYPEID
销售发票数量期初:FBUYIVINIQTY
已收款金额:FRECEIVEAMOUNT
销售订单行号:FORDERENTRYSEQ
业务单据内码:FBizID
业务单据分录内码:FBizEntryId
特殊核销金额:FSpecialAmountFor
业务单据类型:FBizBillTypeId
物料说明:FMaterialDesc
业务单据名称:FBizFormId
业务单据编号:FBizBillNo
特殊核销数量:FSpecialQTY
已开票核销数量:FOPENQTY_D
销售发票数量:FBUYIVQTY
销售发票数量(基本单位):FBUYIVBASICQTY
卖家代扣增值税税率:FTEMPTAXRATE
结算清单调拨类型:FSettleTran
已开票金额(下推审核反写、核销反写):FHadMatchAmountFor
已核销不含税金额:FMatchNotTaxAmtFor
卡片编码:FASSETID
字段说明:
银行:F_PAEZ_Base
银行帐号:F_PAEZ_Base1
转出往来单位类型:FOUTCONTACTTYPE
转出往来单位:FOUTCONTACTID
项目类别:F_PMZC_Assistant1
备注:FCOMMENT
费用项目名称:FCOSTNAME
费用项目编码:FCOSTID
资产名称:FAssetName
生产订单行号:FMOENTRYSEQ
生产订单编号:FMONUMBER
费用承担部门:FCOSTDEPARTMENTID
库存组织:FSTOCKORGID
关联出库数量(基本单位):FBaseStockOutJoinQty
发货上限(基本单位):FBaseDeliveryMaxQty
销售订单内码(删除):FSaleOrderID
控制发货数量:FDeliveryControl
业务流程:FBFLowId
批号:FLot
辅助属性:FAUXPROPID
物料分组:F_PAEZ_BaseProperty1
增值税:FVAT
计入成本金额:FCostAmount
计入成本比例:FCostPercent
卖方代扣代缴:FSellerWithholding
物料名称:FMETRIALNAME
物料编码:FMETRIALID
买方代扣代缴:FBuyerWithholding
税额:FTaxAmount_T
物料名称:FMATERIALNAME_S
物料编码:FMATERIALID_S
订单收款计划明细内码:FRECEIVABLEENTRYID
订单行号:FMATERIALSEQ
税率(%):FTaxRate
税率名称:FTaxRateId
总金额:FAMOUNTFOR_D
备注:FAR_OtherRemarks
扫描点:FScanPoint
表头-付款申请关联金额:FAPPLYAMOUNT_H
销售组织:FSALEORGID
转销:FIsWriteOff
销售组:FSALEGROUPID
销售部门:FSALEDEPTID
收(退)款单关联金额本位币:FWRITTENOFFAMOUNT
成本金额:FCOSTAMT
成本价:FCOSTPrice
会计政策:FACCTPOLICY
基本单位数量:FBaseQty
基本单位:FBASICUNIT
明细内码:FDEntryID
源单行号:FSEQSRC
核算体系:FACCTSYS
计价单位:FPriceUnit
货物类别:FMETRIALTYPE
规格型号:FMetrialModel
计价数量:FPriceUnitQty
源单内码:FROWNOSRC
源单单号:FBILLNOSRC
源出库单类型:FOUTSTOCKTYPE
本位币:FMAINBOOKSTDCURRID (必填项)
结算方式:FSettleTypeID
订货方:FORDERID
税额:FTaxAmountFor
不含税金额本位币:FNoTaxAmount
税额本位币:FTaxAmount
不含税金额:FNoTaxAmountFor
付款方:FChargeId
赠送套餐:F_PAEZ_Decimal3
销售折让:F_PAEZ_Decimal2
返利金额:F_PAEZ_Decimal1
销售员:FSALEERID
税率(%):FEntryTaxRate
已开票金额:FIVAmountFor
发票类型:FINVOICETYPE (必填项)
已生成发票:FCREATEINVOICE
利息:F_PAEZ_Amount
物流车辆:F_PMZC_Base
收货方:FTRANSFERID
物流客户:F_PMZC_Assistant1
油卡号码:F_PMZC_Assistant2
用途:F_PAEZ_Assistant1 (必填项)
运输编号:F_PMZC_Assistant
应收比例(%):FPAYRATE
表头计划 - 收(退)款单关联金额:FRELATEHADPAYAMOUNT_P
表头计划 - 未核销金额(作废):FNOTWRITTENOFFAMOUNTFOR_P
已核销金额:FWRITTENOFFAMOUNTFOR_P
销售订单内码:FSALEORDERID_S
销售订单号:FORDERBILLNO
税额:FTAXAMOUNTFOR
不含税金额本位币:FNOTAXAMOUNT_D
总金额本位币:FAMOUNT_D
不含税金额:FNOTAXAMOUNTFOR
税额本位币:FTAXAMOUNT_D
源单类型:FSOURCETYPE
源单编号:FSourceBillNo
费用承担部门:FCOSTDEPARTMENTID (必填项)
付款申请关联金额:FAPPLYAMOUNT
表头计划 - 核销状态:FWRITTENOFFSTATUS_P
汇率:FExchangeRate
汇率类型:FEXCHANGETYPE (必填项)
价税合计本位币:FALLAMOUNT
到期日计算日期:FACCNTTIMEJUDGETIME
应收金额本位币:FPAYAMOUNT
应收金额:FPAYAMOUNTFOR
表头计划 - 到期日:FENDDATE
作废日期:FCancelDate
作废人:FCancellerId
按含税单价录入:FISTAX
作废状态:FCancelStatus (必填项)
销售组织:FSALEORGID
客户:FCUSTOMERID (必填项)
汇率:FExchangeRate
收款条件:FPayConditon
会计核算体系:FACCOUNTSYSTEM
价税合计:FALLAMOUNTFOR
创建人:FCreatorId
货主:FOWNERID
货主类型:FOWNERTYPE
到期日:FENDDATE_H
销售员:FSALEERID
销售组:FSALEGROUPID
销售部门:FSALEDEPTID
创建日期:FCreateDate
审核日期:FAPPROVEDATE
修改人:FModifierId
本位币:FMAINBOOKSTDCURRID (必填项)
作废日期:FCancelDate
修改日期:FModifyDate
表头基本 - 收款核销状态:FWRITTENOFFSTATUS
审核人:FAPPROVERID
创建日期:FCreateDate
作废状态:FCancelStatus (必填项)
单据类型:FBillTypeID (必填项)
表头基本 - 收(退)款单的关联金额:FRelateHadPayAmount
单据状态:FDocumentStatus
单据编号:FBillNo
业务日期:FDATE (必填项)
单据编号:FBillNo
单据状态:FDocumentStatus
到期日:FENDDATE_H
币别:FCURRENCYID (必填项)
表头基本 -未收款核销金额(作废):FNOTWRITTENOFFAMOUNTFOR
结算组织:FSETTLEORGID (必填项)
表头基本 - 开票核销状态:FOPENSTATUS
税率(%):FEntryTaxRate
不含税金额:FNoTaxAmountFor_D
折扣率(%):FEntryDiscountRate
税额:FTAXAMOUNTFOR_D
销售发票价税合计:FIVALLAMOUNTFOR
备注:FComment
价税合计:FALLAMOUNTFOR_D
折扣额:FDISCOUNTAMOUNTFOR
物料类别:FMaterialType
规格型号:FModel
物料名称:FMaterialName
单价:FPrice
计价数量:FPriceQty
价格系数:FPriceCoefficient
含税单价:FTaxPrice
含税净价:FPriceWithTax
计价基本数量:FBASICUNITQTY
基本单位:FBASICUNITID
基本单位关联数量:FBaseJoinQty
税组合:FTaxCombination
源单编号:FSourceBillNo
源单类型:FSOURCETYPE
计价单位:FPRICEUNITID
价税合计本位币:FALLAMOUNT_D
税额本位币:FTAXAMOUNT_D
折扣额本位币:FDISCOUNTAMOUNT
不含税金额本位币:FNOTAXAMOUNT_D
销售订单号:FORDERNUMBER
表体明细 - 已开票核销金额:FOPENAMOUNTFOR_D
表体明细 - 开票核销状态:FOPENSTATUS_D
业务类型:FBUSINESSTYPE
核销方式:FMatchMethodID
零售:FISRETAIL
现销 :FCASHSALE
信用检查结果:FCreditCheckResult
收款组织:FPAYORGID (必填项)
销售业务类型:FSALESBUSTYPE
往来单位:FCONTACTUNIT (必填项)
往来单位类型:FCONTACTUNITTYPE (必填项)
结算方式:FSettleTypeID
已收款核销金额:FWRITTENOFFAMOUNTFOR
来源系统:FSOURCESYSTEM
申请部门:FDEPARTMENTID
是否期初单据:FISINIT
转出客户:FOUTCUSTOMERID
扫描点:FScanPoint
生成方式:FByVerify
项目类别:F_PAEZ_Assistant1
物料编码:FMATERIALID
是否开票:F_PMZC_Assistant2
中介单位:F_PAEZ_Base
红蓝字:FRedBlue
备注:FAR_Remark
价外税:FISPRICEEXCLUDETAX
B2C业务:FISB2C
立账类型:FSetAccountType
先到票后出库:FISINVOICEARLIER
转销:FIsWriteOff
参与暂估应收核销:FISHookMatch
税额本位币:FTAXAMOUNT
收款组织:FPAYORGID (必填项)
到期日计算日期:FACCNTTIMEJUDGETIME
不含税金额本位币:FNOTAXAMOUNT
修改人:FModifierId
创建人:FCreatorId
审核日期:FAPPROVEDATE
作废人:FCancellerId
总金额:FAMOUNTFOR
总金额本位币:FAMOUNT
表头基本 - 收款核销状态:FWRITTENOFFSTATUS
表头基本 - 收(退)款单的关联金额:FRelateHadPayAmount

BIN
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/其他应收单的参数必填备注.xlsx

Binary file not shown.

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/deliveryPlan/HandoverPrepareVehicleInfoVo.java

@ -39,8 +39,10 @@ public class HandoverPrepareVehicleInfoVo implements Vo {
@JsonProperty("invoiceStateStr")
private String invoicingStateStr;
@ApiModelProperty("状态是false的情况下合格证状态")
@JsonProperty("certificateStateStr")
private String certificateStateStr;
@ApiModelProperty("随车资料状态")
@JsonProperty("carStateStr")
private String onBoardDataStateStr;

1
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/arrearsTakeCar/AppBusArrearsCarryVehicleApplyService.java

@ -257,7 +257,6 @@ public class AppBusArrearsCarryVehicleApplyService {
return rb.setMsg(resultBean.getMsg());
}
BeanUtil.copyProperties(resultBean.getData(), advanceArrearsInfoVo);
advanceArrearsInfoVo.setModelOrgPath(advanceArrearsInfoVo.getOrgPath());
return rb.success().setData(advanceArrearsInfoVo);
}

Loading…
Cancel
Save