|
|
@ -8,6 +8,8 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.RandomUtil; |
|
|
|
import cn.hutool.core.util.RandomUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.csp.sentinel.annotation.SentinelResource; |
|
|
|
import com.alibaba.csp.sentinel.annotation.SentinelResource; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.dxhy.base.constant.TaxSeparateConfig; |
|
|
|
import com.dxhy.base.constant.TaxSeparateConfig; |
|
|
|
import com.dxhy.base.utils.PriceTaxSeparationUtilNew; |
|
|
|
import com.dxhy.base.utils.PriceTaxSeparationUtilNew; |
|
|
|
import com.dxhy.order.baseservice.config.BaseServiceConfig; |
|
|
|
import com.dxhy.order.baseservice.config.BaseServiceConfig; |
|
|
@ -46,6 +48,8 @@ import com.dxhy.order.consumer.modules.order.service.*; |
|
|
|
import com.dxhy.order.consumer.modules.validate.service.ValidateInterfaceOrderService; |
|
|
|
import com.dxhy.order.consumer.modules.validate.service.ValidateInterfaceOrderService; |
|
|
|
import com.dxhy.order.consumer.modules.validate.service.ValidateSpecialInvoiceService; |
|
|
|
import com.dxhy.order.consumer.modules.validate.service.ValidateSpecialInvoiceService; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.InterfaceBlockExceptionUtil; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.InterfaceBlockExceptionUtil; |
|
|
|
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.IsInput; |
|
|
|
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonRequestParam; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.ResponseV4BO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.ResponseV4BO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpcb.CbztcxReqBO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpcb.CbztcxReqBO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpcb.CbztcxRspBO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpcb.CbztcxRspBO; |
|
|
@ -5391,6 +5395,46 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
return resp; |
|
|
|
return resp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String syncAccountInfo(PoCommonRequestParam requestParam){ |
|
|
|
|
|
|
|
log.info("FI005推送会计凭证信息,{}",JSONObject.toJSONString(requestParam)); |
|
|
|
|
|
|
|
IsInput isInput = requestParam.getIS_INPUT(); |
|
|
|
|
|
|
|
String data = isInput.getZDATA(); |
|
|
|
|
|
|
|
JSONArray jsonArray = JSONObject.parseArray(data); |
|
|
|
|
|
|
|
StringBuffer PROMSG = new StringBuffer(); |
|
|
|
|
|
|
|
String PROTYP = "S"; |
|
|
|
|
|
|
|
for (Object t : jsonArray) { |
|
|
|
|
|
|
|
JSONObject jsonObject = (JSONObject)t; |
|
|
|
|
|
|
|
OrderInvoiceInfo invoiceInfo = new OrderInvoiceInfo(); |
|
|
|
|
|
|
|
invoiceInfo.setFpdm(jsonObject.getString("ZFPDM")); |
|
|
|
|
|
|
|
invoiceInfo.setFphm(jsonObject.getString("ZFPHM")); |
|
|
|
|
|
|
|
invoiceInfo.setVoucherNo(jsonObject.getString("BELNR"));//会计凭证号
|
|
|
|
|
|
|
|
invoiceInfo.setAccountDate(jsonObject.getString("BUDAT"));//过账日期
|
|
|
|
|
|
|
|
invoiceInfo.setCheckNo(jsonObject.getString("ZBZDH"));//报账单号
|
|
|
|
|
|
|
|
if(orderInvoiceInfoService.updateInvoiceInfoByNoAndCode(invoiceInfo, null) <= 0) { |
|
|
|
|
|
|
|
PROTYP = "E"; |
|
|
|
|
|
|
|
PROMSG.append(String.format("票据号码:%s-绑定失败!",jsonObject.getString("ZFPHM"))); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
PROMSG.append(String.format("票据号码:%s-绑定成功!",jsonObject.getString("ZFPHM"))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
JSONObject ZDATA = new JSONObject(); |
|
|
|
|
|
|
|
ZDATA.put("PROMSG",PROMSG.toString()); |
|
|
|
|
|
|
|
ZDATA.put("PROTYP",PROTYP); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject ES_OUTPUT = new JSONObject(); |
|
|
|
|
|
|
|
ES_OUTPUT.put("BSKEY",isInput.getBSKEY());//外围系统唯一标识
|
|
|
|
|
|
|
|
ES_OUTPUT.put("SAPKEY",isInput.getSAPKEY());//sap数据唯一标识
|
|
|
|
|
|
|
|
ES_OUTPUT.put("ZTYPE",PROTYP);//E 是失败,S 是成功
|
|
|
|
|
|
|
|
ES_OUTPUT.put("ZMESSAGE","E".equals(PROTYP)? "处理失败":"处理成功"); |
|
|
|
|
|
|
|
ES_OUTPUT.put("ZDATA",ZDATA); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject result = new JSONObject(); |
|
|
|
|
|
|
|
result.put("ES_OUTPUT",ES_OUTPUT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result.toJSONString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private GroupTaxRespBO syncGroupTax(GroupTaxReqBO groupTaxReqBO, String secretId) throws OrderReceiveException { |
|
|
|
private GroupTaxRespBO syncGroupTax(GroupTaxReqBO groupTaxReqBO, String secretId) throws OrderReceiveException { |
|
|
|
if (StringUtils.isEmpty(groupTaxReqBO.getSpmc())) { |
|
|
|
if (StringUtils.isEmpty(groupTaxReqBO.getSpmc())) { |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.SYNC_GROUP_TAX_009999.getKey(), OrderInfoContentEnum.SYNC_GROUP_TAX_009999.getMessage()); |
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.SYNC_GROUP_TAX_009999.getKey(), OrderInfoContentEnum.SYNC_GROUP_TAX_009999.getMessage()); |
|
|
|