|
@@ -1,13 +1,14 @@
|
|
|
package com.ylx.web.controller.massage;
|
|
package com.ylx.web.controller.massage;
|
|
|
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.Objects;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
|
|
|
|
|
-import cn.hutool.json.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -16,20 +17,16 @@ import com.ylx.common.annotation.Log;
|
|
|
import com.ylx.common.constant.CacheConstants;
|
|
import com.ylx.common.constant.CacheConstants;
|
|
|
import com.ylx.common.constant.Constants;
|
|
import com.ylx.common.constant.Constants;
|
|
|
import com.ylx.common.core.controller.BaseController;
|
|
import com.ylx.common.core.controller.BaseController;
|
|
|
-import com.ylx.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ylx.common.core.domain.R;
|
|
import com.ylx.common.core.domain.R;
|
|
|
import com.ylx.common.core.domain.model.LoginUser;
|
|
import com.ylx.common.core.domain.model.LoginUser;
|
|
|
import com.ylx.common.core.domain.model.WxLoginUser;
|
|
import com.ylx.common.core.domain.model.WxLoginUser;
|
|
|
-import com.ylx.common.core.domain.model.aliyun.SMSVerificationCode;
|
|
|
|
|
import com.ylx.common.core.domain.model.aliyun.SendSmsComponents;
|
|
import com.ylx.common.core.domain.model.aliyun.SendSmsComponents;
|
|
|
-import com.ylx.common.core.domain.model.aliyun.SendSmsEnum;
|
|
|
|
|
import com.ylx.common.core.page.TableDataInfo;
|
|
import com.ylx.common.core.page.TableDataInfo;
|
|
|
import com.ylx.common.core.redis.RedisCache;
|
|
import com.ylx.common.core.redis.RedisCache;
|
|
|
import com.ylx.common.enums.BusinessType;
|
|
import com.ylx.common.enums.BusinessType;
|
|
|
import com.ylx.common.exception.user.CaptchaException;
|
|
import com.ylx.common.exception.user.CaptchaException;
|
|
|
import com.ylx.common.exception.user.CaptchaExpireException;
|
|
import com.ylx.common.exception.user.CaptchaExpireException;
|
|
|
import com.ylx.common.utils.MessageUtils;
|
|
import com.ylx.common.utils.MessageUtils;
|
|
|
-import com.ylx.common.utils.SecurityUtils;
|
|
|
|
|
import com.ylx.common.utils.StringUtils;
|
|
import com.ylx.common.utils.StringUtils;
|
|
|
import com.ylx.common.utils.poi.ExcelUtil;
|
|
import com.ylx.common.utils.poi.ExcelUtil;
|
|
|
import com.ylx.framework.manager.AsyncManager;
|
|
import com.ylx.framework.manager.AsyncManager;
|
|
@@ -43,7 +40,6 @@ import com.ylx.massage.domain.vo.*;
|
|
|
import com.ylx.massage.service.IMaProjectService;
|
|
import com.ylx.massage.service.IMaProjectService;
|
|
|
import com.ylx.massage.service.IMaTechnicianService;
|
|
import com.ylx.massage.service.IMaTechnicianService;
|
|
|
import com.ylx.massage.service.TWxUserService;
|
|
import com.ylx.massage.service.TWxUserService;
|
|
|
-import com.ylx.project.domain.Project;
|
|
|
|
|
import com.ylx.servicecategory.domain.ServiceCategory;
|
|
import com.ylx.servicecategory.domain.ServiceCategory;
|
|
|
import com.ylx.servicecategory.service.ServiceCategoryService;
|
|
import com.ylx.servicecategory.service.ServiceCategoryService;
|
|
|
import com.ylx.system.service.ISysConfigService;
|
|
import com.ylx.system.service.ISysConfigService;
|
|
@@ -58,26 +54,6 @@ import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import com.ylx.common.annotation.Log;
|
|
|
|
|
-import com.ylx.common.core.controller.BaseController;
|
|
|
|
|
-import com.ylx.common.core.domain.AjaxResult;
|
|
|
|
|
-import com.ylx.common.enums.BusinessType;
|
|
|
|
|
-import com.ylx.massage.domain.MaTechnician;
|
|
|
|
|
-import com.ylx.massage.service.IMaTechnicianService;
|
|
|
|
|
-import com.ylx.common.utils.poi.ExcelUtil;
|
|
|
|
|
-import com.ylx.common.core.page.TableDataInfo;
|
|
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
-
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
-import java.util.Random;
|
|
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
|
-
|
|
|
|
|
-import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 技师Controller
|
|
* 技师Controller
|
|
@@ -124,18 +100,15 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 商户手机号密码登录
|
|
* 商户手机号密码登录
|
|
|
*
|
|
*
|
|
|
* @param thirdPartyLoginsVo
|
|
* @param thirdPartyLoginsVo
|
|
|
- * @return Result<WxLoginUser>
|
|
|
|
|
|
|
+ * @return R<WxLoginUser>
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation(value = "商户手机号密码登录", notes = "商户手机号密码登录")
|
|
@ApiOperation(value = "商户手机号密码登录", notes = "商户手机号密码登录")
|
|
|
@PostMapping(value = "/clientLogin")
|
|
@PostMapping(value = "/clientLogin")
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- public Result<WxLoginUser> login(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) throws Exception {
|
|
|
|
|
- // 获取登录用户信息
|
|
|
|
|
- Result<WxLoginUser> result = new Result<>();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public R<WxLoginUser> login(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) throws Exception {
|
|
|
// 校验手机号是否为空
|
|
// 校验手机号是否为空
|
|
|
if (StringUtils.isBlank(thirdPartyLoginsVo.getPhone())) {
|
|
if (StringUtils.isBlank(thirdPartyLoginsVo.getPhone())) {
|
|
|
- return result.error500("请输入手机号");
|
|
|
|
|
|
|
+ return R.fail("请输入手机号");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 校验用户是否存在且有效
|
|
// 校验用户是否存在且有效
|
|
@@ -145,25 +118,25 @@ public class MaTechnicianController extends BaseController {
|
|
|
TWxUser tWxUser = wxUserService.getOne(queryWrapper);
|
|
TWxUser tWxUser = wxUserService.getOne(queryWrapper);
|
|
|
// 校验用户是否有效
|
|
// 校验用户是否有效
|
|
|
if (ObjectUtils.isEmpty(tWxUser)) {
|
|
if (ObjectUtils.isEmpty(tWxUser)) {
|
|
|
- return result.error500("商户不存在,请先注册");
|
|
|
|
|
|
|
+ return R.fail("商户不存在,请先注册");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (thirdPartyLoginsVo.getCodeSwitch()) {
|
|
if (thirdPartyLoginsVo.getCodeSwitch()) {
|
|
|
// 短信验证
|
|
// 短信验证
|
|
|
String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
if (StringUtils.isEmpty(msg)) {
|
|
if (StringUtils.isEmpty(msg)) {
|
|
|
- return Result.error("验证码已失效");
|
|
|
|
|
|
|
+ return R.fail("验证码已失效");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!thirdPartyLoginsVo.getPhoneMsg().equals(msg)) {
|
|
if (!thirdPartyLoginsVo.getPhoneMsg().equals(msg)) {
|
|
|
- return Result.error("短信验证码不正确");
|
|
|
|
|
|
|
+ return R.fail("短信验证码不正确");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// 初始化加密工具
|
|
// 初始化加密工具
|
|
|
// 验证:比对是否匹配
|
|
// 验证:比对是否匹配
|
|
|
boolean isOk = passwordEncoder.matches(thirdPartyLoginsVo.getPassWord(), tWxUser.getCPassword());
|
|
boolean isOk = passwordEncoder.matches(thirdPartyLoginsVo.getPassWord(), tWxUser.getCPassword());
|
|
|
/*if (!isOk) {
|
|
/*if (!isOk) {
|
|
|
- return Result.error("密码错误");
|
|
|
|
|
|
|
+ return R.fail("密码错误");
|
|
|
}*/
|
|
}*/
|
|
|
}
|
|
}
|
|
|
WxLoginUser wxUser = new WxLoginUser();
|
|
WxLoginUser wxUser = new WxLoginUser();
|
|
@@ -172,7 +145,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
String token = wxTokenService.createToken(wxUser);
|
|
String token = wxTokenService.createToken(wxUser);
|
|
|
log.info("token的值:{}", token);
|
|
log.info("token的值:{}", token);
|
|
|
if (token == null || token.isEmpty()) {
|
|
if (token == null || token.isEmpty()) {
|
|
|
- return Result.error("生成令牌失败");
|
|
|
|
|
|
|
+ return R.fail("生成令牌失败");
|
|
|
}
|
|
}
|
|
|
//给我把token的值保存到redis中
|
|
//给我把token的值保存到redis中
|
|
|
redisTemplate.opsForValue().set(wxUser.getCOpenid(), token, 3, TimeUnit.DAYS);
|
|
redisTemplate.opsForValue().set(wxUser.getCOpenid(), token, 3, TimeUnit.DAYS);
|
|
@@ -180,22 +153,20 @@ public class MaTechnicianController extends BaseController {
|
|
|
// 返回用户信息
|
|
// 返回用户信息
|
|
|
// 记录登录信息
|
|
// 记录登录信息
|
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(wxUser.getCOpenid(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(wxUser.getCOpenid(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
|
|
- result.setResult(wxUser);
|
|
|
|
|
// 登录成功删除验证码
|
|
// 登录成功删除验证码
|
|
|
redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
- result.success("登录成功");
|
|
|
|
|
- return result;
|
|
|
|
|
|
|
+ return R.ok(wxUser, "登录成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 商户忘记密码接口
|
|
* 商户忘记密码接口
|
|
|
*
|
|
*
|
|
|
* @param thirdPartyLoginsVo
|
|
* @param thirdPartyLoginsVo
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/resetPassword")
|
|
@PostMapping("/resetPassword")
|
|
|
@ApiOperation("商户忘记密码接口")
|
|
@ApiOperation("商户忘记密码接口")
|
|
|
- public Result<?> resetPassword(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) {
|
|
|
|
|
|
|
+ public R<?> resetPassword(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) {
|
|
|
// 核心正则表达式:
|
|
// 核心正则表达式:
|
|
|
// ^ 表示开头,$ 表示结尾
|
|
// ^ 表示开头,$ 表示结尾
|
|
|
// [a-zA-Z0-9] 表示只能是字母或数字
|
|
// [a-zA-Z0-9] 表示只能是字母或数字
|
|
@@ -205,19 +176,19 @@ public class MaTechnicianController extends BaseController {
|
|
|
boolean isMatch = Pattern.matches(regex, thirdPartyLoginsVo.getPassWord().trim());
|
|
boolean isMatch = Pattern.matches(regex, thirdPartyLoginsVo.getPassWord().trim());
|
|
|
if (!isMatch) {
|
|
if (!isMatch) {
|
|
|
// 根据需求返回指定的异常提示
|
|
// 根据需求返回指定的异常提示
|
|
|
- return Result.error("请输入8-20位数字/字母组合");
|
|
|
|
|
|
|
+ return R.fail("请输入8-20位数字/字母组合");
|
|
|
}
|
|
}
|
|
|
// 短信验证 sys:clientLogin:phone:手机号
|
|
// 短信验证 sys:clientLogin:phone:手机号
|
|
|
String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
log.info("短信验证码的值:{}", msg);
|
|
log.info("短信验证码的值:{}", msg);
|
|
|
if (StringUtils.isEmpty(msg)) {
|
|
if (StringUtils.isEmpty(msg)) {
|
|
|
- return Result.error("验证码已失效");
|
|
|
|
|
|
|
+ return R.fail("验证码已失效");
|
|
|
}
|
|
}
|
|
|
if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
|
msg = msg.substring(1, msg.length() - 1);
|
|
msg = msg.substring(1, msg.length() - 1);
|
|
|
}
|
|
}
|
|
|
if (!thirdPartyLoginsVo.getPhoneMsg().equals(msg)) {
|
|
if (!thirdPartyLoginsVo.getPhoneMsg().equals(msg)) {
|
|
|
- return Result.error("短信验证码不正确");
|
|
|
|
|
|
|
+ return R.fail("短信验证码不正确");
|
|
|
}
|
|
}
|
|
|
// 重置密码逻辑
|
|
// 重置密码逻辑
|
|
|
LambdaUpdateWrapper<MaTechnician> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<MaTechnician> updateWrapper = new LambdaUpdateWrapper<>();
|
|
@@ -228,7 +199,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
maTechnicianService.update(updateWrapper);
|
|
maTechnicianService.update(updateWrapper);
|
|
|
// 重置密码成功删除验证码
|
|
// 重置密码成功删除验证码
|
|
|
redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
- return Result.ok("重置密码成功");
|
|
|
|
|
|
|
+ return R.ok("重置密码成功");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -239,15 +210,15 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 校验图形验证码接口
|
|
* 校验图形验证码接口
|
|
|
*
|
|
*
|
|
|
* @param req
|
|
* @param req
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/getValidateCaptcha")
|
|
@PostMapping("/getValidateCaptcha")
|
|
|
@ApiOperation("校验图形验证码接口")
|
|
@ApiOperation("校验图形验证码接口")
|
|
|
- public Result<?> getValidateCaptcha(@RequestBody ValidateCaptchaDto req) {
|
|
|
|
|
|
|
+ public R<?> getValidateCaptcha(@RequestBody ValidateCaptchaDto req) {
|
|
|
try {
|
|
try {
|
|
|
log.info("校验图形验证码的请求参数:{}", JSON.toJSONString(req));
|
|
log.info("校验图形验证码的请求参数:{}", JSON.toJSONString(req));
|
|
|
validateCaptcha(req.getPhone(), req.getCode(), req.getUuid());
|
|
validateCaptcha(req.getPhone(), req.getCode(), req.getUuid());
|
|
|
- return Result.ok("校验成功");
|
|
|
|
|
|
|
+ return R.ok("校验成功");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -258,38 +229,38 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 商户入驻申请接口
|
|
* 商户入驻申请接口
|
|
|
*
|
|
*
|
|
|
* @param req
|
|
* @param req
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/apply")
|
|
@PostMapping("/apply")
|
|
|
@ApiOperation("商户入驻申请接口")
|
|
@ApiOperation("商户入驻申请接口")
|
|
|
- public Result<?> apply(@RequestBody MaTechnicianAppAddVo req) {
|
|
|
|
|
|
|
+ public R<?> apply(@RequestBody MaTechnicianAppAddVo req) {
|
|
|
try {
|
|
try {
|
|
|
// 1. 基础参数校验
|
|
// 1. 基础参数校验
|
|
|
if (StringUtils.isAnyBlank(req.getTeName(), req.getTePhone(), req.getAvatar())) {
|
|
if (StringUtils.isAnyBlank(req.getTeName(), req.getTePhone(), req.getAvatar())) {
|
|
|
- return Result.error("必填项不能为空");
|
|
|
|
|
|
|
+ return R.fail("必填项不能为空");
|
|
|
}
|
|
}
|
|
|
//校验性别不能为空
|
|
//校验性别不能为空
|
|
|
if (Objects.isNull(req.getTeSex())) {
|
|
if (Objects.isNull(req.getTeSex())) {
|
|
|
- return Result.error("性别不能为空");
|
|
|
|
|
|
|
+ return R.fail("性别不能为空");
|
|
|
}
|
|
}
|
|
|
// 短信验证
|
|
// 短信验证
|
|
|
String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + req.getTePhone());
|
|
String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + req.getTePhone());
|
|
|
log.info("短信验证码的值:{}", msg);
|
|
log.info("短信验证码的值:{}", msg);
|
|
|
/*if (StringUtils.isEmpty(msg)) {
|
|
/*if (StringUtils.isEmpty(msg)) {
|
|
|
- return Result.error("验证码已失效");
|
|
|
|
|
|
|
+ return R.fail("验证码已失效");
|
|
|
}
|
|
}
|
|
|
if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
|
msg = msg.substring(1, msg.length() - 1);
|
|
msg = msg.substring(1, msg.length() - 1);
|
|
|
}
|
|
}
|
|
|
if (!req.getPhoneMsg().equals(msg)) {
|
|
if (!req.getPhoneMsg().equals(msg)) {
|
|
|
- return Result.error("短信验证码不正确");
|
|
|
|
|
|
|
+ return R.fail("短信验证码不正确");
|
|
|
}*/
|
|
}*/
|
|
|
if (StringUtils.isNotEmpty(req.getPhoneImgMsg())) {
|
|
if (StringUtils.isNotEmpty(req.getPhoneImgMsg())) {
|
|
|
validateCaptcha(req.getTeName(), req.getPhoneImgMsg(), req.getUuid());
|
|
validateCaptcha(req.getTeName(), req.getPhoneImgMsg(), req.getUuid());
|
|
|
}
|
|
}
|
|
|
// 2. 调用业务层处理入驻申请
|
|
// 2. 调用业务层处理入驻申请
|
|
|
maTechnicianService.apply(req);
|
|
maTechnicianService.apply(req);
|
|
|
- return Result.ok("提交成功,进入审核流程");
|
|
|
|
|
|
|
+ return R.ok("提交成功,进入审核流程");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -324,14 +295,14 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 申请入驻
|
|
* 申请入驻
|
|
|
*
|
|
*
|
|
|
* @param req
|
|
* @param req
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/applyFile")
|
|
@PostMapping("/applyFile")
|
|
|
@ApiOperation("申请入驻")
|
|
@ApiOperation("申请入驻")
|
|
|
- public Result applyFile(@RequestBody MerchantApplyFileRequestDto req) {
|
|
|
|
|
|
|
+ public R<?> applyFile(@RequestBody MerchantApplyFileRequestDto req) {
|
|
|
try {
|
|
try {
|
|
|
maTechnicianService.applyFile(req);
|
|
maTechnicianService.applyFile(req);
|
|
|
- return Result.ok("申请入驻成功");
|
|
|
|
|
|
|
+ return R.ok("申请入驻成功");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -343,9 +314,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/wait/list")
|
|
@PostMapping("/wait/list")
|
|
|
@ApiOperation("获取待接单列表")
|
|
@ApiOperation("获取待接单列表")
|
|
|
- public Result<List<WaitOrderDTO>> getWaitOrder(@RequestBody WaitOrderQueryDTO query) {
|
|
|
|
|
|
|
+ public R<List<WaitOrderDTO>> getWaitOrder(@RequestBody WaitOrderQueryDTO query) {
|
|
|
List<WaitOrderDTO> list = maTechnicianService.listWaitOrder(query);
|
|
List<WaitOrderDTO> list = maTechnicianService.listWaitOrder(query);
|
|
|
- return Result.ok(list);
|
|
|
|
|
|
|
+ return R.ok(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -354,9 +325,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/accept")
|
|
@PostMapping("/accept")
|
|
|
@ApiOperation("滑动接单")
|
|
@ApiOperation("滑动接单")
|
|
|
- public Result<String> acceptOrder(@RequestBody AcceptOrderReqDTO req) {
|
|
|
|
|
|
|
+ public R<String> acceptOrder(@RequestBody AcceptOrderReqDTO req) {
|
|
|
String tip = maTechnicianService.acceptOrder(req);
|
|
String tip = maTechnicianService.acceptOrder(req);
|
|
|
- return Result.ok(tip);
|
|
|
|
|
|
|
+ return R.ok(tip);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -365,9 +336,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/rest/confirm")
|
|
@GetMapping("/rest/confirm")
|
|
|
@ApiOperation("确认接单")
|
|
@ApiOperation("确认接单")
|
|
|
- public Result<String> confirmRestAccept(@RequestParam Long techId, @RequestParam Long orderId) {
|
|
|
|
|
|
|
+ public R<String> confirmRestAccept(@RequestParam Long techId, @RequestParam Long orderId) {
|
|
|
String tip = maTechnicianService.confirmRestAccept(techId, orderId);
|
|
String tip = maTechnicianService.confirmRestAccept(techId, orderId);
|
|
|
- return Result.ok(tip);
|
|
|
|
|
|
|
+ return R.ok(tip);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -376,9 +347,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/refuse")
|
|
@PostMapping("/refuse")
|
|
|
@ApiOperation("拒绝接单")
|
|
@ApiOperation("拒绝接单")
|
|
|
- public Result<Void> refuseOrder(@RequestBody RefuseOrderReqDTO req) {
|
|
|
|
|
|
|
+ public R<String> refuseOrder(@RequestBody RefuseOrderReqDTO req) {
|
|
|
maTechnicianService.refuseOrder(req);
|
|
maTechnicianService.refuseOrder(req);
|
|
|
- return Result.ok("拒绝成功");
|
|
|
|
|
|
|
+ return R.ok("拒绝成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -386,13 +357,13 @@ public class MaTechnicianController extends BaseController {
|
|
|
*
|
|
*
|
|
|
* @param userId 商户ID
|
|
* @param userId 商户ID
|
|
|
* @param forceConfirm 是否强制切换 true:强制切换 false:不强制切换
|
|
* @param forceConfirm 是否强制切换 true:强制切换 false:不强制切换
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/switchToOffline")
|
|
@GetMapping("/switchToOffline")
|
|
|
@ApiOperation("商户状态切换")
|
|
@ApiOperation("商户状态切换")
|
|
|
- public Result switchToOffline(@RequestParam Long userId, @RequestParam Boolean forceConfirm) {
|
|
|
|
|
|
|
+ public R<?> switchToOffline(@RequestParam Long userId, @RequestParam Boolean forceConfirm) {
|
|
|
try {
|
|
try {
|
|
|
- return maTechnicianService.switchToOffline(userId, forceConfirm);
|
|
|
|
|
|
|
+ return toR(maTechnicianService.switchToOffline(userId, forceConfirm));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -403,17 +374,17 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 查询商户信息
|
|
* 查询商户信息
|
|
|
*
|
|
*
|
|
|
* @param openid 微信openid
|
|
* @param openid 微信openid
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/getTechnician")
|
|
@GetMapping("/getTechnician")
|
|
|
@ApiOperation("查询商户信息")
|
|
@ApiOperation("查询商户信息")
|
|
|
- public Result<?> getTechnician(@RequestParam String openid) {
|
|
|
|
|
|
|
+ public R<?> getTechnician(@RequestParam String openid) {
|
|
|
try {
|
|
try {
|
|
|
MerchantAuditFile technicianInfo = maTechnicianService.getTechnicianInfo(openid);
|
|
MerchantAuditFile technicianInfo = maTechnicianService.getTechnicianInfo(openid);
|
|
|
- return Result.ok(technicianInfo.getMerchant());
|
|
|
|
|
|
|
+ return R.ok(technicianInfo.getMerchant());
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("查询商户信息失败", e);
|
|
log.error("查询商户信息失败", e);
|
|
|
- return Result.error(e.getMessage());
|
|
|
|
|
|
|
+ return R.fail(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -421,16 +392,16 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 查询商户信息和入驻资料
|
|
* 查询商户信息和入驻资料
|
|
|
*
|
|
*
|
|
|
* @param openid 微信openid
|
|
* @param openid 微信openid
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/getTechnicianInfo")
|
|
@GetMapping("/getTechnicianInfo")
|
|
|
@ApiOperation("查询商户信息和入驻资料")
|
|
@ApiOperation("查询商户信息和入驻资料")
|
|
|
- public Result<?> getTechnicianInfo(@RequestParam("openid") String openid) {
|
|
|
|
|
|
|
+ public R<?> getTechnicianInfo(@RequestParam("openid") String openid) {
|
|
|
try {
|
|
try {
|
|
|
- return Result.ok(maTechnicianService.getTechnicianInfo(openid));
|
|
|
|
|
|
|
+ return R.ok(maTechnicianService.getTechnicianInfo(openid));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("查询商户信息和入驻资料失败", e);
|
|
log.error("查询商户信息和入驻资料失败", e);
|
|
|
- return Result.error(e.getMessage());
|
|
|
|
|
|
|
+ return R.fail(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -438,17 +409,17 @@ public class MaTechnicianController extends BaseController {
|
|
|
* 修改商户信息
|
|
* 修改商户信息
|
|
|
*
|
|
*
|
|
|
* @param req
|
|
* @param req
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/updateTechnician")
|
|
@PostMapping("/updateTechnician")
|
|
|
- @ApiOperation("修改商户信息接口")
|
|
|
|
|
- public Result<?> updateTechnician(@RequestBody MerchantApplyFileRequestDto req) {
|
|
|
|
|
|
|
+ @ApiOperation("修改商户信息")
|
|
|
|
|
+ public R<?> updateTechnician(@Valid @RequestBody MerchantApplyFileRequestDto req) {
|
|
|
try {
|
|
try {
|
|
|
maTechnicianService.updateTechnician(req);
|
|
maTechnicianService.updateTechnician(req);
|
|
|
- return Result.ok("修改成功");
|
|
|
|
|
|
|
+ return R.ok("修改成功");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("修改商户信息失败", e);
|
|
log.error("修改商户信息失败", e);
|
|
|
- return Result.error(e.getMessage());
|
|
|
|
|
|
|
+ return R.fail(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -457,10 +428,10 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(MaTechnician maTechnician) {
|
|
|
|
|
|
|
+ public R<TableDataInfo> list(MaTechnician maTechnician) {
|
|
|
startPage();
|
|
startPage();
|
|
|
List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
|
|
List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
|
|
|
- return getDataTable(list);
|
|
|
|
|
|
|
+ return R.ok(getDataTable(list));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -480,8 +451,8 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
|
|
- return success(maTechnicianService.selectMaTechnicianById(id));
|
|
|
|
|
|
|
+ public R<MaTechnician> getInfo(@PathVariable("id") Long id) {
|
|
|
|
|
+ return R.ok(maTechnicianService.selectMaTechnicianById(id));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -491,24 +462,24 @@ public class MaTechnicianController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
|
@Log(title = "技师", businessType = BusinessType.INSERT)
|
|
@Log(title = "技师", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
|
|
|
|
|
- return toAjax(maTechnicianService.insertMaTechnician(maTechnicianAppAddVo));
|
|
|
|
|
|
|
+ public R<Void> add(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
|
|
|
|
|
+ return toR(maTechnicianService.insertMaTechnician(maTechnicianAppAddVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 后台新增商户
|
|
* 后台新增商户
|
|
|
*
|
|
*
|
|
|
* @param dto 商户新增DTO
|
|
* @param dto 商户新增DTO
|
|
|
- * @return AjaxResult 结果
|
|
|
|
|
|
|
+ * @return R<Void> 结果
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation("后台新增商户")
|
|
@ApiOperation("后台新增商户")
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
|
@Log(title = "商户", businessType = BusinessType.INSERT)
|
|
@Log(title = "商户", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/merchant")
|
|
@PostMapping("/merchant")
|
|
|
- public AjaxResult addMerchant(@RequestBody MaTechnicianMerchantAddDTO dto) {
|
|
|
|
|
|
|
+ public R<Void> addMerchant(@RequestBody MaTechnicianMerchantAddDTO dto) {
|
|
|
try {
|
|
try {
|
|
|
LoginUser loginUser = getLoginUser();
|
|
LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.insertMerchant(dto, loginUser));
|
|
|
|
|
|
|
+ return toR(maTechnicianService.insertMerchant(dto, loginUser));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -520,16 +491,16 @@ public class MaTechnicianController extends BaseController {
|
|
|
*
|
|
*
|
|
|
* @param id 商户ID
|
|
* @param id 商户ID
|
|
|
* @param dto 商户编辑DTO
|
|
* @param dto 商户编辑DTO
|
|
|
- * @return AjaxResult 结果
|
|
|
|
|
|
|
+ * @return R<Void> 结果
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation("后台编辑商户")
|
|
@ApiOperation("后台编辑商户")
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
@Log(title = "商户", businessType = BusinessType.UPDATE)
|
|
@Log(title = "商户", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/merchant/{id}")
|
|
@PutMapping("/merchant/{id}")
|
|
|
- public AjaxResult editMerchant(@PathVariable("id") Integer id, @RequestBody MaTechnicianMerchantAddDTO dto) {
|
|
|
|
|
|
|
+ public R<Void> editMerchant(@PathVariable("id") Integer id, @RequestBody MaTechnicianMerchantAddDTO dto) {
|
|
|
try {
|
|
try {
|
|
|
LoginUser loginUser = getLoginUser();
|
|
LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.updateMerchant(id, dto, loginUser));
|
|
|
|
|
|
|
+ return toR(maTechnicianService.updateMerchant(id, dto, loginUser));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -547,7 +518,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
@Log(title = "商户合同", businessType = BusinessType.UPDATE)
|
|
@Log(title = "商户合同", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/merchant/{id}/contract")
|
|
@PostMapping("/merchant/{id}/contract")
|
|
|
- public R uploadMerchantContract(@PathVariable("id") Integer id, @RequestBody Map<String, Object> map) {
|
|
|
|
|
|
|
+ public R<Integer> uploadMerchantContract(@PathVariable("id") Integer id, @RequestBody Map<String, Object> map) {
|
|
|
try {
|
|
try {
|
|
|
LoginUser loginUser = getLoginUser();
|
|
LoginUser loginUser = getLoginUser();
|
|
|
return R.ok(maTechnicianService.uploadMerchantContract(id, map, loginUser));
|
|
return R.ok(maTechnicianService.uploadMerchantContract(id, map, loginUser));
|
|
@@ -567,8 +538,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
@ApiOperation("后台查询商户入驻审核列表")
|
|
@ApiOperation("后台查询商户入驻审核列表")
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
@GetMapping("/merchant/audit/list")
|
|
@GetMapping("/merchant/audit/list")
|
|
|
- public R<Page<MaTechnicianAuditListVO>> merchantAuditList
|
|
|
|
|
- (Page<MaTechnicianAuditListVO> page, MaTechnicianAuditQueryDTO dto) {
|
|
|
|
|
|
|
+ public R<Page<MaTechnicianAuditListVO>> merchantAuditList(Page<MaTechnicianAuditListVO> page, MaTechnicianAuditQueryDTO dto) {
|
|
|
try {
|
|
try {
|
|
|
return R.ok(maTechnicianService.selectMerchantAuditList(page, dto));
|
|
return R.ok(maTechnicianService.selectMerchantAuditList(page, dto));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -578,21 +548,42 @@ public class MaTechnicianController extends BaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 商户入驻审核
|
|
|
|
|
|
|
+ * 商户待入驻审核
|
|
|
*
|
|
*
|
|
|
* @param id 商户ID
|
|
* @param id 商户ID
|
|
|
* @param dto 审核提交参数
|
|
* @param dto 审核提交参数
|
|
|
- * @return AjaxResult 结果
|
|
|
|
|
|
|
+ * @return R<Void> 结果
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation("商户入驻审核")
|
|
@ApiOperation("商户入驻审核")
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
@Log(title = "商户入驻审核", businessType = BusinessType.UPDATE)
|
|
@Log(title = "商户入驻审核", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/merchant/audit/{id}/submit")
|
|
@PutMapping("/merchant/audit/{id}/submit")
|
|
|
- public AjaxResult submitMerchantAudit(@PathVariable("id") Integer id, @RequestBody MaTechnicianAuditSubmitDTO
|
|
|
|
|
- dto) {
|
|
|
|
|
|
|
+ public R<Void> submitMerchantAudit(@PathVariable("id") Integer id, @RequestBody MaTechnicianAuditSubmitDTO dto) {
|
|
|
try {
|
|
try {
|
|
|
LoginUser loginUser = getLoginUser();
|
|
LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.submitMerchantAudit(id, dto, loginUser));
|
|
|
|
|
|
|
+ return toR(maTechnicianService.submitMerchantAudit(id, dto, loginUser));
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 商户申请入驻审核
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id 商户ID
|
|
|
|
|
+ * @param dto 审核提交参数
|
|
|
|
|
+ * @return R<Void> 结果
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("商户申请入驻审核")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
|
|
+ @Log(title = "商户申请入驻审核", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PutMapping("/merchant/audit/{id}/applySubmit")
|
|
|
|
|
+ public R<Void> applyMerchantAudit(@PathVariable("id") Integer id, @RequestBody MaTechnicianAuditSubmitDTO dto) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ LoginUser loginUser = getLoginUser();
|
|
|
|
|
+ return toR(maTechnicianService.applyMerchantAudit(id, dto, loginUser));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -604,18 +595,16 @@ public class MaTechnicianController extends BaseController {
|
|
|
*
|
|
*
|
|
|
* @param id 商户ID
|
|
* @param id 商户ID
|
|
|
* @param dto 待审核通过参数
|
|
* @param dto 待审核通过参数
|
|
|
- * @return AjaxResult 结果
|
|
|
|
|
|
|
+ * @return R<Void> 结果
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation("待审核页面审核通过商户")
|
|
@ApiOperation("待审核页面审核通过商户")
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
@Log(title = "商户待审核通过", businessType = BusinessType.UPDATE)
|
|
@Log(title = "商户待审核通过", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/merchant/audit/{id}/approve")
|
|
@PutMapping("/merchant/audit/{id}/approve")
|
|
|
- public AjaxResult approvePendingMerchantAudit(@PathVariable("id") Integer id,
|
|
|
|
|
- @RequestBody MaTechnicianPendingAuditSubmitDTO
|
|
|
|
|
- dto) {
|
|
|
|
|
|
|
+ public R<Void> approvePendingMerchantAudit(@PathVariable("id") Integer id, @RequestBody MaTechnicianPendingAuditSubmitDTO dto) {
|
|
|
try {
|
|
try {
|
|
|
LoginUser loginUser = getLoginUser();
|
|
LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.approvePendingMerchantAudit(id, dto, loginUser));
|
|
|
|
|
|
|
+ return toR(maTechnicianService.approvePendingMerchantAudit(id, dto, loginUser));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -684,8 +673,8 @@ public class MaTechnicianController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
@Log(title = "技师", businessType = BusinessType.UPDATE)
|
|
@Log(title = "技师", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
|
|
|
|
|
- return toAjax(maTechnicianService.updateMaTechnician(maTechnicianAppAddVo));
|
|
|
|
|
|
|
+ public R<Void> edit(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
|
|
|
|
|
+ return toR(maTechnicianService.updateMaTechnician(maTechnicianAppAddVo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -694,8 +683,8 @@ public class MaTechnicianController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:remove')")
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:remove')")
|
|
|
@Log(title = "技师", businessType = BusinessType.DELETE)
|
|
@Log(title = "技师", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
@DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
|
|
- return toAjax(maTechnicianService.deleteMaTechnicianByIds(ids));
|
|
|
|
|
|
|
+ public R<Void> remove(@PathVariable Long[] ids) {
|
|
|
|
|
+ return toR(maTechnicianService.deleteMaTechnicianByIds(ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -703,9 +692,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/getServiceCategoryList")
|
|
@GetMapping("/getServiceCategoryList")
|
|
|
@ApiOperation("获取服务类目列表")
|
|
@ApiOperation("获取服务类目列表")
|
|
|
- public AjaxResult getServiceCategoryList() {
|
|
|
|
|
|
|
+ public R<List<ServiceCategory>> getServiceCategoryList() {
|
|
|
List<ServiceCategory> list = serviceCategoryService.listH5ServiceCategory();
|
|
List<ServiceCategory> list = serviceCategoryService.listH5ServiceCategory();
|
|
|
- return AjaxResult.success(list);
|
|
|
|
|
|
|
+ return R.ok(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -714,10 +703,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/getSkillList")
|
|
@PostMapping("/getSkillList")
|
|
|
@ApiOperation("获取技能列表")
|
|
@ApiOperation("获取技能列表")
|
|
|
- public Result<List<MaProject>> getSkillList(@RequestBody MaProjectGetVo req) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public R<List<MaProject>> getSkillList(@RequestBody MaProjectGetVo req) {
|
|
|
List<MaProject> list = maTechnicianService.selectMaTechnicianListBy(req.getUserId(), req.getAuditStatus());
|
|
List<MaProject> list = maTechnicianService.selectMaTechnicianListBy(req.getUserId(), req.getAuditStatus());
|
|
|
- return Result.ok(list);
|
|
|
|
|
|
|
+ return R.ok(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -728,10 +716,8 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/getNotApplyList")
|
|
@PostMapping("/getNotApplyList")
|
|
|
@ApiOperation("查询未开通的服务项目列表")
|
|
@ApiOperation("查询未开通的服务项目列表")
|
|
|
- public Result<?> getNotApplyList(@RequestBody MaProjectGetVo req) {
|
|
|
|
|
-
|
|
|
|
|
- return Result.ok(maTechnicianService.getNotApplyList(req.getUserId(), req.getTypeId()));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public R<?> getNotApplyList(@RequestBody MaProjectGetVo req) {
|
|
|
|
|
+ return R.ok(maTechnicianService.getNotApplyList(req.getUserId(), req.getTypeId()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -739,9 +725,8 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/applyForService")
|
|
@PostMapping("/applyForService")
|
|
|
@ApiOperation("申请开通新服务")
|
|
@ApiOperation("申请开通新服务")
|
|
|
- public AjaxResult applyForService(@RequestBody MaProjectSaveDto dto) {
|
|
|
|
|
-
|
|
|
|
|
- return toAjax(maTechnicianService.applyForService(dto));
|
|
|
|
|
|
|
+ public R<Void> applyForService(@RequestBody MaProjectSaveDto dto) {
|
|
|
|
|
+ return toR(maTechnicianService.applyForService(dto));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -752,7 +737,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/updateApply")
|
|
@PostMapping("/updateApply")
|
|
|
@ApiOperation("重新申请开通新服务")
|
|
@ApiOperation("重新申请开通新服务")
|
|
|
- public Result<?> updateApply(@RequestBody MaProjectUpdateDto req) {
|
|
|
|
|
|
|
+ public R<?> updateApply(@RequestBody MaProjectUpdateDto req) {
|
|
|
if (StringUtils.isNotEmpty(req.getProjectId()) && StringUtils.isNotEmpty(req.getApplyReason())) {
|
|
if (StringUtils.isNotEmpty(req.getProjectId()) && StringUtils.isNotEmpty(req.getApplyReason())) {
|
|
|
LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
@@ -760,7 +745,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
updateWrapper.set(MaProject::getAuditStatus, 0);
|
|
updateWrapper.set(MaProject::getAuditStatus, 0);
|
|
|
maProjectService.update(updateWrapper);
|
|
maProjectService.update(updateWrapper);
|
|
|
}
|
|
}
|
|
|
- return Result.ok("重新申请成功,提交到审核阶段");
|
|
|
|
|
|
|
+ return R.ok("重新申请成功,提交到审核阶段");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -772,7 +757,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/updateMaProject")
|
|
@PostMapping("/updateMaProject")
|
|
|
@ApiOperation("申请下架,删除服务项目,编辑售价价格")
|
|
@ApiOperation("申请下架,删除服务项目,编辑售价价格")
|
|
|
- public Result<?> updateMaProject(@RequestBody MaProjectUpdateDto req) {
|
|
|
|
|
|
|
+ public R<?> updateMaProject(@RequestBody MaProjectUpdateDto req) {
|
|
|
String message = "";
|
|
String message = "";
|
|
|
if (StringUtils.isNotEmpty(req.getProjectId())) {
|
|
if (StringUtils.isNotEmpty(req.getProjectId())) {
|
|
|
if (req.getIsDelete()) {
|
|
if (req.getIsDelete()) {
|
|
@@ -799,19 +784,19 @@ public class MaTechnicianController extends BaseController {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return Result.ok(message);
|
|
|
|
|
|
|
+ return R.ok(message);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 商户入驻信息
|
|
* 商户入驻信息
|
|
|
*
|
|
*
|
|
|
* @param userId
|
|
* @param userId
|
|
|
- * @return Result<?>
|
|
|
|
|
|
|
+ * @return R<?>
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/getTechnicianList")
|
|
@GetMapping("/getTechnicianList")
|
|
|
@ApiOperation("商户入驻信息")
|
|
@ApiOperation("商户入驻信息")
|
|
|
- public Result<?> getTechnicianList(@RequestParam(value = "userId") Integer userId) {
|
|
|
|
|
- return Result.ok(maTechnicianService.getTechnicianList(userId));
|
|
|
|
|
|
|
+ public R<?> getTechnicianList(@RequestParam(value = "userId") Integer userId) {
|
|
|
|
|
+ return R.ok(maTechnicianService.getTechnicianList(userId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -823,8 +808,19 @@ public class MaTechnicianController extends BaseController {
|
|
|
|
|
|
|
|
@GetMapping("/getContractRecords")
|
|
@GetMapping("/getContractRecords")
|
|
|
@ApiOperation("查询商户合同记录信息")
|
|
@ApiOperation("查询商户合同记录信息")
|
|
|
- public Result<?> getContractRecords(@RequestParam(value = "userId") Long userId) {
|
|
|
|
|
- return Result.ok(maTechnicianService.getContractRecords(userId));
|
|
|
|
|
|
|
+ public R<?> getContractRecords(@RequestParam(value = "userId") Long userId) {
|
|
|
|
|
+ return R.ok(maTechnicianService.getContractRecords(userId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private R<Void> toR(int rows) {
|
|
|
|
|
+ return rows > 0 ? R.ok() : R.fail();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private R<?> toR(Result<?> result) {
|
|
|
|
|
+ if (result == null) {
|
|
|
|
|
+ return R.fail();
|
|
|
|
|
+ }
|
|
|
|
|
+ return result.isSuccess() ? R.ok(result.getResult(), result.getMessage()) : R.fail(result.getResult(), result.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|