|
@@ -3,18 +3,18 @@ package com.ruoyi.system.service.impl;
|
|
|
import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsResponse;
|
|
|
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
|
|
import com.aliyuncs.exceptions.ClientException;
|
|
|
-import com.ruoyi.common.constant.Constants;
|
|
|
import com.ruoyi.common.constant.UserConstants;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
-import com.ruoyi.common.exception.user.CaptchaException;
|
|
|
-import com.ruoyi.common.exception.user.CaptchaExpireException;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.QRCodeUtils;
|
|
|
import com.ruoyi.common.utils.SendSmsUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.system.domain.MiniprogramQueryLog;
|
|
|
import com.ruoyi.system.domain.QueryConfig;
|
|
|
import com.ruoyi.system.domain.ReportDetail;
|
|
|
import com.ruoyi.system.domain.ReportQueryLog;
|
|
|
+import com.ruoyi.system.mapper.MiniprogramQueryLogMapper;
|
|
|
import com.ruoyi.system.mapper.QueryConfigMapper;
|
|
|
import com.ruoyi.system.mapper.ReportDetailMapper;
|
|
|
import com.ruoyi.system.mapper.ReportQueryLogMapper;
|
|
@@ -23,10 +23,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+
|
|
|
import java.util.Calendar;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import static com.ruoyi.common.core.domain.AjaxResult.MSG_TAG;
|
|
|
+import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
|
|
|
|
/**
|
|
|
* @author tjf
|
|
@@ -47,6 +49,9 @@ public class QueryServiceImpl implements IQueryService {
|
|
|
@Autowired
|
|
|
private QueryConfigMapper queryConfigMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MiniprogramQueryLogMapper miniprogramQueryLogMapper;
|
|
|
+
|
|
|
|
|
|
//短信参数
|
|
|
@Value("${sms_aliyun_accessKeyId}")
|
|
@@ -103,8 +108,6 @@ public class QueryServiceImpl implements IQueryService {
|
|
|
String remark = "";
|
|
|
if (StringUtils.isBlank(qrImage)) {
|
|
|
remark = "未接收到二维码";
|
|
|
- reportQueryLog.setRemark(remark);
|
|
|
- reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
|
|
|
return AjaxResult.error(remark);
|
|
|
}
|
|
|
try {
|
|
@@ -112,8 +115,6 @@ public class QueryServiceImpl implements IQueryService {
|
|
|
String reportNumber = QRCodeUtils.decode(qrImage);
|
|
|
if (StringUtils.isBlank(reportNumber)) {
|
|
|
remark = "二维码解析失败";
|
|
|
- reportQueryLog.setRemark(remark);
|
|
|
- reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
|
|
|
return AjaxResult.error(remark);
|
|
|
}
|
|
|
/* //查询二维码有效期
|
|
@@ -128,9 +129,13 @@ public class QueryServiceImpl implements IQueryService {
|
|
|
ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
|
|
|
if (reportDetail != null) {
|
|
|
reportDetail.setReportUrl(null);
|
|
|
- reportQueryLog.setIsSuccess("Y");
|
|
|
- reportQueryLog.setRemark(UserConstants.QUERY_SUCCESS);
|
|
|
- reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
|
|
|
+ MiniprogramQueryLog miniprogramQueryLog = new MiniprogramQueryLog();
|
|
|
+ miniprogramQueryLog.setReportNumber(reportNumber);
|
|
|
+ miniprogramQueryLog.setQueryPhone(reportQueryLog.getQueryPhone());
|
|
|
+ miniprogramQueryLog.setCreateTime(DateUtils.getNowDate());
|
|
|
+ miniprogramQueryLog.setCreateBy(reportQueryLog.getQueryPhone());
|
|
|
+ miniprogramQueryLog.setQueryMode("1");
|
|
|
+ miniprogramQueryLogMapper.insertMiniprogramQueryLog(miniprogramQueryLog);
|
|
|
return AjaxResult.success(reportDetail);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -140,6 +145,29 @@ public class QueryServiceImpl implements IQueryService {
|
|
|
return AjaxResult.error("未查询到对应信息");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 小程序根据编号查询
|
|
|
+ * @param reportQueryLog
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AjaxResult queryReportNum(ReportQueryLog reportQueryLog) {
|
|
|
+ String reportNumber = reportQueryLog.getReportNumber();
|
|
|
+ ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
|
|
|
+ if (reportDetail != null) {
|
|
|
+ reportDetail.setReportUrl(null);
|
|
|
+ MiniprogramQueryLog miniprogramQueryLog = new MiniprogramQueryLog();
|
|
|
+ miniprogramQueryLog.setReportNumber(reportNumber);
|
|
|
+ miniprogramQueryLog.setQueryPhone(reportQueryLog.getQueryPhone());
|
|
|
+ miniprogramQueryLog.setCreateTime(DateUtils.getNowDate());
|
|
|
+ miniprogramQueryLog.setCreateBy(reportQueryLog.getQueryPhone());
|
|
|
+ miniprogramQueryLog.setQueryMode("2");
|
|
|
+ miniprogramQueryLogMapper.insertMiniprogramQueryLog(miniprogramQueryLog);
|
|
|
+ return AjaxResult.success(reportDetail);
|
|
|
+ }
|
|
|
+ return AjaxResult.error("查询的文档编号不存在");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 发送短信验证码
|
|
|
*
|