|
|
|
@ -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()); |
|
|
|
|