|
@ -30,38 +30,24 @@ import cn.hutool.core.date.DateUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemDetailsVo; |
|
|
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailerDetailsVo; |
|
|
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixDto; |
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixDto; |
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixFeign; |
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixFeign; |
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixVo; |
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixVo; |
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.BusArrearsCarryVehicleApplyVo; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; |
|
|
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.FinBillApplication; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationDetailsVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.flowable.FinBillNodeVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finbilltrailer.FinBillTrailerVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmation; |
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmation; |
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingDetailsVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.*; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.*; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.FinFundsApplyNodeQuery; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.FinFundsApplyNodeQuery; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.FinFundsApplyNodeVo; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.FinFundsApplyTaskQuery; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.FinFundsApplyTaskQuery; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.SubmitFinFundsApplyDto; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardapply.flowable.SubmitFinFundsApplyDto; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardveh.FinFundsCarriedForwardVeh; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardveh.FinFundsCarriedForwardVeh; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardveh.FinFundsCarriedForwardVehDetailsVo; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardveh.FinFundsCarriedForwardVehDetailsVo; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardveh.FinFundsCarriedForwardVehDto; |
|
|
import com.yxt.anrui.fin.api.finfundscarriedforwardveh.FinFundsCarriedForwardVehDto; |
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectReceivablesDetailedWCKCLRKVo; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailed; |
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailed; |
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedVo; |
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedVo; |
|
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceDto; |
|
|
|
|
|
import com.yxt.anrui.fin.biz.fincollectionconfirmation.FinCollectionConfirmationService; |
|
|
import com.yxt.anrui.fin.biz.fincollectionconfirmation.FinCollectionConfirmationService; |
|
|
import com.yxt.anrui.fin.biz.finfundscarriedforwardveh.FinFundsCarriedForwardVehService; |
|
|
import com.yxt.anrui.fin.biz.finfundscarriedforwardveh.FinFundsCarriedForwardVehService; |
|
|
import com.yxt.anrui.fin.biz.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedService; |
|
|
import com.yxt.anrui.fin.biz.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedService; |
|
|
import com.yxt.anrui.flowable.api.flow.FlowProcessMapQuery; |
|
|
|
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
@ -69,24 +55,25 @@ import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
|
|
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
|
|
import com.yxt.common.base.utils.ConstantUtils; |
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
|
|
import com.yxt.common.base.utils.WordUtils; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -94,6 +81,8 @@ import java.math.BigDecimal; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import static java.util.Comparator.comparing; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Project: anrui-fin(款项结转申请) <br/> |
|
|
* Project: anrui-fin(款项结转申请) <br/> |
|
|
* File: FinFundsCarriedForwardApplyService.java <br/> |
|
|
* File: FinFundsCarriedForwardApplyService.java <br/> |
|
@ -132,6 +121,8 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
private MessageFeign messageFeign; |
|
|
private MessageFeign messageFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private com.yxt.anrui.portal.api.flow.FlowableFeign flowableFeignPro; |
|
|
|
|
|
|
|
|
public PagerVo<FinFundsCarriedForwardApplyVo> listPageVo(PagerQuery<FinFundsCarriedForwardApplyQuery> pq) { |
|
|
public PagerVo<FinFundsCarriedForwardApplyVo> listPageVo(PagerQuery<FinFundsCarriedForwardApplyQuery> pq) { |
|
|
FinFundsCarriedForwardApplyQuery query = pq.getParams(); |
|
|
FinFundsCarriedForwardApplyQuery query = pq.getParams(); |
|
@ -190,6 +181,14 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
qw.groupBy("fa.sid"); |
|
|
qw.groupBy("fa.sid"); |
|
|
IPage<FinFundsCarriedForwardApply> page = PagerUtil.queryToPage(pq); |
|
|
IPage<FinFundsCarriedForwardApply> page = PagerUtil.queryToPage(pq); |
|
|
IPage<FinFundsCarriedForwardApplyVo> pagging = baseMapper.selectPageVo(page, qw, query.getJzSmallMoney(), query.getJzBigMoney()); |
|
|
IPage<FinFundsCarriedForwardApplyVo> pagging = baseMapper.selectPageVo(page, qw, query.getJzSmallMoney(), query.getJzBigMoney()); |
|
|
|
|
|
for (FinFundsCarriedForwardApplyVo record : pagging.getRecords()) { |
|
|
|
|
|
record.setShowUpdateBtn(false); |
|
|
|
|
|
if (StringUtils.isNotBlank(record.getDownloadUrl())) { |
|
|
|
|
|
record.setShowDownloadBtn(true); |
|
|
|
|
|
} else { |
|
|
|
|
|
record.setShowDownloadBtn(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
PagerVo<FinFundsCarriedForwardApplyVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
PagerVo<FinFundsCarriedForwardApplyVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
@ -225,6 +224,8 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
FinFundsCarriedForwardApplyDetailsVo vo = new FinFundsCarriedForwardApplyDetailsVo(); |
|
|
FinFundsCarriedForwardApplyDetailsVo vo = new FinFundsCarriedForwardApplyDetailsVo(); |
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
vo.setCreateByDate(DateUtil.formatDate(entity.getCreateTime())); |
|
|
vo.setCreateByDate(DateUtil.formatDate(entity.getCreateTime())); |
|
|
|
|
|
vo.setProcInsId(entity.getProcInstSid()); |
|
|
|
|
|
vo.setPublishInfo(vo.getApplyDeptName() + "-" + vo.getCreateByName()); |
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixFeign.selByLinkSid(sid).getData(); |
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixFeign.selByLinkSid(sid).getData(); |
|
|
List<String> kxqrsImages = new ArrayList<>(); |
|
|
List<String> kxqrsImages = new ArrayList<>(); |
|
|
for (CommonAppendixVo commonAppendixVo : commonAppendixVos) { |
|
|
for (CommonAppendixVo commonAppendixVo : commonAppendixVos) { |
|
@ -233,6 +234,13 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
filePath = urlPrefix + filePath; |
|
|
filePath = urlPrefix + filePath; |
|
|
kxqrsImages.add(filePath); |
|
|
kxqrsImages.add(filePath); |
|
|
} |
|
|
} |
|
|
|
|
|
if ("终止".equals(entity.getNodeState())) { |
|
|
|
|
|
vo.setCollectionBillStateValue("已终止"); |
|
|
|
|
|
} else if ("已办结".equals(entity.getNodeState())) { |
|
|
|
|
|
vo.setCollectionBillStateValue("已审核"); |
|
|
|
|
|
} else { |
|
|
|
|
|
vo.setCollectionBillStateValue("待审核"); |
|
|
|
|
|
} |
|
|
vo.setKxqrsImages(kxqrsImages); |
|
|
vo.setKxqrsImages(kxqrsImages); |
|
|
List<FinFundsCarriedForwardVehDetailsVo> finFundsCarriedForwardVehDetailsVos = finFundsCarriedForwardVehService.fetchByMainSid(sid); |
|
|
List<FinFundsCarriedForwardVehDetailsVo> finFundsCarriedForwardVehDetailsVos = finFundsCarriedForwardVehService.fetchByMainSid(sid); |
|
|
vo.setFinFundsCarriedForwardVehDetailsVos(finFundsCarriedForwardVehDetailsVos); |
|
|
vo.setFinFundsCarriedForwardVehDetailsVos(finFundsCarriedForwardVehDetailsVos); |
|
@ -256,12 +264,60 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
appFinFundsCarriedForwardYXYSKXVo.setUseOrgSid(finSelectedReceivablesDetailedVo.getUseOrgSid()); |
|
|
appFinFundsCarriedForwardYXYSKXVo.setUseOrgSid(finSelectedReceivablesDetailedVo.getUseOrgSid()); |
|
|
appFinFundsCarriedForwardYXYSKXVo.setSubscribedOf(finSelectedReceivablesDetailedVo.getSubscribedOf()); |
|
|
appFinFundsCarriedForwardYXYSKXVo.setSubscribedOf(finSelectedReceivablesDetailedVo.getSubscribedOf()); |
|
|
appFinFundsCarriedForwardYXYSKXVo.setSid(finSelectedReceivablesDetailedVo.getCollSid()); |
|
|
appFinFundsCarriedForwardYXYSKXVo.setSid(finSelectedReceivablesDetailedVo.getCollSid()); |
|
|
|
|
|
String currentReceivableMoney = finSelectedReceivablesDetailedVo.getCurrentReceivableMoney(); |
|
|
|
|
|
String subscriptionMoney = finSelectedReceivablesDetailedVo.getSubscriptionMoney(); |
|
|
|
|
|
BigDecimal surplusReceivable = new BigDecimal(currentReceivableMoney).subtract(new BigDecimal(subscriptionMoney)); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setSurplusReceivable(surplusReceivable.toString()); |
|
|
appFinFundsCarriedForwardYXYSKXVoList.add(appFinFundsCarriedForwardYXYSKXVo); |
|
|
appFinFundsCarriedForwardYXYSKXVoList.add(appFinFundsCarriedForwardYXYSKXVo); |
|
|
} |
|
|
} |
|
|
vo.setYxysFinFundsCarriedForwardYXYSKXVos(appFinFundsCarriedForwardYXYSKXVoList); |
|
|
vo.setYxysFinFundsCarriedForwardYXYSKXVos(appFinFundsCarriedForwardYXYSKXVoList); |
|
|
return rb.success().setData(vo); |
|
|
return rb.success().setData(vo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*public ResultBean<FinFundsCarriedForwardApplyDetailsVo> appFetchDetailsBySid(String sid) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
FinFundsCarriedForwardApply entity = fetchBySid(sid); |
|
|
|
|
|
FinFundsCarriedForwardApplyDetailsVo vo = new FinFundsCarriedForwardApplyDetailsVo(); |
|
|
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
|
|
vo.setCreateByDate(DateUtil.formatDate(entity.getCreateTime())); |
|
|
|
|
|
vo.setProcInsId(entity.getProcInstSid()); |
|
|
|
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixFeign.selByLinkSid(sid).getData(); |
|
|
|
|
|
List<String> kxqrsImages = new ArrayList<>(); |
|
|
|
|
|
for (CommonAppendixVo commonAppendixVo : commonAppendixVos) { |
|
|
|
|
|
String filePath = commonAppendixVo.getFilePath(); |
|
|
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
|
|
filePath = urlPrefix + filePath; |
|
|
|
|
|
kxqrsImages.add(filePath); |
|
|
|
|
|
} |
|
|
|
|
|
vo.setKxqrsImages(kxqrsImages); |
|
|
|
|
|
List<FinFundsCarriedForwardVehDetailsVo> finFundsCarriedForwardVehDetailsVos = finFundsCarriedForwardVehService.fetchByMainSid(sid); |
|
|
|
|
|
vo.setFinFundsCarriedForwardVehDetailsVos(finFundsCarriedForwardVehDetailsVos); |
|
|
|
|
|
List<FinSelectedReceivablesDetailedVo> finSelectedReceivablesDetailedVos = finSelectedReceivablesDetailedService.fetchByCillSid(sid); |
|
|
|
|
|
List<AppFinFundsCarriedForwardYXYSKXVo> appFinFundsCarriedForwardYXYSKXVoList = new ArrayList<>(); |
|
|
|
|
|
for (FinSelectedReceivablesDetailedVo finSelectedReceivablesDetailedVo : finSelectedReceivablesDetailedVos) { |
|
|
|
|
|
AppFinFundsCarriedForwardYXYSKXVo appFinFundsCarriedForwardYXYSKXVo = new AppFinFundsCarriedForwardYXYSKXVo(); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setContractSid(finSelectedReceivablesDetailedVo.getContractSid()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setContractId(finSelectedReceivablesDetailedVo.getContractNo()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setName(finSelectedReceivablesDetailedVo.getCustomerName()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setCustomerSid(finSelectedReceivablesDetailedVo.getCustomerSid()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setProjectName(finSelectedReceivablesDetailedVo.getReceivablesName()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setMobile(finSelectedReceivablesDetailedVo.getCustomerPhone()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setReceivable(finSelectedReceivablesDetailedVo.getCurrentReceivableMoney()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setConfirmMoney(finSelectedReceivablesDetailedVo.getSubscriptionMoney()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setVin(finSelectedReceivablesDetailedVo.getVIN()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setConfirmDate(finSelectedReceivablesDetailedVo.getSubscriptionDate()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setReceivablesSid(finSelectedReceivablesDetailedVo.getReceivablesSid()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setPayType(finSelectedReceivablesDetailedVo.getPayType()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setPayTypeKey(finSelectedReceivablesDetailedVo.getPayTypeKey()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setUseOrgSid(finSelectedReceivablesDetailedVo.getUseOrgSid()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setSubscribedOf(finSelectedReceivablesDetailedVo.getSubscribedOf()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVo.setSid(finSelectedReceivablesDetailedVo.getCollSid()); |
|
|
|
|
|
appFinFundsCarriedForwardYXYSKXVoList.add(appFinFundsCarriedForwardYXYSKXVo); |
|
|
|
|
|
} |
|
|
|
|
|
vo.setYxysFinFundsCarriedForwardYXYSKXVos(appFinFundsCarriedForwardYXYSKXVoList); |
|
|
|
|
|
return rb.success().setData(vo); |
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
public ResultBean<FinFundsCarriedForwardApplyDetailsVo> init(FinFundsCarriedForwardApplyInitQuery finFundsCarriedForwardApplyInitQuery) { |
|
|
public ResultBean<FinFundsCarriedForwardApplyDetailsVo> init(FinFundsCarriedForwardApplyInitQuery finFundsCarriedForwardApplyInitQuery) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
List<String> busSids = finFundsCarriedForwardApplyInitQuery.getBusSids(); |
|
|
List<String> busSids = finFundsCarriedForwardApplyInitQuery.getBusSids(); |
|
@ -291,13 +347,18 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
finFundsCarriedForwardVehDetailsVo.setCustomerSid(finSelectedReceivablesDetailed.getCustomerSid()); |
|
|
finFundsCarriedForwardVehDetailsVo.setCustomerSid(finSelectedReceivablesDetailed.getCustomerSid()); |
|
|
finFundsCarriedForwardVehDetailsVo.setCustomerName(finSelectedReceivablesDetailed.getCustomerName()); |
|
|
finFundsCarriedForwardVehDetailsVo.setCustomerName(finSelectedReceivablesDetailed.getCustomerName()); |
|
|
finFundsCarriedForwardVehDetailsVo.setVinNo(finSelectedReceivablesDetailed.getVIN()); |
|
|
finFundsCarriedForwardVehDetailsVo.setVinNo(finSelectedReceivablesDetailed.getVIN()); |
|
|
|
|
|
if (StringUtils.isBlank(finSelectedReceivablesDetailed.getBalance())) { |
|
|
|
|
|
finFundsCarriedForwardVehDetailsVo.setBalance(finSelectedReceivablesDetailed.getSubscriptionMoney().toString()); |
|
|
|
|
|
} else { |
|
|
finFundsCarriedForwardVehDetailsVo.setBalance(finSelectedReceivablesDetailed.getBalance()); |
|
|
finFundsCarriedForwardVehDetailsVo.setBalance(finSelectedReceivablesDetailed.getBalance()); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
finFundsCarriedForwardVehDetailsVos.add(finFundsCarriedForwardVehDetailsVo); |
|
|
finFundsCarriedForwardVehDetailsVos.add(finFundsCarriedForwardVehDetailsVo); |
|
|
} |
|
|
} |
|
|
finFundsCarriedForwardApplyDetailsVo.setSaleDeptSid(finCollectionConfirmation.getStaffDeptSid()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setSaleDeptSid(finCollectionConfirmation.getStaffDeptSid()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setSaleDeptName(finCollectionConfirmation.getStaffDeptName()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setSaleDeptName(finCollectionConfirmation.getStaffDeptName()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setStaffSid(finCollectionConfirmation.getStaffUserSid()); |
|
|
SysUserVo sysUserVo1 = sysUserFeign.fetchBySid(finCollectionConfirmation.getStaffUserSid()).getData(); |
|
|
|
|
|
finFundsCarriedForwardApplyDetailsVo.setStaffSid(sysUserVo1.getStaffSid()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setStaffName(finCollectionConfirmation.getStaffName()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setStaffName(finCollectionConfirmation.getStaffName()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setSource(finFundsCarriedForwardApplyInitQuery.getSource()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setSource(finFundsCarriedForwardApplyInitQuery.getSource()); |
|
|
finFundsCarriedForwardApplyDetailsVo.setFinFundsCarriedForwardVehDetailsVos(finFundsCarriedForwardVehDetailsVos); |
|
|
finFundsCarriedForwardApplyDetailsVo.setFinFundsCarriedForwardVehDetailsVos(finFundsCarriedForwardVehDetailsVos); |
|
@ -305,6 +366,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
String useOrgName = sysOrganizationFeign.fetchBySid(useOrgSid).getData().getName(); |
|
|
String useOrgName = sysOrganizationFeign.fetchBySid(useOrgSid).getData().getName(); |
|
|
finFundsCarriedForwardApplyDetailsVo.setUseOrgSid(useOrgSid); |
|
|
finFundsCarriedForwardApplyDetailsVo.setUseOrgSid(useOrgSid); |
|
|
finFundsCarriedForwardApplyDetailsVo.setUseOrgName(useOrgName); |
|
|
finFundsCarriedForwardApplyDetailsVo.setUseOrgName(useOrgName); |
|
|
|
|
|
finFundsCarriedForwardApplyDetailsVo.setOrgSidPath(finFundsCarriedForwardApplyInitQuery.getOrgSidPath()); |
|
|
return rb.success().setData(finFundsCarriedForwardApplyDetailsVo); |
|
|
return rb.success().setData(finFundsCarriedForwardApplyDetailsVo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -321,7 +383,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
String billNo = ""; |
|
|
String billNo = ""; |
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); |
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); |
|
|
String date = DateUtil.format(DateUtil.date(), "yyyyMM"); |
|
|
String date = DateUtil.format(DateUtil.date(), "yyyyMM"); |
|
|
billNo = "XSCKD" + sysOrganizationVo.getOrgCode() + date; |
|
|
billNo = "KXJZ" + sysOrganizationVo.getOrgCode() + date; |
|
|
String i = baseMapper.selectNum(billNo); |
|
|
String i = baseMapper.selectNum(billNo); |
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); |
|
|
billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); |
|
@ -329,7 +391,14 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
billNo = Rule.getBillNo(billNo, 0); |
|
|
billNo = Rule.getBillNo(billNo, 0); |
|
|
} |
|
|
} |
|
|
finFundsCarriedForwardApply.setBillNo(billNo); |
|
|
finFundsCarriedForwardApply.setBillNo(billNo); |
|
|
|
|
|
Boolean isOneSale = dto.getIsOneSale(); |
|
|
|
|
|
if (isOneSale){ |
|
|
|
|
|
finFundsCarriedForwardApply.setNodeState("已办结"); |
|
|
|
|
|
}else { |
|
|
finFundsCarriedForwardApply.setNodeState("待提交"); |
|
|
finFundsCarriedForwardApply.setNodeState("待提交"); |
|
|
|
|
|
} |
|
|
|
|
|
Long jzjehj = finFundsCarriedForwardVehDetailsVos.stream().collect(Collectors.summingLong(FinFundsCarriedForwardVehDto::getThisUseMoney)); |
|
|
|
|
|
finFundsCarriedForwardApply.setJzjehj(String.valueOf(jzjehj)); |
|
|
save(finFundsCarriedForwardApply); |
|
|
save(finFundsCarriedForwardApply); |
|
|
for (String filePath : kxqrsImages) { |
|
|
for (String filePath : kxqrsImages) { |
|
|
CommonAppendixDto commonAppendixDto = new CommonAppendixDto(); |
|
|
CommonAppendixDto commonAppendixDto = new CommonAppendixDto(); |
|
@ -430,6 +499,36 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
//用户的组织全路径
|
|
|
//用户的组织全路径
|
|
|
FinFundsCarriedForwardApply finFundsCarriedForwardApply = fetchBySid(dto.getSid()); |
|
|
FinFundsCarriedForwardApply finFundsCarriedForwardApply = fetchBySid(dto.getSid()); |
|
|
|
|
|
List<FinFundsCarriedForwardVehDto> finFundsCarriedForwardVehDetailsVos = dto.getFinFundsCarriedForwardVehDetailsVos(); |
|
|
|
|
|
Long jzjehj = finFundsCarriedForwardVehDetailsVos.stream().collect(Collectors.summingLong(FinFundsCarriedForwardVehDto::getThisUseMoney)); |
|
|
|
|
|
List<AppFinFundsCarriedForwardYXYSKXDto> yxysFinFundsCarriedForwardYXYSKXVos = dto.getYxysFinFundsCarriedForwardYXYSKXVos(); |
|
|
|
|
|
Long rkje = yxysFinFundsCarriedForwardYXYSKXVos.stream().collect(Collectors.summingLong(AppFinFundsCarriedForwardYXYSKXDto::getConfirmMoney)); |
|
|
|
|
|
if (rkje < jzjehj) { |
|
|
|
|
|
return rb.setMsg("认款金额不能小于填写的结转金额"); |
|
|
|
|
|
} |
|
|
|
|
|
if ("已认款".equals(dto.getSource())) { |
|
|
|
|
|
Boolean isOneSale = true; |
|
|
|
|
|
for (FinFundsCarriedForwardVehDto finFundsCarriedForwardVehDetailsVo : finFundsCarriedForwardVehDetailsVos) { |
|
|
|
|
|
String busBillNo = finFundsCarriedForwardVehDetailsVo.getBusBillNo(); |
|
|
|
|
|
for (AppFinFundsCarriedForwardYXYSKXDto yxysFinFundsCarriedForwardYXYSKXVo : yxysFinFundsCarriedForwardYXYSKXVos) { |
|
|
|
|
|
String contractId = yxysFinFundsCarriedForwardYXYSKXVo.getContractId(); |
|
|
|
|
|
if (!busBillNo.equals(contractId)) { |
|
|
|
|
|
isOneSale = false; |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!isOneSale) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (isOneSale) { |
|
|
|
|
|
String pdfPath = createPdf(finFundsCarriedForwardApply.getSid(), finFundsCarriedForwardApply.getCreateByName()).getData(); |
|
|
|
|
|
dto.setPdfPath(pdfPath); |
|
|
|
|
|
dto.setIsOneSale(true); |
|
|
|
|
|
saveOrUpdateAll(dto); |
|
|
|
|
|
return rb.success(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
int r = submitBusinessDataPc(dto, finFundsCarriedForwardApply); |
|
|
int r = submitBusinessDataPc(dto, finFundsCarriedForwardApply); |
|
|
if (r == 3) { |
|
|
if (r == 3) { |
|
|
return rb.setMsg("该申请不存在"); |
|
|
return rb.setMsg("该申请不存在"); |
|
@ -443,6 +542,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
} |
|
|
} |
|
|
String businessSid = resultBean.getData(); |
|
|
String businessSid = resultBean.getData(); |
|
|
|
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
//创建BusinessVariables实体对象
|
|
|
//创建BusinessVariables实体对象
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
@ -476,6 +576,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
} |
|
|
} |
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
|
|
updateYeBySid(businessSid); |
|
|
//极光推送
|
|
|
//极光推送
|
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
@ -498,7 +599,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
bv.setTaskDefKey(finFundsCarriedForwardApply.getNodeSid()); |
|
|
bv.setTaskDefKey(finFundsCarriedForwardApply.getNodeSid()); |
|
|
bv.setComment("重新提交"); |
|
|
bv.setComment("重新提交"); |
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
return complete(bv); |
|
|
return completeTwo(bv); |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
@ -536,25 +637,47 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ResultBean<List<FinBillNodeVo>> getPreviousNodesForReject(FinFundsApplyNodeQuery query) { |
|
|
public ResultBean<List<FinFundsApplyNodeVo>> getPreviousNodesForReject(FinFundsApplyNodeQuery query) { |
|
|
ResultBean<List<FinBillNodeVo>> rb = ResultBean.fireFail(); |
|
|
ResultBean<List<FinFundsApplyNodeVo>> rb = ResultBean.fireFail(); |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
BeanUtil.copyProperties(query, bv); |
|
|
BeanUtil.copyProperties(query, bv); |
|
|
bv.setModelId(ProcDefEnum.FINFUNDSAPPLY.getProDefId()); |
|
|
bv.setModelId(ProcDefEnum.FINFUNDSAPPLY.getProDefId()); |
|
|
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
|
|
FinFundsCarriedForwardApply finFundsCarriedForwardApply = fetchBySid(query.getBusinessSid()); |
|
|
|
|
|
//判断发起人和销售专员是同一人
|
|
|
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(finFundsCarriedForwardApply.getCreateBySid()).getData(); |
|
|
|
|
|
if (sysUserVo.getStaffSid().equals(finFundsCarriedForwardApply.getStaffSid())) { |
|
|
|
|
|
variables.put("isAdj", true); |
|
|
|
|
|
} else { |
|
|
|
|
|
variables.put("isAdj", false); |
|
|
|
|
|
} |
|
|
|
|
|
bv.setFormVariables(variables); |
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
List<FinBillNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinBillNodeVo.class)).collect(Collectors.toList()); |
|
|
List<FinFundsApplyNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinFundsApplyNodeVo.class)).collect(Collectors.toList()); |
|
|
return rb.success().setData(voList); |
|
|
return rb.success().setData(voList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ResultBean<List<FinBillNodeVo>> getNextNodesForSubmit(FinFundsApplyNodeQuery query) { |
|
|
public ResultBean<List<FinFundsApplyNodeVo>> getNextNodesForSubmit(FinFundsApplyNodeQuery query) { |
|
|
ResultBean<List<FinBillNodeVo>> rb = ResultBean.fireFail(); |
|
|
ResultBean<List<FinFundsApplyNodeVo>> rb = ResultBean.fireFail(); |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
BeanUtil.copyProperties(query, bv); |
|
|
BeanUtil.copyProperties(query, bv); |
|
|
bv.setModelId(ProcDefEnum.FINFUNDSAPPLY.getProDefId()); |
|
|
bv.setModelId(ProcDefEnum.FINFUNDSAPPLY.getProDefId()); |
|
|
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
|
|
FinFundsCarriedForwardApply finFundsCarriedForwardApply = fetchBySid(query.getBusinessSid()); |
|
|
|
|
|
//判断发起人和销售专员是同一人
|
|
|
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(finFundsCarriedForwardApply.getCreateBySid()).getData(); |
|
|
|
|
|
if (sysUserVo.getStaffSid().equals(finFundsCarriedForwardApply.getStaffSid())) { |
|
|
|
|
|
variables.put("isAdj", true); |
|
|
|
|
|
} else { |
|
|
|
|
|
variables.put("isAdj", false); |
|
|
|
|
|
} |
|
|
|
|
|
bv.setFormVariables(variables); |
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
List<FinBillNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinBillNodeVo.class)).collect(Collectors.toList()); |
|
|
List<FinFundsApplyNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinFundsApplyNodeVo.class)).collect(Collectors.toList()); |
|
|
return rb.success().setData(voList); |
|
|
return rb.success().setData(voList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -581,6 +704,13 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
appMap.put("sid", businessSid); |
|
|
appMap.put("sid", businessSid); |
|
|
appMap.put("sourceStr", finFundsCarriedForwardApply.getSource()); |
|
|
appMap.put("sourceStr", finFundsCarriedForwardApply.getSource()); |
|
|
variables.put("app", appMap); |
|
|
variables.put("app", appMap); |
|
|
|
|
|
//判断发起人和销售专员是同一人
|
|
|
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(finFundsCarriedForwardApply.getCreateBySid()).getData(); |
|
|
|
|
|
if (sysUserVo.getStaffSid().equals(finFundsCarriedForwardApply.getStaffSid())) { |
|
|
|
|
|
variables.put("isAdj", true); |
|
|
|
|
|
} else { |
|
|
|
|
|
variables.put("isAdj", false); |
|
|
|
|
|
} |
|
|
flowTaskVo.setValues(variables); |
|
|
flowTaskVo.setValues(variables); |
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
if (!resultBean.getSuccess()) { |
|
|
if (!resultBean.getSuccess()) { |
|
@ -590,6 +720,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
|
|
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
|
|
//更新业务中的流程相关的参数
|
|
|
//更新业务中的流程相关的参数
|
|
|
updateFlowFiled(map); |
|
|
updateFlowFiled(map); |
|
|
|
|
|
updateYeBySid(businessSid); |
|
|
//极光推送
|
|
|
//极光推送
|
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
@ -634,6 +765,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
} |
|
|
} |
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
|
|
updateYeBySid(query.getBusinessSid()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -663,6 +795,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
} |
|
|
} |
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
updateFlowFiled(map); |
|
|
updateFlowFiled(map); |
|
|
|
|
|
updateYeBySid(query.getBusinessSid()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
} else { |
|
|
} else { |
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
@ -674,6 +807,7 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
} |
|
|
} |
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
updateFlowFiled(map); |
|
|
updateFlowFiled(map); |
|
|
|
|
|
updateYeBySid(query.getBusinessSid()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -691,6 +825,13 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
appMap.put("sid", businessSid); |
|
|
appMap.put("sid", businessSid); |
|
|
appMap.put("sourceStr", finFundsCarriedForwardApply.getSource()); |
|
|
appMap.put("sourceStr", finFundsCarriedForwardApply.getSource()); |
|
|
variables.put("app", appMap); |
|
|
variables.put("app", appMap); |
|
|
|
|
|
//判断发起人和销售专员是同一人
|
|
|
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(finFundsCarriedForwardApply.getCreateBySid()).getData(); |
|
|
|
|
|
if (sysUserVo.getStaffSid().equals(finFundsCarriedForwardApply.getStaffSid())) { |
|
|
|
|
|
variables.put("isAdj", true); |
|
|
|
|
|
} else { |
|
|
|
|
|
variables.put("isAdj", false); |
|
|
|
|
|
} |
|
|
bv.setFormVariables(variables); |
|
|
bv.setFormVariables(variables); |
|
|
bv.setOrgSidPath(finFundsCarriedForwardApply.getOrgSidPath()); |
|
|
bv.setOrgSidPath(finFundsCarriedForwardApply.getOrgSidPath()); |
|
|
if (bv.getTaskId().equals(finFundsCarriedForwardApply.getTaskId())) { |
|
|
if (bv.getTaskId().equals(finFundsCarriedForwardApply.getTaskId())) { |
|
@ -701,6 +842,9 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
|
|
String pdfPath = createPdf(finFundsCarriedForwardApply.getSid(), finFundsCarriedForwardApply.getCreateByName()).getData(); |
|
|
|
|
|
baseMapper.updatePathBySid(pdfPath,businessSid); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
//极光推送
|
|
|
//极光推送
|
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
@ -723,4 +867,178 @@ public class FinFundsCarriedForwardApplyService extends MybatisBaseService<FinFu |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean completeTwo(BusinessVariables bv) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
String businessSid = bv.getBusinessSid(); |
|
|
|
|
|
FinFundsCarriedForwardApply finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
|
|
appMap.put("sid", businessSid); |
|
|
|
|
|
appMap.put("sourceStr", finFundsCarriedForwardApply.getSource()); |
|
|
|
|
|
variables.put("app", appMap); |
|
|
|
|
|
//判断发起人和销售专员是同一人
|
|
|
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(finFundsCarriedForwardApply.getCreateBySid()).getData(); |
|
|
|
|
|
if (sysUserVo.getStaffSid().equals(finFundsCarriedForwardApply.getStaffSid())) { |
|
|
|
|
|
variables.put("isAdj", true); |
|
|
|
|
|
} else { |
|
|
|
|
|
variables.put("isAdj", false); |
|
|
|
|
|
SysUserVo userVo = sysUserFeign.selectByStaffsid(finFundsCarriedForwardApply.getStaffSid()).getData(); |
|
|
|
|
|
bv.setNextNodeUserSids(userVo.getSid()); |
|
|
|
|
|
} |
|
|
|
|
|
bv.setFormVariables(variables); |
|
|
|
|
|
bv.setOrgSidPath(finFundsCarriedForwardApply.getOrgSidPath()); |
|
|
|
|
|
if (bv.getTaskId().equals(finFundsCarriedForwardApply.getTaskId())) { |
|
|
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
|
|
} else { |
|
|
|
|
|
//极光推送
|
|
|
|
|
|
finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
|
|
ufVo.setProcDefId(finFundsCarriedForwardApply.getProcDefId()); |
|
|
|
|
|
ufVo.setProcInsId(finFundsCarriedForwardApply.getProcInstSid()); |
|
|
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
|
|
messageFlowableQuery.setModuleName("款项结转申请"); |
|
|
|
|
|
messageFlowableQuery.setMsgContent(finFundsCarriedForwardApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
|
|
messageFlowableQuery.setMsgTitle("款项结转申请"); |
|
|
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
|
|
} else { |
|
|
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ResultBean updateYeBySid(String businessSid) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
//修改剩余金额
|
|
|
|
|
|
FinFundsCarriedForwardApply finFundsCarriedForwardApply = fetchBySid(businessSid); |
|
|
|
|
|
List<FinFundsCarriedForwardVehDetailsVo> finFundsCarriedForwardVehDetailsVos = finFundsCarriedForwardVehService.fetchByMainSid(businessSid); |
|
|
|
|
|
for (FinFundsCarriedForwardVehDetailsVo finFundsCarriedForwardVehDetailsVo : finFundsCarriedForwardVehDetailsVos) { |
|
|
|
|
|
//结转金额之和
|
|
|
|
|
|
String djjzMoney = finFundsCarriedForwardVehService.fetchDJSumMoneyByBusSid(finFundsCarriedForwardVehDetailsVo.getBusSid()); |
|
|
|
|
|
if (StringUtils.isBlank(djjzMoney)) { |
|
|
|
|
|
djjzMoney = "0"; |
|
|
|
|
|
} |
|
|
|
|
|
if ("简易订单订金".equals(finFundsCarriedForwardApply.getSource())) { |
|
|
|
|
|
FinCollectionConfirmation finCollectionConfirmation = finCollectionConfirmationService.fetchBySid(finFundsCarriedForwardVehDetailsVo.getBusSid()); |
|
|
|
|
|
//余额
|
|
|
|
|
|
BigDecimal collectionMoney = finCollectionConfirmation.getCollectionMoney(); |
|
|
|
|
|
BigDecimal balance = collectionMoney.subtract(new BigDecimal(djjzMoney)); |
|
|
|
|
|
finCollectionConfirmationService.updateYeBySid(balance.toString(), finFundsCarriedForwardVehDetailsVo.getBusSid()); |
|
|
|
|
|
finFundsCarriedForwardVehService.updateYeByMainSid(balance.toString(), finFundsCarriedForwardVehDetailsVo.getSid()); |
|
|
|
|
|
} else if ("已认款".equals(finFundsCarriedForwardApply.getSource())) { |
|
|
|
|
|
FinSelectedReceivablesDetailed finSelectedReceivablesDetailed = finSelectedReceivablesDetailedService.fetchBySid(finFundsCarriedForwardVehDetailsVo.getBusSid()); |
|
|
|
|
|
//余额
|
|
|
|
|
|
BigDecimal subscriptionMoney = finSelectedReceivablesDetailed.getSubscriptionMoney(); |
|
|
|
|
|
BigDecimal balance = subscriptionMoney.subtract(new BigDecimal(djjzMoney)); |
|
|
|
|
|
finSelectedReceivablesDetailedService.updateYeBySid(balance.toString(), finFundsCarriedForwardVehDetailsVo.getSid()); |
|
|
|
|
|
finFundsCarriedForwardVehService.updateYeByMainSid(balance.toString(), businessSid); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<String> getFlowOperateTitle(FinFundsApplyNodeQuery query) { |
|
|
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
|
|
//0 上一环节 1下一环节
|
|
|
|
|
|
int next = query.getNext(); |
|
|
|
|
|
String data = ""; |
|
|
|
|
|
if (next == 0) { |
|
|
|
|
|
ResultBean<List<FinFundsApplyNodeVo>> previousNodesForReject = getPreviousNodesForReject(query); |
|
|
|
|
|
if (previousNodesForReject.getSuccess()) { |
|
|
|
|
|
previousNodesForReject.getData().removeAll(Collections.singleton(null)); |
|
|
|
|
|
data = previousNodesForReject.getData().get(0).getName(); |
|
|
|
|
|
} else { |
|
|
|
|
|
return rb.setMsg(previousNodesForReject.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (next == 1) { |
|
|
|
|
|
ResultBean<List<FinFundsApplyNodeVo>> nextNodesForSubmit = getNextNodesForSubmit(query); |
|
|
|
|
|
if (nextNodesForSubmit.getSuccess()) { |
|
|
|
|
|
nextNodesForSubmit.getData().removeAll(Collections.singleton(null)); |
|
|
|
|
|
data = nextNodesForSubmit.getData().get(0).getName(); |
|
|
|
|
|
} else { |
|
|
|
|
|
return rb.setMsg(nextNodesForSubmit.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
return rb.setMsg("参数错误:next"); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success().setData(data); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<String> createPdf(String sid, String userName) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
FinFundsCarriedForwardApplyDetailsVo data = fetchDetailsVoBySid(sid).getData(); |
|
|
|
|
|
List<FinFundsCarriedForwardVehDetailsVo> finFundsCarriedForwardVehDetailsVos = data.getFinFundsCarriedForwardVehDetailsVos(); |
|
|
|
|
|
List<AppFinFundsCarriedForwardYXYSKXVo> yxysFinFundsCarriedForwardYXYSKXVos = data.getYxysFinFundsCarriedForwardYXYSKXVos(); |
|
|
|
|
|
Map<String, Object> dataMap = new HashMap(); |
|
|
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeignPro.flowRecordAndComment(data.getProcInsId(), "1").getData(); |
|
|
|
|
|
if (flowRecordVo != null) { |
|
|
|
|
|
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) { |
|
|
|
|
|
if (flowTask.getFlowableRecordVo() != null) { |
|
|
|
|
|
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo(); |
|
|
|
|
|
String taskDefKey = (String) flowableRecordVo.get("taskDefKey"); |
|
|
|
|
|
List<Map<String, Object>> taskUserInfos = ConstantUtils.getListData(flowableRecordVo, "taskUserInfos"); |
|
|
|
|
|
String assigneeName = (String) taskUserInfos.get(0).get("assigneeName"); |
|
|
|
|
|
String finishTime = (String) flowableRecordVo.get("finishTime"); |
|
|
|
|
|
finishTime = finishTime.substring(0, 10); |
|
|
|
|
|
if ("Activity_1nfy3ql".equals(taskDefKey)) { |
|
|
|
|
|
dataMap.put("spName", assigneeName + finishTime); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
List<ZC> zcList = new ArrayList<>(); |
|
|
|
|
|
List<ZR> zrList = new ArrayList<>(); |
|
|
|
|
|
for (FinFundsCarriedForwardVehDetailsVo finFundsCarriedForwardVehDetailsVo : finFundsCarriedForwardVehDetailsVos) { |
|
|
|
|
|
ZC zc = new ZC(); |
|
|
|
|
|
zc.setZc("转出"); |
|
|
|
|
|
zc.setConNo(finFundsCarriedForwardVehDetailsVo.getBusBillNo()); |
|
|
|
|
|
zc.setName(finFundsCarriedForwardVehDetailsVo.getCustomerName()); |
|
|
|
|
|
zc.setVinNo(finFundsCarriedForwardVehDetailsVo.getVinNo()); |
|
|
|
|
|
zc.setDcje(finFundsCarriedForwardVehDetailsVo.getThisUseMoney()); |
|
|
|
|
|
zc.setDcqye(finFundsCarriedForwardVehDetailsVo.getBalance()); |
|
|
|
|
|
zc.setDchye(new BigDecimal(finFundsCarriedForwardVehDetailsVo.getBalance()).subtract(new BigDecimal(finFundsCarriedForwardVehDetailsVo.getThisUseMoney())).toString()); |
|
|
|
|
|
zcList.add(zc); |
|
|
|
|
|
} |
|
|
|
|
|
for (AppFinFundsCarriedForwardYXYSKXVo yxysFinFundsCarriedForwardYXYSKXVo : yxysFinFundsCarriedForwardYXYSKXVos) { |
|
|
|
|
|
ZR zr = new ZR(); |
|
|
|
|
|
zr.setZr("转入"); |
|
|
|
|
|
zr.setConNo(yxysFinFundsCarriedForwardYXYSKXVo.getContractId()); |
|
|
|
|
|
zr.setName(yxysFinFundsCarriedForwardYXYSKXVo.getName()); |
|
|
|
|
|
zr.setVinNo(yxysFinFundsCarriedForwardYXYSKXVo.getVin()); |
|
|
|
|
|
zr.setDrje(yxysFinFundsCarriedForwardYXYSKXVo.getConfirmMoney()); |
|
|
|
|
|
zrList.add(zr); |
|
|
|
|
|
} |
|
|
|
|
|
dataMap.put("saleDate", DateUtil.formatDate(new Date())); |
|
|
|
|
|
dataMap.put("zcList", zcList); |
|
|
|
|
|
dataMap.put("zrList", zrList); |
|
|
|
|
|
dataMap.put("makeName", data.getCreateByName() + data.getCreateByDate()); |
|
|
|
|
|
//获取模板
|
|
|
|
|
|
//模板路径
|
|
|
|
|
|
String sourcePath = "D:\\anrui\\upload\\template\\"; |
|
|
|
|
|
//生成word文件名
|
|
|
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
|
|
// 生成文件路径
|
|
|
|
|
|
String targetPath = sourcePath + dateStr; |
|
|
|
|
|
WordUtils.creatWord(dataMap, "kxjz", sourcePath, targetPath, typeName); |
|
|
|
|
|
//新生成的word路径
|
|
|
|
|
|
String wordPath = targetPath + "\\" + typeName; |
|
|
|
|
|
//生成出门证文件名
|
|
|
|
|
|
String pdfName = "款项结转_" + dateStr + seconds + ".pdf"; |
|
|
|
|
|
WordUtils.doc2pdf(wordPath, targetPath, pdfName, userName); |
|
|
|
|
|
return rb.success().setData("template/" + dateStr + "/" + pdfName); |
|
|
|
|
|
} |
|
|
} |
|
|
} |