feature:FI005接口开发

release
gaorl 2 years ago
parent f7e7bde462
commit d4a6ab3aee
  1. 16
      order-management-common/src/main/java/com/dxhy/order/model/OrderInvoiceInfo.java
  2. 11
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java
  3. 4
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/InterfaceServiceV3.java
  4. 44
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/InterfaceServiceImplV3.java
  5. 8
      order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoice/dao/OrderInvoiceInfoMapper.java
  6. 3
      order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoice/service/OrderInvoiceInfoService.java
  7. 5
      order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoice/service/impl/OrderInvoiceInfoServiceImpl.java
  8. 41
      order-management-invoice/src/main/resources/mybatis/mapper/OrderInvoiceInfoMapper.xml

@ -327,6 +327,20 @@ public class OrderInvoiceInfo implements Serializable {
* 税控错误描述 * 税控错误描述
*/ */
private String skcwms; private String skcwms;
/**
* Open Text Id
*/
private String docuId; private String docuId;
/**
* 凭证号
*/
private String voucherNo;
/**
* 过账日期
*/
private String accountDate;
/**
* 报账单号
*/
private String checkNo;
} }

@ -2,6 +2,7 @@ package com.dxhy.order.consumer.openapi.api;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.baseservice.config.BaseServiceConfig; import com.dxhy.order.baseservice.config.BaseServiceConfig;
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxReqBO; import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxReqBO;
@ -22,6 +23,7 @@ import com.dxhy.order.consumer.constant.RespStatusEnum;
import com.dxhy.order.consumer.openapi.protocol.CheckResult; import com.dxhy.order.consumer.openapi.protocol.CheckResult;
import com.dxhy.order.consumer.openapi.protocol.CommonRequestParam; import com.dxhy.order.consumer.openapi.protocol.CommonRequestParam;
import com.dxhy.order.consumer.openapi.protocol.po.EsOutput; import com.dxhy.order.consumer.openapi.protocol.po.EsOutput;
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.po.PoCommonRequestParam;
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonResponseParam; import com.dxhy.order.consumer.openapi.protocol.po.PoCommonResponseParam;
import com.dxhy.order.consumer.openapi.protocol.v4.fpyl.FpylcxReqBO; import com.dxhy.order.consumer.openapi.protocol.v4.fpyl.FpylcxReqBO;
@ -42,6 +44,7 @@ import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.MdmGmfxxtbReqBO;
import com.dxhy.order.consumer.openapi.service.*; import com.dxhy.order.consumer.openapi.service.*;
import com.dxhy.order.consumer.utils.BeanTransitionUtils; import com.dxhy.order.consumer.utils.BeanTransitionUtils;
import com.dxhy.order.exception.OrderReceiveException; import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.OrderInvoiceInfo;
import com.dxhy.order.utils.HttpUtils; import com.dxhy.order.utils.HttpUtils;
import com.dxhy.order.utils.JsonUtils; import com.dxhy.order.utils.JsonUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -395,11 +398,15 @@ public class InvoiceRestApiV6 {
return returnJsonString = ""; return returnJsonString = "";
}else if(ConfigurerInfo.transferTojx.equals(interfaceName)){ }else if(ConfigurerInfo.transferTojx.equals(interfaceName)){
log.info("开始调用进项接口"); log.info("开始调用进项接口");
//根据发票代码 + 号码更新字段
PoCommonRequestParam requestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class);
String result = interfaceServiceV3.syncAccountInfo(requestParam);
Map<String,String> headMap = new HashMap<>(); Map<String,String> headMap = new HashMap<>();
headMap.put("token",ConfigureConstant.POTOKEN); headMap.put("token",ConfigureConstant.POTOKEN);
String s = HttpUtils.doPostWithHeader(jxUrl,reqStr,headMap); String s = HttpUtils.doPostWithHeader(jxUrl,reqStr,headMap);
log.info("进项接口返回:{}",s); log.info("进项接口返回:{}",result);
return s; return result;
} else { } else {
returnJsonString = ""; returnJsonString = "";
} }

@ -11,6 +11,7 @@ import com.dxhy.order.baseservice.openapi.model.SksbxxtbRspBO;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxcxRspBO; import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxcxRspBO;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxtbReqBO; import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxtbReqBO;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxtbRspBO; import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxtbRspBO;
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;
@ -44,6 +45,7 @@ import com.dxhy.order.consumer.openapi.protocol.v4.taxequipment.SksbxxCxReqBO;
import com.dxhy.order.consumer.openapi.protocol.v4.taxequipment.SksbxxCxRspBO; import com.dxhy.order.consumer.openapi.protocol.v4.taxequipment.SksbxxCxRspBO;
import com.dxhy.order.consumer.openapi.protocol.v4.zpjsqr.ZpjsqrReqBO; import com.dxhy.order.consumer.openapi.protocol.v4.zpjsqr.ZpjsqrReqBO;
import com.dxhy.order.consumer.openapi.protocol.v4.zpjsqr.ZpjsqrRspBO; import com.dxhy.order.consumer.openapi.protocol.v4.zpjsqr.ZpjsqrRspBO;
import com.dxhy.order.model.OrderInvoiceInfo;
import java.util.List; import java.util.List;
@ -382,4 +384,6 @@ public interface InterfaceServiceV3 {
* @return * @return
*/ */
List<GroupTaxRespBO> syncGroupTax(List<GroupTaxReqBO> groupTaxReqBO, String secretId); List<GroupTaxRespBO> syncGroupTax(List<GroupTaxReqBO> groupTaxReqBO, String secretId);
String syncAccountInfo(PoCommonRequestParam requestParam);
} }

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

