|
|
@ -1,25 +1,33 @@ |
|
|
|
package com.jianshui.invoice.task; |
|
|
|
package com.jianshui.invoice.task; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
|
|
|
|
|
import com.jianshui.common.core.domain.entity.Companyservice; |
|
|
|
import com.jianshui.common.utils.StringUtils; |
|
|
|
import com.jianshui.common.utils.StringUtils; |
|
|
|
import com.jianshui.common.utils.spring.SpringUtils; |
|
|
|
import com.jianshui.common.utils.spring.SpringUtils; |
|
|
|
|
|
|
|
import com.jianshui.invoice.constant.aisino.console.AisinoConsoleConstants; |
|
|
|
import com.jianshui.invoice.domain.Invoice; |
|
|
|
import com.jianshui.invoice.domain.Invoice; |
|
|
|
import com.jianshui.invoice.domain.InvoiceBack; |
|
|
|
import com.jianshui.invoice.domain.InvoiceBack; |
|
|
|
import com.jianshui.invoice.domain.Redinfo; |
|
|
|
import com.jianshui.invoice.domain.Redinfo; |
|
|
|
|
|
|
|
import com.jianshui.invoice.domain.dto.ExportVehicleDTO; |
|
|
|
|
|
|
|
import com.jianshui.invoice.domain.dto.HXResponse; |
|
|
|
import com.jianshui.invoice.mapper.InvoiceBackMapper; |
|
|
|
import com.jianshui.invoice.mapper.InvoiceBackMapper; |
|
|
|
import com.jianshui.invoice.mapper.InvoiceMapper; |
|
|
|
import com.jianshui.invoice.mapper.InvoiceMapper; |
|
|
|
|
|
|
|
import com.jianshui.invoice.service.IInvoiceApiService; |
|
|
|
|
|
|
|
import com.jianshui.invoice.service.impl.api.AisinoConsoleInvoiceApiZhongQiServiceImpl; |
|
|
|
import com.jianshui.system.domain.CompanyserviceProp; |
|
|
|
import com.jianshui.system.domain.CompanyserviceProp; |
|
|
|
import com.jianshui.system.service.ICompanyservicePropService; |
|
|
|
import com.jianshui.system.service.ICompanyservicePropService; |
|
|
|
|
|
|
|
import com.jianshui.system.service.ICompanyserviceService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 定时任务-发票推送 |
|
|
|
* 定时任务-发票推送 |
|
|
@ -37,6 +45,12 @@ public class InvoiceBackTask |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private InvoiceMapper invoiceMapper; |
|
|
|
private InvoiceMapper invoiceMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ICompanyserviceService iCompanyserviceService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ICompanyservicePropService propService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author kk |
|
|
|
* @author kk |
|
|
@ -159,19 +173,40 @@ public class InvoiceBackTask |
|
|
|
* @date 2023/11/14 9:03 |
|
|
|
* @date 2023/11/14 9:03 |
|
|
|
* @param: [] |
|
|
|
* @param: [] |
|
|
|
* @return: |
|
|
|
* @return: |
|
|
|
* 机动车加密导出 |
|
|
|
* 机动车加密导出-定时任务 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void exportVehicleInvoice(){ |
|
|
|
public void exportVehicleInvoice(){ |
|
|
|
|
|
|
|
// 查询配置的nginx地址
|
|
|
|
|
|
|
|
log.info("[重汽机动车加密导出定时任务开始]---"); |
|
|
|
|
|
|
|
CompanyserviceProp companyservicePropQuery = new CompanyserviceProp(); |
|
|
|
|
|
|
|
companyservicePropQuery.setKey("aisino_nginx_url"); |
|
|
|
|
|
|
|
List<CompanyserviceProp> companyservicePropList = propService.selectCompanyservicePropList(companyservicePropQuery); |
|
|
|
|
|
|
|
log.info("[重汽机动车加密导出定时任务]获取到待发送identity集合,{}",JSONUtil.toJsonStr(companyservicePropList)); |
|
|
|
|
|
|
|
for (CompanyserviceProp companyserviceProp : companyservicePropList) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 参数组装
|
|
|
|
|
|
|
|
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByCompanyid(companyserviceProp.getCompanyid()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExportVehicleDTO exportVehicleDTO = new ExportVehicleDTO(); |
|
|
|
|
|
|
|
exportVehicleDTO.setSavePath(AisinoConsoleConstants.SAVE_PATH); |
|
|
|
|
|
|
|
exportVehicleDTO.setFPZL(""); |
|
|
|
|
|
|
|
exportVehicleDTO.setKSRQ(DateUtil.today()); |
|
|
|
|
|
|
|
exportVehicleDTO.setJSRQ(DateUtil.today()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
IInvoiceApiService iInvoiceApiService = new AisinoConsoleInvoiceApiZhongQiServiceImpl(); |
|
|
|
|
|
|
|
HXResponse hxResponse = iInvoiceApiService.exportVehicleInvoice(JSON.parseObject(JSONUtil.toJsonStr(exportVehicleDTO)),companyservice); |
|
|
|
|
|
|
|
log.info("[重汽机动车加密导出定时任务]返回结果,hxResponse={},identity={}",hxResponse,companyserviceProp.getCompanyid()); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("[重汽机动车加密导出定时任务结束]---"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|