Merge remote-tracking branch 'origin/beta' into beta

beta-prop-all^2
dongxiaoke 2 years ago
commit cad61b8492
  1. 29
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/AutonomousSqServiceImpl.java

@ -57,6 +57,7 @@ public class AutonomousSqServiceImpl implements AutonomousSqService {
// 存流水号
InvoiceAllLoginResult invoiceAllLoginResult = new InvoiceAllLoginResult();
BeanUtil.copyProperties(autonomousAuthorization, invoiceAllLoginResult);
invoiceAllLoginResult.setCreateTime(new Date());
int count = invoiceAllLoginResultMapper.insertInvoiceAllLoginResult(invoiceAllLoginResult);
if (count > 0) {
log.info("全电登录接口,登录返回信息保存成功,信息为:{}", JSONUtil.toJsonStr(invoiceAllLoginResult));
@ -143,46 +144,22 @@ public class AutonomousSqServiceImpl implements AutonomousSqService {
log.info("自主授权短信提交接口,入参:{}", JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO));
// 短信提交
ValidateUtils.validate(invoiceAllSubmitNoteDTO);
Companyservice companyservice = companyserviceMapper.selectCompanyserviceByTaxcode(invoiceAllSubmitNoteDTO.getNsrsbh());
// 根据流水号获取登录结果
InvoiceAllLoginResult invoiceAllLogin = invoiceAllLoginResultMapper.findByQqlsh(invoiceAllSubmitNoteDTO.getTraceno());
if (invoiceAllLogin == null) {
log.info("自主授权短信提交接口,未查询到该流水号相关信息,请确认后输入");
return AjaxResult.error("未查询到该流水号相关信息,请确认后输入");
}
if ("S000".equals(invoiceAllLogin.getCode())){
if ("SMS".equals(invoiceAllLogin.getCode())) {
JSONObject result = new JSONObject();
try {
// 请求封装
log.info("自主授权短信提交接口,请求上游地址:{},入参:{}", "http://221.222.184.98:8880/login/submitSms", JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO));
String sendFormPost = HttpUtils.sendJsonPost("http://221.222.184.98:8880/login/submitSms", invoiceAllSubmitNoteDTO);
log.info("自主授权短信提交接口,请求上游返回结果:{}", sendFormPost);
result = JSONUtil.parseObj(sendFormPost);
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() : "";
if ("S000".equals(code)) {
// 调用日志封装
InvoiceAllApiLog invoiceAllApiLog = new InvoiceAllApiLog();
invoiceAllApiLog.setCreateTime(new Date());
invoiceAllApiLog.setCompany(companyservice.getSellertax());
invoiceAllApiLog.setIdentityId(companyservice.getIdentity());
invoiceAllApiLog.setUrl("http://221.222.184.98:8880/login/submitSms");
invoiceAllApiLog.setSendMsg(JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO));
invoiceAllApiLog.setResultMsg(data);
JSONObject dataObject = JSONUtil.parseObj(data);
String tokenId = dataObject.get("dzfp-ssotoken") != null ? dataObject.get("dzfp-ssotoken").toString() : "";
invoiceAllApiLog.setRequestId(tokenId);
allApiLogMapper.insert(invoiceAllApiLog);
} else {
log.error("自主授权短信提交接口,提交短信失败,失败原因:{}",msg);
return AjaxResult.error(msg);
}
} catch (Exception e) {
e.printStackTrace();
log.error("【金四服务类】【金财数科】【全电登录】API请求异常,外部报文返回code非S000。错误信息:{}", e.getMessage());
log.error("【金四服务类】【金财数科】【自主授权提交短信验证码】API请求异常,外部报文返回code非S000。错误信息:{}", e.getMessage());
return AjaxResult.error(ErrorCode.INCOME_ERROR);
}
log.error("自主授权短信提交接口,提交短信成功,结果:{}", result);