|
|
@ -2,7 +2,6 @@ package com.jianshui.invoiceall.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.jianshui.common.core.domain.AjaxResult; |
|
|
|
import com.jianshui.common.core.domain.AjaxResult; |
|
|
@ -26,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author xingze |
|
|
|
* @author xingze |
|
|
@ -67,6 +67,29 @@ public class AutonomousSqServiceImpl implements AutonomousSqService { |
|
|
|
return AjaxResult.success(); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 功能描述: 获取短信验证结果 |
|
|
|
|
|
|
|
* @param invoiceAllSubmitNoteDTO |
|
|
|
|
|
|
|
* @return : java.lang.Object |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Object submitNoteResult(InvoiceAllSubmitNoteDTO invoiceAllSubmitNoteDTO) { |
|
|
|
|
|
|
|
log.info("获取短信验证结果入口,入参:{}", JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO)); |
|
|
|
|
|
|
|
// 短信提交
|
|
|
|
|
|
|
|
ValidateUtils.validate(invoiceAllSubmitNoteDTO); |
|
|
|
|
|
|
|
List<InvoiceAllLoginResult> invoiceAllLoginResultList = invoiceAllLoginResultMapper.findByQqlsh(invoiceAllSubmitNoteDTO.getTraceno()); |
|
|
|
|
|
|
|
if (invoiceAllLoginResultList == null || invoiceAllLoginResultList.size() <= 0) { |
|
|
|
|
|
|
|
log.info("自主授权短信提交接口,未查询到该流水号相关信息,请确认后输入"); |
|
|
|
|
|
|
|
return AjaxResult.error("未查询到该流水号相关信息,请确认后输入"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (InvoiceAllLoginResult invoiceAllLoginResult : invoiceAllLoginResultList) { |
|
|
|
|
|
|
|
if ("S000".equals(invoiceAllLoginResult.getCode())){ |
|
|
|
|
|
|
|
return AjaxResult.success(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.error(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 功能描述: 全电登录 |
|
|
|
* 功能描述: 全电登录 |
|
|
|
* |
|
|
|
* |
|
|
@ -145,29 +168,30 @@ public class AutonomousSqServiceImpl implements AutonomousSqService { |
|
|
|
// 短信提交
|
|
|
|
// 短信提交
|
|
|
|
ValidateUtils.validate(invoiceAllSubmitNoteDTO); |
|
|
|
ValidateUtils.validate(invoiceAllSubmitNoteDTO); |
|
|
|
// 根据流水号获取登录结果
|
|
|
|
// 根据流水号获取登录结果
|
|
|
|
InvoiceAllLoginResult invoiceAllLogin = invoiceAllLoginResultMapper.findByQqlsh(invoiceAllSubmitNoteDTO.getTraceno()); |
|
|
|
List<InvoiceAllLoginResult> invoiceAllLoginResultList = invoiceAllLoginResultMapper.findByQqlsh(invoiceAllSubmitNoteDTO.getTraceno()); |
|
|
|
if (invoiceAllLogin == null) { |
|
|
|
if (invoiceAllLoginResultList == null || invoiceAllLoginResultList.size() <= 0) { |
|
|
|
log.info("自主授权短信提交接口,未查询到该流水号相关信息,请确认后输入"); |
|
|
|
log.info("自主授权短信提交接口,未查询到该流水号相关信息,请确认后输入"); |
|
|
|
return AjaxResult.error("未查询到该流水号相关信息,请确认后输入"); |
|
|
|
return AjaxResult.error("未查询到该流水号相关信息,请确认后输入"); |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject result = null; |
|
|
|
for (InvoiceAllLoginResult invoiceAllLoginResult : invoiceAllLoginResultList) { |
|
|
|
if ("SMS".equals(invoiceAllLogin.getCode())) { |
|
|
|
if ("SMS".equals(invoiceAllLoginResult.getCode())) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// 请求封装
|
|
|
|
// 请求封装
|
|
|
|
log.info("自主授权短信提交接口,请求上游地址:{},入参:{}", "http://221.222.184.98:8880/login/submitSms", JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO)); |
|
|
|
log.info("自主授权短信提交接口,请求上游地址:{},入参:{}", "http://221.222.184.98:8880/login/submitSms", JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO)); |
|
|
|
String sendResult = HttpUtils.sendJsonPost("http://221.222.184.98:8880/login/submitSms", invoiceAllSubmitNoteDTO); |
|
|
|
Thread requestThread = new Thread(() -> { |
|
|
|
result = JSONUtil.parseObj(sendResult); |
|
|
|
HttpUtils.sendJsonPost("http://221.222.184.98:8880/login/submitSms", invoiceAllSubmitNoteDTO); |
|
|
|
log.info("自主授权短信提交接口,请求上游结果:{}",result); |
|
|
|
}); |
|
|
|
|
|
|
|
requestThread.start(); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("【金四服务类】【金财数科】【自主授权提交短信验证码】API请求异常,外部报文返回code非S000。错误信息:{}", e.getMessage()); |
|
|
|
log.error("【金四服务类】【金财数科】【自主授权提交短信验证码】API请求异常,外部报文返回code非S000。错误信息:{}", e.getMessage()); |
|
|
|
return AjaxResult.error(ErrorCode.INCOME_ERROR); |
|
|
|
return AjaxResult.error(ErrorCode.INCOME_ERROR); |
|
|
|
} |
|
|
|
} |
|
|
|
return AjaxResult.success(result); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
log.error("自主授权短信提交接口,提交短信失败,失败原因:{}", "登录失败,请重新登录"); |
|
|
|
log.error("自主授权短信提交接口,提交短信失败,失败原因:{}", "登录失败,请重新授权登录"); |
|
|
|
return AjaxResult.error("登录失败,请重新登录"); |
|
|
|
return AjaxResult.error("登录失败,请重新授权登录"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.success(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|