销项管理系统开放接口v6新增SdEnergyMdmKsSyncBuyerInfo,同步山能MDM客商API数据;数据库新增字段invoice_name,invoice_taxno,mdm_multicode_json存放山能数据

gongquanlin 2 years ago committed by WangQi
parent 0330839b89
commit 59be0d87e9
  1. 16
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/model/BuyerEntity.java
  2. 15
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/GmfxxtbReqBO.java
  3. 27
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/sdenergy/MdmGmfxxtbMulticodeBO.java
  4. 54
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/sdenergy/MdmGmfxxtbMulticodeValuelistBO.java
  5. 187
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/protocol/sdenergy/MdmGmfxxtbReqBO.java
  6. 46
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/service/impl/BuyerServiceImpl.java
  7. 44
      order-management-base-service/src/main/resources/mybatis/mapper/BuyerMapper.xml
  8. 5
      order-management-common/src/main/java/com/dxhy/order/constant/ConfigurerInfo.java
  9. 90
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java
  10. 8
      order-management-consumer/src/main/java/com/dxhy/order/consumer/utils/BeanTransitionUtils.java

@ -100,4 +100,20 @@ public class BuyerEntity implements Serializable {
* 是否大数据结果,仅供前端判断是否调用精确查询使用
*/
private String isPlatform;
/**
* 山能 MDM 客户API 里的开票名称字段DESC48
*/
private String invoiceName;
/**
* 山能 MDM 客户API 里的开票税号字段DESC49
*/
private String invoiceTaxno;
/**
* 山能 MDM 客户API 里的MULTICODE字段json
*/
private String mdmMulticodeJson;
}

@ -22,4 +22,19 @@ public class GmfxxtbReqBO extends GmfxxBO implements Serializable {
* 操作类型
*/
private String CZLX;
/**
* 山能 MDM 客户API 里的MULTICODE字段json
*/
private String MDM_MULTICODE_JSON;
/**
* 山能 MDM 客户API 里的开票名称字段DESC48
*/
private String INVOICE_NAME;
/**
* 山能 MDM 客户API 里的开票税号字段DESC49
*/
private String INVOICE_TAXNO;
}

@ -0,0 +1,27 @@
package com.dxhy.order.baseservice.module.buyer.protocol.sdenergy;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.ToString;
import java.util.List;
/**
* @Description MdmGmfxxtbReqBO中的MULTICODE字段
* @Author 巩权林
* @Date 2023/2/9 09:33
**/
@ToString
public class MdmGmfxxtbMulticodeBO {
@JSONField(name = "VALUELIST")
private List<MdmGmfxxtbMulticodeValuelistBO> VALUELIST;
public void setVALUELIST(List<MdmGmfxxtbMulticodeValuelistBO> VALUELIST) {
this.VALUELIST = VALUELIST;
}
public List<MdmGmfxxtbMulticodeValuelistBO> getVALUELIST() {
return VALUELIST;
}
}

@ -0,0 +1,54 @@
package com.dxhy.order.baseservice.module.buyer.protocol.sdenergy;
import lombok.ToString;
/**
* @Description MdmGmfxxtbMulticodeReqBO中的VALUELIST字段
* @Author 巩权林
* @Date 2023/2/9 09:33
**/
@ToString
public class MdmGmfxxtbMulticodeValuelistBO {
// 银行名称的值
private String DESC3;
// 银行账号的值
private String DESC4;
// 节点编码的值
private String LISTCODE;
// A4
private String SPECIALITYCODE;
public void setDESC3(String DESC3) {
this.DESC3 = DESC3;
}
public String getDESC3() {
return DESC3;
}
public void setDESC4(String DESC4) {
this.DESC4 = DESC4;
}
public String getDESC4() {
return DESC4;
}
public void setLISTCODE(String LISTCODE) {
this.LISTCODE = LISTCODE;
}
public String getLISTCODE() {
return LISTCODE;
}
public void setSPECIALITYCODE(String SPECIALITYCODE) {
this.SPECIALITYCODE = SPECIALITYCODE;
}
public String getSPECIALITYCODE() {
return SPECIALITYCODE;
}
}

