Browse Source

判断二维码是否过期

v2
蟑螂恶霸 2 years ago
parent
commit
46aaee4558
  1. 14
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java
  2. 3
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml
  3. 2
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/information/information.html
  4. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseInformationController.java
  5. 13
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java
  6. 20
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java
  7. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

14
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java

@ -226,8 +226,8 @@ public class AppEnterpriseInformationController extends BaseController
* @return * @return
*/ */
@ResponseBody @ResponseBody
@GetMapping("/checkIsState/{enterpriseNumber}") @GetMapping("/checkIsState/{enterpriseNumber}/{id}")
public ZDResponse checkIsState(@PathVariable("enterpriseNumber") String enterpriseNumber){ public ZDResponse checkIsState(@PathVariable("enterpriseNumber") String enterpriseNumber, @PathVariable("id") String id){
// 根据加密后的企业编码查询出企业信息 // 根据加密后的企业编码查询出企业信息
System.out.println("===============================进入企业判断======================================"); System.out.println("===============================进入企业判断======================================");
EnterpriseInformation enterpriseInformation = enterpriseInformationService.selectEnterpriseInformationBySalt(enterpriseNumber); EnterpriseInformation enterpriseInformation = enterpriseInformationService.selectEnterpriseInformationBySalt(enterpriseNumber);
@ -236,11 +236,13 @@ public class AppEnterpriseInformationController extends BaseController
System.out.println("===============================二维码判断======================================"); System.out.println("===============================二维码判断======================================");
// 通过正常企业编码查询二维码信息 // 通过正常企业编码查询二维码信息
QrCodeGenerateHistory params = new QrCodeGenerateHistory(); QrCodeGenerateHistory params = new QrCodeGenerateHistory();
params.setEnterpriseNumber(enterpriseInformation.getEnterpriseNumber()); // params.setEnterpriseNumber(enterpriseInformation.getEnterpriseNumber());
params.setStatus(0); // params.setStatus(0);
List<QrCodeGenerateHistory> qrCodeGenerateHistories = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryList(params); // List<QrCodeGenerateHistory> qrCodeGenerateHistories = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryList(params);
// 应该用过id来获取二维码信息判断是否过期
QrCodeGenerateHistory qrCodeGenerateHistories = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryById(id);
System.out.println("===============================二维码查询======================================"); System.out.println("===============================二维码查询======================================");
if (null != qrCodeGenerateHistories && qrCodeGenerateHistories.size()>0) { if (null != qrCodeGenerateHistories && qrCodeGenerateHistories.getStatus()==0) {
return ZDResponse.success("二维码正常",Boolean.TRUE); return ZDResponse.success("二维码正常",Boolean.TRUE);
} }
return ZDResponse.success("二维码已过期",Boolean.FALSE); return ZDResponse.success("二维码已过期",Boolean.FALSE);

3
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml

@ -157,6 +157,9 @@
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
AND (u.dept_id = #{deptId}) AND (u.dept_id = #{deptId})
</if> </if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<!-- 租户数据过滤 --> <!-- 租户数据过滤 -->
<if test="tenantCode != @com.zdxt.auth.common.constant.Constants@DEFAULT_TENANT_CODE and tenantCode != null and tenantCode != ''"> <if test="tenantCode != @com.zdxt.auth.common.constant.Constants@DEFAULT_TENANT_CODE and tenantCode != null and tenantCode != ''">
AND u.tenant_code = #{tenantCode} AND u.tenant_code = #{tenantCode}

2
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/information/information.html

@ -20,7 +20,7 @@
</li> </li>
<li> <li>
<p>企业类型:</p> <p>企业类型:</p>
<select name="enterpriseType" th:with="type=${@dict.getType('')}"> <select name="enterpriseType" th:with="type=${@dict.getType('enterpriseType')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseInformationController.java

@ -42,6 +42,8 @@ public class EnterpriseInformationController extends BaseController
@GetMapping() @GetMapping()
public String information() public String information()
{ {
// 因为企业类型是中文的, 所以分组统计出来
return prefix + "/information"; return prefix + "/information";
} }

13
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java

@ -142,6 +142,11 @@ public class EnforcementRegistration extends BaseDomain
/** 未扫码原因 */ /** 未扫码原因 */
private String enforce; private String enforce;
/** 预约关联id */
private String lawId;
/** 预约关联文字 */
private String lawText;
/** /**
* 关键字查询 * 关键字查询
*/ */
@ -155,7 +160,6 @@ public class EnforcementRegistration extends BaseDomain
private String lawCertificateNumText; private String lawCertificateNumText;
private String lawCertificateNumTwoText; private String lawCertificateNumTwoText;
private String subsidiaryerText; private String subsidiaryerText;
private String lawId;
private int comOrOpi; private int comOrOpi;
private String uniteCheck; private String uniteCheck;
private List fileListObj; private List fileListObj;
@ -187,6 +191,13 @@ public class EnforcementRegistration extends BaseDomain
*/ */
private EnterpriseEvaluate enterpriseEvaluate; private EnterpriseEvaluate enterpriseEvaluate;
public String getLawText() {
return lawText;
}
public void setLawText(String lawText) {
this.lawText = lawText;
}
public String getCheckCss() { public String getCheckCss() {
return checkCss; return checkCss;

20
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

@ -18,6 +18,7 @@ import java.util.Map;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import com.zdxt.auth.dto.UserBean; import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.FileUploadApi; import com.zdxt.auth.feign.FileUploadApi;
import com.zdxt.auth.feign.UserApi; import com.zdxt.auth.feign.UserApi;
@ -150,7 +151,13 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation); i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation);
} }
if(i > 0){ if(i > 0){
String text = salt; // String text = salt;
String uuid = IdUtil.simpleUUID();
Map<String, String> jsonMap = new HashMap<>();
jsonMap.put("salt", salt);
jsonMap.put("codeId", uuid);
jsonMap.put("type", "tmp");
String text = JSON.toJSONString(jsonMap);
//这里设置自定义网站url //这里设置自定义网站url
String logoPath = qrCodeUrl; String logoPath = qrCodeUrl;
try { try {
@ -158,7 +165,7 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
MultipartFile multipartFile = QRCodeUtil.getMultipartFile(encode); MultipartFile multipartFile = QRCodeUtil.getMultipartFile(encode);
String upload = fileUploadApi.upload(multipartFile); String upload = fileUploadApi.upload(multipartFile);
String uuid = IdUtil.simpleUUID(); // String uuid = IdUtil.simpleUUID();
QrCodeGenerateHistory qrCodeGenerateHistory = new QrCodeGenerateHistory(); QrCodeGenerateHistory qrCodeGenerateHistory = new QrCodeGenerateHistory();
qrCodeGenerateHistory.setId(uuid); qrCodeGenerateHistory.setId(uuid);
//生成时间 //生成时间
@ -351,7 +358,13 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
List<EnterpriseInformation> enterpriseInformations = enterpriseInformationMapper.selectEnterpriseInformationList(info); List<EnterpriseInformation> enterpriseInformations = enterpriseInformationMapper.selectEnterpriseInformationList(info);
if (null != enterpriseInformations && enterpriseInformations.size() > 0) { if (null != enterpriseInformations && enterpriseInformations.size() > 0) {
EnterpriseInformation enterpriseInformation = enterpriseInformations.get(0); EnterpriseInformation enterpriseInformation = enterpriseInformations.get(0);
String text = enterpriseInformation.getSalt(); // String text = enterpriseInformation.getSalt();
String uuid = IdUtil.simpleUUID();
Map<String, String> jsonMap = new HashMap<>();
jsonMap.put("salt", enterpriseInformation.getSalt());
jsonMap.put("codeId", uuid);
jsonMap.put("type", "tmp");
String text = JSON.toJSONString(jsonMap);
//这里设置自定义网站url //这里设置自定义网站url
String logoPath = qrCodeUrl; String logoPath = qrCodeUrl;
try { try {
@ -359,7 +372,6 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
MultipartFile multipartFile = QRCodeUtil.getMultipartFile(encode); MultipartFile multipartFile = QRCodeUtil.getMultipartFile(encode);
String upload = fileUploadApi.upload(multipartFile); String upload = fileUploadApi.upload(multipartFile);
String uuid = IdUtil.simpleUUID();
QrCodeGenerateHistory qrCodeGenerateHistory = new QrCodeGenerateHistory(); QrCodeGenerateHistory qrCodeGenerateHistory = new QrCodeGenerateHistory();
qrCodeGenerateHistory.setId(uuid); qrCodeGenerateHistory.setId(uuid);
//生成时间 //生成时间

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -45,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="bureauDeptId" column="bureau_dept_id" /> <result property="bureauDeptId" column="bureau_dept_id" />
<result property="bureauDeptName" column="bureau_dept_name" /> <result property="bureauDeptName" column="bureau_dept_name" />
<result property="isEvaluate" column="is_evaluate" /> <result property="isEvaluate" column="is_evaluate" />
<result property="lawId" column="law_id" />
<result property="lawText" column="law_text" />
</resultMap> </resultMap>
<resultMap type="com.zdxt.code.domain.EnforceRegCount" id="EnforceRegCountResult"> <resultMap type="com.zdxt.code.domain.EnforceRegCount" id="EnforceRegCountResult">
@ -60,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
subsidiaryer_id, subsidiaryer_tel, law_enforcement_item, law_enforcement_item_text, subsidiaryer_id, subsidiaryer_tel, law_enforcement_item, law_enforcement_item_text,
law_enforcement_basis, law_enforcement_basis_text, remark, reslut, user_id, dept_id, is_delete, status, law_enforcement_code, law_enforcement_basis, law_enforcement_basis_text, remark, reslut, user_id, dept_id, is_delete, status, law_enforcement_code,
is_complaint,is_submit, unite_check,check_css, enforce_reason, law_field,check_category, is_complaint,is_submit, unite_check,check_css, enforce_reason, law_field,check_category,
bureau_dept_id,bureau_dept_name,is_evaluate bureau_dept_id,bureau_dept_name,is_evaluate, law_id, law_text
from enforcement_registration from enforcement_registration
</sql> </sql>
@ -183,6 +185,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bureauDeptName != null and bureauDeptName != ''"> bureau_dept_name,</if> <if test="bureauDeptName != null and bureauDeptName != ''"> bureau_dept_name,</if>
<if test="bureauDeptId != null and bureauDeptId != ''"> bureau_dept_id,</if> <if test="bureauDeptId != null and bureauDeptId != ''"> bureau_dept_id,</if>
<if test="isEvaluate != null"> is_evaluate,</if> <if test="isEvaluate != null"> is_evaluate,</if>
<if test="lawId != null and lawId != ''"> law_id,</if>
<if test="lawText != null and lawText != ''"> law_text,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if> <if test="id != null and id != ''">#{id},</if>
@ -225,6 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bureauDeptName != null and bureauDeptName != ''"> #{bureauDeptName},</if> <if test="bureauDeptName != null and bureauDeptName != ''"> #{bureauDeptName},</if>
<if test="bureauDeptId != null and bureauDeptId != ''"> #{bureauDeptId},</if> <if test="bureauDeptId != null and bureauDeptId != ''"> #{bureauDeptId},</if>
<if test="isEvaluate != null"> #{isEvaluate},</if> <if test="isEvaluate != null"> #{isEvaluate},</if>
<if test="lawId != null and lawId != ''"> #{lawId},</if>
<if test="lawText != null and lawText != ''"> #{lawText},</if>
</trim> </trim>
</insert> </insert>
@ -269,6 +275,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bureauDeptName != null and bureauDeptName != ''"> bureau_dept_name = #{bureauDeptName},</if> <if test="bureauDeptName != null and bureauDeptName != ''"> bureau_dept_name = #{bureauDeptName},</if>
<if test="bureauDeptId != null and bureauDeptId != ''"> bureau_dept_id = #{bureauDeptId},</if> <if test="bureauDeptId != null and bureauDeptId != ''"> bureau_dept_id = #{bureauDeptId},</if>
<if test="isEvaluate != null"> is_evaluate = #{isEvaluate},</if> <if test="isEvaluate != null"> is_evaluate = #{isEvaluate},</if>
<if test="lawId != null and lawId != ''"> law_id = #{lawId},</if>
<if test="lawText != null and lawText != ''"> law_text = #{lawText},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

Loading…
Cancel
Save