|
|
|
@ -3,6 +3,7 @@ package com.jianshui.invoice.service.impl.api; |
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.convert.Convert; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.core.util.ReUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
@ -39,11 +40,16 @@ import com.jianshui.invoice.utils.aisino.console.AisinoConsoleUtil; |
|
|
|
|
import com.jianshui.system.domain.CompanyserviceProp; |
|
|
|
|
import com.jianshui.system.service.ICompanyservicePropService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.jsoup.Jsoup; |
|
|
|
|
import org.jsoup.nodes.Document; |
|
|
|
|
import org.jsoup.nodes.Element; |
|
|
|
|
import org.jsoup.select.Elements; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.*; |
|
|
|
@ -1029,6 +1035,14 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
String retmsg = resultJSON.get("retmsg") != null ? resultJSON.get("retmsg").toString() : ""; |
|
|
|
|
|
|
|
|
|
if("0".equals(retcode)){ |
|
|
|
|
|
|
|
|
|
// TODO: 2023/10/24 读取nginx地址,读取数据。
|
|
|
|
|
String indexPage = HttpUtil.get("http://localhost:8082/"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new HXResponse("0000","导出成功!"); |
|
|
|
|
}else { |
|
|
|
|
return new HXResponse("9999","导出失败、发票不存在!"); |
|
|
|
@ -1036,6 +1050,65 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
|
|
// TODO: 2023/10/24 机动车加密文件读取,搭配nginx
|
|
|
|
|
|
|
|
|
|
String indexPage = HttpUtil.get("http://localhost:8082/"); |
|
|
|
|
|
|
|
|
|
System.out.println(indexPage); |
|
|
|
|
|
|
|
|
|
String startDate = "2023.10.10"; |
|
|
|
|
String endDate = "2023.10.12"; |
|
|
|
|
|
|
|
|
|
// 构建要匹配的日期范围字符串
|
|
|
|
|
String dateRange = startDate + "-" + endDate; |
|
|
|
|
// 使用Jsoup解析HTML
|
|
|
|
|
Document doc = Jsoup.parse(indexPage); |
|
|
|
|
|
|
|
|
|
// 获取带有动态日期范围的<a>标签
|
|
|
|
|
Elements aTags = doc.select("a[href*='%28" + dateRange + "%29.dat']"); |
|
|
|
|
|
|
|
|
|
// 遍历<a>标签,提取href属性内容
|
|
|
|
|
for (Element aTag : aTags) { |
|
|
|
|
String href = aTag.attr("href"); |
|
|
|
|
log.info("读取到的机动车加密文件名为"+href); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO: 2023/10/24 调用重汽的推送接口
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> paramMap = new HashMap<>(); |
|
|
|
|
paramMap.put("File", ""); |
|
|
|
|
paramMap.put("qyjc", "KS"); |
|
|
|
|
paramMap.put("zdr", ""); |
|
|
|
|
|
|
|
|
|
String result = HttpUtil.post("",paramMap); |
|
|
|
|
|
|
|
|
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(result); |
|
|
|
|
|
|
|
|
|
String retCode = jsonObject.get("retCode") != null ? jsonObject.get("retCode").toString() : ""; |
|
|
|
|
String retMsg = jsonObject.get("retMsg") != null ? jsonObject.get("retMsg").toString() : ""; |
|
|
|
|
|
|
|
|
|
if("1".equals(retCode)){ |
|
|
|
|
|
|
|
|
|
} else if ("0".equals(retCode)) { |
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AjaxResult syncStockInfo(Companyservice companyservice) { |
|
|
|
|
return null; |
|
|
|
@ -1181,9 +1254,9 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 机动车加密接口(走的大象,重汽用控制台) |
|
|
|
|
*//*
|
|
|
|
|