@ -37,6 +37,14 @@ public interface OrderInvoiceInfoMapper {
*/ */
int updateOrderInvoiceInfoByFpqqlsh(@Param("orderInvoiceInfo") OrderInvoiceInfo record, @Param("shList") List<String> shList); int updateOrderInvoiceInfoByFpqqlsh(@Param("orderInvoiceInfo") OrderInvoiceInfo record, @Param("shList") List<String> shList);
/**
* 根据发票号码 + 发票代码更新发票数据
*
* @param record
* @param shList
* @return
*/
int updateInvoiceInfoByNoAndCode(@Param("orderInvoiceInfo") OrderInvoiceInfo record, @Param("shList") List<String> shList);
/** /**
* 根据发票代码号码查询数据 * 根据发票代码号码查询数据
* *

@ -9,6 +9,7 @@ import com.dxhy.order.baseservice.module.thirdservice.rabbitmq.model.RabbitMqCom
import com.dxhy.order.invoice.module.invoice.model.FileDownLoad; import com.dxhy.order.invoice.module.invoice.model.FileDownLoad;
import com.dxhy.order.invoice.module.invoice.model.bo.QueryCountInvoiceBO; import com.dxhy.order.invoice.module.invoice.model.bo.QueryCountInvoiceBO;
import com.dxhy.order.invoice.module.invoice.model.vo.*; import com.dxhy.order.invoice.module.invoice.model.vo.*;
import org.apache.ibatis.annotations.Param;
import java.io.File; import java.io.File;
import java.io.OutputStream; import java.io.OutputStream;
@ -118,6 +119,8 @@ public interface OrderInvoiceInfoService {
*/ */
int updateDyztByFpqqlsh(String fpqqlsh, String dyzt, String dyztms, List<String> shList); int updateDyztByFpqqlsh(String fpqqlsh, String dyzt, String dyztms, List<String> shList);
int updateInvoiceInfoByNoAndCode(OrderInvoiceInfo invoiceInfo, List<String> shList);
/** /**
* 根据发票id更新发票信息 * 根据发票id更新发票信息
* *

@ -265,6 +265,11 @@ public class OrderInvoiceInfoServiceImpl implements OrderInvoiceInfoService {
} }
@Override
public int updateInvoiceInfoByNoAndCode(OrderInvoiceInfo invoiceInfo, List<String> shList){
return orderInvoiceInfoMapper.updateInvoiceInfoByNoAndCode(invoiceInfo,shList);
}
/** /**
* 插入发票数据统一入口 * 插入发票数据统一入口
* *

@ -885,6 +885,47 @@
</if> </if>
</where> </where>
</update> </update>
<update id="updateInvoiceInfoByNoAndCode" parameterType="com.dxhy.order.model.OrderInvoiceInfo">
update order_invoice_info
<set>
<if test="orderInvoiceInfo.voucherNo != null">
voucher_no = #{orderInvoiceInfo.voucherNo,jdbcType=VARCHAR},
</if>
<if test="orderInvoiceInfo.accountDate != null">
account_date = #{orderInvoiceInfo.accountDate,jdbcType=VARCHAR},
</if>
<if test="orderInvoiceInfo.checkNo != null">
check_no = #{orderInvoiceInfo.checkNo,jdbcType=VARCHAR},
</if>
</set>
<where>
<if test="orderInvoiceInfo.fpqqlsh != null">
and fpqqlsh = #{orderInvoiceInfo.fpqqlsh,jdbcType=VARCHAR}
</if>
<if test="orderInvoiceInfo.fpdm != null and orderInvoiceInfo.fpdm != ''">
fpdm = #{orderInvoiceInfo.fpdm,jdbcType=VARCHAR},
</if>
<if test="orderInvoiceInfo.fphm != null and orderInvoiceInfo.fphm != ''">
fphm = #{orderInvoiceInfo.fphm,jdbcType=VARCHAR},
</if>
<if test="shList != null and shList.size() == 0">
and xhf_nsrsbh = ''
</if>
<if test="shList != null and shList.size() == 1">
and xhf_nsrsbh =
<foreach collection="shList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="shList != null and shList.size() > 1">
and xhf_nsrsbh in
<foreach collection="shList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</update>
<select id="selectOrderInvoiceInfoByFpdmAndFphm" resultMap="BaseResultMap" <select id="selectOrderInvoiceInfoByFpdmAndFphm" resultMap="BaseResultMap"
parameterType="java.lang.String"> parameterType="java.lang.String">

Loading…
Cancel
Save