From 18145120a4dc07b9cb2abcb1172f9f67637a5269 Mon Sep 17 00:00:00 2001 From: God <10745413@qq.com> Date: Wed, 20 Dec 2023 15:59:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=82=AC=E6=94=B6=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=BC=80=E5=8F=91=20=E6=8C=82=E8=BD=A6?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=87=91=E8=9D=B6=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/biz/basevehicleout/BaseVehicleOutService.java | 4 ++-- .../loanbecollectionapply/LoanBeCollectionApplyService.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleout/BaseVehicleOutService.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleout/BaseVehicleOutService.java index ce9cf66acc..31158eb426 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleout/BaseVehicleOutService.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicleout/BaseVehicleOutService.java @@ -1854,9 +1854,9 @@ public class BaseVehicleOutService extends MybatisBaseService collMeasures = dto.getCollMeasures(); + String collMeasureSpan = ""; + for (String collMeasure : collMeasures) { + collMeasureSpan = collMeasureSpan + collMeasure + ","; + } + entity.setCollMeasure(collMeasureSpan.substring(0, collMeasureSpan.lastIndexOf(","))); baseMapper.updateById(entity); } From f0723a3c88da2d30f97c1e0fa33bc5ec83ac398b Mon Sep 17 00:00:00 2001 From: God <10745413@qq.com> Date: Wed, 20 Dec 2023 17:31:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=82=AC=E6=94=B6=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anrui/flowable/api/utils/ProcDefEnum.java | 1 + .../LoanBeCollectionApplyFeign.java | 4 +- .../LoanBeCollectionApplyFeignFallback.java | 4 +- .../LoanBeCollectionApplyMapper.java | 3 + .../LoanBeCollectionApplyMapper.xml | 15 + .../LoanBeCollectionApplyRest.java | 26 +- .../LoanBeCollectionApplyService.java | 323 +++++++++++++++++- 7 files changed, 360 insertions(+), 16 deletions(-) diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java index c83fd0e80e..3766f92e55 100644 --- a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java @@ -64,6 +64,7 @@ public enum ProcDefEnum { LOANBUCKLEAPPLLY("划扣申请", "process_50xtaucg:1:6757504"), COLLECTIONPAYMENT("代收代付申请", "process_6upfyv8i:1:6972504"), BEPADSINCEREAPPLY("逾期垫款申请", "process_h1mcb548:1:6712504"), + BECOLLECTIONAPPLY("催收措施申请", "process_7xz17xva:1:7417504"), MONTHLYACCRUAL("当月应收计提申请", "process_7zpo52qj:1:7367504"), /******************************测试流程id*********************************************/ diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java index 427ef8b5ad..91359a0210 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java @@ -96,11 +96,11 @@ public interface LoanBeCollectionApplyFeign { @ApiOperation(value = "获取上一个环节") @GetMapping(value = "/getPreviousNodesForReject") - ResultBean> getPreviousNodesForReject(@Valid @SpringQueryMap LoanBeCollectionApplyNodeQuery query); + ResultBean> getPreviousNodesForReject(@Valid @SpringQueryMap LoanBeCollectionApplyNodeQuery query); @ApiOperation(value = "获取下一个环节") @GetMapping(value = "/getNextNodesForSubmit") - ResultBean> getNextNodesForSubmit(@Valid @SpringQueryMap LoanBeCollectionApplyNodeQuery query); + ResultBean> getNextNodesForSubmit(@Valid @SpringQueryMap LoanBeCollectionApplyNodeQuery query); @ApiOperation(value = "驳回任务") @PostMapping(value = "/reject") diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java index 2fef99c2ba..7089e14f5d 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java @@ -88,12 +88,12 @@ public class LoanBeCollectionApplyFeignFallback implements LoanBeCollectionApply } @Override - public ResultBean> getPreviousNodesForReject(LoanBeCollectionApplyNodeQuery query) { + public ResultBean> getPreviousNodesForReject(LoanBeCollectionApplyNodeQuery query) { return null; } @Override - public ResultBean> getNextNodesForSubmit(LoanBeCollectionApplyNodeQuery query) { + public ResultBean> getNextNodesForSubmit(LoanBeCollectionApplyNodeQuery query) { return null; } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java index ef7e5007e9..0081b67554 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java @@ -36,6 +36,7 @@ import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApply; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyVo; import java.util.List; +import java.util.Map; /** * Project: anrui-riskcenter(催收措施申请)
@@ -64,4 +65,6 @@ public interface LoanBeCollectionApplyMapper extends BaseMapper selectListVo(); String selectNum(String billNo); + + int updateFlowFiled(Map map); } \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml index c764e261b5..d06a1c63ac 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml @@ -18,4 +18,19 @@ order by billNo desc limit 1 + + + UPDATE loan_be_collection_apply + SET nodeState=#{nodeState}, nodeSid=#{taskDefKey} + + , procDefId=#{procDefId} + + + , procInstSid=#{procInsId} + + + , taskId=#{taskId} + + WHERE sid=#{sid} + \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java index 7658f2eab5..5b23138bc5 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java @@ -25,6 +25,9 @@ *********************************************************/ package com.yxt.anrui.riskcenter.biz.loanbecollectionapply; +import cn.hutool.core.bean.BeanUtil; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.flowable.*; import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.LoanBePadsincereNodeVo; import com.yxt.common.core.query.PagerQuery; @@ -109,41 +112,44 @@ public class LoanBeCollectionApplyRest implements LoanBeCollectionApplyFeign { @Override public ResultBean submit(SubmitLoanBeCollectionApplyDto dto) { - return null; + return loanBeCollectionApplyService.submit(dto); } @Override public ResultBean complete(LoanBeCollectionApplyCompleteDto query) { - return null; + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.BECOLLECTIONAPPLY.getProDefId()); + return loanBeCollectionApplyService.complete(bv); } @Override - public ResultBean> getPreviousNodesForReject(LoanBeCollectionApplyNodeQuery query) { - return null; + public ResultBean> getPreviousNodesForReject(LoanBeCollectionApplyNodeQuery query) { + return loanBeCollectionApplyService.getPreviousNodesForReject(query); } @Override - public ResultBean> getNextNodesForSubmit(LoanBeCollectionApplyNodeQuery query) { - return null; + public ResultBean> getNextNodesForSubmit(LoanBeCollectionApplyNodeQuery query) { + return loanBeCollectionApplyService.getNextNodesForSubmit(query); } @Override public ResultBean reject(LoanBeCollectionApplyTaskQuery query) { - return null; + return loanBeCollectionApplyService.reject(query); } @Override public ResultBean revokeProcess(LoanBeCollectionApplyTaskQuery query) { - return null; + return loanBeCollectionApplyService.revokeProcess(query); } @Override public ResultBean breakProcess(LoanBeCollectionApplyTaskQuery query) { - return null; + return loanBeCollectionApplyService.breakProcess(query); } @Override public ResultBean delegate(LoanBeCollectionApplyDelegateQuery query) { - return null; + return loanBeCollectionApplyService.delegate(query); } } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java index e635756254..26ca94d5aa 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java @@ -27,6 +27,7 @@ package com.yxt.anrui.riskcenter.biz.loanbecollectionapply; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; +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.common.utils.Rule; @@ -36,6 +37,16 @@ import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice; import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeign; +import com.yxt.anrui.flowable.api.flow.FlowProcessMapQuery; +import com.yxt.anrui.flowable.api.flow.FlowableFeign; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery; +import com.yxt.anrui.flowable.api.flow2.FlowFeign; +import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; +import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; +import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; @@ -43,12 +54,16 @@ import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; import com.yxt.anrui.portal.api.sysuser.SysUserFeign; import com.yxt.anrui.portal.api.sysuser.SysUserVo; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.*; +import com.yxt.anrui.riskcenter.api.loanbecollectionapply.flowable.*; import com.yxt.anrui.riskcenter.api.loanbecollectionrecord.LoanBeCollectionRecordDto; import com.yxt.anrui.riskcenter.api.loanbecollectionrecord.LoanBeCollectionRecordVehInit; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehDetailsVo; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehDto; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehFile; +import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.LoanBePadsincereApply; import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.LoanBePadsincereApplyVo; +import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.LoanBePadsincereNodeVo; +import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.SubmitLoanBePadsincereDto; import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; import com.yxt.anrui.riskcenter.api.loanhomevisitinvestigatecustomer.LoanHomevisitInvestigateCustomerDetailsVo; @@ -60,6 +75,9 @@ import com.yxt.anrui.riskcenter.biz.loanhomevisitinvestigate.LoanHomevisitInvest import com.yxt.anrui.riskcenter.biz.loanhomevisitinvestigatecustomer.LoanHomevisitInvestigateCustomerService; import com.yxt.anrui.riskcenter.biz.loansolutions.LoanSolutionsService; 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.utils.PagerUtil; @@ -71,6 +89,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; +import java.util.stream.Collectors; /** * Project: anrui-riskcenter(催收措施申请)
@@ -112,6 +131,14 @@ public class LoanBeCollectionApplyService extends MybatisBaseService createQueryWrapper(LoanBeCollectionApplyQuery query) { // todo: 这里根据具体业务调整查询条件 @@ -184,7 +211,7 @@ public class LoanBeCollectionApplyService extends MybatisBaseService loanBeCollectionVehDetails = dto.getLoanBeCollectionVehDetails(); List files = dto.getFiles(); @@ -233,7 +260,7 @@ public class LoanBeCollectionApplyService extends MybatisBaseService variables = new HashMap<>(); + //用户的部门全路径sid + bv.setOrgSidPath(loanBeCollectionApply.getOrgPath()); + //业务sid + bv.setBusinessSid(businessSid); + //用户sid + bv.setUserSid(loanBeCollectionApply.getCreateBySid()); + //若app移动端有此功能,则传递appMap参数 + Map appMap = new HashMap<>(); + appMap.put("sid", businessSid); + //需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。 + variables.put("app", appMap); + //流程定义id + bv.setModelId(ProcDefEnum.BECOLLECTIONAPPLY.getProDefId()); + bv.setFormVariables(variables); + if (r == 1) { + ResultBean voResultBean = flowableFeign.startProcess(bv); + UpdateFlowFieldVo ufVo = voResultBean.getData(); + updateFlowFiled(BeanUtil.beanToMap(ufVo)); + //极光推送 + loanBeCollectionApply = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("催收措施申请"); + messageFlowableQuery.setMsgContent(loanBeCollectionApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("催收措施申请"); + messageFeign.pushMessage(messageFlowableQuery); + return voResultBean; + } + if (r == 2) { + // ToDo:驳回到发起人后再次提交 + if (StringUtils.isBlank(dto.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + bv.setTaskId(loanBeCollectionApply.getTaskId()); + bv.setTaskDefKey(loanBeCollectionApply.getNodeSid()); + bv.setComment(StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); + bv.setInstanceId(dto.getInstanceId()); + return complete(bv); + } + return rb; + } + + public ResultBean> getPreviousNodesForReject(LoanBeCollectionApplyNodeQuery query) { + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.BECOLLECTIONAPPLY.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), LoanBeCollectionApplyNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); + } + + public ResultBean> getNextNodesForSubmit(LoanBeCollectionApplyNodeQuery query) { + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.BECOLLECTIONAPPLY.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), LoanBeCollectionApplyNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); + } + + public ResultBean reject(LoanBeCollectionApplyTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + String businessSid = query.getBusinessSid(); + LoanBeCollectionApply loanBeCollectionApply = fetchBySid(businessSid); + if (loanBeCollectionApply == null) { + return rb.setMsg("该申请不存在"); + } + String businessTaskId = loanBeCollectionApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + if (StringUtils.isBlank(query.getComment())) { + return rb.setMsg("请填写意见"); + } + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + Map variables = new HashMap<>(); + Map appMap = new HashMap<>(); + appMap.put("sid", businessSid); + variables.put("app", appMap); + flowTaskVo.setValues(variables); + ResultBean resultBean = flowableFeign.taskReject(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + UpdateFlowFieldVo ufVo = resultBean.getData(); + Map map = BeanUtil.beanToMap(ufVo); + //更新业务中的流程相关的参数 + updateFlowFiled(map); + //极光推送 + loanBeCollectionApply = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + String procId = loanBeCollectionApply.getProcInstSid(); + ufVo.setProcInsId(procId); + ufVo.setProcDefId(loanBeCollectionApply.getProcDefId()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("催收措施申请"); + ResultBean> listResultBean = flowTaskFeign.getLatestTasks(procId); + String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); + List receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); + if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(loanBeCollectionApply.getCreateBySid())) { + messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); + } else { + messageFlowableQuery.setMsgContent(loanBeCollectionApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + } + messageFlowableQuery.setMsgTitle("催收措施申请"); + messageFeign.pushMessage(messageFlowableQuery); + return rb.success(); + } + } + return rb.setMsg("操作失败!提交的数据不一致!"); + } + + public ResultBean revokeProcess(LoanBeCollectionApplyTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + LoanBeCollectionApply loanBeCollectionApply = fetchBySid(query.getBusinessSid()); + String businessTaskId = loanBeCollectionApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.revokeProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + return rb.success().setData(resultBean.getData()); + } + } + return rb.setMsg("操作失败,提交的数据不一致!"); + } + + public ResultBean breakProcess(LoanBeCollectionApplyTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + if (StringUtils.isBlank(query.getComment())) { + return rb.setMsg("请填写意见"); + } + LoanBeCollectionApply loanBeCollectionApply = fetchBySid(query.getBusinessSid()); + String businessTaskId = loanBeCollectionApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (query.getUserSid().equals(loanBeCollectionApply.getCreateBySid())) { + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.breakProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + Map map = BeanUtil.beanToMap(resultBean.getData()); + updateFlowFiled(map); + return rb.success().setData(resultBean.getData()); + } else { + if (businessTaskId.equals(query.getTaskId())) { + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.breakProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + Map map = BeanUtil.beanToMap(resultBean.getData()); + updateFlowFiled(map); + return rb.success().setData(resultBean.getData()); + } + } + + } + return rb.setMsg("操作失败!提交的数据不一致!"); + } + + public ResultBean delegate(LoanBeCollectionApplyDelegateQuery query) { + ResultBean rb = ResultBean.fireFail(); + FlowDelegateQuery delegateQuery = new FlowDelegateQuery(); + BeanUtil.copyProperties(query, delegateQuery); + flowFeign.delegate(delegateQuery); + return rb.success(); + } + + public ResultBean complete(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + String businessSid = bv.getBusinessSid(); + LoanBeCollectionApply loanBeCollectionApply = fetchBySid(businessSid); + Map variables = new HashMap<>(); + Map appMap = new HashMap<>(); + appMap.put("sid", businessSid); + variables.put("app", appMap); + FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); + if (StringUtils.isBlank(loanBeCollectionApply.getProcDefId())) { + flowProcessMapQuery.setProDefKey(bv.getModelId()); + } else { + flowProcessMapQuery.setProDefKey(loanBeCollectionApply.getProcDefId()); + } + flowProcessMapQuery.setVariables(variables); + variables = flowableFeign.getMap(flowProcessMapQuery).getData(); + //======================================= + bv.setFormVariables(variables); + bv.setOrgSidPath(loanBeCollectionApply.getOrgPath()); + if (bv.getTaskId().equals(loanBeCollectionApply.getTaskId())) { + ResultBean 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 { + //极光推送 + loanBeCollectionApply = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + ufVo.setProcDefId(loanBeCollectionApply.getProcDefId()); + ufVo.setProcInsId(loanBeCollectionApply.getProcInstSid()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("催收措施申请"); + messageFlowableQuery.setMsgContent(loanBeCollectionApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("催收措施申请"); + messageFeign.pushMessage(messageFlowableQuery); + } + return rb.success().setData(resultBean.getData()); + } else { + return rb.setMsg("操作失败!提交的数据不一致"); + } + } + + private synchronized int submitBusinessData(SubmitLoanBeCollectionApplyDto dto, LoanBeCollectionApply loanBeCollectionApply) { + int r = 0; + if (StringUtils.isBlank(dto.getSid())) { + r = 1; + } else { + if (loanBeCollectionApply != null) { + String businessTaskId = loanBeCollectionApply.getTaskId(); + if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { + //新提交 + r = 1; + } else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { + //二次提交//只有数据一致的时候才能进行下一步 + r = 2; + } + } else { + r = 3; + } + + } + return r; + } + + private int updateFlowFiled(Map map) { + return baseMapper.updateFlowFiled(map); + } } \ No newline at end of file From 80ef96beb0d8b635e070609ff0b60e9cea8640d5 Mon Sep 17 00:00:00 2001 From: fanzongzhe <285169773@qq.com> Date: Wed, 20 Dec 2023 17:35:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=9D=9E=E6=8B=85=E4=BF=9D=E4=BF=A1?= =?UTF-8?q?=E5=AE=A1=E6=97=A0=E6=B3=95=E6=8E=A8=E9=80=81=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=BA=94=E6=94=B6=E9=97=AE=E9=A2=98=E3=80=81?= =?UTF-8?q?=E5=B0=81=E8=A3=85=E6=8E=A8=E9=80=81=E5=87=AD=E8=AF=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoanOtherReceivablePush.java | 3 + .../BusSalesOrderLoancontractService.java | 574 ++++++++++++------ .../fin/api/kingdee/FinKingDeeFeign.java | 52 ++ .../api/kingdee/FinKingDeeFeignFallBack.java | 53 ++ .../kingdee/voucher/CollectionVoucher.java | 3 + .../api/kingdee/voucher/GeneralVoucher.java | 31 + .../api/kingdee/voucher/PaymentVoucher.java | 35 ++ .../api/kingdee/voucher/SceneCodeEnum.java | 53 ++ .../fin/biz/kingdee/FinKingDeeFeignRest.java | 134 ++++ .../biz/kingdee/voucher/VoucherService.java | 12 +- .../LoanCapitalCreditResultService.java | 2 + .../LoanNoGuaranteeCreditReviewService.java | 13 +- 12 files changed, 782 insertions(+), 183 deletions(-) create mode 100644 anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/SceneCodeEnum.java diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorderloancontract/LoanOtherReceivablePush.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorderloancontract/LoanOtherReceivablePush.java index 8ce2903b97..a9d439f68e 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorderloancontract/LoanOtherReceivablePush.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorderloancontract/LoanOtherReceivablePush.java @@ -3,6 +3,8 @@ package com.yxt.anrui.buscenter.api.bussalesorderloancontract; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * @author Administrator * @description @@ -17,4 +19,5 @@ public class LoanOtherReceivablePush { @ApiModelProperty("消贷合同sid") private String loanContractSid; private String isCompInvoic; + private String tag; // 01担保 02非担保 } diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderloancontract/BusSalesOrderLoancontractService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderloancontract/BusSalesOrderLoancontractService.java index 0bb835652f..b640175b5f 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderloancontract/BusSalesOrderLoancontractService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderloancontract/BusSalesOrderLoancontractService.java @@ -371,76 +371,78 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService busSalesOrderVehicleList = busSalesOrderVehicleService.selectListByOrderSidAndXdConSid(saleOrderSid, loanOtherReceivablePush.getLoanContractSid()); - if (!busSalesOrderVehicleList.isEmpty()) { - for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicleList) { - String vinNoCode = ""; - if (StringUtils.isNotBlank(busSalesOrderVehicle.getLinkSid())) { - BaseVehicleSelectVo data = baseVehicleFeign.details(busSalesOrderVehicle.getLinkSid()).getData(); - if (null != data) { - vinNoCode = data.getVinNo(); + if (tag.equals("01")) { + if (null != salesOrder) { + BusSalesOrderBorrower borrowerDetailsVo = busSalesOrderBorrowerService.fetchBySid(borrowerSid); + if (null != borrowerDetailsVo) { + //-----------获取其他应收单对象---------------- + CapitalCreditResult creditResult = new CapitalCreditResult(); + //根据销售订单的贷款人sid查询车辆表中的数据 + List busSalesOrderVehicleList = busSalesOrderVehicleService.selectListByOrderSidAndXdConSid(saleOrderSid, loanOtherReceivablePush.getLoanContractSid()); + if (!busSalesOrderVehicleList.isEmpty()) { + for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicleList) { + String vinNoCode = ""; + if (StringUtils.isNotBlank(busSalesOrderVehicle.getLinkSid())) { + BaseVehicleSelectVo data = baseVehicleFeign.details(busSalesOrderVehicle.getLinkSid()).getData(); + if (null != data) { + vinNoCode = data.getVinNo(); + } } - } - String customerNumber = ""; - //判断财务系统是否有客户 - Boolean aBoolean = finKingDeeFeign.customerExistState(busSalesOrderVehicle.getTemporaryNo()).getData(); - String linkNo = ""; - if (!aBoolean) { - // List bdCustomers = new ArrayList<>(); - BdCustomer bdCustomer = new BdCustomer(); - bdCustomer.setFNumber(busSalesOrderVehicle.getTemporaryNo()); - bdCustomer.setFShortName(salesOrder.getContractNo()); - BasePurchaseSystemDetailsVo data = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); - bdCustomer.setTOrgIds(data.getOrgCode()); - if (StringUtils.isNotBlank(busSalesOrderVehicle.getLinkNo())) { - String vinNo = busSalesOrderVehicle.getLinkNo(); - vinNoCode = busSalesOrderVehicle.getLinkNo(); - if (vinNo.length() > 8) { - linkNo = vinNo.substring(vinNo.length() - 8); + String customerNumber = ""; + //判断财务系统是否有客户 + Boolean aBoolean = finKingDeeFeign.customerExistState(busSalesOrderVehicle.getTemporaryNo()).getData(); + String linkNo = ""; + if (!aBoolean) { + // List bdCustomers = new ArrayList<>(); + BdCustomer bdCustomer = new BdCustomer(); + bdCustomer.setFNumber(busSalesOrderVehicle.getTemporaryNo()); + bdCustomer.setFShortName(salesOrder.getContractNo()); + BasePurchaseSystemDetailsVo data = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); + bdCustomer.setTOrgIds(data.getOrgCode()); + if (StringUtils.isNotBlank(busSalesOrderVehicle.getLinkNo())) { + String vinNo = busSalesOrderVehicle.getLinkNo(); + vinNoCode = busSalesOrderVehicle.getLinkNo(); + if (vinNo.length() > 8) { + linkNo = vinNo.substring(vinNo.length() - 8); + } else { + linkNo = busSalesOrderVehicle.getLinkNo(); + } + bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + linkNo); } else { - linkNo = busSalesOrderVehicle.getLinkNo(); + bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + busSalesOrderVehicle.getTemporaryNo()); + } + // bdCustomers.add(bdCustomer); + ResultBean resultBean = finKingDeeFeign.draftBdCustomer(bdCustomer); + if (resultBean.getSuccess()) { + customerNumber = bdCustomer.getFNumber(); } - bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + linkNo); } else { - bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + busSalesOrderVehicle.getTemporaryNo()); + customerNumber = busSalesOrderVehicle.getTemporaryNo(); } - // bdCustomers.add(bdCustomer); - ResultBean resultBean = finKingDeeFeign.draftBdCustomer(bdCustomer); - if (resultBean.getSuccess()) { - customerNumber = bdCustomer.getFNumber(); + creditResult.setCommUnit(customerNumber); + BasePurchaseSystemDetailsVo basePurchaseSystemDetailsVo = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); + creditResult.setCollectionOrg(basePurchaseSystemDetailsVo.getOrgCode()); + creditResult.setBussDate(DateUtil.formatDate(new Date())); + SolutionsDetailsVo solutionsDetailsVo = loanSolutionsFeign.selectDetails(saleOrderSid).getData(); + if (StringUtils.isNotBlank(solutionsDetailsVo.getPolicySid())) { + LoanFinPolicyVo loanFinPolicyVo = loanFinPolicyFeign.details(solutionsDetailsVo.getPolicySid()).getData(); + LoanFinBankVo loanFinBankVo = loanFinBankFeign.details(loanFinPolicyVo.getBankSid()).getData(); + creditResult.setBankName(loanFinBankVo.getBankNo()); } - } else { - customerNumber = busSalesOrderVehicle.getTemporaryNo(); - } - creditResult.setCommUnit(customerNumber); - BasePurchaseSystemDetailsVo basePurchaseSystemDetailsVo = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); - creditResult.setCollectionOrg(basePurchaseSystemDetailsVo.getOrgCode()); - creditResult.setBussDate(DateUtil.formatDate(new Date())); - SolutionsDetailsVo solutionsDetailsVo = loanSolutionsFeign.selectDetails(saleOrderSid).getData(); - if (StringUtils.isNotBlank(solutionsDetailsVo.getPolicySid())) { - LoanFinPolicyVo loanFinPolicyVo = loanFinPolicyFeign.details(solutionsDetailsVo.getPolicySid()).getData(); - LoanFinBankVo loanFinBankVo = loanFinBankFeign.details(loanFinPolicyVo.getBankSid()).getData(); - creditResult.setBankName(loanFinBankVo.getBankNo()); - } - List collectionDetailDtoListOne = new ArrayList<>(); - SysOrganizationVo sysOrganizationVo2 = sysOrganizationFeign.fetchBySid(salesOrder.getOrgSid()).getData(); - SolutionsDetailsVo solutions = loanSolutionsFeign.selectDetails(saleOrderSid).getData(); - //这是生成业务系统融资放款应收的逻辑: - // 融资放款=融资项目总额-融资首付-[贷款保证金]-[厂家贴息],根据选择的产品政策来判断,若贷款保证金为固定的,需要减去,若为敞口的,不需要减;差额放款需要减厂家贴息,全额放款不需要。差额放款的厂家贴息金额存入“其他应收”字段中, - //计算融资放款的金额以及厂家贴息金额 - ResultBean resultBean = loanSolutionsFeign.selectMoney(saleOrderSid); - if (null != resultBean.getData()) { - CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); - creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + List collectionDetailDtoListOne = new ArrayList<>(); + SysOrganizationVo sysOrganizationVo2 = sysOrganizationFeign.fetchBySid(salesOrder.getOrgSid()).getData(); + SolutionsDetailsVo solutions = loanSolutionsFeign.selectDetails(saleOrderSid).getData(); + //这是生成业务系统融资放款应收的逻辑: + // 融资放款=融资项目总额-融资首付-[贷款保证金]-[厂家贴息],根据选择的产品政策来判断,若贷款保证金为固定的,需要减去,若为敞口的,不需要减;差额放款需要减厂家贴息,全额放款不需要。差额放款的厂家贴息金额存入“其他应收”字段中, + //计算融资放款的金额以及厂家贴息金额 + ResultBean resultBean = loanSolutionsFeign.selectMoney(saleOrderSid); + if (null != resultBean.getData()) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); /*if (null != solutions) { if (StringUtils.isNotBlank(loanOtherReceivablePush.getIsCompInvoic())) { if (loanOtherReceivablePush.getIsCompInvoic().equals("1")) { @@ -460,122 +462,343 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService busSalesOrderVehicleList = busSalesOrderVehicleService.selectListByOrderSidAndDkrSid(saleOrderSid,borrowerSid); + if (!busSalesOrderVehicleList.isEmpty()) { + for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicleList) { + String vinNoCode = ""; + if (StringUtils.isNotBlank(busSalesOrderVehicle.getLinkSid())) { + BaseVehicleSelectVo data = baseVehicleFeign.details(busSalesOrderVehicle.getLinkSid()).getData(); + if (null != data) { + vinNoCode = data.getVinNo(); + } + } + String customerNumber = ""; + //判断财务系统是否有客户 + Boolean aBoolean = finKingDeeFeign.customerExistState(busSalesOrderVehicle.getTemporaryNo()).getData(); + String linkNo = ""; + if (!aBoolean) { + // List bdCustomers = new ArrayList<>(); + BdCustomer bdCustomer = new BdCustomer(); + bdCustomer.setFNumber(busSalesOrderVehicle.getTemporaryNo()); + bdCustomer.setFShortName(salesOrder.getContractNo()); + BasePurchaseSystemDetailsVo data = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); + bdCustomer.setTOrgIds(data.getOrgCode()); + if (StringUtils.isNotBlank(busSalesOrderVehicle.getLinkNo())) { + String vinNo = busSalesOrderVehicle.getLinkNo(); + vinNoCode = busSalesOrderVehicle.getLinkNo(); + if (vinNo.length() > 8) { + linkNo = vinNo.substring(vinNo.length() - 8); + } else { + linkNo = busSalesOrderVehicle.getLinkNo(); + } + bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + linkNo); + } else { + bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + busSalesOrderVehicle.getTemporaryNo()); + } + // bdCustomers.add(bdCustomer); + ResultBean resultBean = finKingDeeFeign.draftBdCustomer(bdCustomer); + if (resultBean.getSuccess()) { + customerNumber = bdCustomer.getFNumber(); + } + } else { + customerNumber = busSalesOrderVehicle.getTemporaryNo(); + } + creditResult.setCommUnit(customerNumber); + BasePurchaseSystemDetailsVo basePurchaseSystemDetailsVo = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); + creditResult.setCollectionOrg(basePurchaseSystemDetailsVo.getOrgCode()); + creditResult.setBussDate(DateUtil.formatDate(new Date())); + SolutionsDetailsVo solutionsDetailsVo = loanSolutionsFeign.selectDetails(saleOrderSid).getData(); + if (StringUtils.isNotBlank(solutionsDetailsVo.getPolicySid())) { + LoanFinPolicyVo loanFinPolicyVo = loanFinPolicyFeign.details(solutionsDetailsVo.getPolicySid()).getData(); + LoanFinBankVo loanFinBankVo = loanFinBankFeign.details(loanFinPolicyVo.getBankSid()).getData(); + creditResult.setBankName(loanFinBankVo.getBankNo()); + } + List collectionDetailDtoListOne = new ArrayList<>(); + SysOrganizationVo sysOrganizationVo2 = sysOrganizationFeign.fetchBySid(salesOrder.getOrgSid()).getData(); + SolutionsDetailsVo solutions = loanSolutionsFeign.selectDetails(saleOrderSid).getData(); + //这是生成业务系统融资放款应收的逻辑: + // 融资放款=融资项目总额-融资首付-[贷款保证金]-[厂家贴息],根据选择的产品政策来判断,若贷款保证金为固定的,需要减去,若为敞口的,不需要减;差额放款需要减厂家贴息,全额放款不需要。差额放款的厂家贴息金额存入“其他应收”字段中, + //计算融资放款的金额以及厂家贴息金额 + ResultBean resultBean = loanSolutionsFeign.selectMoney(saleOrderSid); + if (null != resultBean.getData()) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + /*if (null != solutions) { + if (StringUtils.isNotBlank(loanOtherReceivablePush.getIsCompInvoic())) { + if (loanOtherReceivablePush.getIsCompInvoic().equals("1")) { + //挂车待退款 + if (StringUtils.isNotBlank(solutions.getTrailerAmount()) && !("0").equals(solutions.getTrailerAmount())) { + BigDecimal trailerAmount = new BigDecimal(solutions.getTrailerAmount()); + BigDecimal money = new BigDecimal(resultBean.getData().getMoney()); + BigDecimal subtract = money.subtract(trailerAmount); + creditResultDetailDto.setExTaxMoney("-" + subtract); + } else { + creditResultDetailDto.setExTaxMoney("-" + resultBean.getData().getMoney()); + } + } else { + creditResultDetailDto.setExTaxMoney("-" + resultBean.getData().getMoney()); + } + } else { + creditResultDetailDto.setExTaxMoney("-" + resultBean.getData().getMoney()); + } + }*/ + creditResultDetailDto.setExTaxMoney("-" + resultBean.getData().getMoney()); + creditResultDetailDto.setUseTo(CwSystemYT.RONGZI_FANGKUAN.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.RONGZI_FANGKUAN.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + if (null != solutions) { + if (StringUtils.isNotBlank(loanOtherReceivablePush.getIsCompInvoic())) { + if (loanOtherReceivablePush.getIsCompInvoic().equals("1")) { + //挂车待退款 + if (StringUtils.isNotBlank(solutions.getTrailerAmount()) && !("0").equals(solutions.getTrailerAmount())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setExTaxMoney(solutions.getTrailerAmount()); + creditResultDetailDto.setUseTo(CwSystemYT.GCDTK.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.GCDTK.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + } + } + //贷款保证金 + if (StringUtils.isNotBlank(solutions.getBondAmounts()) && !("0").equals(solutions.getBondAmounts())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setExTaxMoney(solutions.getBondAmounts()); + creditResultDetailDto.setUseTo(CwSystemYT.BOND_AMOUNTS.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.BOND_AMOUNTS.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //保险保证金 + if (StringUtils.isNotBlank(solutions.getDepositPremium()) && !("0").equals(solutions.getDepositPremium())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setExTaxMoney(solutions.getDepositPremium()); + creditResultDetailDto.setUseTo(CwSystemYT.DEPOSIT_PREMIUM.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.DEPOSIT_PREMIUM.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //落户保证金 + if (StringUtils.isNotBlank(solutions.getDepositSettle()) && !("0").equals(solutions.getDepositSettle())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setExTaxMoney(solutions.getDepositSettle()); + creditResultDetailDto.setUseTo(CwSystemYT.DEPOSIT_SETTLE.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.DEPOSIT_SETTLE.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //服务费 + if (StringUtils.isNotBlank(solutions.getServiceAmount()) && !("0").equals(solutions.getServiceAmount())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setUseTo(CwSystemYT.SERVICE_AMOUNT_DANBAO.getType()); + creditResultDetailDto.setExTaxMoney(solutions.getServiceAmount()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.SERVICE_AMOUNT_DANBAO.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //代收意外险 + if (StringUtils.isNotBlank(solutions.getProxyAccidentPremium()) && !("0").equals(solutions.getProxyAccidentPremium())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setUseTo(CwSystemYT.PROXY_ACCIDENT_PREMIUM.getType()); + creditResultDetailDto.setExTaxMoney(solutions.getProxyAccidentPremium()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.PROXY_ACCIDENT_PREMIUM.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //上牌费、运管费 + if ((StringUtils.isNotBlank(solutions.getRegisterAmount()) && !("0").equals(solutions.getRegisterAmount())) || + (StringUtils.isNotBlank(solutions.getOperationAmount()) && !("0").equals(solutions.getOperationAmount()))) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + BigDecimal registerAmount = new BigDecimal(solutions.getRegisterAmount()); + BigDecimal opertionAmount = new BigDecimal(solutions.getOperationAmount()); + BigDecimal add = registerAmount.add(opertionAmount); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setUseTo(CwSystemYT.SHANGPAI_YUNGUAN.getType()); + creditResultDetailDto.setExTaxMoney(add.toString()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.SHANGPAI_YUNGUAN.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //其它费用 + if (StringUtils.isNotBlank(solutions.getOtherAmount()) && !("0").equals(solutions.getOtherAmount())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setExTaxMoney(solutions.getOtherAmount()); + creditResultDetailDto.setUseTo(CwSystemYT.OTHER_AMOUNT.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.OTHER_AMOUNT.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //补车价 + if (StringUtils.isNotBlank(solutions.getVehOtherPrice()) && !("0").equals(solutions.getVehOtherPrice())) { + CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); + creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); + creditResultDetailDto.setExTaxMoney(solutions.getVehOtherPrice()); + creditResultDetailDto.setUseTo(CwSystemYT.VEH_OTHER_PRICE.getType()); + DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(CwSystemYT.VEH_OTHER_PRICE.getType(), "YT").getData(); + creditResultDetailDto.setRemarks(dictCommonVo.getDictValue()); + creditResultDetailDto.setMaterialNo(vinNoCode); + collectionDetailDtoListOne.add(creditResultDetailDto); + } + //留购价 /* if (StringUtils.isNotBlank(solutions.getNominalPrice()) && !("0").equals(solutions.getNominalPrice())) { CapitalCreditResult.CapitalCreditResultDetailDto creditResultDetailDto = new CapitalCreditResult.CapitalCreditResultDetailDto(); creditResultDetailDto.setDearDept(sysOrganizationVo2.getOrgCode()); @@ -585,13 +808,16 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService saveVoucher(@RequestBody @Valid Voucher voucher); + @ApiOperation("保存还款计划表总凭证接口") + @PostMapping("/saveScheduleVoucher") + @ResponseBody + ResultBean saveScheduleVoucher(@RequestBody @Valid GeneralVoucher voucher); + + @ApiOperation("保存月还计提凭证接口") + @PostMapping("/saveAccrualVoucher") + @ResponseBody + ResultBean saveAccrualVoucher(@RequestBody @Valid GeneralVoucher voucher); + + @ApiOperation("保存逾期转累欠凭证接口") + @PostMapping("/saveLateVoucher") + @ResponseBody + ResultBean saveLateVoucher(@RequestBody @Valid GeneralVoucher voucher); + + @ApiOperation("保存月还划扣凭证接口") + @PostMapping("/saveBuckleVoucher") + @ResponseBody + ResultBean saveBuckleVoucher(@RequestBody @Valid GeneralVoucher voucher); + + @ApiOperation("保存间还月还收款凭证接口") + @PostMapping("/saveIndirectVoucher") + @ResponseBody + ResultBean saveIndirectVoucher(@RequestBody @Valid CollectionVoucher voucher); + + @ApiOperation("间还月还代付款凭证") + @PostMapping("/savePaymentVoucher") + @ResponseBody + ResultBean savePaymentVoucher(@RequestBody @Valid PaymentVoucher voucher); + + @ApiOperation("保存垫款付款凭证接口") + @PostMapping("/saveAdvancesVoucher") + @ResponseBody + ResultBean saveAdvancesVoucher(@RequestBody @Valid PaymentVoucher voucher); + + @ApiOperation("保存中车退还垫款收款凭证接口") + @PostMapping("/saveReturnVoucher") + @ResponseBody + ResultBean saveReturnVoucher(@RequestBody @Valid CollectionVoucher voucher); + + @ApiOperation("保存资金占用费计提凭证接口") + @PostMapping("/saveFundVoucher") + @ResponseBody + ResultBean saveFundVoucher(@RequestBody @Valid GeneralVoucher voucher); + + @ApiOperation("保存资金占用费收款凭证接口") + @PostMapping("/saveFeeVoucher") + @ResponseBody + ResultBean saveFeeVoucher(@RequestBody @Valid CollectionVoucher voucher); @ApiOperation("暂存其他应收单的接口(资方信审终审通过后推送)") @PostMapping("/pushOtherReceivableBill") diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java index c4ff013feb..4922367adc 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java @@ -22,6 +22,9 @@ import com.yxt.anrui.fin.api.kingdee.salesreturn.SalesReturn; import com.yxt.anrui.fin.api.kingdee.saloutstock.SalOutStock; import com.yxt.anrui.fin.api.kingdee.stkinstock.StkInStock; import com.yxt.anrui.fin.api.kingdee.stktransferdirect.StkTransferDirect; +import com.yxt.anrui.fin.api.kingdee.voucher.CollectionVoucher; +import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; +import com.yxt.anrui.fin.api.kingdee.voucher.PaymentVoucher; import com.yxt.anrui.fin.api.kingdee.voucher.Voucher; import com.yxt.common.core.result.ResultBean; @@ -49,6 +52,56 @@ implements FinKingDeeFeign{ return null; } + @Override + public ResultBean saveScheduleVoucher(GeneralVoucher voucher) { + return null; + } + + @Override + public ResultBean saveAccrualVoucher(GeneralVoucher voucher) { + return null; + } + + @Override + public ResultBean saveLateVoucher(GeneralVoucher voucher) { + return null; + } + + @Override + public ResultBean saveBuckleVoucher(GeneralVoucher voucher) { + return null; + } + + @Override + public ResultBean saveIndirectVoucher(CollectionVoucher voucher) { + return null; + } + + @Override + public ResultBean savePaymentVoucher(PaymentVoucher voucher) { + return null; + } + + @Override + public ResultBean saveAdvancesVoucher(PaymentVoucher voucher) { + return null; + } + + @Override + public ResultBean saveReturnVoucher(CollectionVoucher voucher) { + return null; + } + + @Override + public ResultBean saveFundVoucher(GeneralVoucher voucher) { + return null; + } + + @Override + public ResultBean saveFeeVoucher(CollectionVoucher voucher) { + return null; + } + @Override public ResultBean pushOtherReceivableBill(CapitalCreditResult creditResult) { return null; diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/CollectionVoucher.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/CollectionVoucher.java index efc7ce2d44..c4d383f0be 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/CollectionVoucher.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/CollectionVoucher.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -40,6 +41,8 @@ public class CollectionVoucher { public String customerCode; @ApiModelProperty("客户名称") public String customerName; + @ApiModelProperty("金额") + public BigDecimal amount; @ApiModelProperty("备注") public String remarks; } diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/GeneralVoucher.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/GeneralVoucher.java index af52116576..d4ed393173 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/GeneralVoucher.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/GeneralVoucher.java @@ -1,8 +1,13 @@ package com.yxt.anrui.fin.api.kingdee.voucher; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + /** * @author Fan * @description @@ -11,5 +16,31 @@ import lombok.Data; @Data @ApiModel(value = "一般凭证 数据传输对象", description = "一般凭证 数据传输对象") public class GeneralVoucher { + @ApiModelProperty("分公司编码") + public String useOrgCode; + @ApiModelProperty("凭证明细") + public List voucherDetails; + + @Data + public static class GeneralVoucherDetail { + @ApiModelProperty("场景编码") + public String sceneCode; + @ApiModelProperty("资方简称") + public String bankName; + @ApiModelProperty("数据日期") + public Date dataTime; + @ApiModelProperty("部门编码") + public String deptCode; + @ApiModelProperty("部门名称") + public String deptName; + @ApiModelProperty("客户编码") + public String customerCode; + @ApiModelProperty("客户名称") + public String customerName; + @ApiModelProperty("金额") + public BigDecimal amount; + @ApiModelProperty("备注") + public String remarks; + } } diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/PaymentVoucher.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/PaymentVoucher.java index df456b92a3..4cbeb63cf4 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/PaymentVoucher.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/PaymentVoucher.java @@ -1,8 +1,13 @@ package com.yxt.anrui.fin.api.kingdee.voucher; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + /** * @author Fan * @description @@ -11,5 +16,35 @@ import lombok.Data; @Data @ApiModel(value = "一般凭证 数据传输对象", description = "一般凭证 数据传输对象") public class PaymentVoucher { + @ApiModelProperty("分公司编码") + public String useOrgCode; + @ApiModelProperty("收款方式编码") + public String payTypeCode; + @ApiModelProperty("银行账号") + public String bankAccount; + @ApiModelProperty("凭证明细") + public List voucherDetails; + + @Data + public static class PaymentVoucherDetail { + @ApiModelProperty("场景编码") + public String sceneCode; + @ApiModelProperty("资方简称") + public String bankName; + @ApiModelProperty("数据日期") + public Date dataTime; + @ApiModelProperty("部门编码") + public String deptCode; + @ApiModelProperty("部门名称") + public String deptName; + @ApiModelProperty("客户编码") + public String customerCode; + @ApiModelProperty("客户名称") + public String customerName; + @ApiModelProperty("金额") + public BigDecimal amount; + @ApiModelProperty("备注") + public String remarks; + } } diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/SceneCodeEnum.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/SceneCodeEnum.java new file mode 100644 index 0000000000..4172d91521 --- /dev/null +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/SceneCodeEnum.java @@ -0,0 +1,53 @@ +package com.yxt.anrui.fin.api.kingdee.voucher; + +/** + * @author Fan + * @description 推送凭证适用的场景编码 + * @date 2023/12/20 11:32 + */ + +public enum SceneCodeEnum { + + BUCKLE_VOUCHER1("月还划扣凭证", "划扣申请通过-正常月还", "01"), + BUCKLE_VOUCHER2("月还划扣凭证", "划扣申请通过-逾期未垫款", "02"), + BUCKLE_VOUCHER3("月还划扣凭证", "划扣申请通过-逾期已垫款(中车类)", "03"), + INDIRECT_VOUCHER1("间还月还收款凭证", "间还出纳确认后-未逾期", "04"), + INDIRECT_VOUCHER2("间还月还收款凭证", "间还出纳确认后-已逾期/资方逾期利息", "05"), + TRANSFER_VOUCHER1("间还月还代付款凭证", "出纳代付款-正常或逾期未垫款", "06"), + TRANSFER_VOUCHER2("间还月还代付款凭证", "出纳代付款-已垫款(中车类)", "07"), + PADSINCERE_VOUCHER1("垫款付款凭证", "出纳付款-资方本金(月还)", "08"), + PADSINCERE_VOUCHER2("垫款付款凭证", "出纳付款-资方逾期利息", "09"), + FUND_VOUCHER1("资金占用费收款凭证", "资金占用费出纳确认后", "10"), + FUND_VOUCHER2("资金占用费收款凭证", "资金占用费出纳确认后-确认收入", "11"); + + /** + * 适用凭证 + */ + private final String voucher; + /** + * 适用场景 + */ + private final String scene; + /** + * 场景编码 + */ + private final String code; + + SceneCodeEnum(String voucher, String scene, String code) { + this.voucher = voucher; + this.scene = scene; + this.code = code; + } + + public String getCode() { + return code; + } + + public String getScene() { + return scene; + } + + public String getVoucher() { + return voucher; + } +} diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java index 51a3e6f00a..64840c415e 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java @@ -26,6 +26,9 @@ import com.yxt.anrui.fin.api.kingdee.salesreturn.SalesReturn; import com.yxt.anrui.fin.api.kingdee.saloutstock.SalOutStock; import com.yxt.anrui.fin.api.kingdee.stkinstock.StkInStock; import com.yxt.anrui.fin.api.kingdee.stktransferdirect.StkTransferDirect; +import com.yxt.anrui.fin.api.kingdee.voucher.CollectionVoucher; +import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; +import com.yxt.anrui.fin.api.kingdee.voucher.PaymentVoucher; import com.yxt.anrui.fin.api.kingdee.voucher.Voucher; import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; import com.yxt.anrui.fin.biz.kingdee.appayable.APPayableService; @@ -50,6 +53,7 @@ import com.yxt.anrui.fin.biz.kingdee.saloutstock.SalOutStockService; import com.yxt.anrui.fin.biz.kingdee.stkinstock.STKInStockService; import com.yxt.anrui.fin.biz.kingdee.stktransferdirect.StkTransferDirectService; import com.yxt.anrui.fin.biz.kingdee.voucher.VoucherService; +import com.yxt.common.base.utils.StringUtils; import com.yxt.common.core.result.ResultBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -58,6 +62,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.ArrayList; import java.util.List; @Api(tags = "单据调用金蝶的暂存接口") @@ -221,6 +226,135 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { return voucherService.saveVoucher(voucher); } + /** + * 保存还款计划表总凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveScheduleVoucher(GeneralVoucher voucher) { + ResultBean rb = ResultBean.fireFail(); + Voucher newVoucher = new Voucher(); + List resultDetails = new ArrayList<>(); + if (StringUtils.isNotBlank(voucher.getUseOrgCode())) { + newVoucher.setAccountBook(voucher.getUseOrgCode()); + newVoucher.setVoucherNo(voucher.getUseOrgCode()); + } + List voucherDetails = voucher.getVoucherDetails(); + if (!voucherDetails.isEmpty()) { + for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); //借方 + Voucher.VoucherResultDetailDto dto2 = new Voucher.VoucherResultDetailDto(); //贷方 + if (StringUtils.isNotBlank(voucherDetail.getBankName())) { + dto1.setSummary(voucherDetail.getBankName() + "贷款"); + dto2.setSummary(voucherDetail.getBankName() + "贷款"); + } + + } + } + return null; + } + + /** + * 保存月还计提凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveAccrualVoucher(GeneralVoucher voucher) { + return null; + } + + /** + * 保存逾期转累欠凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveLateVoucher(GeneralVoucher voucher) { + return null; + } + + /** + * 保存月还划扣凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveBuckleVoucher(GeneralVoucher voucher) { + return null; + } + + /** + * 保存间还月还收款凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveIndirectVoucher(CollectionVoucher voucher) { + return null; + } + + /** + * 间还月还代付款凭证 + * + * @param voucher + * @return + */ + @Override + public ResultBean savePaymentVoucher(PaymentVoucher voucher) { + return null; + } + + /** + * 保存垫款付款凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveAdvancesVoucher(PaymentVoucher voucher) { + return null; + } + + /** + * 保存资金占用费计提凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveReturnVoucher(CollectionVoucher voucher) { + return null; + } + + /** + * 保存中车退还垫款收款凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveFundVoucher(GeneralVoucher voucher) { + return null; + } + + /** + * 保存资金占用费计提凭证接口 + * + * @param voucher + * @return + */ + @Override + public ResultBean saveFeeVoucher(CollectionVoucher voucher) { + return null; + } + @Override public ResultBean pushOtherReceivableBill(CapitalCreditResult creditResult) { log.info("FinKingDeeFeignRest-pushOtherReceivableBill:{}", JSONObject.toJSONString(creditResult)); diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/voucher/VoucherService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/voucher/VoucherService.java index cc7e8e3c03..8a09817955 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/voucher/VoucherService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/voucher/VoucherService.java @@ -27,9 +27,9 @@ public class VoucherService extends FinKingDeeService { Map map_fEntityModel_ = new HashMap<>(); //物料的数组集合 //账簿 -// if (StringUtils.isBlank(voucher.getAccountBook())) { -// return rb.setMsg("账簿不能为空"); -// } + if (StringUtils.isBlank(voucher.getAccountBook())) { + return rb.setMsg("账簿不能为空"); + } map_fEntityModel_.put("FAccountBookID", voucher.getAccountBook()); //业务日期 // if (StringUtils.isBlank(voucher.getBussDate())) { @@ -43,9 +43,9 @@ public class VoucherService extends FinKingDeeService { // } map_fEntityModel_.put("FVOUCHERGROUPID", voucher.getVoucherWord()); //凭证号 -// if (StringUtils.isBlank(voucher.getVoucherNo())) { -// return rb.setMsg("凭证号不能为空"); -// } + if (StringUtils.isBlank(voucher.getVoucherNo())) { + return rb.setMsg("凭证号不能为空"); + } map_fEntityModel_.put("FVOUCHERGROUPNO", voucher.getVoucherNo()); List voucherResultDetailDtos = voucher.getResultDetails() == null ? new ArrayList<>() : voucher.getResultDetails(); diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancapitalcreditresult/LoanCapitalCreditResultService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancapitalcreditresult/LoanCapitalCreditResultService.java index 00eb0ca65b..1855bfb34b 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancapitalcreditresult/LoanCapitalCreditResultService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancapitalcreditresult/LoanCapitalCreditResultService.java @@ -254,6 +254,7 @@ public class LoanCapitalCreditResultService extends MybatisBaseService details(String salesOrderSid) { ResultBean rb = ResultBean.fireFail(); LoanNoGuaranteeCreditReviewDetailsVo vo = new LoanNoGuaranteeCreditReviewDetailsVo(); @@ -141,6 +144,7 @@ public class LoanNoGuaranteeCreditReviewService extends MybatisBaseService saveReviewInfo(LoanNoGuaranteeCreditReviewDto dto) { ResultBean rb = ResultBean.fireFail(); String borrowerSid = dto.getSalesOrderSid(); + BusSalesOrderBorrowerDetailsVo borrowerVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(borrowerSid).getData(); LoanNoGuaranteeCreditReview entity = baseMapper.selectOneByBorrowerSid(borrowerSid); String result = ""; if (null != entity) { @@ -169,7 +173,7 @@ public class LoanNoGuaranteeCreditReviewService extends MybatisBaseService busSalesOrderVehicles = busSalesOrderVehicleFeign.selectByBorrowerSid(borrowerSid).getData(); for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicles) { baseVehicleStateFeign.updateManageState(busSalesOrderVehicle.getSid()); @@ -188,6 +192,7 @@ public class LoanNoGuaranteeCreditReviewService extends MybatisBaseService busSalesOrderVehicles = busSalesOrderVehicleFeign.selectByBorrowerSid(borrowerSid).getData(); for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicles) { baseVehicleStateFeign.updateManageState(busSalesOrderVehicle.getSid()); @@ -248,6 +253,7 @@ public class LoanNoGuaranteeCreditReviewService extends MybatisBaseService