|
|
|
@ -8,15 +8,8 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONException; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.dxyun.invoice.constant.StatusConstants; |
|
|
|
|
import com.dxyun.invoice.exception.BadRequestException; |
|
|
|
|
import com.dxyun.invoice.protocol.InterfaceData; |
|
|
|
|
import com.dxyun.invoice.protocol.ProtocolUtil; |
|
|
|
|
import com.dxyun.invoice.protocol.exception.ProtocolException; |
|
|
|
|
import com.dxyun.invoice.util.InterfaceDataUtil; |
|
|
|
|
import com.jianshui.common.core.domain.AjaxResult; |
|
|
|
|
import com.jianshui.common.core.domain.entity.Companyservice; |
|
|
|
|
import com.jianshui.common.enums.ErrorCode; |
|
|
|
@ -74,6 +67,7 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
private RedinfoMapper redinfoMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 1.发票开具 SID = 1 |
|
|
|
|
* |
|
|
|
@ -996,6 +990,41 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 机动车加密接口(控制台) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse exportVehicleInvoice(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
|
// TODO: 2023/10/10 机动车
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*// 发起请求
|
|
|
|
|
AjaxResult ajaxResult = null; |
|
|
|
|
try { |
|
|
|
|
//hutool的beancopy别名会与JSONUTIl冲突
|
|
|
|
|
Map<String, Object> map = BeanToMapUtils.fastJsonBean2Map(aisinoConsoleInvoiceAddDTO); |
|
|
|
|
map.put("invoiceItems", listMap); |
|
|
|
|
ajaxResult = AisinoConsoleUtil.sendRequest(AisinoConsoleConstants.INVOICE_ADD, JSONUtil.parse(map), companyservice); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("【销项发票】【总部控制台接口】【发票开具】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(aisinoConsoleInvoiceAddDTO).toString(), JSONObject.toJSONString(companyservice)); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
throw new JianshuiServiceException("系统异常!"); |
|
|
|
|
} |
|
|
|
|
log.info("【销项发票】【总部控制台发票】发票开具请求拉取结果{}", ajaxResult.toString()); |
|
|
|
|
|
|
|
|
|
//返回报文解析
|
|
|
|
|
if (ajaxResult.isError()) { |
|
|
|
|
throw new JianshuiServiceException(ajaxResult.getMsg()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cn.hutool.json.JSONObject resultJSON = JSONUtil.parseObj(ajaxResult.get("data")); |
|
|
|
|
String retcode = resultJSON.get("retcode") != null ? resultJSON.get("retcode").toString() : ""; |
|
|
|
|
String retmsg = resultJSON.get("retmsg") != null ? resultJSON.get("retmsg").toString() : "";*/ |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AjaxResult syncStockInfo(Companyservice companyservice) { |
|
|
|
|
return null; |
|
|
|
@ -1141,9 +1170,12 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 机动车加密接口(走的大象,重汽用控制台) |
|
|
|
|
*/ |
|
|
|
|
*//*
|
|
|
|
|
@Override |
|
|
|
|
public HXResponse exportVehicleInvoice(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
@ -1177,7 +1209,7 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
// TODO: 2023/10/8 输出到页面
|
|
|
|
|
// 浏览器处理乱码问题
|
|
|
|
|
/*String userAgent = request.getHeader(HttpHeaders.USER_AGENT); |
|
|
|
|
*//*String userAgent = request.getHeader(HttpHeaders.USER_AGENT);
|
|
|
|
|
try { |
|
|
|
|
//IE浏览器
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.contains(userAgent, ConfigureConstant.REQUEST_HEAD_USER_AGENT_TYPE_MSIE) |
|
|
|
@ -1199,10 +1231,10 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
response.getOutputStream().write(Base64Encoding.decode(data)); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
log.error("{}机动车导出加密数据异常:{}", LOGGER_MSG, e); |
|
|
|
|
}*/ |
|
|
|
|
}*//*
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1224,7 +1256,7 @@ public class AisinoConsoleInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
// )',
|
|
|
|
|
String terminalCode = "007"; |
|
|
|
|
|
|
|
|
|
// TODO: 2023/10/9 机动车加密大象这里代码是混淆的,带看一下他是怎么调用的,哪里有用到这个
|
|
|
|
|
// TODO: 2023/10/9 机动车加密大象
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*try { |
|
|
|
|