Parcourir la source

fix:首页推荐技师

wrj il y a 2 mois
Parent
commit
14fd26128f

+ 13 - 0
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/TJsController.java

@@ -84,6 +84,19 @@ public class TJsController extends BaseController {
 
     }
 
+
+    /**
+     * 添加技师申请
+     *
+     * @param js
+     * @return
+     */
+    @Log(title = "技师管理", businessType = BusinessType.INSERT)
+    @RequestMapping(value = "pc/add", method = RequestMethod.POST)
+    @ApiOperation("PC添加技师申请")
+    public R pcAdd(@RequestBody TJs js) {
+        return R.ok(jsService.pcAddJs(js));
+    }
     /**
      * 更新技师信息
      *

+ 2 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/TJsService.java

@@ -31,4 +31,6 @@ public interface TJsService extends IService<TJs> {
     void jsNotification(TJs js);
 
     boolean block(TJs js);
+
+    boolean pcAddJs(TJs js);
 }

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

@@ -167,8 +167,8 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
 
     @Override
     public boolean updateLocation(TJs js) {
-        if (StringUtils.isBlank(js.getcOpenId())) {
-            throw new ServiceException("技师OpenID不能为空");
+        if (StringUtils.isBlank(js.getId())) {
+            throw new ServiceException("ID不能为空");
         }
         if (StringUtils.isBlank(js.getName())) {
             throw new ServiceException("地址不能为空");
@@ -176,11 +176,8 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
 //        JSONObject jsonObject = new JSONObject(js.getcAddress());
 //        Object latitude = jsonObject.get("latitude");
 //        Object longitude = jsonObject.get("longitude");
-        locationUtil.geoAdd(LocationUtil.GEO_KEY, js.getcOpenId(), Double.parseDouble(js.getLongitude().toString()), Double.parseDouble(js.getLatitude().toString()));
-        LambdaQueryWrapper<TJs> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        objectLambdaQueryWrapper.eq(TJs::getcOpenId, js.getcOpenId());
-        return this.update(js, objectLambdaQueryWrapper);
-
+        locationUtil.geoAdd(LocationUtil.GEO_KEY, js.getcPhone(), Double.parseDouble(js.getLongitude().toString()), Double.parseDouble(js.getLatitude().toString()));
+        return this.updateById(js);
     }
 
     @Override
@@ -298,6 +295,27 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
         return this.updateById(js);
     }
 
+    @Override
+    public boolean pcAddJs(TJs js) {
+        // 评分默认最高
+        js.setnStar(MassageConstants.INTEGER_FIVE);
+        // 已服务数量 0
+        js.setnNum(MassageConstants.INTEGER_ZERO);
+        // 佣金比例 10
+        js.setnBili(MassageConstants.INTEGER_TEN);
+        // 服务状态
+        js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
+        // 上岗状态
+        js.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
+        // 审核状态
+        js.setnTong(JsStatusEnum.JS_PASS.getCode());
+        js.setnB1(MassageConstants.INTEGER_ZERO);
+        js.setnB2(MassageConstants.INTEGER_ZERO);
+        js.setnB3(MassageConstants.INTEGER_ZERO);
+        js.setDtCreateTime(LocalDateTime.now());
+        return this.save(js);
+    }
+
     @Override
     public TJs getByJsId(String jsId, String openId) {
         if (jsId == null || jsId.trim().isEmpty()) {