Browse Source

回款返利凭证

zhanglei
fanzongzhe0036 6 months ago
parent
commit
6b7acf6aa7
  1. 10
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java
  2. 10
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java
  3. 117
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java
  4. 5
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeign.java
  5. 5
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyFeignFallback.java
  6. 10
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java
  7. 4
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java
  8. 10
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeign.java
  9. 4
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyFeignFallback.java
  10. 5
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeign.java
  11. 4
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyFeignFallback.java
  12. 10
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeign.java
  13. 4
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatecheckapply/ScmVehrebateCheckapplyFeignFallback.java
  14. 14
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeign.java
  15. 4
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebatewithapply/ScmVehRebateWithApplyFeignFallback.java
  16. 8
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyRest.java
  17. 211
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatecheckapply/ScmCollectionrebateCheckapplyService.java
  18. 15
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyRest.java
  19. 143
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyService.java
  20. 13
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyRest.java
  21. 13
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyRest.java
  22. 16
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyRest.java
  23. 15
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyRest.java

10
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<String> saveRebateSpecialReviewVoucher(@RequestBody @Valid GeneralVoucher voucher);
@ApiOperation("保存回款返利预提凭证")
@PostMapping("/saveRebateCollectionVoucher")
@ResponseBody
ResultBean<String> saveRebateCollectionVoucher(@RequestBody @Valid GeneralVoucher voucher);
@ApiOperation("保存回款返利核对凭证")
@PostMapping("/saveRebateCollectionReviewVoucher")
@ResponseBody
ResultBean<String> saveRebateCollectionReviewVoucher(@RequestBody @Valid GeneralVoucher voucher);
//---------------------- 返利凭证 ---------------------------------
@ApiOperation("保存凭证的接口")
@PostMapping("/saveVoucher")

