|
|
@ -249,26 +249,49 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
newVoucher.setBussDate(voucher.getBussDate()); |
|
|
|
} |
|
|
|
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails(); |
|
|
|
BigDecimal shangnian = BigDecimal.ZERO;//上年
|
|
|
|
BigDecimal bennian = BigDecimal.ZERO;//本年
|
|
|
|
BigDecimal total = BigDecimal.ZERO;//合计
|
|
|
|
String deptNo = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
String timeFlag = ""; |
|
|
|
if (!voucherDetails.isEmpty()) { |
|
|
|
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); //借方
|
|
|
|
Voucher.VoucherResultDetailDto dto2 = new Voucher.VoucherResultDetailDto(); //贷方
|
|
|
|
dto1.setSummary(voucherDetail.getTimeFlag() + "单车返利预提预留费用"); |
|
|
|
dto2.setSummary(voucherDetail.getTimeFlag() + "单车返利预提预留费用"); |
|
|
|
BigDecimal amount = voucherDetail.getAmount(); |
|
|
|
if (voucherDetail.getSceneCode().equals("上年")) { |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
shangnian = shangnian.add(amount); |
|
|
|
} else if (voucherDetail.getSceneCode().equals("本年")) { |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
bennian = bennian.add(amount); |
|
|
|
} |
|
|
|
dto2.setSubjectNo("2181.07.00"); |
|
|
|
dto1.setDimensionDept(voucherDetail.getDeptCode()); |
|
|
|
dto1.setManufacturer(voucherDetail.getManufacturer()); |
|
|
|
dto2.setDimensionCustom(voucherDetail.getCustomerCode()); |
|
|
|
dto1.setDebit(String.valueOf(voucherDetail.getAmount())); |
|
|
|
dto2.setCredit(String.valueOf(voucherDetail.getAmount())); |
|
|
|
total = total.add(amount); |
|
|
|
deptNo = voucherDetail.getDeptCode(); |
|
|
|
manufacturer = voucherDetail.getManufacturer(); |
|
|
|
timeFlag = voucherDetail.getTimeFlag(); |
|
|
|
} |
|
|
|
if (shangnian.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); //借方
|
|
|
|
dto1.setSummary(timeFlag + "单车返利预提预留费用"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(shangnian)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
resultDetails.add(dto2); |
|
|
|
} |
|
|
|
if (bennian.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); //借方
|
|
|
|
dto1.setSummary(timeFlag + "单车返利预提预留费用"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(bennian)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
Voucher.VoucherResultDetailDto dto2 = new Voucher.VoucherResultDetailDto(); //贷方
|
|
|
|
dto2.setSummary(timeFlag + "单车返利预提预留费用"); |
|
|
|
dto2.setSubjectNo("2181.07.00"); |
|
|
|
dto2.setDimensionCustom("DZFCJFL"); |
|
|
|
dto2.setCredit(String.valueOf(total)); |
|
|
|
resultDetails.add(dto2); |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
|
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher)); |
|
|
@ -366,18 +389,26 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
if (StringUtils.isNotBlank(voucher.getBussDate())) { |
|
|
|
newVoucher.setBussDate(voucher.getBussDate()); |
|
|
|
} |
|
|
|
BigDecimal cjwdx = BigDecimal.ZERO;// 单车厂家未兑现返利
|
|
|
|
BigDecimal shangnian = BigDecimal.ZERO;// 单车上年返利
|
|
|
|
BigDecimal bennian = BigDecimal.ZERO;// 单车本年返利
|
|
|
|
BigDecimal qtdk = BigDecimal.ZERO;// 单车应收厂家返利其他垫款
|
|
|
|
BigDecimal sntz = BigDecimal.ZERO;// 上年返利调整
|
|
|
|
BigDecimal bntz = BigDecimal.ZERO;// 本年返利调整
|
|
|
|
BigDecimal qttz = BigDecimal.ZERO;// 其他应付调整
|
|
|
|
BigDecimal cjwdxJR = BigDecimal.ZERO;// 厂家未兑现返利金融
|
|
|
|
String deptNo = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
String timeFlag = ""; |
|
|
|
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails(); |
|
|
|
if (!voucherDetails.isEmpty()) { |
|
|
|
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) { |
|
|
|
timeFlag = voucherDetail.getTimeFlag(); |
|
|
|
deptNo = voucherDetail.getDeptCode(); |
|
|
|
manufacturer = voucherDetail.getManufacturer(); |
|
|
|
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); |
|
|
|
cjwdxJR = cjwdxJR.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.19") || voucherDetail.getSceneCode().equals("1161.01.19")) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
@ -393,48 +424,100 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
} |
|
|
|
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); |
|
|
|
cjwdx = cjwdx.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15") || |
|
|
|
voucherDetail.getSceneCode().equals("1161.01.15") || |
|
|
|
voucherDetail.getSceneCode().equals("1161.04.00")) { |
|
|
|
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.getSceneCode().equals("1161.02.15")) { |
|
|
|
shangnian = shangnian.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bennian = bennian.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.04.00")) { |
|
|
|
qtdk = qtdk.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (voucherDetail.getRemarks().equals("预留费用调整")) { |
|
|
|
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("1161.02.15")) { |
|
|
|
sntz = sntz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bntz = bntz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("2181.07.00")) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(voucherDetail.getTimeFlag() + "返利上传预留费用调整"); |
|
|
|
dto1.setSubjectNo(voucherDetail.getSceneCode()); |
|
|
|
dto1.setDimensionCustom(voucherDetail.getCustomerCode()); |
|
|
|
dto1.setCredit(String.valueOf(voucherDetail.getAmount())); |
|
|
|
resultDetails.add(dto1); |
|
|
|
qttz = qttz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
if (cjwdxJR.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "金融贴息上传"); |
|
|
|
dto1.setSubjectNo("1161.01.16"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(cjwdxJR)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (cjwdx.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "单车返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.16"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(cjwdx)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (shangnian.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "单车返利上传"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(shangnian)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bennian.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "单车返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(bennian)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qtdk.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "单车返利上传"); |
|
|
|
dto1.setSubjectNo("1161.04.00"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(qtdk)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (sntz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "返利上传预留费用调整"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(sntz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bntz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "返利上传预留费用调整"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(bntz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qttz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "返利上传预留费用调整"); |
|
|
|
dto1.setSubjectNo("2181.07.00"); |
|
|
|
dto1.setDimensionCustom("DZFCJFL"); |
|
|
|
dto1.setCredit(String.valueOf(qttz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
@ -454,35 +537,65 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
if (StringUtils.isNotBlank(voucher.getBussDate())) { |
|
|
|
newVoucher.setBussDate(voucher.getBussDate()); |
|
|
|
} |
|
|
|
BigDecimal snfl = BigDecimal.ZERO;//上年返利
|
|
|
|
BigDecimal bnfl = BigDecimal.ZERO;//本年返利
|
|
|
|
BigDecimal cjfl = BigDecimal.ZERO;//厂家返利
|
|
|
|
BigDecimal qtfl = BigDecimal.ZERO;//其他应付款
|
|
|
|
String deptNo = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
String timeFlag = ""; |
|
|
|
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); |
|
|
|
deptNo = voucherDetail.getDeptCode(); |
|
|
|
manufacturer = voucherDetail.getManufacturer(); |
|
|
|
timeFlag = voucherDetail.getTimeFlag(); |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15")) { |
|
|
|
snfl = snfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bnfl = bnfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
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); |
|
|
|
cjfl = cjfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("2181.07.00")) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利预提"); |
|
|
|
dto1.setSubjectNo(voucherDetail.getSceneCode()); |
|
|
|
dto1.setDimensionCustom(voucherDetail.getCustomerCode()); |
|
|
|
dto1.setCredit(String.valueOf(voucherDetail.getAmount())); |
|
|
|
resultDetails.add(dto1); |
|
|
|
qtfl = qtfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (snfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利预提"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(snfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bnfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利预提"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(bnfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (cjfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利预提"); |
|
|
|
dto1.setSubjectNo("6401.13"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setDebit(cjfl.negate().toString());//转负数
|
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qtfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利预提"); |
|
|
|
dto1.setSubjectNo("2181.07.00"); |
|
|
|
dto1.setDimensionCustom("DZFCJFL"); |
|
|
|
dto1.setCredit(String.valueOf(qtfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
@ -502,118 +615,217 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
if (StringUtils.isNotBlank(voucher.getBussDate())) { |
|
|
|
newVoucher.setBussDate(voucher.getBussDate()); |
|
|
|
} |
|
|
|
BigDecimal cjflxx = BigDecimal.ZERO;//厂家未兑现行销
|
|
|
|
BigDecimal qtyfxx = BigDecimal.ZERO;//其他应付行销
|
|
|
|
BigDecimal dkxx = BigDecimal.ZERO;//垫款行销
|
|
|
|
BigDecimal qtdkxx = BigDecimal.ZERO;//其他垫款行销
|
|
|
|
BigDecimal srlxx = BigDecimal.ZERO;//收入行销
|
|
|
|
BigDecimal dkxxtz = BigDecimal.ZERO;//垫款行销调整
|
|
|
|
BigDecimal srxxtz = BigDecimal.ZERO;//收入行销调整
|
|
|
|
BigDecimal cjfl = BigDecimal.ZERO;//厂家未兑现
|
|
|
|
BigDecimal snfl = BigDecimal.ZERO;//上年返利
|
|
|
|
BigDecimal bnfl = BigDecimal.ZERO;//本年返利
|
|
|
|
BigDecimal qtdk = BigDecimal.ZERO;//其他垫款
|
|
|
|
BigDecimal snfltz = BigDecimal.ZERO;//上年返利调整
|
|
|
|
BigDecimal bnfltz = BigDecimal.ZERO;//本年返利调整
|
|
|
|
BigDecimal cjfltz = BigDecimal.ZERO;//厂家返利调整
|
|
|
|
BigDecimal qtyftz = BigDecimal.ZERO;//其他应付调整
|
|
|
|
String timeFlag = ""; |
|
|
|
String deptNo = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails(); |
|
|
|
if (!voucherDetails.isEmpty()) { |
|
|
|
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) { |
|
|
|
timeFlag = voucherDetail.getTimeFlag(); |
|
|
|
deptNo = voucherDetail.getDeptCode(); |
|
|
|
manufacturer = voucherDetail.getManufacturer(); |
|
|
|
if (!voucherDetail.getType().equals("行销活动")) { |
|
|
|
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); |
|
|
|
cjfl = cjfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15")) { |
|
|
|
snfl = snfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bnfl = bnfl.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15") || |
|
|
|
voucherDetail.getSceneCode().equals("1161.01.15") || |
|
|
|
voucherDetail.getSceneCode().equals("1161.04.00")) { |
|
|
|
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.getSceneCode().equals("1161.04.00")) { |
|
|
|
qtdk = qtdk.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (voucherDetail.getRemarks().equals("返利调整")) { |
|
|
|
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("1161.02.15")) { |
|
|
|
snfltz = snfltz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bnfltz = bnfltz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
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); |
|
|
|
cjfltz = cjfltz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("2181.07.00")) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整"); |
|
|
|
dto1.setSubjectNo(voucherDetail.getSceneCode()); |
|
|
|
dto1.setDimensionCustom(voucherDetail.getCustomerCode()); |
|
|
|
dto1.setCredit(String.valueOf(voucherDetail.getAmount())); |
|
|
|
resultDetails.add(dto1); |
|
|
|
qtyftz = qtyftz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
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); |
|
|
|
cjflxx = cjflxx.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("2181.07.00")) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传"); |
|
|
|
dto1.setSubjectNo(voucherDetail.getSceneCode()); |
|
|
|
dto1.setDimensionCustom(voucherDetail.getCustomerCode()); |
|
|
|
dto1.setCredit(String.valueOf(voucherDetail.getAmount())); |
|
|
|
resultDetails.add(dto1); |
|
|
|
qtyfxx = qtyfxx.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.03.00")) { |
|
|
|
dkxx = dkxx.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.03.00") || |
|
|
|
voucherDetail.getSceneCode().equals("1161.04.00")) { |
|
|
|
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.getSceneCode().equals("1161.04.00")) { |
|
|
|
qtdkxx = qtdkxx.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("6401.14")) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传"); |
|
|
|
dto1.setSubjectNo(voucherDetail.getSceneCode()); |
|
|
|
dto1.setDimensionDept(voucherDetail.getDeptCode()); |
|
|
|
dto1.setCredit(voucherDetail.getAmount().negate().toString()); |
|
|
|
resultDetails.add(dto1); |
|
|
|
srlxx = srlxx.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (voucherDetail.getRemarks().equals("返利调整")) { |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.03.00")) { |
|
|
|
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); |
|
|
|
dkxxtz = dkxxtz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("6401.14")) { |
|
|
|
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); |
|
|
|
srxxtz = srxxtz.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (cjfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.16"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(cjfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (snfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利上传"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(snfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bnfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(bnfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qtdk.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利上传"); |
|
|
|
dto1.setSubjectNo("1161.04.00"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(qtdk)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (snfltz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利调整"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(snfltz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bnfltz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利调整"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(bnfltz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (cjfltz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利调整"); |
|
|
|
dto1.setSubjectNo("6401.13"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setDebit(cjfltz.negate().toString()); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qtyftz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利调整"); |
|
|
|
dto1.setSubjectNo("2181.07.00"); |
|
|
|
dto1.setDimensionCustom("DZFCJFL"); |
|
|
|
dto1.setCredit(String.valueOf(qtyftz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (cjflxx.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "行销返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.16"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(cjflxx)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qtyfxx.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "行销返利上传"); |
|
|
|
dto1.setSubjectNo("2181.07.00"); |
|
|
|
dto1.setDimensionCustom("DZFCJFL"); |
|
|
|
dto1.setCredit(String.valueOf(qtyfxx)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (dkxx.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "行销返利上传"); |
|
|
|
dto1.setSubjectNo("1161.03.00"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(dkxx)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (qtdkxx.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "行销返利上传"); |
|
|
|
dto1.setSubjectNo("1161.04.00"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(qtdkxx)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (srlxx.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "行销返利上传"); |
|
|
|
dto1.setSubjectNo("6401.14"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setCredit(srlxx.negate().toString()); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (dkxxtz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利调整"); |
|
|
|
dto1.setSubjectNo("1161.03.00"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(dkxxtz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (srxxtz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "专项返利调整"); |
|
|
|
dto1.setSubjectNo("6401.14"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setDebit(srxxtz.negate().toString()); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
|
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher)); |
|
|
@ -632,27 +844,54 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
if (StringUtils.isNotBlank(voucher.getBussDate())) { |
|
|
|
newVoucher.setBussDate(voucher.getBussDate()); |
|
|
|
} |
|
|
|
BigDecimal sn = BigDecimal.ZERO; //上年返利
|
|
|
|
BigDecimal bn = BigDecimal.ZERO;//本年返利
|
|
|
|
BigDecimal cd = BigDecimal.ZERO;//承兑贴息
|
|
|
|
String timeFlag = ""; |
|
|
|
String deptNo = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
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); |
|
|
|
timeFlag = voucherDetail.getTimeFlag(); |
|
|
|
deptNo = voucherDetail.getDeptCode(); |
|
|
|
manufacturer = voucherDetail.getManufacturer(); |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15")) { |
|
|
|
sn = sn.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bn = bn.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
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); |
|
|
|
cd = cd.add(voucherDetail.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (sn.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利预提"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(sn)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bn.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利预提"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(bn)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (cd.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利预提"); |
|
|
|
dto1.setSubjectNo("2191.03"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setCredit(cd.toString()); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
|
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher)); |
|
|
@ -671,59 +910,110 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign { |
|
|
|
if (StringUtils.isNotBlank(voucher.getBussDate())) { |
|
|
|
newVoucher.setBussDate(voucher.getBussDate()); |
|
|
|
} |
|
|
|
BigDecimal cjfl = BigDecimal.ZERO;//厂家未兑现
|
|
|
|
BigDecimal snfl = BigDecimal.ZERO;//上年返利
|
|
|
|
BigDecimal bnfl = BigDecimal.ZERO;//本年返利
|
|
|
|
BigDecimal cjfltz = BigDecimal.ZERO;//厂家返利调整
|
|
|
|
BigDecimal snfltz = BigDecimal.ZERO;//上年返利调整
|
|
|
|
BigDecimal bnfltz = BigDecimal.ZERO;//本年返利调整
|
|
|
|
BigDecimal ndsy = BigDecimal.ZERO;//以前年度损益
|
|
|
|
String timeFlag = ""; |
|
|
|
String deptNo = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
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); |
|
|
|
} |
|
|
|
timeFlag = voucherDetail.getTimeFlag(); |
|
|
|
deptNo = voucherDetail.getDeptCode(); |
|
|
|
manufacturer = voucherDetail.getManufacturer(); |
|
|
|
BigDecimal amount = voucherDetail.getAmount(); |
|
|
|
if (voucherDetail.getRemarks().equals("返利上传")) { |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.16")) { |
|
|
|
cjfl = cjfl.add(amount); |
|
|
|
} |
|
|
|
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); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15")) { |
|
|
|
snfl = snfl.add(amount); |
|
|
|
} |
|
|
|
|
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bnfl = bnfl.add(amount); |
|
|
|
} |
|
|
|
} |
|
|
|
if (voucherDetail.getRemarks().equals("返利调整")) { |
|
|
|
if (voucherDetail.getSceneCode().equals("6401.13")) { |
|
|
|
cjfltz = cjfltz.add(amount); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.01.15")) { |
|
|
|
bnfltz = bnfltz.add(amount); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("1161.02.15")) { |
|
|
|
snfltz = snfltz.add(amount); |
|
|
|
} |
|
|
|
if (voucherDetail.getSceneCode().equals("6801")) { |
|
|
|
ndsy = ndsy.add(amount); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (cjfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.16"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(cjfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (snfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(snfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bnfl.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setCredit(String.valueOf(bnfl)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (cjfltz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传调整"); |
|
|
|
dto1.setSubjectNo("6401.13"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setDebit(cjfltz.negate().toString()); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (bnfltz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传调整"); |
|
|
|
dto1.setSubjectNo("1161.01.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(bnfltz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
if (snfltz.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传调整"); |
|
|
|
dto1.setSubjectNo("1161.02.15"); |
|
|
|
dto1.setDimensionDept(deptNo); |
|
|
|
dto1.setManufacturer(manufacturer); |
|
|
|
dto1.setDebit(String.valueOf(snfltz)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
|
if (ndsy.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
dto1.setSummary(timeFlag + "回款返利上传调整"); |
|
|
|
dto1.setSubjectNo("6801"); |
|
|
|
dto1.setCredit(String.valueOf(ndsy)); |
|
|
|
resultDetails.add(dto1); |
|
|
|
} |
|
|
|
newVoucher.setResultDetails(resultDetails); |
|
|
|
} |
|
|
|
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher)); |
|
|
|
return voucherService.saveVoucher(newVoucher); |
|
|
|