|
|
@ -48,7 +48,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -416,14 +415,7 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
//判断申请的订金
|
|
|
|
List<BusVehicleApplyDetailVo> vo = busVehicleApplyDetailService.fetchByApplySid(bv.getBusinessSid()); |
|
|
|
vo.removeAll(Collections.singleton(null)); |
|
|
|
BigDecimal bigDecimal = new BigDecimal("0"); |
|
|
|
for (BusVehicleApplyDetailVo o : vo) { |
|
|
|
String applyForDeposit = o.getApplyForDeposit(); |
|
|
|
if (StringUtils.isNotBlank(applyForDeposit)) { |
|
|
|
bigDecimal = bigDecimal.add(new BigDecimal(applyForDeposit)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (bigDecimal.compareTo(new BigDecimal("0")) == 1) { |
|
|
|
if (busVehicleApply.getCurrentAmount() > 0) { |
|
|
|
//未打款、未认款的厂家认款记录
|
|
|
|
baseManufactorSubscriptionDto.setState(0);//未认款
|
|
|
|
baseManufactorSubscriptionDto.setPaymentState("0");//未打款
|
|
|
@ -435,33 +427,37 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
ResultBean<String> stringResultBean = sysStaffOrgFeign.getPathSidByUserSid(busVehicleApply.getCreateBySid()); |
|
|
|
baseManufactorSubscriptionDto.setCreateOrgSid(stringResultBean.getData()); |
|
|
|
baseManufactorSubscriptionDto.setUseOrgSid(stringResultBean.getData()); |
|
|
|
baseManufactorSubscriptionDto.setPaymentMoney(bigDecimal.toString());//打款金额
|
|
|
|
baseManufactorSubscriptionDto.setPaymentMoney(busVehicleApply.getCurrentAmount().toString());//打款金额
|
|
|
|
baseManufactorSubscriptionDto.setProSchAppNo(busVehicleApply.getApplicationCode());//排产申请编号
|
|
|
|
ResultBean r = baseManufactorSubscriptionService.saveDto(baseManufactorSubscriptionDto); |
|
|
|
ResultBean<String> r = baseManufactorSubscriptionService.saveDto(baseManufactorSubscriptionDto); |
|
|
|
|
|
|
|
//推送到财务出纳
|
|
|
|
FinPaymentrecordDto finPaymentrecordDto = new FinPaymentrecordDto(); |
|
|
|
finPaymentrecordDto.setApplySid(busVehicleApply.getSid()); |
|
|
|
finPaymentrecordDto.setPayCompanySid(busVehicleApply.getCreateOrgSid()); |
|
|
|
finPaymentrecordDto.setPayType(1); |
|
|
|
finPaymentrecordDto.setCreateOrgSid(stringResultBean.getData()); |
|
|
|
finPaymentrecordDto.setUseOrgSid(stringResultBean.getData()); |
|
|
|
finPaymentrecordDto.setCost(busVehicleApply.getCurrentAmount().intValue()); |
|
|
|
finPaymentrecordDto.setCostTitleKey("1"); |
|
|
|
finPaymentrecordDto.setCostTitleValue("车款"); |
|
|
|
finPaymentrecordDto.setCostTypeKey("2"); |
|
|
|
finPaymentrecordDto.setCostTypeValue("排产"); |
|
|
|
//查询收款单位和收款账号
|
|
|
|
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.setReceiveCompany(busApplyVo.get(0).getName()); |
|
|
|
if (busVehicleApply.getCurrentAmount() > 0) { |
|
|
|
FinPaymentrecordDto finPaymentrecordDto = new FinPaymentrecordDto(); |
|
|
|
finPaymentrecordDto.setApplySid(busVehicleApply.getSid()); |
|
|
|
finPaymentrecordDto.setPayCompanySid(busVehicleApply.getCreateOrgSid()); |
|
|
|
finPaymentrecordDto.setPayType(1); |
|
|
|
finPaymentrecordDto.setCreateOrgSid(stringResultBean.getData()); |
|
|
|
finPaymentrecordDto.setUseOrgSid(stringResultBean.getData()); |
|
|
|
finPaymentrecordDto.setCost(busVehicleApply.getCurrentAmount().intValue()); |
|
|
|
finPaymentrecordDto.setCostTitleKey("1"); |
|
|
|
finPaymentrecordDto.setCostTitleValue("车款"); |
|
|
|
finPaymentrecordDto.setCostTypeKey("2"); |
|
|
|
finPaymentrecordDto.setCostTypeValue("排产"); |
|
|
|
//查询收款单位和收款账号
|
|
|
|
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.setReceiveCompany(busApplyVo.get(0).getName()); |
|
|
|
} |
|
|
|
finPaymentrecordDto.setBusSid(r.getData()); |
|
|
|
finPaymentrecordFeign.save(finPaymentrecordDto); |
|
|
|
} |
|
|
|
finPaymentrecordFeign.save(finPaymentrecordDto); |
|
|
|
|
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|