@ -0,0 +1,187 @@
package com.dxhy.order.baseservice.module.buyer.protocol.sdenergy;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.ToString;
/**
* @Description 山东能源 MDM 客商 购买方信息接口BO
* @Author 巩权林
* @Date 2023/2/9 09:31
**/
@ToString
public class MdmGmfxxtbReqBO {
// 主编码的值
private String CODE;
// 业务伙伴全称的值
private String DESC1;
// 法人代表的值
private String DESC12;
// 统一社会信用代码(税号)的值
private String DESC14;
// 省份的值
private String DESC22;
// 城市的值
private String DESC23;
// 街道/门牌号的值
private String DESC24;
// 公司电话的值
private String DESC26;
// 手机号
private String DESC27;
// 邮箱
private String DESC29;
// 是否客户的值
private String DESC38;
// 是否供应商的值
private String DESC39;
// 开票名称的值
private String DESC48;
// 开票税号的值
private String DESC49;
@JSONField(name = "MULTICODE")
private MdmGmfxxtbMulticodeBO MULTICODE;
private String UUID;
public void setCODE(String CODE) {
this.CODE = CODE;
}
public String getCODE() {
return CODE;
}
public void setDESC1(String DESC1) {
this.DESC1 = DESC1;
}
public String getDESC1() {
return DESC1;
}
public void setDESC12(String DESC12) {
this.DESC12 = DESC12;
}
public String getDESC12() {
return DESC12;
}
public void setDESC14(String DESC14) {
this.DESC14 = DESC14;
}
public String getDESC14() {
return DESC14;
}
public void setDESC22(String DESC22) {
this.DESC22 = DESC22;
}
public String getDESC22() {
return DESC22;
}
public void setDESC23(String DESC23) {
this.DESC23 = DESC23;
}
public String getDESC23() {
return DESC23;
}
public void setDESC24(String DESC24) {
this.DESC24 = DESC24;
}
public String getDESC24() {
return DESC24;
}
public void setDESC26(String DESC26) {
this.DESC26 = DESC26;
}
public String getDESC26() {
return DESC26;
}
public void setDESC38(String DESC38) {
this.DESC38 = DESC38;
}
public String getDESC38() {
return DESC38;
}
public void setDESC39(String DESC39) {
this.DESC39 = DESC39;
}
public String getDESC39() {
return DESC39;
}
public void setDESC48(String DESC48) {
this.DESC48 = DESC48;
}
public String getDESC48() {
return DESC48;
}
public void setDESC49(String DESC49) {
this.DESC49 = DESC49;
}
public String getDESC49() {
return DESC49;
}
public void setMULTICODE(MdmGmfxxtbMulticodeBO MULTICODE) {
this.MULTICODE = MULTICODE;
}
public MdmGmfxxtbMulticodeBO getMULTICODE() {
return MULTICODE;
}
public void setUUID(String UUID) {
this.UUID = UUID;
}
public String getUUID() {
return UUID;
}
public String getDESC27() {
return DESC27;
}
public void setDESC27(String DESC27) {
this.DESC27 = DESC27;
}
public String getDESC29() {
return DESC29;
}
public void setDESC29(String DESC29) {
this.DESC29 = DESC29;
}
}

