jinshihui 1 săptămână în urmă
părinte
comite
3286998911
24 a modificat fișierele cu 717 adăugiri și 407 ștergeri
  1. 3 0
      .gitignore
  2. 43 10
      nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/TJsController.java
  3. 11 6
      nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/WeChatController.java
  4. 6 9
      nightFragrance-admin/src/main/java/com/ylx/web/controller/system/SysLoginController.java
  5. 1 1
      nightFragrance-admin/src/main/resources/application-dev.yml
  6. 10 6
      nightFragrance-admin/src/main/resources/application-pro.yml
  7. 6 4
      nightFragrance-admin/src/main/resources/application-test.yml
  8. 1 1
      nightFragrance-admin/src/main/resources/application.yml
  9. 1 1
      nightFragrance-admin/src/main/resources/mybatis/mybatis-config.xml
  10. 6 0
      nightFragrance-common/pom.xml
  11. 6 0
      nightFragrance-common/src/main/java/com/ylx/common/config/WechatAccountConfig.java
  12. 36 48
      nightFragrance-common/src/main/java/com/ylx/common/core/domain/AjaxResult.java
  13. 25 38
      nightFragrance-common/src/main/java/com/ylx/common/core/domain/R.java
  14. 38 60
      nightFragrance-common/src/main/java/com/ylx/common/core/redis/RedisCache.java
  15. 30 56
      nightFragrance-common/src/main/java/com/ylx/common/utils/SecurityUtils.java
  16. 3 4
      nightFragrance-framework/src/main/java/com/ylx/framework/security/handle/AuthenticationEntryPointImpl.java
  17. 27 42
      nightFragrance-framework/src/main/java/com/ylx/framework/web/service/SysLoginService.java
  18. 176 60
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/TJs.java
  19. 8 0
      nightFragrance-massage/src/main/java/com/ylx/massage/enums/JsStatusEnum.java
  20. 246 3
      nightFragrance-massage/src/main/java/com/ylx/massage/service/TJsService.java
  21. 6 6
      nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/TJsServiceImpl.java
  22. 3 1
      nightFragrance-massage/src/main/java/com/ylx/massage/utils/WeChatUtil.java
  23. 25 48
      nightFragrance-system/src/main/java/com/ylx/system/service/impl/SysConfigServiceImpl.java
  24. 0 3
      pom.xml

+ 3 - 0
.gitignore

@@ -45,3 +45,6 @@ nbdist/
 !*/build/*.java
 !*/build/*.html
 !*/build/*.xml
+CLAUDE.md
+*模块功能.md
+.vscode/

+ 43 - 10
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/TJsController.java

@@ -87,10 +87,10 @@ public class TJsController extends BaseController {
 
 
     /**
-     * 添加技师申请
+     * PC端添加技师申请
      *
      * @param js
-     * @return
+     * @return R
      */
     @Log(title = "技师管理", businessType = BusinessType.INSERT)
     @RequestMapping(value = "pc/add", method = RequestMethod.POST)
@@ -98,6 +98,7 @@ public class TJsController extends BaseController {
     public R pcAdd(@RequestBody TJs js) {
         return R.ok(jsService.pcAddJs(js));
     }
+
     /**
      * 更新技师信息
      *
@@ -165,6 +166,12 @@ public class TJsController extends BaseController {
     }
 
 
+    /**
+     * 解绑微信账号
+     *
+     * @param id
+     * @return R
+     */
     @Log(title = "解绑", businessType = BusinessType.UPDATE)
     @RequestMapping(value = "pc/unbind", method = RequestMethod.GET)
     @ApiOperation("技师解绑")
@@ -179,6 +186,8 @@ public class TJsController extends BaseController {
             return R.fail("系统异常");
         }
     }
+
+
     /**
      * 微信查询
      *
@@ -233,13 +242,18 @@ public class TJsController extends BaseController {
 
 
     /**
-     * 分页查询数据
+     * 分页查询技师数据
+     *
+     * @param page
+     * @param js
+     * @return Page<TJs>
      */
     @RequestMapping(value = "/select", method = RequestMethod.GET)
