|
|
@ -661,7 +661,7 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
//排产申请审核通过后,若申请订金的,需要同时生成财务待支付列表记录。
|
|
|
|
//生成一条未打款、未认款的厂家认款记录;若申请订金为0,则只需要生成一条无需打款、未认款的厂家认款记录。
|
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
BaseManufactorSubscriptionDto baseManufactorSubscriptionDto = new BaseManufactorSubscriptionDto(); |
|
|
|
/* BaseManufactorSubscriptionDto baseManufactorSubscriptionDto = new BaseManufactorSubscriptionDto(); |
|
|
|
//判断申请的订金
|
|
|
|
List<BusVehicleApplyDetailVo> vo = busVehicleApplyDetailService.fetchByApplySid(bv.getBusinessSid()); |
|
|
|
vo.removeAll(Collections.singleton(null)); |
|
|
@ -721,7 +721,8 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
finPaymentrecordDto.setBusSid(r.getData()); |
|
|
|
finPaymentrecordDto.setBusRemarks(busVehicleApply.getPayRemarks()); |
|
|
|
finPaymentrecordFeign.save(finPaymentrecordDto); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
pushToFin(bv.getBusinessSid()); |
|
|
|
} else { |
|
|
|
busVehicleApply = fetchBySid(businessSid); |
|
|
|
//==================================添加线程
|
|
|
@ -762,6 +763,71 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void pushToFin(String sid){ |
|
|
|
BusVehicleApply busVehicleApply = fetchBySid(sid); |
|
|
|
BaseManufactorSubscriptionDto baseManufactorSubscriptionDto = new BaseManufactorSubscriptionDto(); |
|
|
|
//判断申请的订金
|
|
|
|
List<BusVehicleApplyDetailVo> vo = busVehicleApplyDetailService.fetchByApplySid(sid); |
|
|
|
vo.removeAll(Collections.singleton(null)); |
|
|
|
if (busVehicleApply.getCurrentAmount() > 0) { |
|
|
|
//未打款、未认款的厂家认款记录
|
|
|
|
baseManufactorSubscriptionDto.setState(0);//未认款
|
|
|
|
baseManufactorSubscriptionDto.setPaymentState("0");//未打款
|
|
|
|
} else { |
|
|
|
//无需打款、未认款的厂家认款记录
|
|
|
|
baseManufactorSubscriptionDto.setState(0);//未认款
|
|
|
|
baseManufactorSubscriptionDto.setPaymentState("2");//无需打款
|
|
|
|
} |
|
|
|
baseManufactorSubscriptionDto.setCreateOrgSid(busVehicleApply.getCreateOrgSid()); |
|
|
|
baseManufactorSubscriptionDto.setUseOrgSid(busVehicleApply.getCreateOrgSid()); |
|
|
|
baseManufactorSubscriptionDto.setPaymentMoney(busVehicleApply.getCurrentAmount().toString());//打款金额
|
|
|
|
baseManufactorSubscriptionDto.setProSchAppNo(busVehicleApply.getApplicationCode());//排产申请编号
|
|
|
|
baseManufactorSubscriptionDto.setApplyType(busVehicleApply.getApplyType()); |
|
|
|
baseManufactorSubscriptionDto.setApplyTypeKey(busVehicleApply.getApplyTypeKey()); |
|
|
|
ResultBean<String> r = baseManufactorSubscriptionService.saveDto(baseManufactorSubscriptionDto); |
|
|
|
|
|
|
|
//推送到财务出纳
|
|
|
|
if (busVehicleApply.getCurrentAmount() > 0) { |
|
|
|
FinPaymentrecordDto finPaymentrecordDto = new FinPaymentrecordDto(); |
|
|
|
finPaymentrecordDto.setPurchaseSystemSid(busVehicleApply.getOrgDeptSid()); |
|
|
|
finPaymentrecordDto.setPurchaseSystemName(busVehicleApply.getOrgDeptName()); |
|
|
|
finPaymentrecordDto.setApplySid(busVehicleApply.getSid()); |
|
|
|
finPaymentrecordDto.setPayCompanySid(busVehicleApply.getCreateOrgSid()); |
|
|
|
finPaymentrecordDto.setPayType(1); |
|
|
|
finPaymentrecordDto.setCreateOrgSid(busVehicleApply.getCreateOrgSid()); |
|
|
|
finPaymentrecordDto.setUseOrgSid(busVehicleApply.getCreateOrgSid()); |
|
|
|
finPaymentrecordDto.setCost(busVehicleApply.getCurrentAmount().toString()); |
|
|
|
finPaymentrecordDto.setAccountsReceive(busVehicleApply.getCurrentAmount().toString()); |
|
|
|
finPaymentrecordDto.setCostTitleKey(ManPurOrderType.CostTitle.DJ_COSTTITLE.getCode()); |
|
|
|
finPaymentrecordDto.setCostTitleValue(ManPurOrderType.CostTitle.DJ_COSTTITLE.getRemarks()); |
|
|
|
finPaymentrecordDto.setCostTypeKey(DictCommonEnum.costType.DJ_TYPE.getCode()); |
|
|
|
finPaymentrecordDto.setCostTypeValue(DictCommonEnum.costType.DJ_TYPE.getRemarks()); |
|
|
|
finPaymentrecordDto.setDictTypeCode("payCostType"); |
|
|
|
finPaymentrecordDto.setDictKey("005"); |
|
|
|
finPaymentrecordDto.setPayRemark(busVehicleApply.getPayRemarks()); |
|
|
|
finPaymentrecordDto.setCreateBySid(busVehicleApply.getCreateBySid()); |
|
|
|
finPaymentrecordDto.setRemarks("排产订金"); |
|
|
|
//查询收款单位和收款账号
|
|
|
|
List<BusVehicleApplyDetailVo> busVehicleApplyDetailList = busVehicleApplyDetailService.fetchByApplySid(busVehicleApply.getSid()); |
|
|
|
String modelSid = busVehicleApplyDetailList.get(0).getVehicleSid(); |
|
|
|
//根据车型sid查询账户名称和银行账号
|
|
|
|
List<BusApplyVo> busApplyVo = baseManufacturerBankService.selectByApplySid(modelSid); |
|
|
|
busApplyVo.removeAll(Collections.singleton(null)); |
|
|
|
if (!busApplyVo.isEmpty()) { |
|
|
|
finPaymentrecordDto.setReceiveBankAccount(busApplyVo.get(0).getNum()); |
|
|
|
finPaymentrecordDto.setReceiveBank(busApplyVo.get(0).getBankName()); |
|
|
|
finPaymentrecordDto.setReceiveCompany(busApplyVo.get(0).getName()); |
|
|
|
} |
|
|
|
BaseManufacturer baseManufacturer = baseManufacturerService.fetchBySid(busVehicleApply.getSupplierSid()); |
|
|
|
if (baseManufacturer != null) { |
|
|
|
finPaymentrecordDto.setPayCode(baseManufacturer.getManufacturerCode()); |
|
|
|
} |
|
|
|
finPaymentrecordDto.setBusSid(r.getData()); |
|
|
|
finPaymentrecordDto.setBusRemarks(busVehicleApply.getPayRemarks()); |
|
|
|
finPaymentrecordFeign.save(finPaymentrecordDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取上一环节 |
|
|
|
* |
|
|
@ -1107,6 +1173,12 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean rePushFin(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
pushToFin(sid); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/* public ResultBean shareBusVehicleApply(ShareBusVehicleApplyQuery shareQuery) { |
|
|
|
ResultBean rb = ResultBean.fireSuccess(); |
|
|
|
log.info("分享功能,厂家采购参数:{}", JSONObject.toJSONString(shareQuery)); |
|
|
|