fix: 推送发票数据问题修复

release
liufeilong 2 years ago
parent 730088b5ec
commit 9c7f506b49
  1. 20
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java
  2. 6
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/protocol/po/generateinvoicepush/sap/FpkjtsMxSap.java

@ -83,7 +83,9 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@ -1304,7 +1306,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
FpkjtsReqSap fpkjtsReqSap = new FpkjtsReqSap();
List<FpkjtsMxSap> itemList = new ArrayList<>();
//主信息
fpkjtsReqSap.setZJSDH(ddfpxx.getDDH());
fpkjtsReqSap.setZJSDH(orderProcessInfo.getOriginDdh());
fpkjtsReqSap.setZFPDM(ddfpxx.getFPDM());
fpkjtsReqSap.setZFPHM(ddfpxx.getFPHM());
fpkjtsReqSap.setZFPLX(CommonUtils.transToSnFplxdm(ddfpxx.getFPLXDM()));
@ -1315,7 +1317,15 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
fpkjtsReqSap.setZHSJEY(ddfpxx.getJSHJ());
fpkjtsReqSap.setZZBZ(ddfpxx.getBZ());
fpkjtsReqSap.setZFPZT(ConfigureConstant.STRING_0);//0-正常、1-作废
fpkjtsReqSap.setZKPRQ(ddfpxx.getKPRQ());
String formatKprq = "";
try {
Date date = (Date) new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ddfpxx.getKPRQ());
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
formatKprq = sdf.format(date);
}catch (Exception e){
log.error("{}发票推送SAP格式化开票日期错误:{}",LOGGER_MSG,e);
}
fpkjtsReqSap.setZKPRQ(formatKprq);
fpkjtsReqSap.setZGFMC(ddfpxx.getGMFMC());
fpkjtsReqSap.setZGFSH(ddfpxx.getGMFSBH());
fpkjtsReqSap.setZXFMC(ddfpxx.getXHFMC());
@ -1335,14 +1345,16 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
detail.setZFPDM(ddfpxx.getFPDM());
detail.setZFPHM(ddfpxx.getFPHM());
detail.setZFPHH(f.getXH());
detail.setMATNR(f.getZXBM());
DecimalFormat g1=new DecimalFormat("000000000000000000");
detail.setMATNR(g1.format(Integer.valueOf(f.getZXBM())));
detail.setZGGXH(f.getGGXH());
detail.setZSLDW(f.getDW());
detail.setZZSL(f.getSPSL());
detail.setZTAX(f.getSL());
detail.setZTAX(new BigDecimal(f.getSL()).multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString());
detail.setZBHSJEY(f.getJE());
detail.setZZSEY(f.getSE());
detail.setZHSJEY(new BigDecimal(f.getJE()).add(new BigDecimal(f.getSE())).toString());
detail.setZZDJFP((new BigDecimal(f.getJE()).add(new BigDecimal(f.getSE())).divide(new BigDecimal(f.getSPSL()),8, BigDecimal.ROUND_HALF_EVEN).toString()));
detail.setINVOICEDATE(ddfpxx.getKPRQ());
detail.setINVOICETYPE(ddfpxx.getFPLXDM());
detail.setZHWMC(f.getXMMC());

@ -1,5 +1,6 @@
package com.dxhy.order.consumer.openapi.protocol.po.generateinvoicepush.sap;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
/**
@ -62,20 +63,23 @@ public class FpkjtsMxSap {
*/
private String ZHSJE;
/**
* 单价(发票)
* 单价(发票) 和成伟确认 这个单价是含税的必传含税金额/数量=含税单价 保留八位小数
*/
private String ZZDJFP;
/**
* 不含税金额(SAP)金税系统开票不含税金额
*/
@JSONField(name = "ZBHSJE_Y")
private String ZBHSJEY;
/**
* 税额(发票)金税系统开票总税额
*/
@JSONField(name = "ZZSE_Y")
private String ZZSEY;
/**
* 含税金额(发票)金税系统开票含税总额
*/
@JSONField(name = "ZHSJE_Y")
private String ZHSJEY;
/**
* 不含税金额(差额)"金税系统与SAP差额-不含税ZBHSJE_Y- ZBHSJE"

Loading…
Cancel
Save