-    @ApiOperation("分页查询数据")
+    @ApiOperation("分页查询技师数据")
     public Page<TJs> selectSp(Page<TJs> page, TJs js) {
         LoginUser loginUser = this.getLoginUser();
         log.info("loginUser:{}", JSONUtil.toJsonStr(loginUser));
+
         LambdaQueryWrapper<TJs> mhCompanyLambdaQueryWrapper = new LambdaQueryWrapper<>();
         mhCompanyLambdaQueryWrapper.eq(null != js.getnTong(), TJs::getnTong, js.getnTong()).
                 like(StringUtils.isNotBlank(js.getcName()), TJs::getcName, js.getcName()).
@@ -263,16 +277,29 @@ public class TJsController extends BaseController {
 
 
     /**
-     * 删除
+     * 删除技师
+     *
+     * @param js
+     * @return Boolean
      */
     @Log(title = "技师管理", businessType = BusinessType.DELETE)
     @RequestMapping(value = "/del", method = RequestMethod.POST)
-    @ApiOperation("删除")
-    public Boolean del(@RequestBody TJs js) {
-        return jsService.removeById(js);
+    @ApiOperation("删除技师")
+    public R del(@RequestBody TJs js) {
+        boolean b = jsService.removeById(js);
+        if(b){
+            return R.ok();
+        }
+        return R.fail("删除失败");
     }
 
-    @ApiOperation("根据id查询技师")
+    /**
+     * 根据id查询技师详情
+     *
+     * @param js
+     * @return R
+     */
+    @ApiOperation("根据id查询技师详情")
     @RequestMapping(value = "/wx/getByid", method = RequestMethod.POST)
     public R getById(@RequestBody TJs js) {
         try {
@@ -286,7 +313,13 @@ public class TJsController extends BaseController {
         }
     }
 
-    @ApiOperation("根据OpenId查询技师")
+    /**
+     * 根据OpenId查询技师详情
+     *
+     * @param js
+     * @return R
+     */
+    @ApiOperation("根据OpenId查询技师详情")
     @RequestMapping(value = "/wx/getByOpenId", method = RequestMethod.POST)
     public R getByOpenId(@RequestBody TJs js) {
         try {

+ 11 - 6
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/WeChatController.java

@@ -64,7 +64,7 @@ import static com.ylx.massage.utils.OtherUtil.verification;
  */
 @Slf4j
 @RestController
-@Api(tags = {"微信公众号"})
+@Api(tags = {"微信服务号"})
 @RequestMapping("/weChat")
 public class WeChatController extends BaseController {
 
@@ -418,13 +418,19 @@ public class WeChatController extends BaseController {
     }
 
 
-    @ApiOperation("兑换JS公众号二维码")
+    /**
+     * 兑换技师公众号二维码
+     *
+     * @param ticket
+     * @param id
+     * @return String
+     * @throws UnsupportedEncodingException
+     */
+    @ApiOperation("兑换技师公众号二维码")
     @RequestMapping(value = "getJSwxQrCodeDh", method = RequestMethod.GET)
     public String getJSwxQrCode1(@RequestParam String ticket,@RequestParam String id) throws UnsupportedEncodingException {
 
-
-        String qrCodeUrl = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="
-                + URLEncoder.encode(ticket, "UTF-8");
+        String qrCodeUrl = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + URLEncoder.encode(ticket, "UTF-8");
         String filePath = RuoYiConfig.getUploadEwmPath() + id +".png";
         log.info("二维码地址:{}", filePath);
 
@@ -438,7 +444,6 @@ public class WeChatController extends BaseController {
         } catch (Exception e) {
             e.printStackTrace();
         }
-        log.info("二维码地址:{}", filePath);
         int lastSlashIndex = filePath.lastIndexOf("/");
         String fileName = filePath.substring(lastSlashIndex + 1);
         return Constants.RESOURCE_PREFIX + "/ewm/" + fileName;

+ 6 - 9
nightFragrance-admin/src/main/java/com/ylx/web/controller/system/SysLoginController.java

@@ -2,6 +2,7 @@ package com.ylx.web.controller.system;
 
 import java.util.List;
 import java.util.Set;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -18,13 +19,12 @@ import com.ylx.framework.web.service.SysPermissionService;
 import com.ylx.system.service.ISysMenuService;
 
 /**
- * 登录验证
+ * 登录
  *
  * @author ylx
  */
 @RestController
-public class SysLoginController
-{
+public class SysLoginController {
     @Autowired
     private SysLoginService loginService;
 
@@ -41,8 +41,7 @@ public class SysLoginController
      * @return 结果
      */
     @PostMapping("/login")
-    public AjaxResult login(@RequestBody LoginBody loginBody)
-    {
+    public AjaxResult login(@RequestBody LoginBody loginBody) {
         AjaxResult ajax = AjaxResult.success();
         // 生成令牌
         String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
@@ -57,8 +56,7 @@ public class SysLoginController
      * @return 用户信息
      */
     @GetMapping("getInfo")
-    public AjaxResult getInfo()
-    {
+    public AjaxResult getInfo() {
         SysUser user = SecurityUtils.getLoginUser().getUser();
         // 角色集合
         Set<String> roles = permissionService.getRolePermission(user);
@@ -77,8 +75,7 @@ public class SysLoginController
      * @return 路由信息
      */
     @GetMapping("getRouters")
-    public AjaxResult getRouters()
-    {
+    public AjaxResult getRouters() {
         Long userId = SecurityUtils.getUserId();
         List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
         return AjaxResult.success(menuService.buildMenus(menus));

+ 1 - 1
nightFragrance-admin/src/main/resources/application-dev.yml

@@ -133,7 +133,7 @@ spring:
     # 端口,默认为6379
     port: 6379
     # 数据库索引
-    database: 0
+    database: 1
     # 密码
     password: '123456'
     # 连接超时时间

+ 10 - 6
nightFragrance-admin/src/main/resources/application-pro.yml

@@ -60,9 +60,12 @@ spring:
       # 主库数据源
       master:
         # url: jdbc:mysql://39.98.239.48:3366/night_fragrance?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-        url: jdbc:mysql://rm-8vbaejxof1xh06o9r.mysql.zhangbei.rds.aliyuncs.com:3306/night_fragrance?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
-        username: sxzgkj
-        password: 'Iy$@$koH@oURxyvw'
+#        url: jdbc:mysql://rm-8vbaejxof1xh06o9r.mysql.zhangbei.rds.aliyuncs.com:3306/night_fragrance?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
+#        username: sxzgkj
+#        password: 'Iy$@$koH@oURxyvw'
+        url: jdbc:mysql://39.98.239.48:3366/night_fragrance?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: '@RqGHG#KZ*C9ytkQ'
       # 从库数据源
       slave:
         # 从数据源开关/默认关闭
@@ -129,13 +132,14 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 172.24.144.225
+    host: 127.0.0.1
     # 端口,默认为6379
     port: 6379
     # 数据库索引
-    database: 0
+    database: 5
     # 密码
-    password: sxzgkj@2023
+    #password: sxzgkj@2023
+    password: 123456
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 6 - 4
nightFragrance-admin/src/main/resources/application-test.yml

@@ -19,7 +19,7 @@ ylx:
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
-  port: 8080
+  port: 8087
   servlet:
     # 应用的访问路径
     context-path: /
@@ -129,13 +129,15 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 172.24.144.218
+    #host: 172.24.144.218
+    host: 127.0.0.1
     # 端口,默认为6379
     port: 6379
     # 数据库索引
-    database: 0
+    database: 1
     # 密码
-    password: sxzgkj@2023
+    #password: sxzgkj@2023
+    password: 123456
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 1 - 1
nightFragrance-admin/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 spring:
   profiles:
-    active: pro
+    active: dev
 #  profiles:
 #    active: druid

+ 1 - 1
nightFragrance-admin/src/main/resources/mybatis/mybatis-config.xml

@@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
         <!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
         <setting name="defaultExecutorType"      value="SIMPLE" />
 		<!-- 指定 MyBatis 所用日志的具体实现 -->
-        <setting name="logImpl"                  value="SLF4J"  />
+        <!--<setting name="logImpl"                  value="SLF4J"  />-->
         <!-- 使用驼峰命名法转换字段 -->
 		<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
 	</settings>

+ 6 - 0
nightFragrance-common/pom.xml

@@ -194,6 +194,12 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-test</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
     </dependencies>
 
 </project>

+ 6 - 0
nightFragrance-common/src/main/java/com/ylx/common/config/WechatAccountConfig.java

@@ -13,8 +13,14 @@ import org.springframework.stereotype.Component;
 @ConfigurationProperties(prefix = "wechat")
 public class WechatAccountConfig {
 
+    /**
+     * 微信公众号appid
+     */
     private String mpAppId;
 
+    /**
+     * 微信公众号appsecret
+     */
     private String mpAppSecret;
 
     /**

+ 36 - 48
nightFragrance-common/src/main/java/com/ylx/common/core/domain/AjaxResult.java

@@ -2,6 +2,7 @@ package com.ylx.common.core.domain;
 
 import java.util.HashMap;
 import java.util.Objects;
+
 import com.ylx.common.constant.HttpStatus;
 import com.ylx.common.utils.StringUtils;
 
@@ -10,34 +11,37 @@ import com.ylx.common.utils.StringUtils;
  *
  * @author ylx
  */
-public class AjaxResult extends HashMap<String, Object>
-{
+public class AjaxResult extends HashMap<String, Object> {
     private static final long serialVersionUID = 1L;
 
-    /** 状态码 */
+    /**
+     * 状态码
+     */
     public static final String CODE_TAG = "code";
 
-    /** 返回内容 */
+    /**
+     * 返回内容
+     */
     public static final String MSG_TAG = "msg";
 
-    /** 数据对象 */
+    /**
+     * 数据对象
+     */
     public static final String DATA_TAG = "data";
 
     /**
      * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
      */
-    public AjaxResult()
-    {
+    public AjaxResult() {
     }
 
     /**
      * 初始化一个新创建的 AjaxResult 对象
      *
      * @param code 状态码
-     * @param msg 返回内容
+     * @param msg  返回内容
      */
-    public AjaxResult(int code, String msg)
-    {
+    public AjaxResult(int code, String msg) {
         super.put(CODE_TAG, code);
         super.put(MSG_TAG, msg);
     }
@@ -46,15 +50,13 @@ public class AjaxResult extends HashMap<String, Object>
      * 初始化一个新创建的 AjaxResult 对象
      *
      * @param code 状态码
-     * @param msg 返回内容
+     * @param msg  返回内容
      * @param data 数据对象
      */
-    public AjaxResult(int code, String msg, Object data)
-    {
+    public AjaxResult(int code, String msg, Object data) {
         super.put(CODE_TAG, code);
         super.put(MSG_TAG, msg);
-        if (StringUtils.isNotNull(data))
-        {
+        if (StringUtils.isNotNull(data)) {
             super.put(DATA_TAG, data);
         }
     }
@@ -64,8 +66,7 @@ public class AjaxResult extends HashMap<String, Object>
      *
      * @return 成功消息
      */
-    public static AjaxResult success()
-    {
+    public static AjaxResult success() {
         return AjaxResult.success("操作成功");
     }
 
@@ -74,8 +75,7 @@ public class AjaxResult extends HashMap<String, Object>
      *
      * @return 成功消息
      */
-    public static AjaxResult success(Object data)
-    {
+    public static AjaxResult success(Object data) {
         return AjaxResult.success("操作成功", data);
     }
 
@@ -85,20 +85,18 @@ public class AjaxResult extends HashMap<String, Object>
      * @param msg 返回内容
      * @return 成功消息
      */
-    public static AjaxResult success(String msg)
-    {
+    public static AjaxResult success(String msg) {
         return AjaxResult.success(msg, null);
     }
 
     /**
      * 返回成功消息
      *
-     * @param msg 返回内容
+     * @param msg  返回内容
      * @param data 数据对象
      * @return 成功消息
      */
-    public static AjaxResult success(String msg, Object data)
-    {
+    public static AjaxResult success(String msg, Object data) {
         return new AjaxResult(HttpStatus.SUCCESS, msg, data);
     }
 
@@ -108,20 +106,18 @@ public class AjaxResult extends HashMap<String, Object>
      * @param msg 返回内容
      * @return 警告消息
      */
-    public static AjaxResult warn(String msg)
-    {
+    public static AjaxResult warn(String msg) {
         return AjaxResult.warn(msg, null);
     }
 
     /**
      * 返回警告消息
      *
-     * @param msg 返回内容
+     * @param msg  返回内容
      * @param data 数据对象
      * @return 警告消息
      */
-    public static AjaxResult warn(String msg, Object data)
-    {
+    public static AjaxResult warn(String msg, Object data) {
         return new AjaxResult(HttpStatus.WARN, msg, data);
     }
 
@@ -130,8 +126,7 @@ public class AjaxResult extends HashMap<String, Object>
      *
      * @return 错误消息
      */
-    public static AjaxResult error()
-    {
+    public static AjaxResult error() {
         return AjaxResult.error("操作失败");
     }
 
@@ -141,20 +136,18 @@ public class AjaxResult extends HashMap<String, Object>
      * @param msg 返回内容
      * @return 错误消息
      */
-    public static AjaxResult error(String msg)
-    {
+    public static AjaxResult error(String msg) {
         return AjaxResult.error(msg, null);
     }
 
     /**
      * 返回错误消息
      *
-     * @param msg 返回内容
+     * @param msg  返回内容
      * @param data 数据对象
      * @return 错误消息
      */
-    public static AjaxResult error(String msg, Object data)
-    {
+    public static AjaxResult error(String msg, Object data) {
         return new AjaxResult(HttpStatus.ERROR, msg, data);
     }
 
@@ -162,11 +155,10 @@ public class AjaxResult extends HashMap<String, Object>
      * 返回错误消息
      *
      * @param code 状态码
-     * @param msg 返回内容
+     * @param msg  返回内容
      * @return 错误消息
      */
-    public static AjaxResult error(int code, String msg)
-    {
+    public static AjaxResult error(int code, String msg) {
         return new AjaxResult(code, msg, null);
     }
 
@@ -175,8 +167,7 @@ public class AjaxResult extends HashMap<String, Object>
      *
      * @return 结果
      */
-    public boolean isSuccess()
-    {
+    public boolean isSuccess() {
         return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
     }
 
@@ -185,8 +176,7 @@ public class AjaxResult extends HashMap<String, Object>
      *
      * @return 结果
      */
-    public boolean isWarn()
-    {
+    public boolean isWarn() {
         return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
     }
 
@@ -195,21 +185,19 @@ public class AjaxResult extends HashMap<String, Object>
      *
      * @return 结果
      */
-    public boolean isError()
-    {
+    public boolean isError() {
         return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
     }
 
     /**
      * 方便链式调用
      *
-     * @param key 键
+     * @param key   
      * @param value 值
      * @return 数据对象
      */
     @Override
-    public AjaxResult put(String key, Object value)
-    {
+    public AjaxResult put(String key, Object value) {
         super.put(key, value);
         return this;
     }

+ 25 - 38
nightFragrance-common/src/main/java/com/ylx/common/core/domain/R.java

@@ -1,6 +1,7 @@
 package com.ylx.common.core.domain;
 
 import java.io.Serializable;
+
 import com.ylx.common.constant.HttpStatus;
 
 /**
@@ -8,14 +9,17 @@ import com.ylx.common.constant.HttpStatus;
  *
  * @author ylx
  */
-public class R<T> implements Serializable
-{
+public class R<T> implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    /** 成功 */
+    /**
+     * 成功
+     */
     public static final int SUCCESS = HttpStatus.SUCCESS;
 
-    /** 失败 */
+    /**
+     * 失败
+     */
     public static final int FAIL = HttpStatus.ERROR;
 
     private int code;
@@ -24,48 +28,39 @@ public class R<T> implements Serializable
 
     private T data;
 
-    public static <T> R<T> ok()
-    {
+    public static <T> R<T> ok() {
         return restResult(null, SUCCESS, "操作成功");
     }
 
-    public static <T> R<T> ok(T data)
-    {
+    public static <T> R<T> ok(T data) {
         return restResult(data, SUCCESS, "操作成功");
     }
 
-    public static <T> R<T> ok(T data, String msg)
-    {
+    public static <T> R<T> ok(T data, String msg) {
         return restResult(data, SUCCESS, msg);
     }
 
-    public static <T> R<T> fail()
-    {
+    public static <T> R<T> fail() {
         return restResult(null, FAIL, "操作失败");
     }
 
-    public static <T> R<T> fail(String msg)
-    {
+    public static <T> R<T> fail(String msg) {
         return restResult(null, FAIL, msg);
     }
 
-    public static <T> R<T> fail(T data)
-    {
+    public static <T> R<T> fail(T data) {
         return restResult(data, FAIL, "操作失败");
     }
 
-    public static <T> R<T> fail(T data, String msg)
-    {
+    public static <T> R<T> fail(T data, String msg) {
         return restResult(data, FAIL, msg);
     }
 
-    public static <T> R<T> fail(int code, String msg)
-    {
+    public static <T> R<T> fail(int code, String msg) {
         return restResult(null, code, msg);
     }
 
-    private static <T> R<T> restResult(T data, int code, String msg)
-    {
+    private static <T> R<T> restResult(T data, int code, String msg) {
         R<T> apiResult = new R<>();
         apiResult.setCode(code);
         apiResult.setData(data);
@@ -73,43 +68,35 @@ public class R<T> implements Serializable
         return apiResult;
     }
 
-    public int getCode()
-    {
+    public int getCode() {
         return code;
     }
 
-    public void setCode(int code)
-    {
+    public void setCode(int code) {
         this.code = code;
     }
 
-    public String getMsg()
-    {
+    public String getMsg() {
         return msg;
     }
 
-    public void setMsg(String msg)
-    {
+    public void setMsg(String msg) {
         this.msg = msg;
     }
 
-    public T getData()
-    {
+    public T getData() {
         return data;
     }
 
-    public void setData(T data)
-    {
+    public void setData(T data) {
         this.data = data;
     }
 
-    public static <T> Boolean isError(R<T> ret)
-    {
+    public static <T> Boolean isError(R<T> ret) {
         return !isSuccess(ret);
     }
 
-    public static <T> Boolean isSuccess(R<T> ret)
-    {
+    public static <T> Boolean isSuccess(R<T> ret) {
         return R.SUCCESS == ret.getCode();
     }
 }

+ 38 - 60
nightFragrance-common/src/main/java/com/ylx/common/core/redis/RedisCache.java

@@ -20,59 +20,54 @@ import org.springframework.stereotype.Component;
  *
  * @author ylx
  **/
-@SuppressWarnings(value = { "unchecked", "rawtypes" })
+@SuppressWarnings(value = {"unchecked", "rawtypes"})
 @Component
-public class RedisCache
-{
+public class RedisCache {
     @Autowired
     public RedisTemplate redisTemplate;
 
     /**
      * 缓存基本的对象,Integer、String、实体类等
      *
-     * @param key 缓存的键值
+     * @param key   缓存的键值
      * @param value 缓存的值
      */
-    public <T> void setCacheObject(final String key, final T value)
-    {
+    public <T> void setCacheObject(final String key, final T value) {
         redisTemplate.opsForValue().set(key, value);
     }
 
     /**
      * 缓存基本的对象,Integer、String、实体类等
      *
-     * @param key 缓存的键值
-     * @param value 缓存的值
-     * @param timeout 时间
+     * @param key      缓存的键值
+     * @param value    缓存的值
+     * @param timeout  时间
      * @param timeUnit 时间颗粒度
      */
-    public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit)
-    {
+    public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) {
         redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
     }
 
     /**
      * 设置有效时间
      *
-     * @param key Redis键
+     * @param key     Redis键
      * @param timeout 超时时间
      * @return true=设置成功;false=设置失败
      */
-    public boolean expire(final String key, final long timeout)
-    {
+    public boolean expire(final String key, final long timeout) {
         return expire(key, timeout, TimeUnit.SECONDS);
     }
 
     /**
      * 设置有效时间
      *
-     * @param key Redis键
+     * @param key     Redis键
      * @param timeout 超时时间
-     * @param unit 时间单位
+     * @param unit    时间单位
      * @return true=设置成功;false=设置失败
      */
-    public boolean expire(final String key, final long timeout, final TimeUnit unit)
-    {
+    public boolean expire(final String key, final long timeout, final TimeUnit unit) {
         return redisTemplate.expire(key, timeout, unit);
     }
 
@@ -82,8 +77,7 @@ public class RedisCache
      * @param key Redis键
      * @return 有效时间
      */
-    public long getExpire(final String key)
-    {
+    public long getExpire(final String key) {
         return redisTemplate.getExpire(key);
     }
 
@@ -93,19 +87,17 @@ public class RedisCache
      * @param key 键
      * @return true 存在 false不存在
      */
-    public Boolean hasKey(String key)
-    {
+    public Boolean hasKey(String key) {
         return redisTemplate.hasKey(key);
     }
 
     /**
-     * 获得缓存的基本对象。
+     * 获得缓存的数据
      *
      * @param key 缓存键值
      * @return 缓存键值对应的数据
      */
-    public <T> T getCacheObject(final String key)
-    {
+    public <T> T getCacheObject(final String key) {
         ValueOperations<String, T> operation = redisTemplate.opsForValue();
         return operation.get(key);
     }
@@ -115,8 +107,7 @@ public class RedisCache
      *
      * @param key
      */
-    public boolean deleteObject(final String key)
-    {
+    public boolean deleteObject(final String key) {
         return redisTemplate.delete(key);
     }
 
@@ -126,20 +117,18 @@ public class RedisCache
      * @param collection 多个对象
      * @return
      */
-    public boolean deleteObject(final Collection collection)
-    {
+    public boolean deleteObject(final Collection collection) {
         return redisTemplate.delete(collection) > 0;
     }
 
     /**
      * 缓存List数据
      *
-     * @param key 缓存的键值
+     * @param key      缓存的键值
      * @param dataList 待缓存的List数据
      * @return 缓存的对象
      */
-    public <T> long setCacheList(final String key, final List<T> dataList)
-    {
+    public <T> long setCacheList(final String key, final List<T> dataList) {
         Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
         return count == null ? 0 : count;
     }
@@ -150,24 +139,21 @@ public class RedisCache
      * @param key 缓存的键值
      * @return 缓存键值对应的数据
      */
-    public <T> List<T> getCacheList(final String key)
-    {
+    public <T> List<T> getCacheList(final String key) {
         return redisTemplate.opsForList().range(key, 0, -1);
     }
 
     /**
      * 缓存Set
      *
-     * @param key 缓存键值
+     * @param key     缓存键值
      * @param dataSet 缓存的数据
      * @return 缓存数据的对象
      */
-    public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
-    {
+    public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet) {
         BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
         Iterator<T> it = dataSet.iterator();
-        while (it.hasNext())
-        {
+        while (it.hasNext()) {
             setOperation.add(it.next());
         }
         return setOperation;
@@ -179,8 +165,7 @@ public class RedisCache
      * @param key
      * @return
      */
-    public <T> Set<T> getCacheSet(final String key)
-    {
+    public <T> Set<T> getCacheSet(final String key) {
         return redisTemplate.opsForSet().members(key);
     }
 
@@ -190,8 +175,7 @@ public class RedisCache
      * @param key
      * @param dataMap
      */
-    public <T> void setCacheMap(final String key, final Map<String, T> dataMap)
-    {
+    public <T> void setCacheMap(final String key, final Map<String, T> dataMap) {
         if (dataMap != null) {
             redisTemplate.opsForHash().putAll(key, dataMap);
         }
@@ -203,32 +187,29 @@ public class RedisCache
      * @param key
      * @return
      */
-    public <T> Map<String, T> getCacheMap(final String key)
-    {
+    public <T> Map<String, T> getCacheMap(final String key) {
         return redisTemplate.opsForHash().entries(key);
     }
 
     /**
      * 往Hash中存入数据
      *
-     * @param key Redis键
-     * @param hKey Hash键
+     * @param key   Redis键
+     * @param hKey  Hash键
      * @param value 值
      */
-    public <T> void setCacheMapValue(final String key, final String hKey, final T value)
-    {
+    public <T> void setCacheMapValue(final String key, final String hKey, final T value) {
         redisTemplate.opsForHash().put(key, hKey, value);
     }
 
     /**
      * 获取Hash中的数据
      *
-     * @param key Redis键
+     * @param key  Redis键
      * @param hKey Hash键
      * @return Hash中的对象
      */
-    public <T> T getCacheMapValue(final String key, final String hKey)
-    {
+    public <T> T getCacheMapValue(final String key, final String hKey) {
         HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
         return opsForHash.get(key, hKey);
     }
@@ -236,24 +217,22 @@ public class RedisCache
     /**
      * 获取多个Hash中的数据
      *
-     * @param key Redis键
+     * @param key   Redis键
      * @param hKeys Hash键集合
      * @return Hash对象集合
      */
-    public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys)
-    {
+    public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys) {
         return redisTemplate.opsForHash().multiGet(key, hKeys);
     }
 
     /**
      * 删除Hash中的某条数据
      *
-     * @param key Redis键
+     * @param key  Redis键
      * @param hKey Hash键
      * @return 是否成功
      */
-    public boolean deleteCacheMapValue(final String key, final String hKey)
-    {
+    public boolean deleteCacheMapValue(final String key, final String hKey) {
         return redisTemplate.opsForHash().delete(key, hKey) > 0;
     }
 
@@ -263,8 +242,7 @@ public class RedisCache
      * @param pattern 字符串前缀
      * @return 对象列表
      */
-    public Collection<String> keys(final String pattern)
-    {
+    public Collection<String> keys(final String pattern) {
         return redisTemplate.keys(pattern);
     }
 

+ 30 - 56
nightFragrance-common/src/main/java/com/ylx/common/utils/SecurityUtils.java

@@ -20,20 +20,15 @@ import com.ylx.common.exception.ServiceException;
  *
  * @author ylx
  */
-public class SecurityUtils
-{
+public class SecurityUtils {
 
     /**
      * 用户ID
      **/
-    public static Long getUserId()
-    {
-        try
-        {
+    public static Long getUserId() {
+        try {
             return getLoginUser().getUserId();
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
         }
     }
@@ -41,14 +36,10 @@ public class SecurityUtils
     /**
      * 获取部门ID
      **/
-    public static Long getDeptId()
-    {
-        try
-        {
+    public static Long getDeptId() {
+        try {
             return getLoginUser().getDeptId();
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
         }
     }
@@ -56,29 +47,24 @@ public class SecurityUtils
     /**
      * 获取用户账户
      **/
-    public static String getUsername()
-    {
-        try
-        {
+    public static String getUsername() {
+        try {
             return getLoginUser().getUsername();
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
         }
     }
 
     /**
      * 获取用户
+     *
+     * @return LoginUser 用户信息
      **/
-    public static LoginUser getLoginUser()
-    {
-        try
-        {
+    public static LoginUser getLoginUser() {
+        try {
             return (LoginUser) getAuthentication().getPrincipal();
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
+            e.printStackTrace();
             throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
         }
     }
@@ -86,14 +72,10 @@ public class SecurityUtils
     /**
      * 获取微信用户
      **/
-    public static WxLoginUser getWxLoginUser()
-    {
-        try
-        {
+    public static WxLoginUser getWxLoginUser() {
+        try {
             return (WxLoginUser) getAuthentication().getPrincipal();
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
         }
     }
@@ -101,8 +83,7 @@ public class SecurityUtils
     /**
      * 获取Authentication
      */
-    public static Authentication getAuthentication()
-    {
+    public static Authentication getAuthentication() {
         return SecurityContextHolder.getContext().getAuthentication();
     }
 
@@ -112,8 +93,7 @@ public class SecurityUtils
      * @param password 密码
      * @return 加密字符串
      */
-    public static String encryptPassword(String password)
-    {
+    public static String encryptPassword(String password) {
         BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
         return passwordEncoder.encode(password);
     }
@@ -121,12 +101,11 @@ public class SecurityUtils
     /**
      * 判断密码是否相同
      *
-     * @param rawPassword 真实密码
+     * @param rawPassword     真实密码
      * @param encodedPassword 加密后字符
      * @return 结果
      */
-    public static boolean matchesPassword(String rawPassword, String encodedPassword)
-    {
+    public static boolean matchesPassword(String rawPassword, String encodedPassword) {
         BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
         return passwordEncoder.matches(rawPassword, encodedPassword);
     }
@@ -137,8 +116,7 @@ public class SecurityUtils
      * @param userId 用户ID
      * @return 结果
      */
-    public static boolean isAdmin(Long userId)
-    {
+    public static boolean isAdmin(Long userId) {
         return userId != null && 1L == userId;
     }
 
@@ -148,8 +126,7 @@ public class SecurityUtils
      * @param permission 权限字符串
      * @return 用户是否具备某权限
      */
-    public static boolean hasPermi(String permission)
-    {
+    public static boolean hasPermi(String permission) {
         return hasPermi(getLoginUser().getPermissions(), permission);
     }
 
@@ -157,11 +134,10 @@ public class SecurityUtils
      * 判断是否包含权限
      *
      * @param authorities 权限列表
-     * @param permission 权限字符串
+     * @param permission  权限字符串
      * @return 用户是否具备某权限
      */
-    public static boolean hasPermi(Collection<String> authorities, String permission)
-    {
+    public static boolean hasPermi(Collection<String> authorities, String permission) {
         return authorities.stream().filter(StringUtils::hasText)
                 .anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
     }
@@ -172,8 +148,7 @@ public class SecurityUtils
      * @param role 角色标识
      * @return 用户是否具备某角色
      */
-    public static boolean hasRole(String role)
-    {
+    public static boolean hasRole(String role) {
         List<SysRole> roleList = getLoginUser().getUser().getRoles();
         Collection<String> roles = roleList.stream().map(SysRole::getRoleKey).collect(Collectors.toSet());
         return hasRole(roles, role);
@@ -183,11 +158,10 @@ public class SecurityUtils
      * 判断是否包含角色
      *
      * @param roles 角色列表
-     * @param role 角色
+     * @param role  角色
      * @return 用户是否具备某角色权限
      */
-    public static boolean hasRole(Collection<String> roles, String role)
-    {
+    public static boolean hasRole(Collection<String> roles, String role) {
         return roles.stream().filter(StringUtils::hasText)
                 .anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
     }

+ 3 - 4
nightFragrance-framework/src/main/java/com/ylx/framework/security/handle/AuthenticationEntryPointImpl.java

@@ -4,6 +4,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.AuthenticationEntryPoint;
 import org.springframework.stereotype.Component;
@@ -19,14 +20,12 @@ import com.ylx.common.utils.StringUtils;
  * @author ylx
  */
 @Component
-public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable
-{
+public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable {
     private static final long serialVersionUID = -8970718410437077606L;
 
     @Override
     public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e)
-            throws IOException
-    {
+            throws IOException {
         int code = HttpStatus.UNAUTHORIZED;
         String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
         ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));

+ 27 - 42
nightFragrance-framework/src/main/java/com/ylx/framework/web/service/SysLoginService.java

@@ -1,6 +1,8 @@
 package com.ylx.framework.web.service;
 
 import javax.annotation.Resource;
+
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.authentication.BadCredentialsException;
@@ -35,8 +37,8 @@ import com.ylx.system.service.ISysUserService;
  * @author ylx
  */
 @Component
-public class SysLoginService
-{
+@Slf4j
+public class SysLoginService {
     @Autowired
     private TokenService tokenService;
 
@@ -57,40 +59,31 @@ public class SysLoginService
      *
      * @param username 用户名
      * @param password 密码
-     * @param code 验证码
-     * @param uuid 唯一标识
+     * @param code     验证码
+     * @param uuid     唯一标识
      * @return 结果
      */
-    public String login(String username, String password, String code, String uuid)
-    {
+    public String login(String username, String password, String code, String uuid) {
         // 验证码校验
-        validateCaptcha(username, code, uuid);
+        //validateCaptcha(username, code, uuid);
         // 登录前置校验
         loginPreCheck(username, password);
         // 用户验证
         Authentication authentication = null;
-        try
-        {
+        try {
             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
             AuthenticationContextHolder.setContext(authenticationToken);
             // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
             authentication = authenticationManager.authenticate(authenticationToken);
-        }
-        catch (Exception e)
-        {
-            if (e instanceof BadCredentialsException)
-            {
+        } catch (Exception e) {
+            if (e instanceof BadCredentialsException) {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
                 throw new UserPasswordNotMatchException();
-            }
-            else
-            {
+            } else {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
                 throw new ServiceException(e.getMessage());
             }
-        }
-        finally
-        {
+        } finally {
             AuthenticationContextHolder.clearContext();
         }
         AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
@@ -104,25 +97,21 @@ public class SysLoginService
      * 校验验证码
      *
      * @param username 用户名
-     * @param code 验证码
-     * @param uuid 唯一标识
+     * @param code     验证码
+     * @param uuid     唯一标识
      * @return 结果
      */
-    public void validateCaptcha(String username, String code, String uuid)
-    {
+    public void validateCaptcha(String username, String code, String uuid) {
         boolean captchaEnabled = configService.selectCaptchaEnabled();
-        if (captchaEnabled)
-        {
+        if (captchaEnabled) {
             String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
             String captcha = redisCache.getCacheObject(verifyKey);
             redisCache.deleteObject(verifyKey);
-            if (captcha == null)
-            {
+            if (captcha == null) {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
                 throw new CaptchaExpireException();
             }
-            if (!code.equalsIgnoreCase(captcha))
-            {
+            if (!code.equalsIgnoreCase(captcha)) {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
                 throw new CaptchaException();
             }
@@ -131,35 +120,32 @@ public class SysLoginService
 
     /**
      * 登录前置校验
+     *
      * @param username 用户名
      * @param password 用户密码
      */
-    public void loginPreCheck(String username, String password)
-    {
+    public void loginPreCheck(String username, String password) {
         // 用户名或密码为空 错误
-        if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
-        {
+        if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
             throw new UserNotExistsException();
         }
         // 密码如果不在指定范围内 错误
         if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
-                || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
-        {
+                || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
             throw new UserPasswordNotMatchException();
         }
         // 用户名不在指定范围内 错误
         if (username.length() < UserConstants.USERNAME_MIN_LENGTH
-                || username.length() > UserConstants.USERNAME_MAX_LENGTH)
-        {
+                || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
             throw new UserPasswordNotMatchException();
         }
         // IP黑名单校验
         String blackStr = configService.selectConfigByKey("sys.login.blackIPList");
-        if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr()))
-        {
+        log.info("IP黑名单校验:{}", blackStr);
+        if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("login.blocked")));
             throw new BlackListException();
         }
@@ -170,8 +156,7 @@ public class SysLoginService
      *
      * @param userId 用户ID
      */
-    public void recordLoginInfo(Long userId)
-    {
+    public void recordLoginInfo(Long userId) {
         SysUser sysUser = new SysUser();
         sysUser.setUserId(userId);
         sysUser.setLoginIp(IpUtils.getIpAddr());

+ 176 - 60
nightFragrance-massage/src/main/java/com/ylx/massage/domain/TJs.java

@@ -20,134 +20,185 @@ import java.util.Date;
 import java.util.List;
 
 /**
- * 技师表
+ * 技师信息实体类
+ * <p>
+ * 该类用于映射技师表(t_js),存储技师的基本信息、资质证书、服务状态、位置信息等。
+ * 支持技师的注册、审核、上岗、接单等业务流程。
+ * </p>
+ *
+ * @author ylx
+ * @version 1.0
+ * @since 2024-01-01
  */
 @Getter
 @Setter
 @Accessors(chain = true)
-@TableName(value = "t_js",autoResultMap = true)
-@ApiModel(value = "TJs", description = "技师")
+@TableName(value = "t_js", autoResultMap = true)
+@ApiModel(value = "TJs", description = "技师信息实体")
 public class TJs implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 主键ID
+     */
     @TableId("id")
-    @ApiModelProperty("Id")
+    @ApiModelProperty("主键ID")
     private String id;
 
+    /**
+     * 微信OpenID
+     * 用于关联微信用户身份
+     */
     @TableField("c_open_id")
-    @ApiModelProperty("cOpenId")
+    @ApiModelProperty("微信OpenID")
     private String cOpenId;
 
+    /**
+     * 所在城市
+     */
     @TableField("city")
-    @ApiModelProperty("城市")
+    @ApiModelProperty("所在城市")
     private String city;
 
+    /**
+     * 技师等级
+     * 表示技师的专业级别
+     */
     @TableField("js_grade")
     @ApiModelProperty("技师等级")
     private Integer jsGrade;
 
-    @ApiModelProperty("视频")
+    /**
+     * 技师视频介绍
+     * 存储视频文件的URL地址
+     */
+    @ApiModelProperty("技师视频介绍")
     private String cVideo;
 
     /**
-     * 可预约项目编号 JsonArray
+     * 可预约项目编号列表
+     * 以JSON数组格式存储,表示技师可提供的服务项目编号集合
      */
     @TableField(value = "c_bh_list")
-    @ApiModelProperty("可预约项目编号")
+    @ApiModelProperty("可预约项目编号列表")
     private String cBhList;
 
     /**
-     * 生活照 JsonArray
+     * 生活照图片列表
+     * 以JSONArray格式存储,包含技师的生活照片URL
      */
-    @TableField(value = "c_img_list",typeHandler = FastjsonTypeHandler.class)
-    @ApiModelProperty("生活照 JsonArray")
+    @TableField(value = "c_img_list", typeHandler = FastjsonTypeHandler.class)
+    @ApiModelProperty("生活照图片列表")
     private JSONArray cImgList;
 
     /**
-     * 身份证图片 JsonArray
+     * 身份证图片列表
+     * 以JSONArray格式存储,包含身份证正反面照片
      */
-    @TableField(value = "c_sfz_img",typeHandler = FastjsonTypeHandler.class)
-    @ApiModelProperty("身份证图片 JsonArray")
+    @TableField(value = "c_sfz_img", typeHandler = FastjsonTypeHandler.class)
+    @ApiModelProperty("身份证图片列表")
     private JSONArray cSfzImg;
 
     /**
-     * 性别 0女 1男
+     * 性别
+     * 0-女,1-男
      */
     @TableField("n_sex")
-    @ApiModelProperty("性别 0女 1男")
+    @ApiModelProperty("性别 0-女 1-男")
     private Integer nSex;
 
     /**
      * 昵称
+     * 显示给用户看的昵称
      */
     @TableField("c_nick_name")
     @ApiModelProperty("昵称")
     private String cNickName;
 
     /**
-     * 头像
+     * 头像URL
+     * 技师头像图片地址
      */
     @TableField("c_portrait")
-    @ApiModelProperty("头像")
+    @ApiModelProperty("头像URL")
     private String cPortrait;
 
     /**
-     * 姓名
+     * 真实姓名
+     * 技师身份证真实姓名
      */
     @TableField("c_name")
-    @ApiModelProperty("姓名")
+    @ApiModelProperty("真实姓名")
     private String cName;
 
     /**
-     * 电话
+     * 联系电话
+     * 技师手机号码
      */
     @TableField("c_phone")
-    @ApiModelProperty("电话")
+    @ApiModelProperty("联系电话")
     private String cPhone;
 
     /**
-     * 地址
+     * 居住地址
+     * 技师常住地址
      */
     @TableField("c_address")
-    @ApiModelProperty("地址")
+    @ApiModelProperty("居住地址")
     private String cAddress;
 
     /**
-     * 健康证
+     * 健康证图片URL
+     * 用于证明技师身体健康状况
      */
     @TableField("health_certificate")
-    @ApiModelProperty("健康证")
+    @ApiModelProperty("健康证图片URL")
     private String healthCertificate;
 
     /**
-     * 营业执照
+     * 营业执照图片URL
+     * 个体工商户营业执照
      */
     @TableField("business_license")
-    @ApiModelProperty("营业执照")
+    @ApiModelProperty("营业执照图片URL")
     private String businessLicense;
 
+    /**
+     * 按摩师资格证图片URL
+     * 专业技能认证证书
+     */
     @TableField("certification")
-    @ApiModelProperty("按摩师资格证")
+    @ApiModelProperty("按摩师资格证图片URL")
     private String certification;
 
+    /**
+     * 无犯罪记录证明图片URL
+     * 用于背景调查
+     */
     @TableField("no_crime")
-    @ApiModelProperty("无犯罪记录")
+    @ApiModelProperty("无犯罪记录证明图片URL")
     private String noCrime;
 
+    /**
+     * 部门ID
+     * 关联的部门/机构标识
+     */
     @TableField("dept_id")
-    @ApiModelProperty("部门Id")
+    @ApiModelProperty("部门ID")
     private String deptId;
 
     /**
      * 白天免车费公里数
+     * 白天时段(如6:00-18:00)免收车费的距离上限
      */
     @TableField("daytime_mileage")
     @ApiModelProperty("白天免车费公里数")
     private BigDecimal daytimeMileage;
 
     /**
-     * 白天免车费公里数
+     * 夜间免车费公里数
+     * 夜间时段(如18:00-6:00)免收车费的距离上限
      */
     @TableField("nigth_mileage")
     @ApiModelProperty("夜间免车费公里数")
@@ -155,6 +206,7 @@ public class TJs implements Serializable {
 
     /**
      * 个人简介
+     * 技师自我介绍文字描述
      */
     @TableField("c_jianjie")
     @ApiModelProperty("个人简介")
@@ -162,6 +214,7 @@ public class TJs implements Serializable {
 
     /**
      * 评分
+     * 用户对技师的评分,通常为1-5分
      */
     @TableField("n_star")
     @ApiModelProperty("评分")
@@ -169,6 +222,7 @@ public class TJs implements Serializable {
 
     /**
      * 佣金比例
+     * 技师从订单金额中获取的佣金百分比
      */
     @TableField("n_bili")
     @ApiModelProperty("佣金比例")
@@ -176,6 +230,7 @@ public class TJs implements Serializable {
 
     /**
      * 经度
+     * 技师当前位置的经度坐标
      */
     @TableField("longitude")
     @ApiModelProperty("经度")
@@ -183,6 +238,7 @@ public class TJs implements Serializable {
 
     /**
      * 纬度
+     * 技师当前位置的纬度坐标
      */
     @TableField("latitude")
     @ApiModelProperty("纬度")
@@ -190,115 +246,175 @@ public class TJs implements Serializable {
 
     /**
      * 已服务数量
+     * 技师累计完成的订单总数
      */
     @TableField("n_num")
-    @ApiModelProperty("已服务数量")
+    @ApiModelProperty("已服务订单数量")
     private Integer nNum;
 
-
-
     /**
-     * 服务状态	0 可服务	1 服务中 2不可服务
+     * 服务状态
+     * 0-可服务(空闲可接单)
+     * 1-服务中(正在服务无法接单)
+     * 2-不可服务(临时无法接单)
      */
     @TableField("n_status")
-    @ApiModelProperty("服务状态\t0 可服务\t1 服务中 2不可服务")
+    @ApiModelProperty("服务状态 0-可服务 1-服务中 2-不可服务")
     private Integer nStatus;
 
     /**
-     * 上岗状态 0未上岗 1已上岗
+     * 上岗状态
+     * -1-未上岗(未通过审核或已下岗)
+     * 0-已上岗(可接单状态)
+     * 1-已申请上岗(待审核)
      */
     @TableField("n_status2")
-    @ApiModelProperty("上岗状态 -1未上岗 0已上岗")
+    @ApiModelProperty("上岗状态 -1-未上岗 0-已上岗 1-已申请")
     private Integer nStatus2;
 
     /**
-     * 审核状态 0 未通过 1已通过
+     * 审核状态
+     * 0-未通过(初始状态)
+     * 1-已通过(审核通过)
+     * 2-驳回(审核不通过)
+     * 3-拉黑(被封禁)
      */
     @TableField("n_tong")
-    @ApiModelProperty("审核状态 0 未通过 1已通过 2驳回 3拉黑")
+    @ApiModelProperty("审核状态 0-未通过 1-已通过 2-驳回 3-拉黑")
     private Integer nTong;
 
     /**
      * 注册时间
+     * 技师首次注册的时间
      */
     @TableField("c_time")
     @ApiModelProperty("注册时间")
     private Date cTime;
 
     /**
-     * 是否带头像框 0否 1是
+     * 是否带头像框标识
+     * 0-否,1-是(用于特殊标识或VIP展示)
      */
     @TableField("n_b1")
-    @ApiModelProperty("是否带头像框 0否 1是")
+    @ApiModelProperty("是否带头像框 0-否 1-是")
     private Integer nB1;
 
     /**
-     * 是否是新技师 0否 1是
+     * 是否新技师标识
+     * 0-否,1-是(用于新人推荐)
      */
     @TableField("n_b2")
-    @ApiModelProperty("是否新技师 0否 1是")
+    @ApiModelProperty("是否新技师 0-否 1-是")
     private Integer nB2;
 
     /**
-     * 是否有热度 0否 1是
+     * 是否有热度标识
+     * 0-否,1-是(用于热门技师推荐)
      */
     @TableField("n_b3")
-    @ApiModelProperty("是否有热度 0否 1是")
+    @ApiModelProperty("是否有热度 0-否 1-是")
     private Integer nB3;
 
     /**
      * 创建时间
+     * 记录创建的时间戳
      */
     @TableField("dt_create_time")
     @ApiModelProperty("创建时间")
     private LocalDateTime dtCreateTime;
 
+    /**
+     * 地址名称
+     * 位置名称(如某某小区、某某大厦)
+     */
     @TableField("name")
-    @ApiModelProperty("地址name")
+    @ApiModelProperty("地址名称")
     private String name;
 
+    /**
+     * 详细地址
+     * 完整的街道地址信息
+     */
     @TableField("address")
-    @ApiModelProperty("地址详细")
+    @ApiModelProperty("详细地址")
     private String address;
 
+    /**
+     * 退回原因
+     * 审核被驳回时填写的原因说明
+     */
     @TableField("reason_refusal")
-    @ApiModelProperty("退回原因")
+    @ApiModelProperty("审核驳回原因")
     private String reasonRefusal;
 
-    @ApiModelProperty("是否删除0否1是")
+    /**
+     * 逻辑删除标识
+     * 0-未删除,1-已删除
+     */
+    @ApiModelProperty("逻辑删除标识 0-未删除 1-已删除")
     @TableLogic
     private Integer isDelete;
+
     /**
-     * 收藏人员数量
+     * 收藏数量
+     * 当前技师被用户收藏的总次数(非持久化字段)
      */
     @TableField(exist = false)
-    @ApiModelProperty("收藏人员数量")
+    @ApiModelProperty("收藏数量")
     private Integer number;
 
-    @ApiModelProperty("收藏人员数量")
+    /**
+     * 点赞数量
+     * 用户对技师的点赞数
+     */
+    @ApiModelProperty("点赞数量")
     private Integer nZan;
 
+    /**
+     * 当前用户是否收藏
+     * 用于前端显示收藏状态(非持久化字段)
+     */
     @TableField(exist = false)
     @ApiModelProperty("当前用户是否收藏")
     private Boolean isCollection;
 
+    /**
+     * 技师距离
+     * 当前用户与技师之间的距离,单位:公里(非持久化字段)
+     */
     @TableField(exist = false)
-    @ApiModelProperty("技师距离")
+    @ApiModelProperty("技师距离(公里)")
     private BigDecimal distance = BigDecimal.valueOf(10000L);
 
+    /**
+     * 页面类型
+     * 1-技师页,2-审核页(用于区分不同展示场景)
+     */
     @TableField(exist = false)
-    @ApiModelProperty("1技师,2审核")
+    @ApiModelProperty("页面类型 1-技师 2-审核")
     private Integer pageType;
 
+    /**
+     * 技师服务项目列表
+     * 关联查询的服务项目信息(非持久化字段)
+     */
     @TableField(exist = false)
-    @ApiModelProperty("技师项目")
+    @ApiModelProperty("技师服务项目列表")
     private List<TXiangmu> projects;
 
+    /**
+     * 技师评价列表
+     * 关联查询的用户评价信息(非持久化字段)
+     */
     @TableField(exist = false)
-    @ApiModelProperty("技师评价")
+    @ApiModelProperty("技师评价列表")
     private List<TComment> comments;
 
-    @ApiModelProperty("技师二维码")
+    /**
+     * 技师推广二维码Ticket
+     * 用于生成技师专属推广二维码
+     */
+    @ApiModelProperty("技师推广二维码Ticket")
     private String ticket;
 
 

+ 8 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/enums/JsStatusEnum.java

@@ -14,10 +14,18 @@ public enum JsStatusEnum {
 
     /*** 技师上岗状态*/
     POST_ON_DUTY(0, "已上岗"),
+
+    /**
+     * 未上岗状态
+     */
     POST_NOT_ON_DUTY(-1, "未上岗"),
 
     /*** 技师审核状态*/
     JS_NOT_PASS(0, "待审核"),
+
+    /**
+     * 已通过
+     */
     JS_PASS(1, "已通过"),
     JS_RETURN(2, "已退回"),
     BLOCKED(3, "已拉黑");

+ 246 - 3
nightFragrance-massage/src/main/java/com/ylx/massage/service/TJsService.java

@@ -9,28 +9,271 @@ import com.ylx.massage.domain.vo.TJsVo;
 import java.util.List;
 
 /**
- * 技师表 服务类
+ * 技师信息业务服务接口
+ * <p>
+ * 该接口定义了技师管理的核心业务操作,包括:
+ * <ul>
+ *   <li>技师注册与申请:技师通过微信小程序提交申请材料</li>
+ *   <li>审核流程:管理员审核技师资信,通过/驳回/拉黑</li>
+ *   <li>上岗管理:技师上下岗打卡,记录在线时长</li>
+ *   <li>位置服务:维护技师地理位置,用于距离计算和订单分配</li>
+ *   <li>状态管理:服务状态、上岗状态、审核状态的流转控制</li>
+ *   <li>通知推送:微信模板消息推送(审核结果、新订单通知等)</li>
+ * </ul>
+ * </p>
+ * <p>
+ * 业务流程说明:
+ * <pre>
+ * 1. 技师注册流程:
+ *    用户提交申请 → 填写基本信息/上传资质证书 → 等待审核 → 审核通过 → 标记为新技师
+ *
+ * 2. 上岗接单流程:
+ *    审核通过 → 申请上岗 → 上岗打卡(nStatus2=0, nStatus=0) → 开始接单 → 服务中(nStatus=1) → 完成服务 → 继续接单
+ *    ↓
+ *    下岗打卡(nStatus2=-1, nStatus=2) → 停止接单
+ *
+ * 3. 审核状态流转:
+ *    待审核(nTong=0) → 审核通过(nTong=1) → 可以上岗
+ *                  → 审核驳回(nTong=2) → 修改资料重新提交
+ *                  → 拉黑(nTong=3) → 无法接单
+ *
+ * 4. 服务状态流转:
+ *    可服务(nStatus=0) → 服务中(nStatus=1) → 可服务(nStatus=0)
+ *    不可服务(nStatus=2) → 上岗后变为可服务
+ * </pre>
+ * </p>
+ *
+ * @author ylx
+ * @version 1.0
+ * @since 2024-01-01
+ * @see com.ylx.massage.domain.TJs
+ * @see com.ylx.massage.service.impl.TJsServiceImpl
  */
 public interface TJsService extends IService<TJs> {
-    public Page<TJs> getAll(Page<TJs> page, TJsVo param);
 
+    /**
+     * 分页查询技师列表(管理后台)
+     * <p>
+     * 支持多条件组合查询,包括:
+     * <ul>
+     *   <li>昵称或电话模糊查询</li>
+     *   <li>服务项目筛选</li>
+     *   <li>城市筛选</li>
+     *   <li>审核状态筛选</li>
+     *   <li>上岗状态筛选</li>
+     *   <li>免车费条件筛选</li>
+     * </ul>
+     * </p>
+     *
+     * @param page 分页对象
+     * @param param 查询条件封装对象
+     * @return 分页结果,包含符合条件的技师列表
+     */
+    Page<TJs> getAll(Page<TJs> page, TJsVo param);
+
+    /**
+     * 技师申请注册(微信小程序端)
+     * <p>
+     * 业务规则:
+     * <ul>
+     *   <li>检查微信号是否已申请(通过OpenID去重)</li>
+     *   <li>初始化技师信息:评分5星、服务数0、佣金比例10%</li>
+     *   <li>设置初始状态:不可服务、未上岗、待审核</li>
+     *   <li>不允许重复申请,否则抛出异常</li>
+     * </ul>
+     * </p>
+     *
+     * @param js 技师实体对象,包含基本信息和资质证书
+     * @return true-申请成功,false-申请失败
+     * @throws ServiceException 当微信号已申请时抛出异常
+     */
     boolean addJs(TJs js);
 
-    TJs getByJsId(String s, String openId);
+    /**
+     * 根据技师ID查询详情(微信小程序端)
+     * <p>
+     * 查询内容包括:
+     * <ul>
+     *   <li>技师基本信息(头像、昵称、评分、服务数等)</li>
+     *   <li>可提供的服务项目列表(按价格排序)</li>
+     *   <li>用户评价列表(最新10条)</li>
+     *   <li>当前用户是否收藏该技师</li>
+     *   <li>技师与用户的距离</li>
+     * </ul>
+     * </p>
+     *
+     * @param jsId 技师ID
+     * @param openId 当前用户的微信OpenID(用于判断收藏状态)
+     * @return 技师详情对象,包含关联的项目和评价信息;如果技师不存在返回null
+     * @throws ServiceException 当技师ID为空时抛出异常
+     */
+    TJs getByJsId(String jsId, String openId);
 
+    /**
+     * 微信小程序端更新技师信息
+     * <p>
+     * 支持更新内容:
+     * <ul>
+     *   <li>基本信息:姓名、电话、地址</li>
+     *   <li>资质证书:身份证、健康证、资格证等</li>
+     *   <li>服务配置:可服务项目、免车费公里数</li>
+     *   <li>位置信息:经纬度坐标(用于距离计算)</li>
+     *   <li>个人简介:自我介绍文字</li>
+     * </ul>
+     * </p>
+     * <p>
+     * 注意:如果技师曾被驳回,更新后会重置为待审核状态
+     * </p>
+     *
+     * @param js 技师实体对象,包含需要更新的字段
+     * @return true-更新成功,false-更新失败
+     */
     boolean wxUpdateJs(TJs js);
 
+    /**
+     * 审核技师申请(管理后台)
+     * <p>
+     * 审核通过操作:
+     * <ul>
+     *   <li>将审核状态改为"已通过"(nTong=1)</li>
+     *   <li>标记为新技师(nB2=1),用于新人推荐</li>
+     *   <li>记录注册时间</li>
+     *   <li>将微信用户角色改为技师(role=1)</li>
+     *   <li>发送微信模板消息通知技师</li>
+     * </ul>
+     * </p>
+     * <p>
+     * 审核驳回操作:
+     * <ul>
+     *   <li>将审核状态改为"已退回"(nTong=2)</li>
+     *   <li>记录驳回原因</li>
+     *   <li>发送微信模板消息通知技师</li>
+     * </ul>
+     * </p>
+     *
+     * @param js 技师实体对象,必须包含ID和审核状态(nTong)
+     * @return true-审核成功,false-审核失败
+     */
     boolean auditing(TJs js);
 
+    /**
+     * 更新技师地理位置信息
+     * <p>
+     * 将技师位置信息添加到Redis GEO中,用于:
+     * <ul>
+     *   <li>计算技师与用户的距离</li>
+     *   <li>查找附近可用技师</li>
+     *   <li>订单分配时的距离排序</li>
+     * </ul>
+     * </p>
+     *
+     * @param js 技师实体对象,必须包含ID和经纬度坐标
+     * @return true-更新成功,false-更新失败
+     * @throws ServiceException 当技师ID或地址为空时抛出异常
+     */
     boolean updateLocation(TJs js);
 
+    /**
+     * 新订单通知(预留接口,当前未实现)
+     * <p>
+     * 当有新订单分配给技师时,发送微信模板消息通知:
+     * <ul>
+     *   <li>订单号</li>
+     *   <li>用户电话</li>
+     *   <li>用户名称</li>
+     *   <li>服务时间</li>
+     *   <li>服务地址</li>
+     * </ul>
+     * </p>
+     *
+     * @param openId 技师的微信OpenID
+     */
     void newOrderNotification(String openId);
 
+    /**
+     * 技师上下岗打卡(微信小程序端)
+     * <p>
+     * 上岗操作(nStatus2=0):
+     * <ul>
+     *   <li>将服务状态改为"可服务"(nStatus=0)</li>
+     *   <li>记录签到时间和技师信息</li>
+     *   <li>开始在线时长统计</li>
+     * </ul>
+     * </p>
+     * <p>
+     * 下岗操作(nStatus2=-1):
+     * <ul>
+     *   <li>检查是否有服务中的订单(如有则不允许下岗)</li>
+     *   <li>将服务状态改为"不可服务"(nStatus=2)</li>
+     *   <li>记录下岗时间</li>
+     *   <li>计算并保存本次在线时长(分钟)</li>
+     * </ul>
+     * </p>
+     *
+     * @param js 技师实体对象,必须包含ID和上岗状态(nStatus2)
+     * @return true-操作成功,false-操作失败
+     * @throws ServiceException 当技师ID为空或下岗时有服务中订单时抛出异常
+     */
     boolean upPost(TJs js);
 
+    /**
+     * 发送审核结果通知(内部方法)
+     * <p>
+     * 通过微信公众号模板消息推送审核结果:
+     * <ul>
+     *   <li>审核通过:通知"可以接单"</li>
+     *   <li>审核驳回:通知"请重新提交"</li>
+     *   <li>包含审核时间和联系电话</li>
+     * </ul>
+     * </p>
+     *
+     * @param js 技师实体对象,包含OpenID和审核状态
+     */
     void jsNotification(TJs js);
 
+    /**
+     * 拉黑/恢复技师(管理后台)
+     * <p>
+     * 拉黑操作(nTong=3):
+     * <ul>
+     *   <li>检查是否有服务中的订单(如有则不允许拉黑)</li>
+     *   <li>将审核状态改为"已拉黑"</li>
+     *   <li>将服务状态改为"不可服务"</li>
+     *   <li>将上岗状态改为"未上岗"</li>
+     * </ul>
+     * </p>
+     * <p>
+     * 恢复操作(nTong=0):
+     * <ul>
+     *   <li>将审核状态改为"待审核"</li>
+     *   <li>将服务状态改为"不可服务"</li>
+     *   <li>需要重新审核通过后才能上岗</li>
+     * </ul>
+     * </p>
+     *
+     * @param js 技师实体对象,必须包含ID和审核状态(nTong)
+     * @return true-操作成功,false-操作失败
+     * @throws ServiceException 当技师ID或拉黑状态为空时抛出异常
+     */
     boolean block(TJs js);
 
+    /**
+     * 管理后台新增技师
+     * <p>
+     * 与微信端注册的区别:
+     * <ul>
+     *   <li>直接设置为"已通过"审核状态</li>
+     *   <li>默认值设置:评分5星、服务数0、佣金比例10%</li>
+     *   <li>初始状态:不可服务、未上岗</li>
+     *   <li>不触发微信通知</li>
+     * </ul>
+     * </p>
+     * <p>
+     * 用途:管理员直接录入技师信息,跳过审核流程
+     * </p>
+     *
+     * @param js 技师实体对象,包含完整的基本信息
+     * @return true-添加成功,false-添加失败
+     */
     boolean pcAddJs(TJs js);
 }

+ 6 - 6
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/TJsServiceImpl.java

@@ -297,9 +297,9 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
 
     @Override
     public boolean pcAddJs(TJs js) {
-        if (js.getCity() == null) {
+        /*if (js.getCity() == null) {
             throw new ServiceException("所在城市不能为空");
-        }
+        }*/
         // 评分默认最高
         js.setnStar(MassageConstants.INTEGER_FIVE);
         // 已服务数量 0
@@ -317,10 +317,10 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
         js.setnB3(MassageConstants.INTEGER_ZERO);
         js.setDtCreateTime(LocalDateTime.now());
         this.save(js);
-        String token = weChatUtil.getToken();
+        /*String token = weChatUtil.getToken();
         //获取的二维码ticket
         Map<?, ?> jsTicket = weChatUtil.getJsTicket(token, js.getId());
-        js.setTicket(jsTicket.get("ticket").toString());
+        js.setTicket(jsTicket.get("ticket").toString());*/
         return this.updateById(js);
     }
 
@@ -340,13 +340,13 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
             js.setProjects(new ArrayList<>()); // 设置空列表,避免后续调用空指针
             return js;
         }
-        //项目
+        //查询项目
         List<String> projectIds = Arrays.stream(js.getcBhList().split(",")).collect(Collectors.toList());
         LambdaQueryWrapper<TXiangmu> xiangmuLambdaQueryWrapper = new LambdaQueryWrapper<>();
         xiangmuLambdaQueryWrapper.in(TXiangmu::getcId, projectIds).orderByAsc(TXiangmu::getdPrice);
         List<TXiangmu> projects = xiangmuService.list(xiangmuLambdaQueryWrapper);
         js.setProjects(projects);
-        //评论
+        //查询评论
         LambdaQueryWrapper<TComment> commentLambdaQueryWrapper = new LambdaQueryWrapper<>();
         commentLambdaQueryWrapper.eq(TComment::getcJsid, jsId);
         List<TComment> list = commentService.list(commentLambdaQueryWrapper);

+ 3 - 1
nightFragrance-massage/src/main/java/com/ylx/massage/utils/WeChatUtil.java

@@ -119,6 +119,7 @@ public class WeChatUtil {
                 .append("?grant_type=").append("client_credential")
                 .append("&appid=").append(wxPayProperties.getMpAppId())
                 .append("&secret=").append(wxPayProperties.getMpAppSecret());
+        log.info("URL的值:{}", url.toString());
         String rs = HttpUtil.get(url.toString());
         Map<?, ?> map = JSONObject.parseObject(rs, Map.class);
         if (null == map.get(ERROR_CODE)) {
@@ -280,6 +281,8 @@ public class WeChatUtil {
      * 生成公众号码技师 ticket
      *
      * @param token access_token
+     * @param jsId 技师id
+     *
      * @return 返回包含微信公众号码ticket的Map
      */
     public Map<?, ?> getJsTicket(String token, String jsId) {
@@ -291,7 +294,6 @@ public class WeChatUtil {
         String rs = HttpUtil.post(url, param);
         Map<?, ?> map = JSONObject.parseObject(rs, Map.class);
         return map;
-
     }
 
 

+ 25 - 48
nightFragrance-system/src/main/java/com/ylx/system/service/impl/SysConfigServiceImpl.java

@@ -3,6 +3,7 @@ package com.ylx.system.service.impl;
 import java.util.Collection;
 import java.util.List;
 import javax.annotation.PostConstruct;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ylx.common.annotation.DataSource;
@@ -23,8 +24,7 @@ import com.ylx.system.service.ISysConfigService;
  * @author ylx
  */
 @Service
-public class SysConfigServiceImpl implements ISysConfigService
-{
+public class SysConfigServiceImpl implements ISysConfigService {
     @Autowired
     private SysConfigMapper configMapper;
 
@@ -35,8 +35,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 项目启动时,初始化参数到缓存
      */
     @PostConstruct
-    public void init()
-    {
+    public void init() {
         loadingConfigCache();
     }
 
@@ -48,8 +47,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      */
     @Override
     @DataSource(DataSourceType.MASTER)
-    public SysConfig selectConfigById(Long configId)
-    {
+    public SysConfig selectConfigById(Long configId) {
         SysConfig config = new SysConfig();
         config.setConfigId(configId);
         return configMapper.selectConfig(config);
@@ -62,18 +60,15 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @return 参数键值
      */
     @Override
-    public String selectConfigByKey(String configKey)
-    {
+    public String selectConfigByKey(String configKey) {
         String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey)));
-        if (StringUtils.isNotEmpty(configValue))
-        {
+        if (StringUtils.isNotEmpty(configValue)) {
             return configValue;
         }
         SysConfig config = new SysConfig();
         config.setConfigKey(configKey);
         SysConfig retConfig = configMapper.selectConfig(config);
-        if (StringUtils.isNotNull(retConfig))
-        {
+        if (StringUtils.isNotNull(retConfig)) {
             redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
             return retConfig.getConfigValue();
         }
@@ -86,11 +81,9 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @return true开启,false关闭
      */
     @Override
-    public boolean selectCaptchaEnabled()
-    {
+    public boolean selectCaptchaEnabled() {
         String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled");
-        if (StringUtils.isEmpty(captchaEnabled))
-        {
+        if (StringUtils.isEmpty(captchaEnabled)) {
             return true;
         }
         return Convert.toBool(captchaEnabled);
@@ -103,8 +96,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @return 参数配置集合
      */
     @Override
-    public List<SysConfig> selectConfigList(SysConfig config)
-    {
+    public List<SysConfig> selectConfigList(SysConfig config) {
         return configMapper.selectConfigList(config);
     }
 
@@ -115,11 +107,9 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @return 结果
      */
     @Override
-    public int insertConfig(SysConfig config)
-    {
+    public int insertConfig(SysConfig config) {
         int row = configMapper.insertConfig(config);
-        if (row > 0)
-        {
+        if (row > 0) {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
         return row;
@@ -132,17 +122,14 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @return 结果
      */
     @Override
-    public int updateConfig(SysConfig config)
-    {
+    public int updateConfig(SysConfig config) {
         SysConfig temp = configMapper.selectConfigById(config.getConfigId());
-        if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey()))
-        {
+        if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
             redisCache.deleteObject(getCacheKey(temp.getConfigKey()));
         }
 
         int row = configMapper.updateConfig(config);
-        if (row > 0)
-        {
+        if (row > 0) {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
         return row;
@@ -154,13 +141,10 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @param configIds 需要删除的参数ID
      */
     @Override
-    public void deleteConfigByIds(Long[] configIds)
-    {
-        for (Long configId : configIds)
-        {
+    public void deleteConfigByIds(Long[] configIds) {
+        for (Long configId : configIds) {
             SysConfig config = selectConfigById(configId);
-            if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
-            {
+            if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
                 throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
             }
             configMapper.deleteConfigById(configId);
@@ -172,11 +156,9 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 加载参数缓存数据
      */
     @Override
-    public void loadingConfigCache()
-    {
+    public void loadingConfigCache() {
         List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
-        for (SysConfig config : configsList)
-        {
+        for (SysConfig config : configsList) {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
     }
@@ -185,8 +167,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 清空参数缓存数据
      */
     @Override
-    public void clearConfigCache()
-    {
+    public void clearConfigCache() {
         Collection<String> keys = redisCache.keys(CacheConstants.SYS_CONFIG_KEY + "*");
         redisCache.deleteObject(keys);
     }
@@ -195,8 +176,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      * 重置参数缓存数据
      */
     @Override
-    public void resetConfigCache()
-    {
+    public void resetConfigCache() {
         clearConfigCache();
         loadingConfigCache();
     }
@@ -208,12 +188,10 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @return 结果
      */
     @Override
-    public boolean checkConfigKeyUnique(SysConfig config)
-    {
+    public boolean checkConfigKeyUnique(SysConfig config) {
         Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
         SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
-        if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -225,8 +203,7 @@ public class SysConfigServiceImpl implements ISysConfigService
      * @param configKey 参数键
      * @return 缓存键key
      */
-    private String getCacheKey(String configKey)
-    {
+    private String getCacheKey(String configKey) {
         return CacheConstants.SYS_CONFIG_KEY + configKey;
     }
 }

+ 0 - 3
pom.xml

@@ -235,8 +235,5 @@
                 <enabled>false</enabled>
             </snapshots>
         </pluginRepository>
-
-
     </pluginRepositories>
-
 </project>