|
|
|
@ -2,6 +2,7 @@ package com.jianshui.invoice.service.impl.api; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.codec.Base64; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse; |
|
|
|
|
import com.google.gson.Gson; |
|
|
|
|
import com.jianshui.common.constant.Constants; |
|
|
|
|
import com.jianshui.common.constant.WebServiceConstant; |
|
|
|
|
import com.jianshui.common.core.domain.AjaxResult; |
|
|
|
|
import com.jianshui.common.core.domain.entity.Companyservice; |
|
|
|
|
import com.jianshui.common.enums.ErrorCode; |
|
|
|
@ -19,6 +21,7 @@ import com.jianshui.common.utils.DateUtils; |
|
|
|
|
import com.jianshui.common.utils.StringUtils; |
|
|
|
|
import com.jianshui.common.utils.TimeUtil; |
|
|
|
|
import com.jianshui.common.utils.http.HttpHelper; |
|
|
|
|
import com.jianshui.common.utils.jcsk.ApiHttp; |
|
|
|
|
import com.jianshui.common.utils.uuid.IdUtils; |
|
|
|
|
import com.jianshui.framework.manager.AsyncManager; |
|
|
|
|
import com.jianshui.invoice.constant.elephant.ElephantConstantsV6; |
|
|
|
@ -43,6 +46,7 @@ import com.jianshui.queue.utils.RedisQueueUtil; |
|
|
|
|
import com.jianshui.storage.domain.StorageUrlDTO; |
|
|
|
|
import com.jianshui.storage.factory.StorageFactory; |
|
|
|
|
import com.jianshui.storage.service.IStorageService; |
|
|
|
|
import com.jianshui.system.domain.InvoiceAllApiLog; |
|
|
|
|
import com.jianshui.system.mapper.CompanyserviceMapper; |
|
|
|
|
import com.jianshui.system.service.ISysConfigService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -806,6 +810,30 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 生成动态二维码接口 |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse generateDynamicCode(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
|
DxhyInterfaceResponse dxhyInterfaceResponse = null; |
|
|
|
|
try { |
|
|
|
|
dxhyInterfaceResponse = ElephantUtils.sendRequestWithoutTokenV6(ElephantConstantsV6.GEN_DYNAMIC_CODE_LOCALHOST, ElephantConstantsV6.GEN_DYNAMIC_CODE_METHOD, JSONUtil.parse(decryptResult), companyservice); |
|
|
|
|
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { |
|
|
|
|
log.error("【销项发票】【大象接口】【生成动态二维码】发票请求异常,请求报文{},销方信息{}", decryptResult, JSONObject.toJSONString(companyservice)); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
return new HXResponse("9999","系统异常!"); |
|
|
|
|
} |
|
|
|
|
String data = dxhyInterfaceResponse.getData(); |
|
|
|
|
String code = dxhyInterfaceResponse.getCode(); |
|
|
|
|
|
|
|
|
|
return new HXResponse(code,data); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|