Althars123 3 年之前
父節點
當前提交
f832631c88

+ 11 - 0
twzd-admin/src/test/java/com/miaxis/test/NormalTest.java

@@ -1,9 +1,12 @@
 package com.miaxis.test;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.miaxis.TwzdApplication;
 import com.miaxis.question.mapper.QuestionInfoMapper;
 import com.miaxis.question.vo.QuestionInfoExcelTypeVo;
 import com.miaxis.question.vo.QuestionInfoExcelVo;
+import com.miaxis.wx.domain.WxForeverCode;
+import com.miaxis.wx.service.IWxForeverCodeService;
 import com.miaxis.wx.service.impl.WxGzhServiceImpl;
 import org.apache.poi.hssf.usermodel.*;
 import org.junit.Test;
@@ -29,7 +32,15 @@ public class NormalTest {
     @Resource
     QuestionInfoMapper questionInfoMapper;
 
+    @Resource
+    IWxForeverCodeService wxForeverCodeService;
 
+    @Test
+    public void test11() throws Exception {
+        String  content = "k3vvps";
+        WxForeverCode wxForeverCode = wxForeverCodeService.getOne(new QueryWrapper<WxForeverCode>().eq("code", content).isNull("openid"));
+        System.out.println(11);
+    }
 
 
     @Test

+ 1 - 1
twzd-service/src/main/java/com/miaxis/wx/service/impl/WxGzhServiceImpl.java

@@ -117,7 +117,7 @@ public class WxGzhServiceImpl implements IWxGzhService {
             if (MessageUtil.MESSAGE_TEXT.equals(msgType)) { // 文本消息
                 log.info("2.1...");
                 String content = jsonObjectData.getStr("Content");
-                WxForeverCode wxForeverCode = wxForeverCodeService.getOne(new QueryWrapper<WxForeverCode>().eq("code", content).eq("openid",null));
+                WxForeverCode wxForeverCode = wxForeverCodeService.getOne(new QueryWrapper<WxForeverCode>().eq("code", content).isNull("openid"));
                 //若该口令为未使用的口令
                 if (wxForeverCode != null){
                     log.info("2.1.1:口令有效,生成永久二维码");