diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f3fb7d8..8309a0f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,14 +9,13 @@
-
+
+
-
-
-
-
-
-
+
+
+
+
@@ -73,58 +72,58 @@
- {
- "keyToString": {
- "Application.DivPassDataImpl.executor": "Run",
- "Application.ImageUtils.executor": "Run",
- "Application.PubTools.executor": "Run",
- "Application.QCodeInfoServiceImpl.executor": "Debug",
- "Application.SensitiveFilter.executor": "Run",
- "Application.main.executor": "Debug",
- "Application.redisConfigUtil.executor": "Debug",
- "Maven.IntegraManager [clean].executor": "Run",
- "Maven.IntegraManager [install].executor": "Run",
- "Maven.IntegralManager [clean].executor": "Run",
- "Maven.IntegralManager [install].executor": "Run",
- "Maven.IntegralManager [validate].executor": "Run",
- "Maven.IntegralManagerSys [clean].executor": "Run",
- "Maven.IntegralManagerSys [install].executor": "Run",
- "Maven.devProject [clean].executor": "Run",
- "Maven.devProject [install].executor": "Run",
- "Maven.dev_project [clean].executor": "Run",
- "Maven.dev_project [install].executor": "Run",
- "Maven.special_event [clean].executor": "Run",
- "Maven.special_event [install].executor": "Run",
- "Maven.special_event [org.apache.maven.plugins:maven-assembly-plugin:3.3.0:single].executor": "Run",
- "Maven.special_event [org.springframework.boot:spring-boot-maven-plugin:2.7.11:repackage].executor": "Run",
- "Maven.special_event [package].executor": "Run",
- "Maven.special_event [validate].executor": "Run",
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "SHARE_PROJECT_CONFIGURATION_FILES": "true",
- "TomEE Server.special_event.executor": "Debug",
- "Tomcat Server.Tomcat 9.0.80.executor": "Debug",
- "deletionFromPopupRequiresConfirmation": "false",
- "git-widget-placeholder": "master",
- "kotlin-language-version-configured": "true",
- "last_opened_file_path": "E:/work/TGGLT-WorkSpace/IntegralManager",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "project.structure.last.edited": "Modules",
- "project.structure.proportion": "0.15",
- "project.structure.side.proportion": "0.37169158",
- "settings.editor.selected.configurable": "vcs.Git",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -147,33 +146,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -385,17 +358,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -556,7 +518,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -686,7 +657,31 @@
1731986350521
-
+
+
+ 1732871610553
+
+
+
+ 1732871610553
+
+
+
+ 1733208152671
+
+
+
+ 1733208152672
+
+
+
+ 1733293115770
+
+
+
+ 1733293115770
+
+
@@ -716,7 +711,8 @@
-
+
+
diff --git a/pom.xml b/pom.xml
index 5c5b8a4..47198b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,6 +21,7 @@
+
org.springframework.boot
spring-boot-starter-web
@@ -196,7 +197,12 @@
knife4j-openapi2-spring-boot-starter
4.4.0
-
+
+
+ org.springframework.session
+ spring-session-data-redis
+
+
org.springframework.boot
spring-boot-starter-data-redis
@@ -218,7 +224,6 @@
commons-io
2.4
-
diff --git a/src/main/java/com/nmgs/controller/LoginController.java b/src/main/java/com/nmgs/controller/LoginController.java
new file mode 100644
index 0000000..9a231a8
--- /dev/null
+++ b/src/main/java/com/nmgs/controller/LoginController.java
@@ -0,0 +1,64 @@
+package com.nmgs.controller;
+
+import cn.hutool.captcha.LineCaptcha;
+import cn.hutool.captcha.generator.RandomGenerator;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+@RestController
+@RequestMapping(value = "login")
+@Api(tags = "登录信息")
+public class LoginController {
+ /**
+ * 登录页面获取验证码
+ *
+ * @return
+ */
+ @RequestMapping(value = "getCode",
+ method = {RequestMethod.POST}
+ )
+ @ApiOperation(httpMethod = "POST", value = "登录页面获取图片流验证码")
+ public ResponseEntity getCode() throws IOException {
+ //配置验证码图片的宽度,以及验证码字符的个数,还有它的模糊程度(也就是干扰线),这儿设置4个字符,1条干扰线
+ LineCaptcha captcha = new LineCaptcha(130, 40, 4, 1);
+ //配置只有纯数字 1到9
+ captcha.setGenerator(new RandomGenerator("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 4));
+ //配置背景颜色
+ captcha.setBackground(Color.pink);
+ //配置字体
+ captcha.setFont(new Font("微软雅黑", Font.BOLD, 18));
+ //这儿就是生成验证码了
+ String captchaCode = captcha.getCode();
+ //其实,到这儿,验证码已配置完成,大家可以打印下 captchaCode 是可以出来4个字符的字符串的。
+ System.out.println("验证码==========>" + captchaCode);
+ //下面两行是生成图片的文件流
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ ImageIO.write(captcha.getImage(), "png", outputStream);
+
+
+ //在这中间还有一串的代码
+ //那就是还需要生成唯一的uuid,将来需要结合当前生成验证码结合起来
+ //把它们存到缓存中,这样,前端发送过后就可以拿来做比较
+
+ //这儿就是设置返回体以及返回的内容(最后返回的是一个图片的文件流,直接在浏览器访问看到是一个图片)
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(org.springframework.http.MediaType.IMAGE_PNG);
+ headers.set("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
+ headers.setPragma("no-cache");
+ headers.setDate("Expires", 0);
+
+ byte[] b = outputStream.toByteArray();
+ return new ResponseEntity<>(b, headers, HttpStatus.OK);
+ }
+}
diff --git a/src/main/java/com/nmgs/controller/WebSocket.java b/src/main/java/com/nmgs/controller/WebSocket.java
index 206a6eb..4b2cff8 100644
--- a/src/main/java/com/nmgs/controller/WebSocket.java
+++ b/src/main/java/com/nmgs/controller/WebSocket.java
@@ -26,7 +26,7 @@ public class WebSocket {
@OnOpen
public void onOpen(Session session,@PathParam(value = "userId") String userId) throws IOException {
- System.out.println("连接websocket的人员======"+userId);
+ LogUtil.WriteLog_Info("连接websocket的人员======" + userId, "WebSocket");
WebsocketUtil.addSession(userId, session);
JSONObject retJo=new JSONObject();
retJo.put("code",1);
@@ -37,7 +37,7 @@ public class WebSocket {
@OnClose
public void onClose(Session session,@PathParam(value = "userId") String userId) {
- System.out.println("关闭连接的人员======"+userId);
+ LogUtil.WriteLog_Info("关闭连接的人员======" + userId, "WebSocket");
String socketId = userId;
WebsocketUtil.removeSession(socketId);
}
diff --git a/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java b/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java
index 9377add..b28089a 100644
--- a/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java
@@ -1642,12 +1642,13 @@ public class QCodeInfoServiceImpl {
}else{
if (!content.contains("|")) {
//需要判断是否是餐饮预约
- String appointMentSql = "select t.ID,t.SERVICEOPERATIONID,tt.JOBNUMBER,t.COMPLETESTATUS from APPOINTMENT_INFO_TABLE t,SERVICE_AREA_OPERATORS_TABLE tt where t.SERVICEOPERATIONID = tt.ID AND t.ORDERID='" + content + "'";
+ String appointMentSql = "select t.ID,t.SERVICEOPERATIONID,tt.JOBNUMBER,t.COMPLETESTATUS,wut.OPENID from APPOINTMENT_INFO_TABLE t,SERVICE_AREA_OPERATORS_TABLE tt,WEIXN_USER_TABLE wut where wut.ID=t.USERID AND t.SERVICEOPERATIONID = tt.ID AND t.ORDERID='" + content + "'";
List appointMentList = this.mapperI.selectforlist(appointMentSql);
if (appointMentList != null && appointMentList.size() > 0) {
Map appointment = (Map) appointMentList.get(0);
String appomintJob = appointment.get("JOBNUMBER").toString();
String completeStatus = appointment.get("COMPLETESTATUS").toString();
+ openId = appointment.get("OPENID").toString();
if ("Y".equals(completeStatus)) {
if (!appomintJob.equals(serverOperationId)) {//数据已核销
ret = "12";
@@ -1674,6 +1675,7 @@ public class QCodeInfoServiceImpl {
this.mapperI.update(updateAppointSql);
LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
ret = "1";
+ retJo.put("openId", openId);
retJo.put("ret", ret);
return retJo;
}
diff --git a/src/main/java/com/nmgs/util/WebsocketUtil.java b/src/main/java/com/nmgs/util/WebsocketUtil.java
index ce8083a..611572f 100644
--- a/src/main/java/com/nmgs/util/WebsocketUtil.java
+++ b/src/main/java/com/nmgs/util/WebsocketUtil.java
@@ -62,9 +62,11 @@ public class WebsocketUtil {
*/
public static void sendMessage(Session session, String message) {
if (session == null) {
+ LogUtil.WriteLog_Info("websocket给前端发送消息======session为空{}" + message, "WebSocket");
return;
}
synchronized(session) {
+ LogUtil.WriteLog_Info("websocket给前端发送消息======" + session.getId() + "=={}" + message, "WebSocket");
try {
session.getBasicRemote().sendText(message);
} catch (IOException e) {