|
@@ -13,10 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.jkcredit.invoice.hub.constant.CommonConstant;
|
|
|
import com.jkcredit.invoice.hub.enums.ApiResponseCodeEnum;
|
|
|
-import com.jkcredit.invoice.hub.model.dto.apiCarFree.InvoiceResult;
|
|
|
-import com.jkcredit.invoice.hub.model.dto.apiCarFree.InvoiceResultDto;
|
|
|
-import com.jkcredit.invoice.hub.model.dto.apiCarFree.VehicleRegisterDto;
|
|
|
-import com.jkcredit.invoice.hub.model.dto.apiCarFree.WayBillNumFindInvoiceDto;
|
|
|
+import com.jkcredit.invoice.hub.model.dto.apiCarFree.*;
|
|
|
import com.jkcredit.invoice.hub.model.dto.carFreeCarrierBillEnd.CarFreeCarrierBillEndDto;
|
|
|
import com.jkcredit.invoice.hub.model.dto.carFreeCarrierBillStart.CarFreeCarrierBillStartDto;
|
|
|
import com.jkcredit.invoice.hub.model.dto.searchInvoice.SearchInvoiceDto;
|
|
@@ -425,4 +422,37 @@ public class ApiCarFreeServiceImpl extends BaseService implements ApiCarFreeServ
|
|
|
throw new ServiceException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ApiResponseData offsetInvoiceQuery(JSONObject param) {
|
|
|
+ long costTimeStart = System.currentTimeMillis();
|
|
|
+ String result;
|
|
|
+
|
|
|
+ try {
|
|
|
+ OffsetInvoiceQueryDto dto = JSONObject.toJavaObject(param, OffsetInvoiceQueryDto.class);
|
|
|
+ validate(dto);
|
|
|
+ WaybillInvoiceRedQueryRequest request = new WaybillInvoiceRedQueryRequest();
|
|
|
+ request.setCompanyNum(CommonConstant.COMPANY_NUMBER);
|
|
|
+ request.setMonth(dto.getMonth());
|
|
|
+ String fileName = request.getFilename();
|
|
|
+
|
|
|
+ // 调用upload 发送数据
|
|
|
+ WaybillInvoiceRedQueryResponse response = ETCCommHelper.upload(fileName, request, WaybillInvoiceRedQueryResponse.class);
|
|
|
+ result = response.toJson();
|
|
|
+ long costTimeEnd = System.currentTimeMillis();
|
|
|
+ log.info("[-offsetInvoiceQuery-] result is " + result.replaceAll("\r|\n", "") + " , request is "
|
|
|
+ + param + ",costtime=" + (costTimeEnd - costTimeStart) + ",startTime=" + costTimeStart
|
|
|
+ + ",endTime=" + costTimeEnd);
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.error("[-offsetInvoiceQuery-] 网络异常 " + e);
|
|
|
+ throw new ServiceException(CommonConstant.QUERY_FAILED);
|
|
|
+ } catch (ApiRequestException apie) {
|
|
|
+ log.error("[-offsetInvoiceQuery-] 错误信息:" + apie.getMessage());
|
|
|
+ throw new com.jkcredit.invoice.hub.spi.lang.exception.ApiRequestException(apie.getMessage());
|
|
|
+ } catch (ServiceException se) {
|
|
|
+ log.error("[-offsetInvoiceQuery-] 错误信息:" + se.getMessage());
|
|
|
+ throw new ServiceException(se.getMessage());
|
|
|
+ }
|
|
|
+ return ApiResponseData.success(ApiResponseCodeEnum.CODE_200.getValue(), result);
|
|
|
+ }
|
|
|
}
|