|
|
|
@ -11,6 +11,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; |
|
|
|
@ -46,7 +47,9 @@ 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.mapper.InvoiceAllApiLogMapper; |
|
|
|
|
import com.jianshui.system.service.ISysConfigService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
@ -91,6 +94,9 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
@Autowired |
|
|
|
|
private IBillInfoService billInfoService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private InvoiceAllApiLogMapper allApiLogMapper; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 发票开具 |
|
|
|
|
* |
|
|
|
@ -266,6 +272,18 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
// 定时拉取保存发票, TODO 处理开票中的问题
|
|
|
|
|
AsyncManager.me().execute(new QueryInvoiceTask(billInfo, companyservice, this)); |
|
|
|
|
|
|
|
|
|
// 数电的加入金财表
|
|
|
|
|
InvoiceAllApiLog allApiLog = new InvoiceAllApiLog(); |
|
|
|
|
allApiLog.setUrl(WebServiceConstant.LZFPKJ); |
|
|
|
|
allApiLog.setSendMsg(""); |
|
|
|
|
allApiLog.setResultMsg(""); |
|
|
|
|
allApiLog.setCompany(companyservice.getSellertax()); |
|
|
|
|
allApiLog.setIdentityId(companyservice.getIdentity()); |
|
|
|
|
allApiLog.setRequestId(billInfo.getSystemOrderno()); |
|
|
|
|
allApiLog.setCreateTime(new Date()); |
|
|
|
|
allApiLog.setCompanyName("大象V6"); |
|
|
|
|
allApiLogMapper.insertInvoiceAllApiLog(allApiLog); |
|
|
|
|
|
|
|
|
|
HXResponse response = new HXResponse("0000", "同步成功"); |
|
|
|
|
response.put("fpqqlsh", billInfo.getSystemOrderno()); |
|
|
|
|
return response; |
|
|
|
@ -1851,9 +1869,59 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author kk |
|
|
|
|
* 通用查询接口 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse queryResultInfo(InvoiceAllQueryTWODTO invoiceAllYhdjDTO, Companyservice companyservice) { |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
//存入金财的调用接口表里去
|
|
|
|
|
String requestId = invoiceAllYhdjDTO.getRequestId() != null ? invoiceAllYhdjDTO.getRequestId() : ""; |
|
|
|
|
if(StrUtil.isEmpty(requestId)){ |
|
|
|
|
return new HXResponse("requestId不能为空!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询调用记录
|
|
|
|
|
QueryWrapper<InvoiceAllApiLog> apiLogQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
apiLogQueryWrapper.eq("request_id", requestId); |
|
|
|
|
InvoiceAllApiLog allApiLog = allApiLogMapper.selectOne(apiLogQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (BeanUtil.isEmpty(allApiLog) || StrUtil.isEmpty(allApiLog.getRequestId())) { |
|
|
|
|
return new HXResponse("serviceId异常!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String finalServiceId = allApiLog.getUrl(); |
|
|
|
|
|
|
|
|
|
HXResponse response = new HXResponse("0000", "查询成功"); |
|
|
|
|
|
|
|
|
|
// 蓝字发票开具
|
|
|
|
|
if (WebServiceConstant.LZFPKJ.equals(finalServiceId)) { |
|
|
|
|
|
|
|
|
|
// 先执行获取
|
|
|
|
|
QueryBillInfoDTO queryBillInfoDTO = new QueryBillInfoDTO(); |
|
|
|
|
queryBillInfoDTO.setFpqqlsh(requestId); |
|
|
|
|
HXResponse hxResponseTemp = queryInvoice(queryBillInfoDTO, companyservice); |
|
|
|
|
|
|
|
|
|
// 查询同金财数科返回一样
|
|
|
|
|
/* QueryWrapper<Invoice> invoiceQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
invoiceQueryWrapper.eq("fpqqlsh", requestId); |
|
|
|
|
Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper); |
|
|
|
|
|
|
|
|
|
response.put("data", invoice);*/ |
|
|
|
|
|
|
|
|
|
return hxResponseTemp; |
|
|
|
|
}else{ |
|
|
|
|
return new HXResponse("功能升级中~请稍等~"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return response;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|