数电发票查询接口

beta-enc
kk 2 years ago
parent fd1c37c6e5
commit e2d896c510
  1. 70
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java
  2. 25
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java
  3. 3
      jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllApiLog.java
  4. 7
      jianshui-system/src/main/resources/mapper/system/InvoiceAllApiLogMapper.xml

@ -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;
}
}

@ -1306,31 +1306,6 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
try {
result = ApiHttp.request(WebServiceConstant.TYCXJK, WebServiceConstant.URL, queryDTO, companyservice);
// TODO: 2023/5/11 测试
// result = new cn.hutool.json.JSONObject();
// result.set("code", "0000");
// result.set("msg", "123");
// result.set("data", "{\n" +
// " \"hzfpxxqrdbh\": \"37021423051000203148\",\n" +
// " \"hzfpxxqrdid\": \"953bf4ef7ac74c24ae9a056262939f96\",\n" +
// " \"hzfpxxqrdZtdm\": \"01\",\n" +
// " \"lrrq\": \"2023-05-09 09:47:53\",\n" +
// " \"hzfpxx\": {\n" +
// " \"fpqqlsh\": \"c817769da5c27e3fbda4fe5ce72857f7\",\n" +
// " \"gmfnsrsbh\": \"91370102MA3UD2FG21\",\n" +
// " \"gmfmc\": \"山东慧永信息科技有限公司\",\n" +
// " \"xsfmc\": \"城阳区兴顺通制冷设备维修服务部\",\n" +
// " \"xsfnsrsbh\": \"92370214MACAAEK16E\",\n" +
// " \"kprq\": \"2023-05-09 09:47:54\",\n" +
// " \"fphm\": \"23922000000005190521\",\n" +
// " \"ewmUrl\": \"https://dppt.qingdao.chinatax.gov.cn:8443/v/2_23922000000005190521_202305090947549016EF6F4\",\n" +
// " \"pdfUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_pdf\",\n" +
// " \"ofdUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_ofd\",\n" +
// " \"xmlUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_xml\"\n" +
// " }\n" +
// "}");
String code = result.get("code") != null ? result.get("code").toString() : "";
String msg = result.get("msg") != null ? result.get("msg").toString() : "";
String data = result.get("data") != null ? result.get("data").toString() : "";

@ -48,6 +48,9 @@ public class InvoiceAllApiLog implements Serializable
@Excel(name = "请求id")
private String requestId;
/** 公司名称*/
private String companyName;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;

@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="identityId" column="identity_id" />
<result property="createTime" column="create_time" />
<result property="requestId" column="request_id" />
<result property="companyName" column="company_name" />
</resultMap>
<sql id="selectInvoiceAllApiLogVo">
select id, url, send_msg, result_msg, company, identity_id, create_time, request_id from invoice_all_api_log
select id, url, send_msg, result_msg, company, identity_id, create_time, request_id,company_name from invoice_all_api_log
</sql>
<select id="selectInvoiceAllApiLogList" parameterType="InvoiceAllApiLog" resultMap="InvoiceAllApiLogResult">
@ -28,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="company != null and company != ''"> and company = #{company}</if>
<if test="identityId != null and identityId != ''"> and identity_id = #{identityId}</if>
<if test="requestId != null and requestId != ''"> and request_id = #{requestId}</if>
<if test="companyName != null and companyName != ''"> and company_name = #{companyName}</if>
</where>
</select>
@ -46,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="identityId != null">identity_id,</if>
<if test="createTime != null">create_time,</if>
<if test="requestId != null">request_id,</if>
<if test="companyName != null">company_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="url != null">#{url},</if>
@ -55,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="identityId != null">#{identityId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="requestId != null">#{requestId},</if>
<if test="companyName != null">#{companyName},</if>
</trim>
</insert>
@ -68,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="identityId != null">identity_id = #{identityId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="requestId != null">request_id = #{requestId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save