From 6b7acf6aa75ad87ba25b92cebbe1307f184a23b0 Mon Sep 17 00:00:00 2001 From: fanzongzhe0036 Date: Fri, 13 Dec 2024 17:48:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=9B=9E=E6=AC=BE=E8=BF=94=E5=88=A9?= =?UTF-8?q?=E5=87=AD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fin/api/kingdee/FinKingDeeFeign.java | 10 + .../api/kingdee/FinKingDeeFeignFallBack.java | 10 + .../fin/biz/kingdee/FinKingDeeFeignRest.java | 117 +++++++++- .../ScmCollectionrebateCheckapplyFeign.java | 5 + ...llectionrebateCheckapplyFeignFallback.java | 5 + .../ScmCollectionRebateWithApplyFeign.java | 10 +- ...ollectionRebateWithApplyFeignFallback.java | 4 + .../ScmSpecialrebateCheckapplyFeign.java | 10 +- ...mSpecialrebateCheckapplyFeignFallback.java | 4 + .../ScmSpecialRebateWithApplyFeign.java | 5 + ...cmSpecialRebateWithApplyFeignFallback.java | 4 + .../ScmVehrebateCheckapplyFeign.java | 10 +- .../ScmVehrebateCheckapplyFeignFallback.java | 4 + .../ScmVehRebateWithApplyFeign.java | 14 +- .../ScmVehRebateWithApplyFeignFallback.java | 4 + .../ScmCollectionrebateCheckapplyRest.java | 8 +- .../ScmCollectionrebateCheckapplyService.java | 211 +++++++++++++++++- .../ScmCollectionRebateWithApplyRest.java | 15 +- .../ScmCollectionRebateWithApplyService.java | 143 +++++++++++- .../ScmSpecialrebateCheckapplyRest.java | 13 +- .../ScmSpecialRebateWithApplyRest.java | 13 +- .../ScmVehrebateCheckapplyRest.java | 16 +- .../ScmVehRebateWithApplyRest.java | 15 +- 23 files changed, 578 insertions(+), 72 deletions(-) diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java index bc3f161063..96218d3fcf 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java @@ -92,6 +92,16 @@ public interface FinKingDeeFeign { @ResponseBody ResultBean saveRebateSpecialReviewVoucher(@RequestBody @Valid GeneralVoucher voucher); + @ApiOperation("保存回款返利预提凭证") + @PostMapping("/saveRebateCollectionVoucher") + @ResponseBody + ResultBean saveRebateCollectionVoucher(@RequestBody @Valid GeneralVoucher voucher); + + @ApiOperation("保存回款返利核对凭证") + @PostMapping("/saveRebateCollectionReviewVoucher") + @ResponseBody + ResultBean saveRebateCollectionReviewVoucher(@RequestBody @Valid GeneralVoucher voucher); + //---------------------- 返利凭证 --------------------------------- @ApiOperation("保存凭证的接口") @PostMapping("/saveVoucher") 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 99f7bddc3b..6f9254608f 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 @@ -68,6 +68,16 @@ implements FinKingDeeFeign{ return null; } + @Override + public ResultBean saveRebateCollectionVoucher(@Valid GeneralVoucher voucher) { + return null; + } + + @Override + public ResultBean saveRebateCollectionReviewVoucher(@Valid GeneralVoucher voucher) { + return null; + } + @Override public ResultBean saveVoucher(Voucher voucher) { return null; 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 7d9c725e6e..fcf8a77ef7 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 @@ -386,7 +386,7 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利预提"); dto1.setSubjectNo(voucherDetail.getSceneCode()); dto1.setDimensionDept(voucherDetail.getDeptCode()); - dto1.setDebit("-" + voucherDetail.getAmount().toString()); + dto1.setDebit(voucherDetail.getAmount().negate().toString());//转负数 resultDetails.add(dto1); } if (voucherDetail.getSceneCode().equals("2181.07.00")) { @@ -458,7 +458,7 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整"); dto1.setSubjectNo(voucherDetail.getSceneCode()); dto1.setDimensionDept(voucherDetail.getDeptCode()); - dto1.setDebit("-" + String.valueOf(voucherDetail.getAmount())); + dto1.setDebit(voucherDetail.getAmount().negate().toString()); resultDetails.add(dto1); } if (voucherDetail.getSceneCode().equals("2181.07.00")) { @@ -504,7 +504,7 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传"); dto1.setSubjectNo(voucherDetail.getSceneCode()); dto1.setDimensionDept(voucherDetail.getDeptCode()); - dto1.setCredit("-"+String.valueOf(voucherDetail.getAmount())); + dto1.setCredit(voucherDetail.getAmount().negate().toString()); resultDetails.add(dto1); } } @@ -523,7 +523,7 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整"); dto1.setSubjectNo(voucherDetail.getSceneCode()); dto1.setDimensionDept(voucherDetail.getDeptCode()); - dto1.setDebit("-" + String.valueOf(voucherDetail.getAmount())); + dto1.setDebit(voucherDetail.getAmount().negate().toString()); resultDetails.add(dto1); } } @@ -535,6 +535,115 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { return voucherService.saveVoucher(newVoucher); } + @Override + public ResultBean saveRebateCollectionVoucher(@Valid 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()); + } + if (StringUtils.isNotBlank(voucher.getBussDate())) { + newVoucher.setBussDate(voucher.getBussDate()); + } + List voucherDetails = voucher.getVoucherDetails(); + if (!voucherDetails.isEmpty()) { + for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) { + if (voucherDetail.getSceneCode().equals("1161.02.15") || voucherDetail.getSceneCode().equals("1161.01.15")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利预提"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setDimensionDept(voucherDetail.getDeptCode()); + dto1.setManufacturer(voucherDetail.getManufacturer()); + dto1.setDebit(String.valueOf(voucherDetail.getAmount())); + resultDetails.add(dto1); + } + if (voucherDetail.getSceneCode().equals("2191.03")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利预提"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setDimensionDept(voucherDetail.getDeptCode()); + dto1.setCredit(voucherDetail.getAmount().toString()); + resultDetails.add(dto1); + } + } + newVoucher.setResultDetails(resultDetails); + } + log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher)); + return voucherService.saveVoucher(newVoucher); + } + + @Override + public ResultBean saveRebateCollectionReviewVoucher(@Valid 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()); + } + if (StringUtils.isNotBlank(voucher.getBussDate())) { + newVoucher.setBussDate(voucher.getBussDate()); + } + List voucherDetails = voucher.getVoucherDetails(); + if (!voucherDetails.isEmpty()) { + for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) { + if (voucherDetail.getRemarks().equals("返利上传")) { + if (voucherDetail.getSceneCode().equals("1161.01.16")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利上传"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setDimensionDept(voucherDetail.getDeptCode()); + dto1.setManufacturer(voucherDetail.getManufacturer()); + dto1.setDebit(String.valueOf(voucherDetail.getAmount())); + resultDetails.add(dto1); + } + if (voucherDetail.getSceneCode().equals("1161.02.15") || + voucherDetail.getSceneCode().equals("1161.01.15")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利上传"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setDimensionDept(voucherDetail.getDeptCode()); + dto1.setManufacturer(voucherDetail.getManufacturer()); + dto1.setCredit(String.valueOf(voucherDetail.getAmount())); + resultDetails.add(dto1); + } + } + if (voucherDetail.getRemarks().equals("返利调整")) { + if (voucherDetail.getSceneCode().equals("6401.13")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利上传调整"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setDimensionDept(voucherDetail.getDeptCode()); + dto1.setDebit(voucherDetail.getAmount().negate().toString()); + resultDetails.add(dto1); + } + if (voucherDetail.getSceneCode().equals("1161.01.15") || voucherDetail.getSceneCode().equals("1161.02.15")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利上传调整"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setDimensionDept(voucherDetail.getDeptCode()); + dto1.setManufacturer(voucherDetail.getManufacturer()); + dto1.setDebit(String.valueOf(voucherDetail.getAmount())); + resultDetails.add(dto1); + } + if (voucherDetail.getSceneCode().equals("6801")) { + Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); + dto1.setSummary(voucherDetail.getTimeFlag() + "回款返利上传调整"); + dto1.setSubjectNo(voucherDetail.getSceneCode()); + dto1.setCredit(String.valueOf(voucherDetail.getAmount())); + resultDetails.add(dto1); + } + } + + } + newVoucher.setResultDetails(resultDetails); + } + log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher)); + return voucherService.saveVoucher(newVoucher); + } + @Override public ResultBean saveVoucher(Voucher voucher) { diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeign.java index edfe63823d..930d8478c4 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeign.java @@ -64,6 +64,11 @@ import java.util.List; fallback = ScmCollectionrebateCheckapplyFeignFallback.class) public interface ScmCollectionrebateCheckapplyFeign { + @ApiOperation("重推凭证") + @PostMapping("/rePushVoucher") + public ResultBean rePushVoucher(@RequestParam("sid") String sid); + + @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeignFallback.java index 93f35886b6..b71b6bdd49 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeignFallback.java @@ -53,6 +53,11 @@ import java.util.List; @Component public class ScmCollectionrebateCheckapplyFeignFallback implements ScmCollectionrebateCheckapplyFeign { + @Override + public ResultBean rePushVoucher(String sid) { + return null; + } + @Override public ResultBean> listPage(PagerQuery pq) { ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java index c8171d1b7d..24cf5398e3 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java @@ -27,12 +27,11 @@ package com.yxt.anrui.scm.api.scmcollectionrebatewithapply; import com.yxt.anrui.scm.api.flow.FlowTaskVo; import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.*; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.ScmVehRebateWithApplyDelegateQuery; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.SpringQueryMap; @@ -62,6 +61,11 @@ import java.util.List; fallback = ScmCollectionRebateWithApplyFeignFallback.class) public interface ScmCollectionRebateWithApplyFeign { + @ApiOperation("重推凭证") + @PostMapping("/rePushVoucher") + public ResultBean rePushVoucher(@RequestParam("sid") String sid); + + @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java index f69137b3b9..3f256e231d 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java @@ -50,6 +50,10 @@ import java.util.List; @Component public class ScmCollectionRebateWithApplyFeignFallback implements ScmCollectionRebateWithApplyFeign { + @Override + public ResultBean rePushVoucher(String sid) { + return null; + } @Override public ResultBean> listPage(PagerQuery pq) { ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeign.java index 46a7e7be3c..d919a5f29a 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeign.java @@ -27,12 +27,11 @@ package com.yxt.anrui.scm.api.scmspecialrebatecheckapply; import com.yxt.anrui.scm.api.flow.FlowTaskVo; import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.flow.*; -import com.yxt.anrui.scm.api.scmspecialrebatedistribute.flow.ScmSpecialRebatedistributeDelegateQuery; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.SpringQueryMap; @@ -62,6 +61,11 @@ import java.util.List; fallback = ScmSpecialrebateCheckapplyFeignFallback.class) public interface ScmSpecialrebateCheckapplyFeign { + @ApiOperation("重推凭证") + @PostMapping("/rePushVoucher") + public ResultBean rePushVoucher(@RequestParam("sid") String sid); + + @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeignFallback.java index 127a018b64..0e8d903812 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeignFallback.java @@ -53,6 +53,10 @@ import java.util.List; @Component public class ScmSpecialrebateCheckapplyFeignFallback implements ScmSpecialrebateCheckapplyFeign { + @Override + public ResultBean rePushVoucher(String sid) { + return null; + } @Override public ResultBean> listPage(PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeign.java index 5afbcddea6..3e6086e4e3 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeign.java @@ -61,6 +61,11 @@ import java.util.List; fallback = ScmSpecialRebateWithApplyFeignFallback.class) public interface ScmSpecialRebateWithApplyFeign { + @ApiOperation("重推凭证") + @PostMapping("/rePushVoucher") + public ResultBean rePushVoucher(@RequestParam("sid") String sid); + + @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeignFallback.java index f2dc4bb478..d882e51c21 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeignFallback.java @@ -50,6 +50,10 @@ import java.util.List; @Component public class ScmSpecialRebateWithApplyFeignFallback implements ScmSpecialRebateWithApplyFeign { + @Override + public ResultBean rePushVoucher(String sid) { + return null; + } @Override public ResultBean> listPage(PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeign.java index 6303f29f6e..b7252a10c8 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeign.java @@ -27,12 +27,11 @@ package com.yxt.anrui.scm.api.scmvehrebatecheckapply; import com.yxt.anrui.scm.api.flow.FlowTaskVo; import com.yxt.anrui.scm.api.scmvehrebatecheckapply.flow.*; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.ScmVehRebateWithApplyDelegateQuery; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.SpringQueryMap; @@ -62,6 +61,11 @@ import java.util.List; fallback = ScmVehrebateCheckapplyFeignFallback.class) public interface ScmVehrebateCheckapplyFeign { + @ApiOperation("重推凭证") + @PostMapping("/rePushVoucher") + public ResultBean rePushVoucher(@RequestParam("sid") String sid); + + @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeignFallback.java index 392468fd3d..9327ca9cc9 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeignFallback.java @@ -50,6 +50,10 @@ import java.util.List; @Component public class ScmVehrebateCheckapplyFeignFallback implements ScmVehrebateCheckapplyFeign { + @Override + public ResultBean rePushVoucher(String sid) { + return null; + } @Override public ResultBean> listPage(PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeign.java index fbcdcfb770..88622873ac 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeign.java @@ -26,13 +26,12 @@ package com.yxt.anrui.scm.api.scmvehrebatewithapply; import com.yxt.anrui.scm.api.flow.FlowTaskVo; -import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.ScmSpecialRebateWithApplyDelegateQuery; import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.SpringQueryMap; @@ -62,6 +61,11 @@ import java.util.List; fallback = ScmVehRebateWithApplyFeignFallback.class) public interface ScmVehRebateWithApplyFeign { + @ApiOperation("重推凭证") + @PostMapping("/rePushVoucher") + public ResultBean rePushVoucher(@RequestParam("sid") String sid); + + @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") @ResponseBody @@ -71,12 +75,12 @@ public interface ScmVehRebateWithApplyFeign { @PostMapping("/save") @ResponseBody public ResultBean save(@RequestBody ScmVehRebateWithApplyDto dto); - + @ApiOperation("根据sid删除记录") @DeleteMapping("/delBySids") @ResponseBody public ResultBean delBySids(@RequestBody String[] sids); - + @ApiOperation("根据SID获取一条记录") @GetMapping("/fetchDetailsBySid/{sid}") @ResponseBody diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeignFallback.java index ecc4470c68..e3e3e2b5f3 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeignFallback.java @@ -50,6 +50,10 @@ import java.util.List; @Component public class ScmVehRebateWithApplyFeignFallback implements ScmVehRebateWithApplyFeign { + @Override + public ResultBean rePushVoucher(String sid) { + return null; + } @Override public ResultBean> listPage(PagerQuery pq){ ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyRest.java index 8e8edb9132..107e51d63a 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyRest.java @@ -34,7 +34,6 @@ import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.flow.ScmCollectionReb import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.flow.SubmitScmCollectionRebateCheckApplyDto; import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery; import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo; -import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApply; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -75,6 +74,13 @@ public class ScmCollectionrebateCheckapplyRest implements ScmCollectionrebateChe return rb.success().setData(pv); } + @Override + public ResultBean rePushVoucher(String sid) { + ResultBean rb = ResultBean.fireFail(); + scmCollectionrebateCheckapplyService.pusCollectionRebateWithVoucher(sid); + return rb.success(); + } + @Override @ApiOperation("新增或修改") @PostMapping("/save") diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyService.java index 81385a5102..dc4a139182 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyService.java @@ -26,46 +26,50 @@ package com.yxt.anrui.scm.biz.scmcollectionrebatecheckapply; 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.api.basemanufacturer.BaseManufacturer; +import com.yxt.anrui.base.api.basemanufacturer.BaseManufacturerFeign; +import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrand; +import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrandFeign; +import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; +import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; import com.yxt.anrui.flowable.api.flow.FlowableFeign; import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; import com.yxt.anrui.flowable.api.flow2.FlowFeign; import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; 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.SysStaffOrg; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; 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.scm.api.flow.FlowTaskVo; +import com.yxt.anrui.scm.api.scmcollectionrebate.ScmCollectionRebate; +import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.*; import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.flow.SubmitScmCollectionRebateCheckApplyDto; -import com.yxt.anrui.scm.api.scmcollectionrebatecheckapplydetail.ScmCollectionrebateCheckapplydetail; import com.yxt.anrui.scm.api.scmcollectionrebatecheckapplydetail.ScmCollectionrebateCheckapplydetailDetailsVo; import com.yxt.anrui.scm.api.scmcollectionrebatecheckapplydetail.ScmCollectionrebateCheckapplydetailDto; import com.yxt.anrui.scm.api.scmcollectionrebatecheckapplydetail.ScmCollectionrebateCheckapplydetailVo; -import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyVo; import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery; import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo; +import com.yxt.anrui.scm.biz.scmcollectionrebate.ScmCollectionRebateService; import com.yxt.anrui.scm.biz.scmcollectionrebatecheckapplydetail.ScmCollectionrebateCheckapplydetailService; -import com.yxt.common.core.result.ResultBean; -import org.apache.commons.lang3.StringUtils; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; -import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.ScmCollectionrebateCheckapply; -import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.ScmCollectionrebateCheckapplyQuery; -import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.ScmCollectionrebateCheckapplyVo; -import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.ScmCollectionrebateCheckapplyDetailsVo; -import com.yxt.anrui.scm.api.scmcollectionrebatecheckapply.ScmCollectionrebateCheckapplyDto; - +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -85,6 +89,14 @@ import java.util.stream.Collectors; @Service public class ScmCollectionrebateCheckapplyService extends MybatisBaseService { + @Autowired + private FinKingDeeFeign finKingDeeFeign; + @Autowired + private BaseVehicleBrandFeign baseVehicleBrandFeign; + @Autowired + private BaseManufacturerFeign baseManufacturerFeign; + @Autowired + private SysOrganizationFeign sysOrganizationFeign; @Autowired private ScmCollectionrebateCheckapplydetailService scmCollectionrebateCheckapplydetailService; @Autowired @@ -97,6 +109,8 @@ public class ScmCollectionrebateCheckapplyService extends MybatisBaseService listPageVo(PagerQuery pq) { ScmCollectionrebateCheckapplyQuery query = pq.getParams(); @@ -345,6 +359,179 @@ public class ScmCollectionrebateCheckapplyService extends MybatisBaseService scmVehRebates = new ArrayList<>(); + List scmVehrebateCheckapplydetailVos = scmCollectionrebateCheckapplydetailService.selByMainSid(sid); + if (!scmVehrebateCheckapplydetailVos.isEmpty()) { + for (ScmCollectionrebateCheckapplydetailVo s : scmVehrebateCheckapplydetailVos) { + ScmCollectionRebate v = scmCollectionRebateService.fetchBySid(s.getCollectionRebateSid()); + if (null != v) { + scmVehRebates.add(v); + } + } + } + //按照采购系统分组 + if (!scmVehRebates.isEmpty()) { + Map> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmCollectionRebate::getPurchaseSystemSid)); + String finalSummaryTag = summaryTag; + String[] split = finalSummaryTag.split("年"); + String y1 = split[0]; //预提申请标题年份 + map.forEach((k, v) -> { + List rebates = v; + GeneralVoucher generalVoucher = new GeneralVoucher(); + generalVoucher.setBussDate(format); + List voucherDetails = new ArrayList<>(); + if (!v.isEmpty()) { + for (ScmCollectionRebate rebate : v) { + if (StringUtils.isNotBlank(rebate.getUseOrgSid())) { + String useOrgSid = rebate.getUseOrgSid(); + SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData(); + if (null != organizationVo) { + generalVoucher.setUseOrgCode(organizationVo.getOrgCode()); + } + } + String deptCode = "";//部门编码 + String gysCode = "";//厂商编码 + SysOrganizationVo data = sysOrganizationFeign.fetchBySid(rebate.getPurchaseSystemSid()).getData(); + if (null != data) { + deptCode = data.getOrgCode(); + + } + if (StringUtils.isNotBlank(rebate.getBrandSid())) { + String brandSid = rebate.getBrandSid(); + BaseVehicleBrand baseVehicleBrand = baseVehicleBrandFeign.fetchBySid(brandSid); + if (null != baseVehicleBrand) { + String manufacturerSid = baseVehicleBrand.getManufacturerSid(); + if (StringUtils.isNotBlank(manufacturerSid)) { + BaseManufacturer baseManufacturer = baseManufacturerFeign.fetchBySid(manufacturerSid).getData(); + if (null != baseManufacturer) { + gysCode = baseManufacturer.getManufacturerCode(); + } + } + } + } + + BigDecimal shangchuanMoney = BigDecimal.ZERO;//上传金额 + BigDecimal chaMoney = BigDecimal.ZERO;//差额 + if (null != rebate.getUploadMoney()) { + shangchuanMoney = rebate.getUploadMoney(); + } + if (null != rebate.getAdjustmentMoney()) { + chaMoney = rebate.getAdjustmentMoney(); + } + String palceGenDate = rebate.getCollectionDate(); + String[] palceGenDateSplit = palceGenDate.split("-"); + String y2 = palceGenDateSplit[0];//所属年份 + if (y1.equals(y2)) { + //本年 + if (shangchuanMoney.compareTo(BigDecimal.ZERO) != 0) { + GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail.setTimeFlag(finalSummaryTag); + voucherDetail.setDeptCode(deptCode); //部门编码赋值 + voucherDetail.setManufacturer(gysCode); + voucherDetail.setAmount(shangchuanMoney); + voucherDetail.setSceneCode("1161.01.16"); + voucherDetail.setRemarks("返利上传"); + voucherDetails.add(voucherDetail); + GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail2.setTimeFlag(finalSummaryTag); + voucherDetail2.setDeptCode(deptCode); //部门编码赋值 + voucherDetail2.setManufacturer(gysCode); + voucherDetail2.setAmount(shangchuanMoney); + voucherDetail2.setSceneCode("1161.01.15"); + voucherDetail2.setRemarks("返利上传"); + voucherDetails.add(voucherDetail2); + } + + if (chaMoney.compareTo(BigDecimal.ZERO) != 0) { + GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail.setTimeFlag(finalSummaryTag); + voucherDetail.setDeptCode(deptCode); //部门编码赋值 + voucherDetail.setAmount(chaMoney); + voucherDetail.setSceneCode("6401.13"); + voucherDetail.setRemarks("返利调整"); + voucherDetails.add(voucherDetail); + GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail2.setTimeFlag(finalSummaryTag); + voucherDetail2.setDeptCode(deptCode); //部门编码赋值 + voucherDetail2.setManufacturer(gysCode); + voucherDetail2.setAmount(chaMoney); + voucherDetail2.setSceneCode("1161.01.15"); + voucherDetail2.setRemarks("返利调整"); + voucherDetails.add(voucherDetail2); + } + + } else { + //上年 + if (shangchuanMoney.compareTo(BigDecimal.ZERO) != 0) { + GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail.setTimeFlag(finalSummaryTag); + voucherDetail.setDeptCode(deptCode); //部门编码赋值 + voucherDetail.setManufacturer(gysCode); + voucherDetail.setAmount(shangchuanMoney); + voucherDetail.setSceneCode("1161.01.16"); + voucherDetail.setRemarks("返利上传"); + voucherDetails.add(voucherDetail); + GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail2.setTimeFlag(finalSummaryTag); + voucherDetail2.setDeptCode(deptCode); //部门编码赋值 + voucherDetail2.setManufacturer(gysCode); + voucherDetail2.setAmount(shangchuanMoney); + voucherDetail2.setSceneCode("1161.02.15"); + voucherDetail2.setRemarks("返利上传"); + voucherDetails.add(voucherDetail2); + } + + if (chaMoney.compareTo(BigDecimal.ZERO) != 0) { + GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail.setTimeFlag(finalSummaryTag); + voucherDetail.setAmount(chaMoney); + voucherDetail.setSceneCode("6801"); + voucherDetail.setRemarks("返利调整"); + voucherDetails.add(voucherDetail); + GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail2.setTimeFlag(finalSummaryTag); + voucherDetail2.setDeptCode(deptCode); //部门编码赋值 + voucherDetail2.setManufacturer(gysCode); + voucherDetail2.setAmount(chaMoney); + voucherDetail2.setSceneCode("1161.02.15"); + voucherDetail2.setRemarks("返利调整"); + voucherDetails.add(voucherDetail2); + } + } + + } + if (!voucherDetails.isEmpty()) { + generalVoucher.setVoucherDetails(voucherDetails); + finKingDeeFeign.saveRebateCollectionReviewVoucher(generalVoucher); + } + } + }); + } + + } + + public ResultBean complete(BusinessVariables bv) { ResultBean rb = ResultBean.fireFail(); ScmCollectionrebateCheckapply scmCollectionrebateCheckapply = fetchBySid(bv.getBusinessSid()); @@ -355,6 +542,8 @@ public class ScmCollectionrebateCheckapplyService extends MybatisBaseService { + @Autowired + private FinKingDeeFeign finKingDeeFeign; + @Autowired + private BaseVehicleBrandFeign baseVehicleBrandFeign; + @Autowired + private BaseManufacturerFeign baseManufacturerFeign; + @Autowired + private SysOrganizationFeign sysOrganizationFeign; @Autowired private ScmCollectionRebateWithService scmCollectionRebateWithService; @Autowired @@ -372,6 +382,118 @@ public class ScmCollectionRebateWithApplyService extends MybatisBaseService scmVehRebates = new ArrayList<>(); + List vehRebateSids = scmCollectionRebateWithService.fetchCollectionReBateSidByMainSid(sid); + if (!vehRebateSids.isEmpty()) { + for (String s : vehRebateSids) { + ScmCollectionRebate v = scmCollectionRebateService.fetchBySid(s); + if (null != v) { + scmVehRebates.add(v); + } + } + } + //按照采购系统分组 + if (!scmVehRebates.isEmpty()) { + Map> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmCollectionRebate::getPurchaseSystemSid)); + String finalSummaryTag = summaryTag; + String[] split = finalSummaryTag.split("年"); + String y1 = split[0]; //预提申请标题年份 + map.forEach((k, v) -> { + List rebates = v; + GeneralVoucher generalVoucher = new GeneralVoucher(); + generalVoucher.setBussDate(format); + List voucherDetails = new ArrayList<>(); + if (!v.isEmpty()) { + for (ScmCollectionRebate rebate : v) { + if (StringUtils.isNotBlank(rebate.getUseOrgSid())) { + String useOrgSid = rebate.getUseOrgSid(); + SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData(); + if (null != organizationVo) { + generalVoucher.setUseOrgCode(organizationVo.getOrgCode()); + } + } + String deptCode = "";//部门编码 + String gysCode = "";//厂商编码 + SysOrganizationVo data = sysOrganizationFeign.fetchBySid(rebate.getPurchaseSystemSid()).getData(); + if (null != data) { + deptCode = data.getOrgCode(); + } + if (StringUtils.isNotBlank(rebate.getBrandSid())) { + String brandSid = rebate.getBrandSid(); + BaseVehicleBrand baseVehicleBrand = baseVehicleBrandFeign.fetchBySid(brandSid); + if (null != baseVehicleBrand) { + String manufacturerSid = baseVehicleBrand.getManufacturerSid(); + if (StringUtils.isNotBlank(manufacturerSid)) { + BaseManufacturer baseManufacturer = baseManufacturerFeign.fetchBySid(manufacturerSid).getData(); + if (null != baseManufacturer) { + gysCode = baseManufacturer.getManufacturerCode(); + } + } + } + } + + BigDecimal fanliMoney = BigDecimal.ZERO;// 其中返利金 + if (null != rebate.getEstimateRebate()) { + fanliMoney = rebate.getEstimateRebate(); + } + + if (fanliMoney.compareTo(BigDecimal.ZERO) != 0) { + GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail.setTimeFlag(finalSummaryTag); + voucherDetail.setDeptCode(deptCode); //部门编码赋值 + voucherDetail.setSceneCode("2191.03"); + voucherDetail.setAmount(fanliMoney); + voucherDetails.add(voucherDetail); + + GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail(); + voucherDetail2.setTimeFlag(finalSummaryTag); + voucherDetail2.setDeptCode(deptCode); //部门编码赋值 + voucherDetail2.setManufacturer(gysCode); + String palceGenDate = rebate.getCollectionDate(); + String[] palceGenDateSplit = palceGenDate.split("-"); + String y2 = palceGenDateSplit[0];//所属年份 + if (y1.equals(y2)) { + voucherDetail2.setSceneCode("1161.01.15"); + } else { + voucherDetail2.setSceneCode("1161.02.15"); + } + voucherDetail2.setAmount(fanliMoney); + voucherDetails.add(voucherDetail2); + } + + } + if (!voucherDetails.isEmpty()) { + generalVoucher.setVoucherDetails(voucherDetails); + finKingDeeFeign.saveRebateCollectionVoucher(generalVoucher); + } + } + }); + } + + + } + + public ResultBean complete(BusinessVariables bv) { ResultBean rb = ResultBean.fireFail(); ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(bv.getBusinessSid()); @@ -400,6 +522,7 @@ public class ScmCollectionRebateWithApplyService extends MybatisBaseService @@ -66,6 +62,13 @@ public class ScmSpecialRebateWithApplyRest implements ScmSpecialRebateWithApplyF @Autowired private ScmSpecialRebateWithApplyService scmSpecialRebateWithApplyService; + @Override + public ResultBean rePushVoucher(String sid) { + ResultBean rb = ResultBean.fireFail(); + scmSpecialRebateWithApplyService.pushSpecialRebateWithVoucher(sid); + return rb.success(); + } + @Override @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyRest.java index 5156f2b9c1..a3292da561 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyRest.java @@ -29,6 +29,7 @@ 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.scm.api.flow.FlowTaskVo; +import com.yxt.anrui.scm.api.scmvehrebatecheckapply.*; import com.yxt.anrui.scm.api.scmvehrebatecheckapply.flow.*; import com.yxt.anrui.scm.biz.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailService; import com.yxt.common.core.query.PagerQuery; @@ -39,16 +40,8 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; import java.util.List; -import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapply; -import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyQuery; -import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyVo; -import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyDetailsVo; -import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyDto; -import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyFeign; - /** * Project: anrui-scm(单车返利核对)
* File: ScmVehrebateCheckapplyFeignFallback.java
@@ -72,6 +65,13 @@ public class ScmVehrebateCheckapplyRest implements ScmVehrebateCheckapplyFeign { @Autowired private ScmVehrebateCheckapplydetailService scmVehrebateCheckapplydetailService; + @Override + public ResultBean rePushVoucher(String sid) { + ResultBean rb = ResultBean.fireFail(); + scmVehrebateCheckapplyService.pushVehRebateWithVoucher(sid,"1"); + return rb.success(); + } + @Override @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyRest.java index 77f0cbe1c2..16ba8f2ea2 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyRest.java @@ -29,23 +29,17 @@ 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.scm.api.flow.FlowTaskVo; +import com.yxt.anrui.scm.api.scmvehrebatewithapply.*; import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.*; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.ibatis.annotations.Delete; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApply; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyQuery; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyVo; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDetailsVo; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDto; -import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyFeign; /** * Project: anrui-scm(单车返利预提申请)
@@ -68,6 +62,13 @@ public class ScmVehRebateWithApplyRest implements ScmVehRebateWithApplyFeign { @Autowired private ScmVehRebateWithApplyService scmVehRebateWithApplyService; + @Override + public ResultBean rePushVoucher(String sid) { + ResultBean rb = ResultBean.fireFail(); + scmVehRebateWithApplyService.pushVehRebateWithVoucher(sid); + return rb.success(); + } + @Override @ApiOperation("根据条件分页查询数据的列表") @PostMapping("/listPage") From e71c884fe5b025269ca44772a44926a966cf70d1 Mon Sep 17 00:00:00 2001 From: fanzongzhe0036 Date: Mon, 16 Dec 2024 15:04:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8D=95=E7=9A=84=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fin/api/kingdee/FinKingDeeFeign.java | 6 + .../api/kingdee/FinKingDeeFeignFallBack.java | 6 + .../anrui/fin/api/kingdee/KingDeeBillId.java | 1 + .../CostAdjustmentsBill.java | 40 ++++++ .../fin/biz/kingdee/FinKingDeeFeignRest.java | 16 ++- ...djustmentsBillCastToKingDeeBillFields.java | 59 +++++++++ .../CostAdjustmentsBillService.java | 87 +++++++++++++ .../biz/kingdee/costadjustmentsbill/data.json | 4 + .../costadjustmentsbill/data_FEntity.json | 116 ++++++++++++++++++ .../costadjustmentsbill/data_data.json | 13 ++ .../costadjustmentsbill/data_model.json | 38 ++++++ .../kingdee/costadjustmentsbill/remarks.txt | 97 +++++++++++++++ .../ScmVehrebateCheckapplyService.java | 25 ++++ .../ScmVehRebateWithApplyService.java | 43 +++++-- 14 files changed, 542 insertions(+), 9 deletions(-) create mode 100644 anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/costadjustmentsbill/CostAdjustmentsBill.java create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillCastToKingDeeBillFields.java create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillService.java create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data.json create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_FEntity.json create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_data.json create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_model.json create mode 100644 anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/remarks.txt diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java index 96218d3fcf..87f6e8e9a5 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java @@ -14,6 +14,7 @@ import com.yxt.anrui.fin.api.kingdee.bdsupplier.BdSupplier; import com.yxt.anrui.fin.api.kingdee.capitalcreditresult.CapitalCreditResult; import com.yxt.anrui.fin.api.kingdee.cnbankcnt.CNBankacnt; import com.yxt.anrui.fin.api.kingdee.cnrecpaypurpose.CNRecpaypurpose; +import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill; import com.yxt.anrui.fin.api.kingdee.orgorganizations.OrgOrganizations; import com.yxt.anrui.fin.api.kingdee.otherarreceivable.OtherReceivable; import com.yxt.anrui.fin.api.kingdee.purmrb.PurMrb; @@ -181,6 +182,11 @@ public interface FinKingDeeFeign { @ResponseBody ResultBean pushOtherReceivableBill(@RequestBody @Valid CapitalCreditResult creditResult); + @ApiOperation("保存成本调整单") + @PostMapping("/pushCostAdjustmentsBill") + @ResponseBody + ResultBean pushCostAdjustmentsBill(@RequestBody @Valid CostAdjustmentsBill costAdjustmentsBill); + @ApiOperation("暂存付款单的接口") @PostMapping("/draftArReceivebill") 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 6f9254608f..3267d88598 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 @@ -14,6 +14,7 @@ import com.yxt.anrui.fin.api.kingdee.bdsupplier.BdSupplier; import com.yxt.anrui.fin.api.kingdee.capitalcreditresult.CapitalCreditResult; import com.yxt.anrui.fin.api.kingdee.cnbankcnt.CNBankacnt; import com.yxt.anrui.fin.api.kingdee.cnrecpaypurpose.CNRecpaypurpose; +import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill; import com.yxt.anrui.fin.api.kingdee.orgorganizations.OrgOrganizations; import com.yxt.anrui.fin.api.kingdee.otherarreceivable.OtherReceivable; import com.yxt.anrui.fin.api.kingdee.purmrb.PurMrb; @@ -153,6 +154,11 @@ implements FinKingDeeFeign{ return null; } + @Override + public ResultBean pushCostAdjustmentsBill(@Valid CostAdjustmentsBill costAdjustmentsBill) { + return null; + } + @Override public ResultBean draftArReceivebill(ARReceivebill arReceivebill) { return null; diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/KingDeeBillId.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/KingDeeBillId.java index b71026b52b..b4504e7494 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/KingDeeBillId.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/KingDeeBillId.java @@ -7,6 +7,7 @@ public enum KingDeeBillId { GL_VOUCHER("GL_VOUCHER", "凭证"), AP_PAYBILL("AP_PAYBILL", "付款单"), SAL_RETURNSTOCK("SAL_RETURNSTOCK","销售退货单"), + HS_AdjustmentBill("HS_AdjustmentBill","成本调整单"), AR_RECEIVEBILL("AR_RECEIVEBILL", "收款单"), STK_INSTOCK("STK_InStock", "采购入库单"), PUR_MRB("PUR_MRB", "采购退料单"), diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/costadjustmentsbill/CostAdjustmentsBill.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/costadjustmentsbill/CostAdjustmentsBill.java new file mode 100644 index 0000000000..4118de8614 --- /dev/null +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/costadjustmentsbill/CostAdjustmentsBill.java @@ -0,0 +1,40 @@ +package com.yxt.anrui.fin.api.kingdee.costadjustmentsbill; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author Administrator + * @description + * @date 2023/9/12 18:13 + */ +@Data +public class CostAdjustmentsBill { + + + @ApiModelProperty("往来单位/供应商编码") + public String commUnit; + @ApiModelProperty("核算组织/分公司编码") + public String useOrgCode; + @ApiModelProperty("业务日期") + public String bussDate; + @ApiModelProperty("单据明细") + public List resultDetails; + + @Data + public static class CostAdjustmentsBillDetailDto implements Dto { + + + @ApiModelProperty("分公司编码") + public String companyCode; + @ApiModelProperty("物料编码") + public String materialID; + @ApiModelProperty("调整金额") + public String amount; + @ApiModelProperty("部门编码") + public String deptCode; + } +} 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 fcf8a77ef7..87cc790b3a 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 @@ -17,6 +17,7 @@ import com.yxt.anrui.fin.api.kingdee.bdsupplier.BdSupplier; import com.yxt.anrui.fin.api.kingdee.capitalcreditresult.CapitalCreditResult; import com.yxt.anrui.fin.api.kingdee.cnbankcnt.CNBankacnt; import com.yxt.anrui.fin.api.kingdee.cnrecpaypurpose.CNRecpaypurpose; +import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill; import com.yxt.anrui.fin.api.kingdee.kingdeeUtils.KingDeeOrgAndDeptCode; import com.yxt.anrui.fin.api.kingdee.kingdeeUtils.KingDeeUtils; import com.yxt.anrui.fin.api.kingdee.orgorganizations.OrgOrganizations; @@ -28,8 +29,8 @@ 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.*; -import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; import com.yxt.anrui.fin.biz.kingdee.appayable.APPayableService; +import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; import com.yxt.anrui.fin.biz.kingdee.arreceivebill.ArReceivebillService; import com.yxt.anrui.fin.biz.kingdee.bank.BDBankService; import com.yxt.anrui.fin.biz.kingdee.bdcustomer.BdCustomerService; @@ -41,6 +42,7 @@ import com.yxt.anrui.fin.biz.kingdee.bdsupplier.BdSupplierService; import com.yxt.anrui.fin.biz.kingdee.capitalcreditresult.OtherReceivableBillCreditResultService; import com.yxt.anrui.fin.biz.kingdee.cnbankcnt.CNBankcntService; import com.yxt.anrui.fin.biz.kingdee.cnrecpaypurpose.CNRecpaypurposeService; +import com.yxt.anrui.fin.biz.kingdee.costadjustmentsbill.CostAdjustmentsBillService; import com.yxt.anrui.fin.biz.kingdee.orgorganizations.OrgOrganizationsService; import com.yxt.anrui.fin.biz.kingdee.otherreceivablebill.OtherReceivableBillService; import com.yxt.anrui.fin.biz.kingdee.purmrb.PurMrbService; @@ -67,7 +69,9 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.math.BigDecimal; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; @Api(tags = "单据调用金蝶的暂存接口") @RestController("com.yxt.anrui.fin.biz.kingdee.FinKingDeeFeignRest") @@ -75,6 +79,8 @@ import java.util.*; @Slf4j public class FinKingDeeFeignRest implements FinKingDeeFeign { + @Autowired + private CostAdjustmentsBillService costAdjustmentsBillService; /** * 应付单service */ @@ -1574,6 +1580,12 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { return creditResultService.pushOtherReceivableBill(creditResult); } + @Override + public ResultBean pushCostAdjustmentsBill(@Valid CostAdjustmentsBill costAdjustmentsBill) { + log.info("FinKingDeeFeignRest-pushOtherReceivableBill:{}", JSONObject.toJSONString(costAdjustmentsBill)); + return costAdjustmentsBillService.costAdjustmentsBillService(costAdjustmentsBill); + } + @Override public ResultBean draftSalesReturnOrders(SalesReturn salesReturn) { log.info("FinKingDeeFeignRest-draftSalesReturnOrders:{}", JSONObject.toJSONString(salesReturn)); diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillCastToKingDeeBillFields.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillCastToKingDeeBillFields.java new file mode 100644 index 0000000000..4273e8c1e1 --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillCastToKingDeeBillFields.java @@ -0,0 +1,59 @@ +package com.yxt.anrui.fin.biz.kingdee.costadjustmentsbill; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; +import com.yxt.anrui.fin.biz.kingdee.KingDeeUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 封装转换的类 + */ +public class CostAdjustmentsBillCastToKingDeeBillFields { + /** + * 构造金蝶需要的数据结构 并对字段赋值 + * + * @param map_fEntityModel_ + * @param vehicleList + * @return + */ + public static String getKingDeeData(Map map_fEntityModel_, List> vehicleList) { + /** + * 取模板 + */ + String readJsonFile = KingDeeUtils.readJsonFile("com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data.json"); + String fEntityData_ = KingDeeUtils.readJsonFile("com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_data.json"); + String fEntityModel_ = KingDeeUtils.readJsonFile("com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_model.json"); + + //模板字符创转json + JSONObject jsonObj = JSONObject.parseObject(readJsonFile, Feature.OrderedField); + JSONObject jsonFEntityData_ = JSONObject.parseObject(fEntityData_, Feature.OrderedField); + fEntityModel_ = KingDeeUtils.replaceTemplateParams(fEntityModel_, map_fEntityModel_); + JSONObject jsonFEntityModel_ = JSONObject.parseObject(fEntityModel_, Feature.OrderedField); + + List list_fEntity_ = new ArrayList<>(); + + //对模板字段赋值 根据传递进来的map数据的集合进行赋值 + for (int i = 0; i < vehicleList.size(); i++) { + String fEntity_ = KingDeeUtils.readJsonFile("com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_FEntity.json"); + Map params = vehicleList.get(i); + Map map_fEntity_ = new HashMap<>(); + for (Map.Entry entry : params.entrySet()) { + map_fEntity_.put(entry.getKey(), entry.getValue()); + } + fEntity_ = KingDeeUtils.replaceTemplateParams(fEntity_, map_fEntity_); + list_fEntity_.add(JSONObject.parseObject(fEntity_, Feature.OrderedField)); + } + + jsonFEntityModel_.put("FEntity", JSONArray.parseArray(JSON.toJSONString(list_fEntity_))); + jsonFEntityData_.put("Model", JSONObject.parseObject(JSON.toJSONString(jsonFEntityModel_), Feature.OrderedField)); + jsonObj.put("data", jsonFEntityData_.toJSONString()); + + return jsonObj.toJSONString(); + } +} \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillService.java new file mode 100644 index 0000000000..6a27f8004f --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/CostAdjustmentsBillService.java @@ -0,0 +1,87 @@ +package com.yxt.anrui.fin.biz.kingdee.costadjustmentsbill; + +import com.yxt.anrui.fin.api.kingdee.KingDeeBillId; +import com.yxt.anrui.fin.api.kingdee.KingDeeBillUrl; +import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill; +import com.yxt.anrui.fin.biz.kingdee.FinKingDeeService; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.result.ResultBean; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class CostAdjustmentsBillService extends FinKingDeeService { + + /** + * 生成的成本调整单的数据,推送到金蝶的平台中 + * + * @param costAdjustmentsBill + * @return + */ + public ResultBean costAdjustmentsBillService(CostAdjustmentsBill costAdjustmentsBill) { + ResultBean rb = ResultBean.fireFail(); + //业务表的主表数据集合 + Map map_fEntityModel_ = new HashMap<>(); + + //往来单位 + if (StringUtils.isBlank(costAdjustmentsBill.getCommUnit())) { + return rb.setMsg("往来单位不能为空"); + } + map_fEntityModel_.put("FSUPPLIERID", costAdjustmentsBill.getCommUnit()); + //业务日期 + if (StringUtils.isBlank(costAdjustmentsBill.getBussDate())) { + return rb.setMsg("业务日期不能为空"); + } + map_fEntityModel_.put("FDate", costAdjustmentsBill.getBussDate()); + //核算组织 + if (StringUtils.isBlank(costAdjustmentsBill.getUseOrgCode())) { + return rb.setMsg("核算组织不能为空"); + } + map_fEntityModel_.put("FAcctOrgID", costAdjustmentsBill.getUseOrgCode()); + + List costAdjustmentsBillDetailDtos = costAdjustmentsBill.getResultDetails() == null ? new ArrayList<>() : costAdjustmentsBill.getResultDetails(); + //准备 物料列表的数据 + ResultBean>> vehicleListMap = createVehicleListsForReceivableBill(costAdjustmentsBillDetailDtos); + if (!vehicleListMap.getSuccess()) { + return rb.setMsg(vehicleListMap.getMsg()); + } + String kingDeeData = CostAdjustmentsBillCastToKingDeeBillFields.getKingDeeData(map_fEntityModel_, vehicleListMap.getData()); + try { + ResultBean resultBean1 = accessKingDeeInterface(KingDeeBillId.HS_AdjustmentBill.getID(), kingDeeData, KingDeeBillUrl.SAVE_URL.getURL()); + if (!resultBean1.getSuccess()) { + log.info("成本调整单保存失败!"); + return rb.setMsg("成本调整单保存失败!"); + } + log.info("成本调整单保存成功!"); + } catch (Exception e) { + e.printStackTrace(); + } + return rb; + } + + public ResultBean>> createVehicleListsForReceivableBill(List collectionDetails) { + ResultBean>> rb = ResultBean.fireFail(); + List> collectionDetailMap = new ArrayList<>(); + for (int i = 0; i < collectionDetails.size(); i++) { + CostAdjustmentsBill.CostAdjustmentsBillDetailDto c = collectionDetails.get(i); + Map m = new HashMap<>(); + if (StringUtils.isBlank(c.getCompanyCode())) { + return rb.setMsg("库存组织不能为空"); + } + if (StringUtils.isBlank(c.getMaterialID())) { + return rb.setMsg("物料编码不能为空"); + } + m.put("FStockOrgID", c.getCompanyCode()); + m.put("FOwnerID", c.getCompanyCode()); + m.put("FMaterialID", c.getMaterialID()); + m.put("FDepartmentId", c.getDeptCode()); + m.put("FAdjustmentAMOUNT", c.getAmount()); + collectionDetailMap.add(m); + } + return rb.success().setData(collectionDetailMap); + } +} diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data.json b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data.json new file mode 100644 index 0000000000..3886bfdee1 --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data.json @@ -0,0 +1,4 @@ +{ + "formId": "HS_AdjustmentBill", + "data": "@KD_data" +} \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_FEntity.json b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_FEntity.json new file mode 100644 index 0000000000..5b53ea7288 --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_FEntity.json @@ -0,0 +1,116 @@ +{ + "FEntryID": "0", + "FStockOrgID": { + "FNumber": "@KD_FStockOrgID" + }, + "FMaterialID": { + "FNumber": "@KD_FMaterialID" + }, + "FAuxPropId": { + "FAUXPROPID__FF100001": { + "FNumber": "" + }, + "FAUXPROPID__FF100005": { + "FNumber": "" + }, + "FAUXPROPID__FF100002": { + "FNumber": "" + }, + "FAUXPROPID__FF100004": { + "FNumber": "" + }, + "FAUXPROPID__FF100006": { + "FNumber": "" + } + }, + "FLOT": { + "FNumber": "" + }, + "FBOMId": { + "FNumber": "" + }, + "FSTOCKSTATUSID": { + "FNumber": "KCZT01_SYS" + }, + "FAdjustmentAMOUNT": "@KD_FAdjustmentAMOUNT", + "FAdjustmentAMOUNTFor": "0", + "FStockID": { + "FNumber": "ARZSCK" + }, + "FOwnerID": { + "FNumber": "@KD_FOwnerID" + }, + "FSTOCKLOCID": { + "FSTOCKLOCID__FF100001": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100002": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100003": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100004": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100005": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100006": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100007": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100008": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100009": { + "FNumber": "" + }, + "FSTOCKLOCID__FF100010": { + "FNumber": "" + } + }, + "FAcctgRangeID": { + "FNumber": "" + }, + "FMtoNo": "", + "FSeqId": "", + "FPROJECTNO": "", + "FOwnerTypeId": "", + "FPrice": "0", + "FSeqEntryId": "0", + "FInvoiceRateType": { + "FNumber": "" + }, + "FStockRateType": { + "FNumber": "" + }, + "FOriginalCurrencyId": { + "FNumber": "" + }, + "FStockRate": "0", + "FInvoiceRate": "0", + "FRateDiff": "0", + "FPriceDiff": "0", + "FQty": "0", + "FCostCenterID": { + "FNumber": "" + }, + "FSRCSEQ": "0", + "FSRCBILLNO": "", + "FSRCBILLTYPEID": { + "FNumber": "" + }, + "FDepartmentId": { + "FNUMBER": "@KD_FDepartmentId" + }, + "FExpense": [{ + "FExpenseEntryID": "0", + "FExpenseID": { + "FNumber": "" + }, + "FExpenseAmount": "0" + }] +} \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_data.json b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_data.json new file mode 100644 index 0000000000..f8b9dc071d --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_data.json @@ -0,0 +1,13 @@ +{ + "Creator": "", + "NeedUpDateFields": [], + "NeedReturnFields": [], + "IsDeleteEntry": "True", + "SubSystemId": "", + "IsVerifyBaseDataField": "false", + "IsEntryBatchFill": "True", + "ValidateFlag": "True", + "NumberSearch": "True", + "InterationFlags": "", + "Model": {} +} \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_model.json b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_model.json new file mode 100644 index 0000000000..26bbaace5f --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/data_model.json @@ -0,0 +1,38 @@ +{ + "FID": "0", + "FBillTypeID": { + "FNUMBER": "CGRKTZD01_SYS" + }, + "FBillNo": "", + "FBusinessType": "1", + "FSUPPLIERID": { + "FNumber": "@KD_FSUPPLIERID" + }, + "FDate": "@KD_FDATE", + "FACCTGSYSTEMID": { + "FNumber": "01" + }, + "FAcctOrgID": { + "FNumber": "@KD_FAcctOrgID" + }, + "FACCTPOLICYID": { + "FNumber": "KJZC01_SYS" + }, + "FCurrencyID": { + "FNumber": "" + }, + "FAdjustmentReason": "", + "FAcctgId": "0", + "FDocumentStatus": "", + "FCreateOrgId": { + "FNumber": "" + }, + "FCreatorId": { + "FUserID": "" + }, + "FInOutIndex": "", + "F_PAEZ_Assistant": { + "FNumber": "01" + }, + "FEntity": [] +} \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/remarks.txt b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/remarks.txt new file mode 100644 index 0000000000..d941438b45 --- /dev/null +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/costadjustmentsbill/remarks.txt @@ -0,0 +1,97 @@ +一、请求参数说明: +1.formid:业务对象表单Id,字符串类型(必录) +2.data:Json格式数据(详情参考Json格式数据)(必录) + 2.1.Creator:创建者内码(非必录) + 2.2.NeedUpDateFields:需要更新的字段,数组类型,格式:[key1,key2,...](非必录),注(更新单据体字段得加上单据体key) + 2.3.NeedReturnFields:需返回结果的字段集合,数组类型,格式:[key,entitykey.key,...](非必录),注(返回单据体字段格式:entitykey.key) + 2.4.IsDeleteEntry:是否删除已存在的分录,布尔类型,默认true(非必录) + 2.5.SubSystemId:表单所在的子系统内码,字符串类型(非必录) + 2.6.IsVerifyBaseDataField:是否验证所有的基础资料有效性,布尔类,默认false(非必录) + 2.7.IsEntryBatchFill:是否批量填充分录,默认true(非必录) + 2.8.ValidateFlag:是否验证标志,布尔类型,默认true(非必录) + 2.9.NumberSearch:是否用编码搜索基础资料,布尔类型,默认true(非必录) + 2.10.InterationFlags:交互标志集合,字符串类型,分号分隔,格式:"flag1;flag2;..."(非必录),例如(允许负库存标识:STK_InvCheckResult) + 2.11.Model:表单数据包,Json类型(必录) + +字段说明: +来源单据号:FSRCBILLNO +原单分录内码:FSRCEntryID +来源单据行号:FSRCSEQ +原单内码:FSRCBILLID +成本中心:FCostCenterID +数量:FQty +来源单据类别:FSRCBILLTYPEID +汇率差异:FRateDiff +入库单汇率类型:FStockRateType +发票汇率类型:FInvoiceRateType +价格差异:FPriceDiff +原币币别:FOriginalCurrencyId +采购入库单汇率:FStockRate +应付单汇率:FInvoiceRate +存货类别:FMaterialType +出入库序列:FInOutIndex (必填项) +来源类型:FFROMTYPE +成本调整类型:F_PAEZ_Assistant +期初类型:FINITTYPE +物料编码:FMaterialID (必填项) +物料名称:FMaterialName +规格型号:FMaterialModel +仓库名称:FStockName +核算范围编码:FAcctgRangeID +核算范围:FAcctgRangeName +仓库:FStockID (必填项) +核算维度Id:FAcctgDimeEntryId +FSeqEntryId:FSeqEntryId +应付单编号:FInvoiceBillNo +维度ID:FDimeentryId +库存状态:FSTOCKSTATUSID (必填项) +单价:FPrice +跨期调整:FCrossPeriodAdjust +费用项目:FExpenseID +费用项目名称:FExpenseName +金额:FExpenseAmount +部门:FDepartmentId +应付单行号:FInvoiceSeq +应付单单据类型:FInvoiceBillTypeId +钩稽序号:FHookLogID +批号:FLOT +货主名称:FOwnerName +调整金额(原币):FAdjustmentAMOUNTFor +BOM版本:FBOMId +调整金额:FAdjustmentAMOUNT +货主:FOwnerID (必填项) +库存组织:FStockOrgID (必填项) +库存组织名称:FStockOrgName +仓位:FSTOCKLOCID +货主类型:FOwnerTypeId +辅助属性:FAuxPropId +基本单位:FBASICUNITID +计划跟踪号:FMtoNo +项目编号:FPROJECTNO +序列号:FSeqId +修改日期:FModifyDate +创建人:FCreatorId +审核人:FAuditorID +审核日期:FAuditDate +创建日期:FCreateDate +创建组织:FCreateOrgId (必填项) +单据状态:FDocumentStatus (必填项) +币别:FCurrencyID +业务日期:FDate +单据编号:FBillNo +核算体系名称:FACCTGSYSTEMNAME +核算体系编码:FACCTGSYSTEMID (必填项) +往来单位:FSUPPLIERID +会计政策名称:FACCTPOLICYNAME +是否为出库核算生成:FIsAcctgGenerate +核算内码:FAcctgId +会计政策编码:FACCTPOLICYID (必填项) +调整原因:FAdjustmentReason +修改人:FModifierId +作废人:FForbidderID +作废状态:FForbidStatus +作废日期:FForbidDate +核算组织名称:FAcctOrgName +核算组织编码:FAcctOrgID (必填项) +业务类型:FBusinessType +单据类型:FBillTypeID \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyService.java index c26f7c9441..bcd1cb3bf5 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyService.java @@ -37,6 +37,7 @@ import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeig import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp; import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; +import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill; import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; import com.yxt.anrui.flowable.api.flow.FlowableFeign; import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; @@ -478,8 +479,12 @@ public class ScmVehrebateCheckapplyService extends MybatisBaseService voucherDetails = new ArrayList<>(); + CostAdjustmentsBill costAdjustmentsBill = new CostAdjustmentsBill(); + costAdjustmentsBill.setBussDate(format); + List resultDetails = new ArrayList<>(); if (!v.isEmpty()) { for (ScmVehRebate rebate : v) { + String useOrgCode = ""; String deptCode = ""; //采购系统部门编码 String salesDeptCode = ""; //销售部门编码 String customerCode = ""; //出库单客户编码 @@ -493,6 +498,7 @@ public class ScmVehrebateCheckapplyService extends MybatisBaseService voucherDetails = new ArrayList<>(); + CostAdjustmentsBill costAdjustmentsBill = new CostAdjustmentsBill(); + costAdjustmentsBill.setBussDate(format); + List resultDetails = new ArrayList<>(); if (!v.isEmpty()) { for (ScmVehRebate rebate : v) { + String useOrgCode = ""; + String vinCode = ""; + String deptCode = ""; + if (StringUtils.isNotBlank(rebate.getUseOrgSid())) { + String useOrgSid = rebate.getUseOrgSid(); + SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData(); + if (null != organizationVo) { + generalVoucher.setUseOrgCode(organizationVo.getOrgCode()); + costAdjustmentsBill.setUseOrgCode(organizationVo.getOrgCode()); + useOrgCode = organizationVo.getOrgCode(); + } + } if (!rebate.getRebateTypeValue().equals("金融贴息")) { GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail(); - if (StringUtils.isNotBlank(rebate.getUseOrgSid())) { - String useOrgSid = rebate.getUseOrgSid(); - SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData(); - if (null != organizationVo) { - generalVoucher.setUseOrgCode(organizationVo.getOrgCode()); - } - } voucherDetail.setTimeFlag(finalSummaryTag); String palceGenDate = rebate.getPalceGenDate(); String[] palceGenDateSplit = palceGenDate.split("-"); @@ -443,12 +452,15 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService Date: Mon, 16 Dec 2024 16:43:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8E=A8=E9=80=81=E4=BB=98=E6=AC=BE=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kingdee/appaybill/ApPayBillService.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/appaybill/ApPayBillService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/appaybill/ApPayBillService.java index 83441c09f4..de4c3b8631 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/appaybill/ApPayBillService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/appaybill/ApPayBillService.java @@ -1,21 +1,16 @@ package com.yxt.anrui.fin.biz.kingdee.appaybill; -import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSONObject; import com.yxt.anrui.fin.api.kingdee.KingDeeBillId; import com.yxt.anrui.fin.api.kingdee.KingDeeBillUrl; import com.yxt.anrui.fin.api.kingdee.KingDeeCode; import com.yxt.anrui.fin.api.kingdee.appaybill.ApPayBill; -import com.yxt.anrui.fin.api.kingdee.bdmaterial.BdMaterial; import com.yxt.anrui.fin.biz.kingdee.FinKingDeeService; import com.yxt.anrui.portal.api.sysmapping.SysMappingInfoQuery; -import com.yxt.anrui.portal.api.sysmapping.SysMappingInfoQueryBatch; import com.yxt.anrui.portal.api.sysmapping.SysMappingInfoVo; import com.yxt.common.core.result.ResultBean; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,11 +41,17 @@ public class ApPayBillService extends FinKingDeeService { for(int i=0;i params=vehicleListMap.get(i); //付款用途 - sysMappingInfoVoResultBean = getSysMappingInfoVoResultBean( "付款用途", params.get("FPURPOSEIDKey"), params.get("FPURPOSEIDType")); - if(! sysMappingInfoVoResultBean.getSuccess()){ - return rb.setMsg(sysMappingInfoVoResultBean.getMsg()); +// sysMappingInfoVoResultBean = getSysMappingInfoVoResultBean( "付款用途", params.get("FPURPOSEIDKey"), params.get("FPURPOSEIDType")); +// if(! sysMappingInfoVoResultBean.getSuccess()){ +// return rb.setMsg(sysMappingInfoVoResultBean.getMsg()); +// } +// params.put("FPURPOSEID",sysMappingInfoVoResultBean.getData().getMap_itemKey());//"SFKYT08_SYS"); + String map_itemKey = sysMappingInfoVoResultBean.getData().getMap_itemKey(); + if (map_itemKey.equals("005")) { //根据付款类别来判断付款用途,005定金 对应预付款,其余为采购付款 + params.put("FPURPOSEID","SFKYT09_SYS");//预付款 + } else { + params.put("FPURPOSEID","SFKYT08_SYS");//采购付款 } - params.put("FPURPOSEID",sysMappingInfoVoResultBean.getData().getMap_itemKey());//"SFKYT08_SYS"); //结算方式 sysMappingInfoVoResultBean = getSysMappingInfoVoResultBean( "结算方式", params.get("FSETTLETYPEIDKey"), params.get("FSETTLETYPEIDType")); if(!sysMappingInfoVoResultBean.getSuccess()){ From 68da0aba49dace956e98b79b1402f5cdf2c0659d Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Tue, 17 Dec 2024 10:25:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/anruifinmanagement/payment.js | 17 +- .../src/api/jichuxinxi/dictcommons.js | 7 + .../src/components/publicPage/tops.vue | 142 ++++ .../src/router/modules/codemenu.js | 8 +- .../fukuanshenqing/payment.vue | 176 ++-- .../fukuanshenqing/paymentAdd.vue | 770 +++++++++++------- .../fukuanshenqing/paymentInfo.vue | 416 ++++++---- .../relation/paymentInformationAdd.vue | 397 +++++++++ .../relation/paymentInformationInfo.vue | 135 +++ .../fukuanshenqing/relation/vehcile.vue | 54 +- .../fukuanguanli/fukuanDaiBanInfo.vue | 405 +++++---- .../fukuanguanli/fukuanEdit.vue | 750 ++++++++++------- .../fukuanguanli/fukuanYiBanInfo.vue | 401 +++++---- .../relation/paymentInformationAdd.vue | 397 +++++++++ .../relation/paymentInformationInfo.vue | 135 +++ .../fukuanguanli/relation/vehcile.vue | 57 +- .../src/views/workFlow/publicPage/tops.vue | 142 ++++ 17 files changed, 3187 insertions(+), 1222 deletions(-) create mode 100644 anrui-buscenter/anrui-finmanage-ui/src/components/publicPage/tops.vue create mode 100644 anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/fukuanshenqing/relation/paymentInformationAdd.vue create mode 100644 anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/fukuanshenqing/relation/paymentInformationInfo.vue create mode 100644 anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/fukuanguanliFlow/fukuanguanli/relation/paymentInformationAdd.vue create mode 100644 anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/fukuanguanliFlow/fukuanguanli/relation/paymentInformationInfo.vue create mode 100644 anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/publicPage/tops.vue diff --git a/anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/payment.js b/anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/payment.js index 0001a6f274..ce8d6c7900 100644 --- a/anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/payment.js +++ b/anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/payment.js @@ -19,11 +19,20 @@ export default { headers: { 'Content-Type': 'application/json' } }) }, - // 获取厂家销售通路 - actualList: function(data) { + // 根据分公司Sid获取本分公司下的付款信息 + selectByUseOrgSid: function(data) { return request({ - url: '/base/v1/basemanufacturerbank/payList', - method: 'get' + url: '/fin/v1/finpayment/selectByUseOrgSid', + method: 'get', + params: data + }) + }, + paymentSave: function(data) { + return request({ + url: 'fin/v1/finpayment/save', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } }) }, // 保存修改记录 diff --git a/anrui-buscenter/anrui-finmanage-ui/src/api/jichuxinxi/dictcommons.js b/anrui-buscenter/anrui-finmanage-ui/src/api/jichuxinxi/dictcommons.js index 55086c8c88..65019d59a4 100644 --- a/anrui-buscenter/anrui-finmanage-ui/src/api/jichuxinxi/dictcommons.js +++ b/anrui-buscenter/anrui-finmanage-ui/src/api/jichuxinxi/dictcommons.js @@ -224,3 +224,10 @@ export function fetchDetails(data) { method: 'get' }) } +// 通过sid查询一条记录(上装配置信息) +export function fetchBySidByTops(sid) { + return request({ + url: '/base/v1/basevehinstallmodel/fetchDetailsBySid/' + sid, + method: 'get' + }) +} diff --git a/anrui-buscenter/anrui-finmanage-ui/src/components/publicPage/tops.vue b/anrui-buscenter/anrui-finmanage-ui/src/components/publicPage/tops.vue new file mode 100644 index 0000000000..84995b2a02 --- /dev/null +++ b/anrui-buscenter/anrui-finmanage-ui/src/components/publicPage/tops.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/anrui-buscenter/anrui-finmanage-ui/src/router/modules/codemenu.js b/anrui-buscenter/anrui-finmanage-ui/src/router/modules/codemenu.js index 9d8ade7d0f..11bbc9a99b 100644 --- a/anrui-buscenter/anrui-finmanage-ui/src/router/modules/codemenu.js +++ b/anrui-buscenter/anrui-finmanage-ui/src/router/modules/codemenu.js @@ -120,7 +120,7 @@ const codemenu = [ children: [{ path: '/anruifinmanagement/fukuanshenqing', component: () => import('@/views/anruifinmanagement/fukuanshenqing/payment.vue'), - name: 'fukuanshenqingguaili', + name: 'Payment', meta: { title: '付款申请管理', noCache: true } }] }, @@ -293,21 +293,21 @@ const codemenu = [ path: '/fukuanguanliFlow/fukuanguanli/fukuanEdit', component: () => import('@/views/workFlow/fukuanguanliFlow/fukuanguanli/fukuanEdit.vue'), - name: 'fukuanEdit' + name: 'FuKuanEdit' }, // 付款申请管理待办详情 { path: '/fukuanguanliFlow/fukuanguanli/fukuanDaiBanInfo', component: () => import('@/views/workFlow/fukuanguanliFlow/fukuanguanli/fukuanDaiBanInfo.vue'), - name: 'fukaunDaiBanInfo' + name: 'FuKuanDaiBanInfo' }, // 付款申请管理已办详情 { path: '/fukuanguanliFlow/fukuanguanli/fukuanYiBanInfo', component: () => import('@/views/workFlow/fukuanguanliFlow/fukuanguanli/fukuanYiBanInfo.vue'), - name: 'fukuanYiBanInfo' + name: 'FuKuanYiBanInfo' }, // 开票申请管理编辑 { diff --git a/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/fukuanshenqing/payment.vue b/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/fukuanshenqing/payment.vue index 7d2d059332..a04eefd11d 100644 --- a/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/fukuanshenqing/payment.vue +++ b/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/fukuanshenqing/payment.vue @@ -8,9 +8,36 @@ {{ searchxianshitit }}