|
|
|
@ -19,7 +19,9 @@ import com.dxhy.common.vo.TaxOrgCode; |
|
|
|
|
import com.dxhy.erp.dao.*; |
|
|
|
|
import com.dxhy.erp.entity.*; |
|
|
|
|
import com.dxhy.erp.entity.sdny.*; |
|
|
|
|
import com.dxhy.erp.model.InvoiceDetailInfo; |
|
|
|
|
import com.dxhy.erp.service.*; |
|
|
|
|
import com.dxhy.erp.service.impl.GatherServiceImpl; |
|
|
|
|
import com.dxhy.erp.utils.Base64; |
|
|
|
|
import com.dxhy.erp.utils.HmacSHA1Util; |
|
|
|
|
import com.dxhy.erp.utils.ServiceResult; |
|
|
|
@ -96,6 +98,12 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private TdxPlatformCheckLogService platfromCheckLogService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private MryxInterfaceService mryxInterfaceService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GatherService gatherService; |
|
|
|
|
/** |
|
|
|
|
* 查验发票 |
|
|
|
|
*/ |
|
|
|
@ -344,7 +352,11 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
checkInvoice.put("totalTax", checkInvoice.getString("taxAmount")); |
|
|
|
|
checkInvoice.put("amountTax", checkInvoice.getString("totalAmount")); |
|
|
|
|
checkInvoice.put("totalAmount", checkInvoice.getString("invoiceAmount")); |
|
|
|
|
String invoiceCode = checkInvoice.get("invoiceCode").toString(); |
|
|
|
|
//添加非空判断
|
|
|
|
|
String invoiceCode = null; |
|
|
|
|
if ( checkInvoice.get("invoiceCode") != null){ |
|
|
|
|
invoiceCode = checkInvoice.get("invoiceCode").toString(); |
|
|
|
|
} |
|
|
|
|
String invoiceType = checkInvoice.get("invoiceType").toString(); |
|
|
|
|
if ("22".equals(invoiceType)) { |
|
|
|
|
invoiceType = "33"; |
|
|
|
@ -727,6 +739,14 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
|
|
|
|
|
List<SNInvoiceDetail> invoiceLineList = snInvoice.getInvoiceLineList(); |
|
|
|
|
List<SAPInvoiceDetail> sapInvoiceDetailList = new ArrayList<>(); |
|
|
|
|
//查询明细
|
|
|
|
|
String uuid = snInvoice.getInvoiceCode() + snInvoice.getInvoiceNumber(); |
|
|
|
|
if (StringUtils.isBlank(snInvoice.getInvoiceCode())){ |
|
|
|
|
uuid = snInvoice.getInvoiceNumber(); |
|
|
|
|
} |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); |
|
|
|
|
List<InvoiceDetailInfo> detailInfo = mryxInterfaceService.getDetailInfo(uuid); |
|
|
|
|
|
|
|
|
|
if (invoiceLineList != null && invoiceLineList.size() > 0) { |
|
|
|
|
for (SNInvoiceDetail snInvoiceDetail : invoiceLineList) { |
|
|
|
|
SAPInvoiceDetail sapInvoiceDetail = new SAPInvoiceDetail(); |
|
|
|
@ -780,7 +800,18 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
sapInvoiceDetail.setZCYR(info.getZCYRMC()); |
|
|
|
|
sapInvoiceDetail.setZDW(snInvoiceDetail.getUnit()); |
|
|
|
|
sapInvoiceDetail.setZGSJBM(snInvoiceDetail.getCommodityCode()); |
|
|
|
|
if (StringUtils.isNotBlank(snInvoiceDetail.getTax())){ |
|
|
|
|
|
|
|
|
|
sapInvoiceDetail.setZSE(snInvoiceDetail.getTax()); |
|
|
|
|
}else { |
|
|
|
|
if (detailInfo != null && !detailInfo.isEmpty()){ |
|
|
|
|
for (InvoiceDetailInfo invoiceDetailInfo : detailInfo) { |
|
|
|
|
if (StringUtils.isNotBlank(invoiceDetailInfo.getDetailNo()) && invoiceDetailInfo.getDetailNo().equals(snInvoiceDetail.getRowNo())) { |
|
|
|
|
sapInvoiceDetail.setZSE(invoiceDetailInfo.getTaxAmount()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
sapInvoiceDetail.setZSL(snInvoiceDetail.getQuantity()); |
|
|
|
|
String zsmTax = snInvoiceDetail.getTaxRate(); |
|
|
|
|
if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4){ |
|
|
|
|