@ -287,6 +287,18 @@ public class BuyerServiceImpl implements BuyerService {
orderInfoContentEnum = OrderInfoContentEnum.BUYER_MESSAGE_SYNC_DELETE;
}
break;
case "3":
// 先查后更新,针对山能MDM可能回重复推送的问题,先查,如果存在则更新,不存在则udpate
if (Objects.nonNull(buyerEntityOld)) {
// 存在则更新
buyerEntity.setId(buyerEntityOld.getId());
buyerMapper.updateBuyer(buyerEntity, shList);
} else if (Objects.isNull(buyerEntityOld)) {
// 不存在则插入
buyerEntity.setId(baseService.getGenerateShotKey());
buyerMapper.insertBuyer(buyerEntity);
}
break;
default:
log.error("不存在的类型");
break;
@ -547,13 +559,14 @@ public class BuyerServiceImpl implements BuyerService {
/**
* 自动获取购方企业信息
*
* @param ghfMc
* @param shList
* @return
*/
public List<BuyerEntity> autoQueryBuyerInfoList(String ghfMc, List<String> shList, List<String> entList) {
log.info("{}自动查询购方信息,请求纳税人识别号:{},数据权限列表:{},请求购方名称为:{}",LOGGER_MSG, shList,entList,ghfMc);
List<BuyerEntity> dataList = queryBuyerByName(ghfMc, shList,entList);
log.info("{}自动查询购方信息,请求纳税人识别号:{},数据权限列表:{},请求购方名称为:{}", LOGGER_MSG, shList, entList, ghfMc);
List<BuyerEntity> dataList = queryBuyerByName(ghfMc, shList, entList);
log.info("{}本地调用购方发票列表结果{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(dataList));
if (ObjectUtil.isEmpty(dataList) && ConfigureConstant.STRING_Y.equals(baseServiceConfig.configUseBigDataProcessBuyer())) {
log.info("{}本地调用购方发票列表数据为空,开始调用大数据接口", LOGGER_MSG);
@ -567,18 +580,19 @@ public class BuyerServiceImpl implements BuyerService {
/**
* 自动获取购方企业信息
*
* @param ghfMc
* @param shList
* @return
*/
public BuyerEntity autoQueryBuyerInfo(String ghfMc, List<String> shList, List<String> entList) {
BuyerEntity buyerEntity = new BuyerEntity();
log.info("{}自动查询购方信息,请求纳税人识别号:{},请求购方名称为:{}",LOGGER_MSG, shList,ghfMc);
List<BuyerEntity> dataList = queryBuyerByName(ghfMc, shList,entList);
log.info("{}自动查询购方信息,请求纳税人识别号:{},请求购方名称为:{}", LOGGER_MSG, shList, ghfMc);
List<BuyerEntity> dataList = queryBuyerByName(ghfMc, shList, entList);
log.info("{}本地调用购方发票列表结果{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(dataList));
if(ObjectUtil.isNotEmpty(dataList)){
if (ObjectUtil.isNotEmpty(dataList)) {
buyerEntity = dataList.get(0);
}else{
} else {
//如果返回数据为空或者返回数据不为空,但是购方地址或购方银行为空时
boolean usePlatform = false;
if (ObjectUtil.isEmpty(dataList)) {
@ -600,6 +614,7 @@ public class BuyerServiceImpl implements BuyerService {
/**
* 调用大象云平台企业模糊查询
*
* @param purchaseName
* @return
*/
@ -609,15 +624,15 @@ public class BuyerServiceImpl implements BuyerService {
//判断使用新版还是旧版,
String useOpenApiNew = baseServiceConfig.getUseOpenApiNew();
if(StringUtils.isNotBlank(useOpenApiNew) && ConfigureConstant.STRING_Y.equals(useOpenApiNew)) {
if (StringUtils.isNotBlank(useOpenApiNew) && ConfigureConstant.STRING_Y.equals(useOpenApiNew)) {
OpenApiGfxxCxReq openApiGfxxCxReq = new OpenApiGfxxCxReq();
openApiGfxxCxReq.setNsrmc(purchaseName);
log.info("{}调用开放平台企业模糊查询接口content内容:{}",LOGGER_MSG, JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
log.info("{}调用开放平台企业模糊查询接口content内容:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
Map<String, Object> response = openApiService.openApiGfxxCx(baseServiceConfig.configFuzzyQuery(),JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
Map<String, Object> response = openApiService.openApiGfxxCx(baseServiceConfig.configFuzzyQuery(), JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
log.info("{}调用开放平台企业模糊查询结果:{} ", LOGGER_MSG, JsonUtils.getInstance().toJsonString(response));
if (ObjectUtil.isNotEmpty(response) && ConfigureConstant.STRING_0000.equals(String.valueOf(response.get(OrderManagementConstant.CODE)))) {
@ -638,7 +653,7 @@ public class BuyerServiceImpl implements BuyerService {
}
}
}else{
} else {
Map<String, String> headMap = new HashMap<>(2);
Map<String, String> requestMap = new HashMap<>(2);
@ -676,6 +691,7 @@ public class BuyerServiceImpl implements BuyerService {
/**
* 调用大象云平台企业精确查询
*
* @param purchaseName
* @return
*/
@ -684,21 +700,21 @@ public class BuyerServiceImpl implements BuyerService {
try {
String useOpenApiNew = baseServiceConfig.getUseOpenApiNew();
if(StringUtils.isNotBlank(useOpenApiNew) && ConfigureConstant.STRING_Y.equals(useOpenApiNew)){
if (StringUtils.isNotBlank(useOpenApiNew) && ConfigureConstant.STRING_Y.equals(useOpenApiNew)) {
OpenApiGfxxCxReq openApiGfxxCxReq = new OpenApiGfxxCxReq();
openApiGfxxCxReq.setNsrmc(purchaseName);
log.info("{}调用开放平台企业精确查询接口content内容:{}",LOGGER_MSG, JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
log.info("{}调用开放平台企业精确查询接口content内容:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
Map<String, Object> response = openApiService.openApiGfxxCx(baseServiceConfig.configExactQuery(),JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
Map<String, Object> response = openApiService.openApiGfxxCx(baseServiceConfig.configExactQuery(), JsonUtils.getInstance().toJsonString(openApiGfxxCxReq));
log.info("{}调用开放平台企业精确查询结果:{} ", LOGGER_MSG, JsonUtils.getInstance().toJsonString(response));
if (ObjectUtil.isNotEmpty(response) && ConfigureConstant.STRING_0000.equals(String.valueOf(response.get(OrderManagementConstant.CODE)))) {
OpenApiGfxxCxData openApiGfxxCxData = JsonUtils.getInstance().parseObject(String.valueOf(response.get(OrderManagementConstant.DATA)), OpenApiExactQueryRsp.class).getData();
if(ObjectUtil.isNotNull(openApiGfxxCxData)){
if (ObjectUtil.isNotNull(openApiGfxxCxData)) {
buyerEntity.setPurchaseName(openApiGfxxCxData.getNsrmc());
buyerEntity.setTaxpayerCode(openApiGfxxCxData.getNsrsbh());
buyerEntity.setAddress(openApiGfxxCxData.getZcdwdz());
@ -709,7 +725,7 @@ public class BuyerServiceImpl implements BuyerService {
}
}
}else{
} else {
Map<String, String> headMap = new HashMap<>(2);
Map<String, String> requestMap = new HashMap<>(2);
requestMap.put("ptcode", baseServiceConfig.configBigDataPtCode());

@ -21,11 +21,13 @@
<result column="xhf_nsrsbh" jdbcType="VARCHAR" property="xhfNsrsbh"/>
<result column="xhf_mc" jdbcType="VARCHAR" property="xhfMc"/>
<result column="buyer_code" jdbcType="VARCHAR" property="buyerCode"/>
<result column="invoice_name" jdbcType="VARCHAR" property="invoiceName"/>
<result column="invoice_taxno" jdbcType="VARCHAR" property="invoiceTaxno"/>
<result column="mdm_multicode_json" jdbcType="VARCHAR" property="mdmMulticodeJson"/>
</resultMap>
<sql id="Buyer_Base_Column_List">
id
,taxpayer_code,purchase_name,address,phone,bank_of_deposit,bank_number,email,sjh,remarks,create_time,create_user_id,modify_time,modify_user_id,ghf_qylx,xhf_nsrsbh,xhf_mc,buyer_code
id,taxpayer_code,purchase_name,address,phone,bank_of_deposit,bank_number,email,sjh,remarks,create_time,create_user_id,modify_time,modify_user_id,ghf_qylx,xhf_nsrsbh,xhf_mc,buyer_code,invoice_name,invoice_taxno,mdm_multicode_json
</sql>
<!-- 查询 -->
<select parameterType="map" id="selectBuyerList" resultMap="BaseResultMap">
@ -228,6 +230,15 @@
<if test="buyer.buyerCode != null ">
buyer_code = #{buyer.buyerCode,jdbcType=VARCHAR},
</if>
<if test="buyer.invoiceName != null ">
invoice_name = #{buyer.invoiceName,jdbcType=VARCHAR},
</if>
<if test="buyer.invoiceTaxno != null ">
invoice_taxno = #{buyer.invoiceTaxno,jdbcType=VARCHAR},
</if>
<if test="buyer.mdmMulticodeJson != null ">
mdm_multicode_json = #{buyer.mdmMulticodeJson,jdbcType=VARCHAR},
</if>
</set>
<where>
id = #{buyer.id,jdbcType=VARCHAR}
@ -304,6 +315,16 @@
<if test="buyerCode != null">
buyer_code,
</if>
<if test="invoiceName != null">
invoice_name,
</if>
<if test="invoiceTaxno != null">
invoice_taxno,
</if>
<if test="mdmMulticodeJson != null">
mdm_multicode_json,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -364,6 +385,15 @@
<if test="buyerCode != null">
#{buyerCode,jdbcType=VARCHAR},
</if>
<if test="invoiceName != null">
#{invoiceName,jdbcType=VARCHAR},
</if>
<if test="invoiceTaxno != null">
#{invoiceTaxno,jdbcType=VARCHAR},
</if>
<if test="mdmMulticodeJson != null">
#{mdmMulticodeJson,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="insertBuyerByList">
@ -385,7 +415,10 @@
ghf_qylx,
xhf_nsrsbh,
xhf_mc,
buyer_code
buyer_code,
invoice_name,
invoice_taxno,
mdm_multicode_json
)
values
<foreach collection="list" item="item" index="index"
@ -408,7 +441,10 @@
#{item.ghfQylx,jdbcType=VARCHAR},
#{item.xhfNsrsbh,jdbcType=VARCHAR},
#{item.xhfMc,jdbcType=VARCHAR},
#{item.buyerCode,jdbcType=VARCHAR}
#{item.buyerCode,jdbcType=VARCHAR},
#{item.invoiceName,jdbcType=VARCHAR},
#{item.invoiceTaxno,jdbcType=VARCHAR},
#{item.mdmMulticodeJson,jdbcType=VARCHAR}
)
</foreach>
</insert>

@ -233,6 +233,11 @@ public class ConfigurerInfo {
*/
public static final String SYNCBUYERINFO = "SyncBuyerInfo";
/**
* 山能MDM客商购买方信息同步接口
*/
public static final String SDENERGY_MDM_KS_SYNCBUYERINFO = "SdEnergyMdmKsSyncBuyerInfo";
/**
* 税控设备信息同步接口
*/

@ -6,6 +6,8 @@ import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxReqBO;
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxRspBO;
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxtbReqBO;
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxtbRspBO;
import com.dxhy.order.baseservice.module.buyer.protocol.sdenergy.MdmGmfxxtbMulticodeValuelistBO;
import com.dxhy.order.baseservice.module.buyer.protocol.sdenergy.MdmGmfxxtbReqBO;
import com.dxhy.order.baseservice.module.commodity.model.protocol.SpxxcxReqBO;
import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.ConfigurerInfo;
@ -39,18 +41,21 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import static org.joda.time.DateTime.now;
/**
* 订单对外接口入口
*
* @author: <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @createDate: Created in 2022-10-10
*/
@ -77,16 +82,16 @@ public class InvoiceRestApiV6 {
private InterfaceServiceV6 interfaceServiceV6;
/**
* 统一SDK对外接口方法
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @date 2022-10-10
*
* @param request servlet请求
* @param response servlet响应
* @param interfaceName 接口名
* @param content 请求报文
* @return java.lang.String 响应报文
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @date 2022-10-10
*/
@ApiOperation(value = "订单对外统一接口", notes = "订单对外统一接口入口")
@RequestMapping(path = "/invoice/api/v6/{interfaceName}", method = {RequestMethod.POST, RequestMethod.GET})
@ -191,7 +196,7 @@ public class InvoiceRestApiV6 {
//返回参数
String returnJsonString;
if(ConfigurerInfo.GENERATE_QD_INVOICE.equals(interfaceName)){
if (ConfigurerInfo.GENERATE_QD_INVOICE.equals(interfaceName)) {
//全电开票接口
PoCommonRequestParam requestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class);
DdpcxxReqBO ddpcxxReq = BeanTransitionUtils.transitionPoKpReq(requestParam);
@ -199,43 +204,43 @@ public class InvoiceRestApiV6 {
PoCommonResponseParam poCommonResponseParam = BeanTransitionUtils.transitionPoKpResp(ddpcxxRspV5);
returnJsonString = JsonUtils.getInstance().toJsonString(poCommonResponseParam);
} else if (ConfigurerInfo.GETORDERINFOANDINVOICEINFO.equals(interfaceName)){
} else if (ConfigurerInfo.GETORDERINFOANDINVOICEINFO.equals(interfaceName)) {
//订单和发票数据查询接口
DdfpcxReqV5 ddfpcxReq = JsonUtils.getInstance().parseObject(reqStr, DdfpcxReqV5.class);
DdfpcxRspV5 ddfpcxRsp = interfaceServiceV5.getOrderInfoAndInvoiceInfoV5(ddfpcxReq);
returnJsonString = JsonUtils.getInstance().toJsonString(ddfpcxRsp);
} else if (ConfigurerInfo.QUERYCOMMODITYINFO.equals(interfaceName)){
} else if (ConfigurerInfo.QUERYCOMMODITYINFO.equals(interfaceName)) {
//商品信息查询接口
SpxxcxReqBO spxxcxReq = JsonUtils.getInstance().parseObject(reqStr, SpxxcxReqBO.class);
SpxxcxRspBO spxxcxRsp = interfaceServiceV3.queryCommodityMessage(spxxcxReq, secretId);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(spxxcxRsp);
} else if (ConfigurerInfo.SYNCCOMMODITYINFO.equals(interfaceName)){
} else if (ConfigurerInfo.SYNCCOMMODITYINFO.equals(interfaceName)) {
//商品信息同步接口
List<SpxxtbReqBO> spxxtbReqList = JSONObject.parseArray(reqStr, SpxxtbReqBO.class);
List<SpxxtbRspBO> spxxtbRspList = interfaceServiceV3.syncCommodityMessage(spxxtbReqList, secretId);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(spxxtbRspList);
} else if (ConfigurerInfo.QUERYBUYERINFO.equals(interfaceName)){
} else if (ConfigurerInfo.QUERYBUYERINFO.equals(interfaceName)) {
//购买方信息查询接口
GmfxxcxReqBO gmfxxcxReq = JsonUtils.getInstance().parseObject(reqStr, GmfxxcxReqBO.class);
GmfxxcxRspBO gmfxxcxRsp = interfaceServiceV3.queryBuyerMessage(gmfxxcxReq, secretId);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(gmfxxcxRsp);
} else if (ConfigurerInfo.SYNCBUYERINFO.equals(interfaceName)){
} else if (ConfigurerInfo.SYNCBUYERINFO.equals(interfaceName)) {
//购买方信息同步接口
List<GmfxxtbReqBO> gmfxxtbReqList = JSONObject.parseArray(reqStr, GmfxxtbReqBO.class);
List<GmfxxtbRspBO> gmfxxtbRspList = interfaceServiceV3.syncBuyerMessage(gmfxxtbReqList, secretId);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(gmfxxtbRspList);
} else if (ConfigurerInfo.QUERYINVOICESTORE.equals(interfaceName)){
} else if (ConfigurerInfo.QUERYINVOICESTORE.equals(interfaceName)) {
//发票余量查询接口
FpylcxReqBO fpylcxReq = JsonUtils.getInstance().parseObject(reqStr, FpylcxReqBO.class);
List<FpylcxRspBO> fpylcxRsps = interfaceServiceV3.queryInvoiceStore(fpylcxReq, secretId);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(fpylcxRsps);
} else if (ConfigurerInfo.QUERYTAXPAYERGENERALINFO.equals(interfaceName)){
} else if (ConfigurerInfo.QUERYTAXPAYERGENERALINFO.equals(interfaceName)) {
//企业基本信息查询接口
QyjbxxCxReqBO qyjbxxCxReqBO = JsonUtils.getInstance().parseObject(reqStr, QyjbxxCxReqBO.class);
QyjbxxCxRspBO qyjbxxCxRspBO = interfaceServiceV3.queryTaxpayerGeneralInfo(qyjbxxCxReqBO, secretId);
@ -244,17 +249,74 @@ public class InvoiceRestApiV6 {
} else if (ConfigurerInfo.QUERY_RED_CONFIRMATION_LIST.equals(interfaceName)
|| ConfigurerInfo.QUERY_RED_CONFIRMATION_ITEM_LIST.equals(interfaceName)
|| ConfigurerInfo.RED_CONFIRMATION_APPLY.equals(interfaceName)
|| ConfigurerInfo.RED_CONFIRMATION_CONFIRM.equals(interfaceName)){
|| ConfigurerInfo.RED_CONFIRMATION_CONFIRM.equals(interfaceName)) {
//红字确认单接口-查询列表,查询明细列表,申请,确认
HzqrdRspV6 hzqrdRspV6 = interfaceServiceV6.processRedConfirmation(interfaceName, reqStr);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(hzqrdRspV6);
} else if (ConfigurerInfo.ORDER_STATUS_UPDATE.equals(interfaceName)){
} else if (ConfigurerInfo.ORDER_STATUS_UPDATE.equals(interfaceName)) {
//订单驳回状态更新接口-(销售结算报账单的驳回状态传给发票系统(ERP-FI-INT-046))
PoCommonRequestParam requestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class);
PoCommonResponseParam poCommonResponseParam = interfaceServiceV6.updateOrderStatus(requestParam, secretId);
returnJsonString = JsonUtils.getInstance().toJsonString(poCommonResponseParam);
}else {
} else if (ConfigurerInfo.SDENERGY_MDM_KS_SYNCBUYERINFO.equals(interfaceName)) {
// 山东能源 MDM 客商 购买方信息同步接口
List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS = JSONObject.parseArray(reqStr, MdmGmfxxtbReqBO.class);
List<GmfxxtbReqBO> gmfxxtbReqList = new ArrayList<>();
for (MdmGmfxxtbReqBO tempMdmGmfxxtbReqBO : mdmGmfxxtbReqBOS) {
GmfxxtbReqBO gmfxxtbReqBO = new GmfxxtbReqBO();
gmfxxtbReqBO.setGMFBM(tempMdmGmfxxtbReqBO.getCODE()); // 取code
gmfxxtbReqBO.setXHFSBH(tempMdmGmfxxtbReqBO.getDESC14());
gmfxxtbReqBO.setXHFMC(tempMdmGmfxxtbReqBO.getDESC1());
// 判断下DESC14是否为身份证,如果为身份证,则填写03,否则填写01,其余情况置空
// 身份证正则表达式
String idCardRegex = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)";
// 税号正则表达式
String taxNoRegex = "^[a-zA-Z0-9]{15,20}$";
gmfxxtbReqBO.setGMFLX("");
if (StringUtils.isNotEmpty(tempMdmGmfxxtbReqBO.getDESC14())) {
if (tempMdmGmfxxtbReqBO.getDESC14().matches(idCardRegex)) {
gmfxxtbReqBO.setGMFLX("03"); // 有可能出现个人
}
if (tempMdmGmfxxtbReqBO.getDESC14().matches(taxNoRegex)) {
gmfxxtbReqBO.setGMFLX("01");
}
}
gmfxxtbReqBO.setGMFMC(tempMdmGmfxxtbReqBO.getDESC48());
gmfxxtbReqBO.setGMFSBH(tempMdmGmfxxtbReqBO.getDESC49());
gmfxxtbReqBO.setGMFDH(tempMdmGmfxxtbReqBO.getDESC26()); // ?
// 根据要求,取VALUELIST中的第一组数据作为银行数据
if (tempMdmGmfxxtbReqBO.getMULTICODE() != null && !CollectionUtils.isEmpty(tempMdmGmfxxtbReqBO.getMULTICODE().getVALUELIST())) {
// 处理开户行银行
MdmGmfxxtbMulticodeValuelistBO firstValueList = tempMdmGmfxxtbReqBO.getMULTICODE().getVALUELIST().get(0);
if (firstValueList != null) {
gmfxxtbReqBO.setGMFYH(firstValueList.getDESC3());
gmfxxtbReqBO.setGMFZH(firstValueList.getDESC4());
}
}
gmfxxtbReqBO.setGMFSJH(tempMdmGmfxxtbReqBO.getDESC27());
gmfxxtbReqBO.setGMFYX(tempMdmGmfxxtbReqBO.getDESC29());
gmfxxtbReqBO.setCZLX("3"); // 可能重复推送,重复推送可能出现更新的情况,增加先查询,存在则更新不存在则插入的逻辑
// 拼接邮箱和地址
String buyerAddress = "";
buyerAddress = buyerAddress.concat(StringUtils.isEmpty(tempMdmGmfxxtbReqBO.getDESC22()) ? "" : tempMdmGmfxxtbReqBO.getDESC22());
buyerAddress = buyerAddress.concat(StringUtils.isEmpty(tempMdmGmfxxtbReqBO.getDESC23()) ? "" : tempMdmGmfxxtbReqBO.getDESC23());
buyerAddress = buyerAddress.concat(StringUtils.isEmpty(tempMdmGmfxxtbReqBO.getDESC24()) ? "" : tempMdmGmfxxtbReqBO.getDESC24());
gmfxxtbReqBO.setGMFDZ(buyerAddress);
gmfxxtbReqBO.setINVOICE_NAME(tempMdmGmfxxtbReqBO.getDESC48());
gmfxxtbReqBO.setINVOICE_TAXNO(tempMdmGmfxxtbReqBO.getDESC49());
gmfxxtbReqBO.setMDM_MULTICODE_JSON(JsonUtils.getInstance().toJsonStringNullToEmpty(tempMdmGmfxxtbReqBO.getMULTICODE()));
gmfxxtbReqList.add(gmfxxtbReqBO);
}
List<GmfxxtbRspBO> gmfxxtbRspList = interfaceServiceV3.syncBuyerMessage(gmfxxtbReqList, secretId);
returnJsonString = JsonUtils.getInstance().toJsonStringNullToEmpty(gmfxxtbRspList);
} else {
returnJsonString = "";
}
return returnJsonString;

@ -2795,6 +2795,14 @@ public class BeanTransitionUtils {
buyerEntity.setSjh(gmfxxtbReq.getGMFSJH());
//备注
buyerEntity.setRemarks(gmfxxtbReq.getBZ());
// 山能定制开发字段
// 山能 MDM 开票名称
buyerEntity.setInvoiceName(gmfxxtbReq.getINVOICE_NAME());
// 山能 MDM 开票税号
buyerEntity.setInvoiceTaxno(gmfxxtbReq.getINVOICE_TAXNO());
// 山能 MDM mdmMulticodeJson
buyerEntity.setMdmMulticodeJson(gmfxxtbReq.getMDM_MULTICODE_JSON());
return buyerEntity;
}

Loading…
Cancel
Save