10
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<String> saveRebateCollectionVoucher(@Valid GeneralVoucher voucher) {
return null;
}
@Override
public ResultBean<String> saveRebateCollectionReviewVoucher(@Valid GeneralVoucher voucher) {
return null;
}
@Override
public ResultBean<String> saveVoucher(Voucher voucher) {
return null;

117
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<String> saveRebateCollectionVoucher(@Valid GeneralVoucher voucher) {
ResultBean rb = ResultBean.fireFail();
Voucher newVoucher = new Voucher();
List<Voucher.VoucherResultDetailDto> 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<GeneralVoucher.GeneralVoucherDetail> 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<String> saveRebateCollectionReviewVoucher(@Valid GeneralVoucher voucher) {
ResultBean rb = ResultBean.fireFail();
Voucher newVoucher = new Voucher();
List<Voucher.VoucherResultDetailDto> 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<GeneralVoucher.GeneralVoucherDetail> 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<String> saveVoucher(Voucher voucher) {

5
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

5
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<PagerVo<ScmCollectionrebateCheckapplyVo>> listPage(PagerQuery<ScmCollectionrebateCheckapplyQuery> pq) {
ResultBean rb = ResultBean.fireFail();

10
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

4
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<PagerVo<ScmCollectionRebateWithApplyVo>> listPage(PagerQuery<ScmCollectionRebateWithApplyQuery> pq) {
ResultBean rb = ResultBean.fireFail();

10
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

4
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<PagerVo<ScmSpecialrebateCheckapplyVo>> listPage(PagerQuery<ScmSpecialrebateCheckapplyQuery> pq){
ResultBean rb = ResultBean.fireFail();

5
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

4
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<PagerVo<ScmSpecialRebateWithApplyVo>> listPage(PagerQuery<ScmSpecialRebateWithApplyQuery> pq){
ResultBean rb = ResultBean.fireFail();

10
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

4
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<PagerVo<ScmVehrebateCheckapplyVo>> listPage(PagerQuery<ScmVehrebateCheckapplyQuery> pq){
ResultBean rb = ResultBean.fireFail();

14
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

4
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<PagerVo<ScmVehRebateWithApplyVo>> listPage(PagerQuery<ScmVehRebateWithApplyQuery> pq){
ResultBean rb = ResultBean.fireFail();

8
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")

211
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<ScmCollectionrebateCheckapplyMapper, ScmCollectionrebateCheckapply> {
@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<Scm
private SysUserFeign sysUserFeign;
@Autowired
private FlowFeign flowFeign;
@Autowired
private ScmCollectionRebateService scmCollectionRebateService;
public PagerVo<ScmCollectionrebateCheckapplyVo> listPageVo(PagerQuery<ScmCollectionrebateCheckapplyQuery> pq) {
ScmCollectionrebateCheckapplyQuery query = pq.getParams();
@ -345,6 +359,179 @@ public class ScmCollectionrebateCheckapplyService extends MybatisBaseService<Scm
return baseMapper.updateFlowFiled(beanToMap);
}
/**
* 推送回款返利核对凭证
*
* @param sid
*/
public void pusCollectionRebateWithVoucher(String sid) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH);
calendar.set(Calendar.MONTH, month - 1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endTime = calendar.getTime();//上个月最后一天
String format = sdf.format(endTime);
String summaryTag = "";//摘要前缀
ScmCollectionrebateCheckapply entity = fetchBySid(sid);
if (null != entity) {
if (StringUtils.isNotBlank(entity.getCheckApply())) {
summaryTag = entity.getCheckApply();
}
}
List<ScmCollectionRebate> scmVehRebates = new ArrayList<>();
List<ScmCollectionrebateCheckapplydetailVo> 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<String, List<ScmCollectionRebate>> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmCollectionRebate::getPurchaseSystemSid));
String finalSummaryTag = summaryTag;
String[] split = finalSummaryTag.split("年");
String y1 = split[0]; //预提申请标题年份
map.forEach((k, v) -> {
List<ScmCollectionRebate> rebates = v;
GeneralVoucher generalVoucher = new GeneralVoucher();
generalVoucher.setBussDate(format);
List<GeneralVoucher.GeneralVoucherDetail> 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<Scm
}
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData()));
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) {
pusCollectionRebateWithVoucher(bv.getBusinessSid()); //推送回款返利核对凭证
}
return rb.success().setData(resultBean.getData());
} else {

15
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyRest.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.scmcollectionrebatewithapply.*;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.*;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
@ -40,13 +41,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApply;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyQuery;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyDetailsVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyDto;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyFeign;
@Api(tags = "回款返利预提申请表")
@RestController
@RequestMapping("v1/scmcollectionrebatewithapply")
@ -98,6 +92,13 @@ public class ScmCollectionRebateWithApplyRest implements ScmCollectionRebateWith
return scmCollectionRebateWithApplyService.complete(bv);
}
@Override
public ResultBean rePushVoucher(String sid) {
ResultBean rb = ResultBean.fireFail();
scmCollectionRebateWithApplyService.pushCollectionRebateWithVoucher(sid);
return rb.success();
}
@Override
public ResultBean revokeProcess(FlowTaskVo flowTaskVo) {
return scmCollectionRebateWithApplyService.revokeProcess(flowTaskVo);

143
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyService.java

@ -26,11 +26,16 @@
package com.yxt.anrui.scm.biz.scmcollectionrebatewithapply;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
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.FlowDelegateQuery;
@ -38,6 +43,8 @@ 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;
@ -45,12 +52,12 @@ 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.scmcollectionrebate.ScmCollectionRebateVo;
import com.yxt.anrui.scm.api.scmcollectionrebatedistribution.ScmCollectionRebateDistribution;
import com.yxt.anrui.scm.api.scmcollectionrebateveh.ScmCollectionRebateVehDetailsVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewith.ScmCollectionRebateWith;
import com.yxt.anrui.scm.api.scmcollectionrebatewith.ScmCollectionRebateWithDetailsVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewith.ScmCollectionRebateWithDto;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.*;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.ScmCollectionRebateWithApplyDelegateQuery;
@ -59,28 +66,31 @@ import com.yxt.anrui.scm.biz.scmcollectionrebate.ScmCollectionRebateService;
import com.yxt.anrui.scm.biz.scmcollectionrebatedistribution.ScmCollectionRebateDistributionService;
import com.yxt.anrui.scm.biz.scmcollectionrebateveh.ScmCollectionRebateVehService;
import com.yxt.anrui.scm.biz.scmcollectionrebatewith.ScmCollectionRebateWithService;
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.scmcollectionrebatewithapply.ScmCollectionRebateWithApply;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyQuery;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyDetailsVo;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyDto;
import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyFeign;
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;
@Service
public class ScmCollectionRebateWithApplyService extends MybatisBaseService<ScmCollectionRebateWithApplyMapper, ScmCollectionRebateWithApply> {
@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<ScmC
return baseMapper.updateFlowFiled(beanToMap);
}
/**
* 推送回款预提凭证
* @param sid
*/
public void pushCollectionRebateWithVoucher(String sid) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
int month=calendar.get(Calendar.MONTH);
calendar.set(Calendar.MONTH, month-1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endTime = calendar.getTime();//上个月最后一天
String format = sdf.format(endTime);
String summaryTag = "";//摘要前缀
ScmCollectionRebateWithApply entity = fetchBySid(sid);
if (null != entity) {
if (StringUtils.isNotBlank(entity.getCollectionApply())) {
summaryTag = entity.getCollectionApply();
}
}
List<ScmCollectionRebate> scmVehRebates = new ArrayList<>();
List<String> 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<String, List<ScmCollectionRebate>> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmCollectionRebate::getPurchaseSystemSid));
String finalSummaryTag = summaryTag;
String[] split = finalSummaryTag.split("年");
String y1 = split[0]; //预提申请标题年份
map.forEach((k, v) -> {
List<ScmCollectionRebate> rebates = v;
GeneralVoucher generalVoucher = new GeneralVoucher();
generalVoucher.setBussDate(format);
List<GeneralVoucher.GeneralVoucherDetail> 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<ScmC
scmCollectionRebateDistributionService.save(scmCollectionRebateDistribution);
}
}
pushCollectionRebateWithVoucher(bv.getBusinessSid()); //回款返利预提凭证
}
return rb.success().setData(resultBean.getData());
} else {

13
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyRest.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.scmspecialrebatecheckapply.*;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.flow.*;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
@ -39,11 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyQuery;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyDetailsVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyDto;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyFeign;
@Api(tags = "专项返利核对申请表")
@RestController
@ -53,6 +49,13 @@ public class ScmSpecialrebateCheckapplyRest implements ScmSpecialrebateCheckappl
@Autowired
private ScmSpecialrebateCheckapplyService scmSpecialrebateCheckapplyService;
@Override
public ResultBean rePushVoucher(String sid) {
ResultBean rb = ResultBean.fireFail();
scmSpecialrebateCheckapplyService.pushSpecialRebateWithVoucher(sid,"1");
return rb.success();
}
@Override
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")

13
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyRest.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.scmspecialrebatewithapply.*;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.*;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
@ -39,11 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyQuery;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyVo;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyDetailsVo;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyDto;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyFeign;
/**
* Project: anrui-scm(专项返利) <br/>
@ -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")

16
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(单车返利核对) <br/>
* File: ScmVehrebateCheckapplyFeignFallback.java <br/>
@ -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")

15
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(单车返利预提申请) <br/>
@ -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")

Loading…
Cancel
Save