|
|
@ -31,6 +31,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.baseaccadjapply.BaseAccadjApply; |
|
|
|
import com.yxt.anrui.base.api.baseinternalpurchasevehicle.BaseInternalPurchaseVehicle; |
|
|
|
import com.yxt.anrui.base.api.baseinternalpurchasevehicle.BaseInternalPurchaseVehicleDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.baseshuntinginvoicinapplyeveh.BaseShuntingInvoicinApplyeVeh; |
|
|
|
import com.yxt.anrui.base.api.baseshuntinginvoicinapplyeveh.BaseShuntingInvoicinApplyeVehDetailsVo; |
|
|
@ -38,12 +39,20 @@ import com.yxt.anrui.base.api.baseshuntinginvoicinapplyeveh.BaseShuntingInvoicin |
|
|
|
import com.yxt.anrui.base.api.baseshuntinginvoicingapply.*; |
|
|
|
import com.yxt.anrui.base.api.baseshuntinginvoicingapply.flow.BaseShuntingInvoicingApplyTaskQuery; |
|
|
|
import com.yxt.anrui.base.api.baseshuntinginvoicingapply.flow.SubmitBaseShuntingInvoicingApplyDto; |
|
|
|
import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificate; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.flow.GetNodeQuery; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.flow.GetNodeVo; |
|
|
|
import com.yxt.anrui.base.biz.baseinternalpurchasevehicle.BaseInternalPurchaseVehicleService; |
|
|
|
import com.yxt.anrui.base.biz.baseshuntinginvoicinapplyeveh.BaseShuntingInvoicinApplyeVehService; |
|
|
|
import com.yxt.anrui.base.biz.basevehiclecertificate.BaseVehicleCertificateService; |
|
|
|
import com.yxt.anrui.base.common.enums.VehicleState; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingFeign; |
|
|
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceDto; |
|
|
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
|
import com.yxt.anrui.flowable.api.flow2.FlowFeign; |
|
|
@ -105,6 +114,10 @@ public class BaseShuntingInvoicingApplyService extends MybatisBaseService<BaseSh |
|
|
|
private BaseVehicleCertificateService baseVehicleCertificateService; |
|
|
|
@Autowired |
|
|
|
private FlowFeign flowFeign; |
|
|
|
@Autowired |
|
|
|
private FinVehicleInvoiceFeign finVehicleInvoiceFeign; |
|
|
|
@Autowired |
|
|
|
private FinCompanyInvoicingFeign finCompanyInvoicingFeign; |
|
|
|
|
|
|
|
private QueryWrapper<BaseShuntingInvoicingApply> createQueryWrapper(BaseShuntingInvoicingApplyQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
@ -136,9 +149,9 @@ public class BaseShuntingInvoicingApplyService extends MybatisBaseService<BaseSh |
|
|
|
public ResultBean<String> saveOrUpdateDto(BaseShuntingInvoicingApplyDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String orgSidPath = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())){ |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())) { |
|
|
|
orgSidPath = dto.getOrgPath(); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getCreateBySid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
@ -172,14 +185,14 @@ public class BaseShuntingInvoicingApplyService extends MybatisBaseService<BaseSh |
|
|
|
dto.setOrgSidPath(orgSidPath); |
|
|
|
this.updateByDto(dto); |
|
|
|
baseShuntingInvoicinApplyeVehService.delByMainSid(dtoSid); |
|
|
|
for (BaseShuntingInvoicinApplyeVehDto baseShuntingInvoicinApplyeVeh : baseShuntingInvoicinApplyeVehs) { |
|
|
|
BaseShuntingInvoicinApplyeVeh baseShuntingInvoicinApplyeVeh1 = new BaseShuntingInvoicinApplyeVeh(); |
|
|
|
String sid = baseShuntingInvoicinApplyeVeh1.getSid(); |
|
|
|
BeanUtil.copyProperties(baseShuntingInvoicinApplyeVeh, baseShuntingInvoicinApplyeVeh1); |
|
|
|
baseShuntingInvoicinApplyeVeh1.setSid(sid); |
|
|
|
baseShuntingInvoicinApplyeVeh1.setMainSid(dtoSid); |
|
|
|
baseShuntingInvoicinApplyeVehService.save(baseShuntingInvoicinApplyeVeh1); |
|
|
|
} |
|
|
|
for (BaseShuntingInvoicinApplyeVehDto baseShuntingInvoicinApplyeVeh : baseShuntingInvoicinApplyeVehs) { |
|
|
|
BaseShuntingInvoicinApplyeVeh baseShuntingInvoicinApplyeVeh1 = new BaseShuntingInvoicinApplyeVeh(); |
|
|
|
String sid = baseShuntingInvoicinApplyeVeh1.getSid(); |
|
|
|
BeanUtil.copyProperties(baseShuntingInvoicinApplyeVeh, baseShuntingInvoicinApplyeVeh1); |
|
|
|
baseShuntingInvoicinApplyeVeh1.setSid(sid); |
|
|
|
baseShuntingInvoicinApplyeVeh1.setMainSid(dtoSid); |
|
|
|
baseShuntingInvoicinApplyeVehService.save(baseShuntingInvoicinApplyeVeh1); |
|
|
|
} |
|
|
|
return rb.success().setMsg("修改成功").setData(dtoSid); |
|
|
|
} |
|
|
|
|
|
|
@ -292,9 +305,9 @@ public class BaseShuntingInvoicingApplyService extends MybatisBaseService<BaseSh |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
if (baseShuntingInvoicinApplyeVehs.size() > 0){ |
|
|
|
if (baseShuntingInvoicinApplyeVehs.size() > 0) { |
|
|
|
for (BaseShuntingInvoicinApplyeVehDto baseShuntingInvoicinApplyeVeh : baseShuntingInvoicinApplyeVehs) { |
|
|
|
baseInternalPurchaseVehicleService.updateIsInvoicing(baseShuntingInvoicinApplyeVeh.getPurchaseSid(),"2"); |
|
|
|
baseInternalPurchaseVehicleService.updateIsInvoicing(baseShuntingInvoicinApplyeVeh.getPurchaseSid(), "2"); |
|
|
|
} |
|
|
|
} |
|
|
|
return voResultBean; |
|
|
@ -419,10 +432,48 @@ public class BaseShuntingInvoicingApplyService extends MybatisBaseService<BaseSh |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
if ("Activity_1xpmnfk".equals(resultBean.getData().getTaskDefKey())) {//调出方支持部审核
|
|
|
|
for (BaseShuntingInvoicinApplyeVehDetailsVo baseShuntingInvoicinApplyeVehDetailsVo : baseShuntingInvoicinApplyeVehDetailsVos) { |
|
|
|
BaseVehicleCertificate baseVehicleCertificate = baseVehicleCertificateService.selectByVinNoAndCreateOrgSid(baseShuntingInvoicinApplyeVehDetailsVo.getVinNo().substring(baseShuntingInvoicinApplyeVehDetailsVo.getVinNo().length() - 8), baseShuntingInvoicingApply.getCallOutOrgSid()); |
|
|
|
if ("虚拟".equals(baseVehicleCertificate.getCertificateStateValue())) { |
|
|
|
baseVehicleCertificateService.updateCertificateStateNew("002", "待转", baseVehicleCertificate.getSid()); |
|
|
|
} |
|
|
|
//推送开票管理
|
|
|
|
FinVehicleInvoiceDto finVehicleInvoiceDto = new FinVehicleInvoiceDto(); |
|
|
|
finVehicleInvoiceDto.setInvoiceTitle(baseShuntingInvoicinApplyeVehDetailsVo.getInvoicinCompanyName()); |
|
|
|
finVehicleInvoiceDto.setContractNo(""); |
|
|
|
BaseInternalPurchaseVehicle baseInternalPurchaseVehicle = baseInternalPurchaseVehicleService.fetchBySid(baseShuntingInvoicinApplyeVehDetailsVo.getPurchaseSid()); |
|
|
|
FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(baseShuntingInvoicingApply.getCallInOrgSid(), baseInternalPurchaseVehicle.getCallInBuyerOrgSid()).getData(); |
|
|
|
finVehicleInvoiceDto.setCustomerName(finCompanyInvoicingDetailsVo.getName()); |
|
|
|
finVehicleInvoiceDto.setVehicleSid(baseVehicleCertificate.getVehicleSid()); |
|
|
|
finVehicleInvoiceDto.setVIN(baseShuntingInvoicinApplyeVehDetailsVo.getVinNo()); |
|
|
|
finVehicleInvoiceDto.setInvoiceTypeKey(baseShuntingInvoicinApplyeVehDetailsVo.getInvoiceTypeKey()); |
|
|
|
finVehicleInvoiceDto.setInvoiceType(baseShuntingInvoicinApplyeVehDetailsVo.getInvoiceTypeValue()); |
|
|
|
finVehicleInvoiceDto.setInvoiceAmount(baseShuntingInvoicinApplyeVehDetailsVo.getInvoicinMoney()); |
|
|
|
finVehicleInvoiceDto.setBillingStateKey("001"); |
|
|
|
finVehicleInvoiceDto.setBillingState("未开票"); |
|
|
|
finVehicleInvoiceDto.setTransferStateKey("001"); |
|
|
|
finVehicleInvoiceDto.setTransferState("未移交"); |
|
|
|
finVehicleInvoiceDto.setVehicleType("主车"); |
|
|
|
finVehicleInvoiceDto.setBillingSid(baseShuntingInvoicingApply.getSid()); |
|
|
|
finVehicleInvoiceDto.setInvoicingName(finCompanyInvoicingDetailsVo.getName()); |
|
|
|
finVehicleInvoiceDto.setCreateBySid(""); |
|
|
|
finVehicleInvoiceDto.setBusinessStateKey("001"); |
|
|
|
finVehicleInvoiceDto.setBusinessState("正常开票"); |
|
|
|
finVehicleInvoiceDto.setUseOrgSid(baseShuntingInvoicingApply.getCallOutOrgSid()); |
|
|
|
finVehicleInvoiceDto.setAddress(finCompanyInvoicingDetailsVo.getAddress()); |
|
|
|
finVehicleInvoiceDto.setTelPhone(finCompanyInvoicingDetailsVo.getPhone()); |
|
|
|
finVehicleInvoiceDto.setOpeningBank(finCompanyInvoicingDetailsVo.getBankName()); |
|
|
|
finVehicleInvoiceDto.setBankNum(finCompanyInvoicingDetailsVo.getBankAccount()); |
|
|
|
finVehicleInvoiceDto.setTaxpayerNo(finCompanyInvoicingDetailsVo.getTaxpayerNo()); |
|
|
|
finVehicleInvoiceDto.setIsTakeTicket("是"); |
|
|
|
finVehicleInvoiceFeign.saveOrUpdate(finVehicleInvoiceDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
if (baseShuntingInvoicinApplyeVehDetailsVos.size() > 0){ |
|
|
|
if (baseShuntingInvoicinApplyeVehDetailsVos.size() > 0) { |
|
|
|
for (BaseShuntingInvoicinApplyeVehDetailsVo baseShuntingInvoicinApplyeVehDetailsVo : baseShuntingInvoicinApplyeVehDetailsVos) { |
|
|
|
baseInternalPurchaseVehicleService.updateIsInvoicing(baseShuntingInvoicinApplyeVehDetailsVo.getPurchaseSid(),"1"); |
|
|
|
baseInternalPurchaseVehicleService.updateIsInvoicing(baseShuntingInvoicinApplyeVehDetailsVo.getPurchaseSid(), "1"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -530,9 +581,9 @@ public class BaseShuntingInvoicingApplyService extends MybatisBaseService<BaseSh |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
if (baseShuntingInvoicinApplyeVehDetailsVos.size() > 0){ |
|
|
|
if (baseShuntingInvoicinApplyeVehDetailsVos.size() > 0) { |
|
|
|
for (BaseShuntingInvoicinApplyeVehDetailsVo baseShuntingInvoicinApplyeVehDetailsVo : baseShuntingInvoicinApplyeVehDetailsVos) { |
|
|
|
baseInternalPurchaseVehicleService.updateIsInvoicing(baseShuntingInvoicinApplyeVehDetailsVo.getPurchaseSid(),"0"); |
|
|
|
baseInternalPurchaseVehicleService.updateIsInvoicing(baseShuntingInvoicinApplyeVehDetailsVo.getPurchaseSid(), "0"); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|