|
|
@@ -18,6 +18,7 @@ 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.model.LoginUser;
|
|
|
+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.SendSmsEnum;
|
|
|
@@ -31,6 +32,7 @@ import com.ylx.common.utils.StringUtils;
|
|
|
import com.ylx.common.utils.poi.ExcelUtil;
|
|
|
import com.ylx.framework.manager.AsyncManager;
|
|
|
import com.ylx.framework.manager.factory.AsyncFactory;
|
|
|
+import com.ylx.framework.web.service.WxTokenService;
|
|
|
import com.ylx.massage.domain.MaProject;
|
|
|
import com.ylx.massage.domain.MaTechnician;
|
|
|
import com.ylx.massage.domain.dto.*;
|
|
|
@@ -43,6 +45,8 @@ import com.ylx.servicecategory.service.ServiceCategoryService;
|
|
|
import com.ylx.system.service.ISysConfigService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@@ -68,6 +72,8 @@ 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
|
|
|
*
|
|
|
@@ -75,6 +81,7 @@ import java.util.regex.Pattern;
|
|
|
* @date 2024-03-22
|
|
|
*/
|
|
|
@Api("技师管理")
|
|
|
+@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("/technician/technician")
|
|
|
public class MaTechnicianController extends BaseController {
|
|
|
@@ -94,6 +101,8 @@ public class MaTechnicianController extends BaseController {
|
|
|
private ISysConfigService configService;
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
+ @Autowired
|
|
|
+ private WxTokenService wxTokenService;
|
|
|
|
|
|
|
|
|
public static final String PHONE_THREEUSERPARTCLIENT_CODE_KEY = "sys:clientLogin:phone:";
|
|
|
@@ -131,9 +140,9 @@ public class MaTechnicianController extends BaseController {
|
|
|
@ApiOperation(value = "商户登录", notes = "商户登录")
|
|
|
@PostMapping(value = "/clientLogin")
|
|
|
@Transactional
|
|
|
- public Result<JSONObject> login(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) throws Exception {
|
|
|
+ public Result<WxLoginUser> login(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) throws Exception {
|
|
|
// 获取登录用户信息
|
|
|
- Result<JSONObject> result = new Result<>();
|
|
|
+ Result<WxLoginUser> result = new Result<>();
|
|
|
|
|
|
// 校验手机号是否为空
|
|
|
if (StringUtils.isEmpty(thirdPartyLoginsVo.getPhone())) {
|
|
|
@@ -164,271 +173,320 @@ public class MaTechnicianController extends BaseController {
|
|
|
// 初始化加密工具
|
|
|
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
|
|
// 验证:比对是否匹配
|
|
|
- boolean isOk = encoder.matches(thirdPartyLoginsVo.getPassWord(),maTechnician.getTePassword());
|
|
|
- if (!isOk) {
|
|
|
- return Result.error("密码错误");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ boolean isOk = encoder.matches(thirdPartyLoginsVo.getPassWord(), maTechnician.getTePassword());
|
|
|
+ if (!isOk) {
|
|
|
+ return Result.error("密码错误");
|
|
|
}
|
|
|
|
|
|
- // 登录成功删除验证码
|
|
|
- redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
- result.success("登录成功");
|
|
|
- return result;
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 商户忘记密码接口
|
|
|
- */
|
|
|
- @PostMapping("/resetPassword")
|
|
|
- public Result<?> resetPassword (@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo){
|
|
|
- // 核心正则表达式:
|
|
|
- // ^ 表示开头,$ 表示结尾
|
|
|
- // [a-zA-Z0-9] 表示只能是字母或数字
|
|
|
- // {8,20} 表示长度必须在8到20之间
|
|
|
- String regex = "^[a-zA-Z0-9]{8,20}$";
|
|
|
- boolean isMatch = Pattern.matches(regex, thirdPartyLoginsVo.getPassWord().trim());
|
|
|
- if (!isMatch) {
|
|
|
- // 根据需求返回指定的异常提示
|
|
|
- return Result.error("请输入8-20位数字/字母组合");
|
|
|
- }
|
|
|
- // 短信验证
|
|
|
- String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
- if (StringUtils.isEmpty(msg)) {
|
|
|
- return Result.error("验证码已失效");
|
|
|
- }
|
|
|
- if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
|
- msg = msg.substring(1, msg.length() - 1);
|
|
|
- }
|
|
|
- if (!thirdPartyLoginsVo.getPhoneMsg().equals(msg)) {
|
|
|
- return Result.error("短信验证码不正确");
|
|
|
- }
|
|
|
- // 重置密码逻辑
|
|
|
- LambdaUpdateWrapper<MaTechnician> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(MaTechnician::getTePhone, thirdPartyLoginsVo.getPhone());
|
|
|
- updateWrapper.set(MaTechnician::getTePassword, thirdPartyLoginsVo.getPassWord());
|
|
|
- maTechnicianService.update(updateWrapper);
|
|
|
- redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
- return Result.ok("重置密码成功");
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 校验图形验证码接口
|
|
|
- */
|
|
|
- @PostMapping("/getValidateCaptcha")
|
|
|
- public Result<?> getValidateCaptcha (@RequestBody ValidateCaptchaDto req){
|
|
|
- validateCaptcha(req.getPhone(), req.getCode(), req.getUuid());
|
|
|
- return Result.ok("校验成功");
|
|
|
+ WxLoginUser wxUser = new WxLoginUser();
|
|
|
+ BeanUtils.copyProperties(maTechnician, wxUser);
|
|
|
+ // 生成并返回令牌
|
|
|
+ String token = wxTokenService.createToken(wxUser);
|
|
|
+ log.info("token的值:{}", token);
|
|
|
+ if (token == null || token.isEmpty()) {
|
|
|
+ return Result.error("生成令牌失败");
|
|
|
}
|
|
|
- /**
|
|
|
- * 商户入驻申请接口
|
|
|
- */
|
|
|
- @PostMapping("/apply")
|
|
|
- public Result<?> apply (@RequestBody MaTechnicianAppAddVo req){
|
|
|
- // 1. 基础参数校验
|
|
|
- if (StringUtils.isAnyBlank(req.getTeName(), req.getTePhone(), req.getTeAddress(), req.getAvatar())) {
|
|
|
- return Result.error("必填项不能为空");
|
|
|
- }
|
|
|
- //校验性别不能为空
|
|
|
- if (Objects.isNull(req.getTeSex())) {
|
|
|
- return Result.error("性别不能为空");
|
|
|
- }
|
|
|
- // 短信验证
|
|
|
- String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + req.getTePhone());
|
|
|
- if (StringUtils.isEmpty(msg)) {
|
|
|
- return Result.error("验证码已失效");
|
|
|
- }
|
|
|
- if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
|
- msg = msg.substring(1, msg.length() - 1);
|
|
|
- }
|
|
|
- if (!req.getPhoneMsg().equals(msg)) {
|
|
|
- return Result.error("短信验证码不正确");
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(req.getPhoneImgMsg())) {
|
|
|
- validateCaptcha(req.getTeName(), req.getPhoneImgMsg(), req.getUuid());
|
|
|
- }
|
|
|
- // 2. 调用业务层处理入驻申请
|
|
|
- maTechnicianService.apply(req);
|
|
|
- return Result.ok("提交成功,进入审核流程");
|
|
|
+ //给我把token的值保存到redis中
|
|
|
+ redisTemplate.opsForValue().set(wxUser.getCOpenid(), token, 180, TimeUnit.MINUTES);
|
|
|
+ wxUser.setToken(token);
|
|
|
+ // 返回用户信息
|
|
|
+ // 记录登录信息
|
|
|
+ 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());
|
|
|
+
|
|
|
+ result.success("登录成功");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商户忘记密码接口
|
|
|
+ */
|
|
|
+ @PostMapping("/resetPassword")
|
|
|
+ public Result<?> resetPassword(@RequestBody ThirdPartyLoginsVo thirdPartyLoginsVo) {
|
|
|
+ // 核心正则表达式:
|
|
|
+ // ^ 表示开头,$ 表示结尾
|
|
|
+ // [a-zA-Z0-9] 表示只能是字母或数字
|
|
|
+ // {8,20} 表示长度必须在8到20之间
|
|
|
+ String regex = "^[a-zA-Z0-9]{8,20}$";
|
|
|
+ boolean isMatch = Pattern.matches(regex, thirdPartyLoginsVo.getPassWord().trim());
|
|
|
+ if (!isMatch) {
|
|
|
+ // 根据需求返回指定的异常提示
|
|
|
+ return Result.error("请输入8-20位数字/字母组合");
|
|
|
+ }
|
|
|
+ // 短信验证
|
|
|
+ String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
+ if (StringUtils.isEmpty(msg)) {
|
|
|
+ return Result.error("验证码已失效");
|
|
|
+ }
|
|
|
+ if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
|
+ msg = msg.substring(1, msg.length() - 1);
|
|
|
+ }
|
|
|
+ if (!thirdPartyLoginsVo.getPhoneMsg().equals(msg)) {
|
|
|
+ return Result.error("短信验证码不正确");
|
|
|
+ }
|
|
|
+ // 重置密码逻辑
|
|
|
+ LambdaUpdateWrapper<MaTechnician> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(MaTechnician::getTePhone, thirdPartyLoginsVo.getPhone());
|
|
|
+ updateWrapper.set(MaTechnician::getTePassword, thirdPartyLoginsVo.getPassWord());
|
|
|
+ maTechnicianService.update(updateWrapper);
|
|
|
+ redisTemplate.delete(PHONE_THREEUSERPARTCLIENT_CODE_KEY + thirdPartyLoginsVo.getPhone());
|
|
|
+ return Result.ok("重置密码成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 校验图形验证码接口
|
|
|
+ */
|
|
|
+ @PostMapping("/getValidateCaptcha")
|
|
|
+ public Result<?> getValidateCaptcha(@RequestBody ValidateCaptchaDto req) {
|
|
|
+ validateCaptcha(req.getPhone(), req.getCode(), req.getUuid());
|
|
|
+ return Result.ok("校验成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商户入驻申请接口
|
|
|
+ */
|
|
|
+ @PostMapping("/apply")
|
|
|
+ public Result<?> apply(@RequestBody MaTechnicianAppAddVo req) {
|
|
|
+ // 1. 基础参数校验
|
|
|
+ if (StringUtils.isAnyBlank(req.getTeName(), req.getTePhone(), req.getAvatar())) {
|
|
|
+ return Result.error("必填项不能为空");
|
|
|
}
|
|
|
- /**
|
|
|
- * 校验验证码
|
|
|
- *
|
|
|
- * @param username 用户名
|
|
|
- * @param code 验证码
|
|
|
- * @param uuid 唯一标识
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
- public void validateCaptcha (String username, String code, String uuid){
|
|
|
- boolean captchaEnabled = configService.selectCaptchaEnabled();
|
|
|
- if (captchaEnabled) {
|
|
|
- String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
|
|
|
- String captcha = redisCache.getCacheObject(verifyKey);
|
|
|
- redisCache.deleteObject(verifyKey);
|
|
|
- if (captcha == null) {
|
|
|
- AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
|
- throw new CaptchaExpireException();
|
|
|
- }
|
|
|
- if (!code.equalsIgnoreCase(captcha)) {
|
|
|
- AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
|
- throw new CaptchaException();
|
|
|
- }
|
|
|
- }
|
|
|
+ //校验性别不能为空
|
|
|
+ if (Objects.isNull(req.getTeSex())) {
|
|
|
+ return Result.error("性别不能为空");
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 申请技师文件
|
|
|
- * @param req
|
|
|
- */
|
|
|
- @PostMapping("/applyFile")
|
|
|
- public Result applyFile (@RequestBody MerchantApplyFileRequestDto req) {
|
|
|
- maTechnicianService.applyFile(req);
|
|
|
- return Result.ok("上传成功");
|
|
|
+ // 短信验证
|
|
|
+ String msg = redisTemplate.opsForValue().get(PHONE_THREEUSERPARTCLIENT_CODE_KEY + req.getTePhone());
|
|
|
+ if (StringUtils.isEmpty(msg)) {
|
|
|
+ return Result.error("验证码已失效");
|
|
|
}
|
|
|
- /**
|
|
|
- * 获取待接单列表:前端传技师实时经纬度筛选订单
|
|
|
- */
|
|
|
- @GetMapping("/wait/list")
|
|
|
- public Result<List<WaitOrderDTO>> getWaitOrder (WaitOrderQueryDTO query){
|
|
|
- List<WaitOrderDTO> list = maTechnicianService.listWaitOrder(query);
|
|
|
- return Result.ok(list);
|
|
|
+ if (msg != null && msg.startsWith("\"") && msg.endsWith("\"")) {
|
|
|
+ msg = msg.substring(1, msg.length() - 1);
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 技师状态切换
|
|
|
- *
|
|
|
- * @param
|
|
|
- */
|
|
|
- @GetMapping("/switchToOffline")
|
|
|
- public Result switchToOffline (@RequestParam Long userId, @RequestParam Boolean forceConfirm){
|
|
|
- return maTechnicianService.switchToOffline(userId, forceConfirm);
|
|
|
+ if (!req.getPhoneMsg().equals(msg)) {
|
|
|
+ return Result.error("短信验证码不正确");
|
|
|
}
|
|
|
- /**
|
|
|
- * 查询商户信息接口
|
|
|
- */
|
|
|
- @GetMapping("/getTechnician")
|
|
|
- public Result<?> getTechnician (@RequestParam String openid){
|
|
|
- LambdaQueryWrapper<MaTechnician> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(MaTechnician::getCOpenid, openid);
|
|
|
- MaTechnician maTechnician = maTechnicianService.getBaseMapper().selectOne(queryWrapper);
|
|
|
- return Result.ok(maTechnician);
|
|
|
+ if (StringUtils.isNotEmpty(req.getPhoneImgMsg())) {
|
|
|
+ validateCaptcha(req.getTeName(), req.getPhoneImgMsg(), req.getUuid());
|
|
|
}
|
|
|
+ // 2. 调用业务层处理入驻申请
|
|
|
+ maTechnicianService.apply(req);
|
|
|
+ return Result.ok("提交成功,进入审核流程");
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 修改和上传商户信息接口
|
|
|
- */
|
|
|
- @PostMapping("/updateTechnician")
|
|
|
- public Result<?> updateTechnician (@RequestBody MaTechnicianAppAddVo req){
|
|
|
- if (req.getAuditStatus() == 0 || req.getAuditStatus() == 3) {
|
|
|
- //修改基本信息
|
|
|
- updateMaTechnician(req);
|
|
|
+ /**
|
|
|
+ * 校验验证码
|
|
|
+ *
|
|
|
+ * @param username 用户名
|
|
|
+ * @param code 验证码
|
|
|
+ * @param uuid 唯一标识
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ public void validateCaptcha(String username, String code, String uuid) {
|
|
|
+ boolean captchaEnabled = configService.selectCaptchaEnabled();
|
|
|
+ if (captchaEnabled) {
|
|
|
+ String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
|
|
|
+ String captcha = redisCache.getCacheObject(verifyKey);
|
|
|
+ redisCache.deleteObject(verifyKey);
|
|
|
+ if (captcha == null) {
|
|
|
+ AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
|
+ throw new CaptchaExpireException();
|
|
|
+ }
|
|
|
+ if (!code.equalsIgnoreCase(captcha)) {
|
|
|
+ AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
|
+ throw new CaptchaException();
|
|
|
}
|
|
|
- return Result.ok("修改成功");
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 申请技师文件
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ @PostMapping("/applyFile")
|
|
|
+ public Result applyFile(@RequestBody MerchantApplyFileRequestDto req) {
|
|
|
+ maTechnicianService.applyFile(req);
|
|
|
+ return Result.ok("上传成功");
|
|
|
+ }
|
|
|
|
|
|
- private void updateMaTechnician (MaTechnicianAppAddVo req){
|
|
|
- LambdaUpdateWrapper<MaTechnician> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(MaTechnician::getId, req.getId());
|
|
|
- updateWrapper.set(MaTechnician::getTePhone, req.getTePhone());
|
|
|
- updateWrapper.set(MaTechnician::getTeName, req.getTeName());
|
|
|
- updateWrapper.set(MaTechnician::getOpenService, req.getServiceTag());
|
|
|
- updateWrapper.set(MaTechnician::getTeAddress, req.getTeAddress());
|
|
|
- updateWrapper.set(MaTechnician::getTeAge, req.getTeAge());
|
|
|
- updateWrapper.set(MaTechnician::getAvatar, req.getAvatar());
|
|
|
- updateWrapper.set(MaTechnician::getTeBrief, req.getTeBrief());
|
|
|
- maTechnicianService.update(updateWrapper);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 获取待接单列表:前端传技师实时经纬度筛选订单
|
|
|
+ */
|
|
|
+ @PostMapping("/wait/list")
|
|
|
+ public Result<List<WaitOrderDTO>> getWaitOrder(@RequestBody WaitOrderQueryDTO query) {
|
|
|
+ List<WaitOrderDTO> list = maTechnicianService.listWaitOrder(query);
|
|
|
+ return Result.ok(list);
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 查询技师列表
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
- @GetMapping("/list")
|
|
|
- public TableDataInfo list (MaTechnician maTechnician){
|
|
|
- startPage();
|
|
|
- List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 滑动接单逻辑不变,
|
|
|
+ * 仅列表查询逻辑修正
|
|
|
+ */
|
|
|
+ @PostMapping("/accept")
|
|
|
+ public Result<String> acceptOrder(@RequestBody AcceptOrderReqDTO req) {
|
|
|
+ String tip = maTechnicianService.acceptOrder(req);
|
|
|
+ return Result.ok(tip);
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 导出技师列表
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:export')")
|
|
|
- @Log(title = "技师", businessType = BusinessType.EXPORT)
|
|
|
- @PostMapping("/export")
|
|
|
- public void export (HttpServletResponse response, MaTechnician maTechnician){
|
|
|
- List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
|
|
|
- ExcelUtil<MaTechnician> util = new ExcelUtil<MaTechnician>(MaTechnician.class);
|
|
|
- util.exportExcel(response, list, "技师数据");
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 技师接单确认逻辑不变,
|
|
|
+ * 仅列表查询逻辑修正
|
|
|
+ */
|
|
|
+ @GetMapping("/rest/confirm")
|
|
|
+ public Result<String> confirmRestAccept(@RequestParam Long techId, @RequestParam Long orderId) {
|
|
|
+ String tip = maTechnicianService.confirmRestAccept(techId, orderId);
|
|
|
+ return Result.ok(tip);
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 获取技师详细信息
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
- @GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo (@PathVariable("id") Long id){
|
|
|
- return success(maTechnicianService.selectMaTechnicianById(id));
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 技师拒绝接单逻辑不变,
|
|
|
+ * 仅列表查询逻辑修正
|
|
|
+ */
|
|
|
+ @PostMapping("/refuse")
|
|
|
+ public Result<Void> refuseOrder(@RequestBody RefuseOrderReqDTO req) {
|
|
|
+ maTechnicianService.refuseOrder(req);
|
|
|
+ return Result.ok("拒绝成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 技师状态切换
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ */
|
|
|
+ @GetMapping("/switchToOffline")
|
|
|
+ public Result switchToOffline(@RequestParam Long userId, @RequestParam Boolean forceConfirm) {
|
|
|
+ return maTechnicianService.switchToOffline(userId, forceConfirm);
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 新增技师
|
|
|
- */
|
|
|
- @ApiOperation("技师入驻")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
|
- @Log(title = "技师", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping
|
|
|
- public AjaxResult add (@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo){
|
|
|
- return toAjax(maTechnicianService.insertMaTechnician(maTechnicianAppAddVo));
|
|
|
+ /**
|
|
|
+ * 查询商户信息接口
|
|
|
+ */
|
|
|
+ @GetMapping("/getTechnician")
|
|
|
+ public Result<?> getTechnician(@RequestParam String openid) {
|
|
|
+ LambdaQueryWrapper<MaTechnician> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(MaTechnician::getCOpenid, openid);
|
|
|
+ MaTechnician maTechnician = maTechnicianService.getBaseMapper().selectOne(queryWrapper);
|
|
|
+ return Result.ok(maTechnician);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改和上传商户信息接口
|
|
|
+ */
|
|
|
+ @PostMapping("/updateTechnician")
|
|
|
+ public Result<?> updateTechnician(@RequestBody MaTechnicianAppAddVo req) {
|
|
|
+ if (req.getAuditStatus() == 0 || req.getAuditStatus() == 3) {
|
|
|
+ //修改基本信息
|
|
|
+ updateMaTechnician(req);
|
|
|
}
|
|
|
+ return Result.ok("修改成功");
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 后台新增商户
|
|
|
- *
|
|
|
- * @param dto 商户新增DTO
|
|
|
- * @return AjaxResult 结果
|
|
|
- */
|
|
|
- @ApiOperation("后台新增商户")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
|
- @Log(title = "商户", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping("/merchant")
|
|
|
- public AjaxResult addMerchant (@RequestBody MaTechnicianMerchantAddDTO dto){
|
|
|
- try {
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.insertMerchant(dto, loginUser));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+
|
|
|
+ private void updateMaTechnician(MaTechnicianAppAddVo req) {
|
|
|
+ LambdaUpdateWrapper<MaTechnician> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(MaTechnician::getId, req.getId());
|
|
|
+ updateWrapper.set(MaTechnician::getTePhone, req.getTePhone());
|
|
|
+ updateWrapper.set(MaTechnician::getTeName, req.getTeName());
|
|
|
+ updateWrapper.set(MaTechnician::getOpenService, req.getServiceTag());
|
|
|
+ updateWrapper.set(MaTechnician::getTeAge, req.getTeAge());
|
|
|
+ updateWrapper.set(MaTechnician::getAvatar, req.getAvatar());
|
|
|
+ updateWrapper.set(MaTechnician::getTeBrief, req.getTeBrief());
|
|
|
+ maTechnicianService.update(updateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询技师列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(MaTechnician maTechnician) {
|
|
|
+ startPage();
|
|
|
+ List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出技师列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:export')")
|
|
|
+ @Log(title = "技师", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, MaTechnician maTechnician) {
|
|
|
+ List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
|
|
|
+ ExcelUtil<MaTechnician> util = new ExcelUtil<MaTechnician>(MaTechnician.class);
|
|
|
+ util.exportExcel(response, list, "技师数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取技师详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
+ return success(maTechnicianService.selectMaTechnicianById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增技师
|
|
|
+ */
|
|
|
+ @ApiOperation("技师入驻")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
|
+ @Log(title = "技师", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
|
|
|
+ return toAjax(maTechnicianService.insertMaTechnician(maTechnicianAppAddVo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 后台新增商户
|
|
|
+ *
|
|
|
+ * @param dto 商户新增DTO
|
|
|
+ * @return AjaxResult 结果
|
|
|
+ */
|
|
|
+ @ApiOperation("后台新增商户")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:add')")
|
|
|
+ @Log(title = "商户", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/merchant")
|
|
|
+ public AjaxResult addMerchant(@RequestBody MaTechnicianMerchantAddDTO dto) {
|
|
|
+ try {
|
|
|
+ LoginUser loginUser = getLoginUser();
|
|
|
+ return toAjax(maTechnicianService.insertMerchant(dto, loginUser));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 后台编辑商户
|
|
|
- *
|
|
|
- * @param id 商户ID
|
|
|
- * @param dto 商户编辑DTO
|
|
|
- * @return AjaxResult 结果
|
|
|
- */
|
|
|
- @ApiOperation("后台编辑商户")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
- @Log(title = "商户", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping("/merchant/{id}")
|
|
|
- public AjaxResult editMerchant (@PathVariable("id") Integer id, @RequestBody MaTechnicianMerchantAddDTO dto){
|
|
|
- try {
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.updateMerchant(id, dto, loginUser));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 后台编辑商户
|
|
|
+ *
|
|
|
+ * @param id 商户ID
|
|
|
+ * @param dto 商户编辑DTO
|
|
|
+ * @return AjaxResult 结果
|
|
|
+ */
|
|
|
+ @ApiOperation("后台编辑商户")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
+ @Log(title = "商户", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/merchant/{id}")
|
|
|
+ public AjaxResult editMerchant(@PathVariable("id") Integer id, @RequestBody MaTechnicianMerchantAddDTO dto) {
|
|
|
+ try {
|
|
|
+ LoginUser loginUser = getLoginUser();
|
|
|
+ return toAjax(maTechnicianService.updateMerchant(id, dto, loginUser));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 后台上传商户合同文件
|
|
|
*
|
|
|
- * @param id 商户ID
|
|
|
+ * @param id 商户ID
|
|
|
* @param map 合同文件
|
|
|
* @return R 上传结果
|
|
|
*/
|
|
|
@@ -436,7 +494,7 @@ public class MaTechnicianController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
@Log(title = "商户合同", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/merchant/{id}/contract")
|
|
|
- public R uploadMerchantContract(@PathVariable("id") Integer id, @RequestBody Map<String,Object> map) {
|
|
|
+ public R uploadMerchantContract(@PathVariable("id") Integer id, @RequestBody Map<String, Object> map) {
|
|
|
try {
|
|
|
LoginUser loginUser = getLoginUser();
|
|
|
return R.ok(maTechnicianService.uploadMerchantContract(id, map, loginUser));
|
|
|
@@ -446,259 +504,260 @@ public class MaTechnicianController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 查询商户入驻审核列表
|
|
|
- *
|
|
|
- * @param page 分页参数
|
|
|
- * @param dto 查询条件
|
|
|
- * @return Page 商户入驻审核分页列表
|
|
|
- */
|
|
|
- @ApiOperation("后台查询商户入驻审核列表")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
- @GetMapping("/merchant/audit/list")
|
|
|
- public R<Page<MaTechnicianAuditListVO>> merchantAuditList
|
|
|
- (Page < MaTechnicianAuditListVO > page, MaTechnicianAuditQueryDTO dto){
|
|
|
- try {
|
|
|
- return R.ok(maTechnicianService.selectMerchantAuditList(page, dto));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 查询商户入驻审核列表
|
|
|
+ *
|
|
|
+ * @param page 分页参数
|
|
|
+ * @param dto 查询条件
|
|
|
+ * @return Page 商户入驻审核分页列表
|
|
|
+ */
|
|
|
+ @ApiOperation("后台查询商户入驻审核列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
+ @GetMapping("/merchant/audit/list")
|
|
|
+ public R<Page<MaTechnicianAuditListVO>> merchantAuditList
|
|
|
+ (Page<MaTechnicianAuditListVO> page, MaTechnicianAuditQueryDTO dto) {
|
|
|
+ try {
|
|
|
+ return R.ok(maTechnicianService.selectMerchantAuditList(page, dto));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 商户入驻审核
|
|
|
- *
|
|
|
- * @param id 商户ID
|
|
|
- * @param dto 审核提交参数
|
|
|
- * @return AjaxResult 结果
|
|
|
- */
|
|
|
- @ApiOperation("商户入驻审核")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
- @Log(title = "商户入驻审核", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping("/merchant/audit/{id}/submit")
|
|
|
- public AjaxResult submitMerchantAudit (@PathVariable("id") Integer id, @RequestBody MaTechnicianAuditSubmitDTO
|
|
|
- dto){
|
|
|
- try {
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.submitMerchantAudit(id, dto, loginUser));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 商户入驻审核
|
|
|
+ *
|
|
|
+ * @param id 商户ID
|
|
|
+ * @param dto 审核提交参数
|
|
|
+ * @return AjaxResult 结果
|
|
|
+ */
|
|
|
+ @ApiOperation("商户入驻审核")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
+ @Log(title = "商户入驻审核", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/merchant/audit/{id}/submit")
|
|
|
+ public AjaxResult submitMerchantAudit(@PathVariable("id") Integer id, @RequestBody MaTechnicianAuditSubmitDTO
|
|
|
+ dto) {
|
|
|
+ try {
|
|
|
+ LoginUser loginUser = getLoginUser();
|
|
|
+ return toAjax(maTechnicianService.submitMerchantAudit(id, dto, loginUser));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 待审核页面审核通过商户
|
|
|
- *
|
|
|
- * @param id 商户ID
|
|
|
- * @param dto 待审核通过参数
|
|
|
- * @return AjaxResult 结果
|
|
|
- */
|
|
|
- @ApiOperation("待审核页面审核通过商户")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
- @Log(title = "商户待审核通过", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping("/merchant/audit/{id}/approve")
|
|
|
- public AjaxResult approvePendingMerchantAudit (@PathVariable("id") Integer id,
|
|
|
- @RequestBody MaTechnicianPendingAuditSubmitDTO
|
|
|
- dto){
|
|
|
- try {
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- return toAjax(maTechnicianService.approvePendingMerchantAudit(id, dto, loginUser));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 待审核页面审核通过商户
|
|
|
+ *
|
|
|
+ * @param id 商户ID
|
|
|
+ * @param dto 待审核通过参数
|
|
|
+ * @return AjaxResult 结果
|
|
|
+ */
|
|
|
+ @ApiOperation("待审核页面审核通过商户")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
+ @Log(title = "商户待审核通过", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/merchant/audit/{id}/approve")
|
|
|
+ public AjaxResult approvePendingMerchantAudit(@PathVariable("id") Integer id,
|
|
|
+ @RequestBody MaTechnicianPendingAuditSubmitDTO
|
|
|
+ dto) {
|
|
|
+ try {
|
|
|
+ LoginUser loginUser = getLoginUser();
|
|
|
+ return toAjax(maTechnicianService.approvePendingMerchantAudit(id, dto, loginUser));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 查询商户列表
|
|
|
- *
|
|
|
- * @param page 分页参数
|
|
|
- * @param dto 商户查询DTO
|
|
|
- * @return Page 商户分页列表
|
|
|
- */
|
|
|
- @ApiOperation("后台查询商户列表")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
- @GetMapping("/merchant/list")
|
|
|
- public R<Page<MaTechnicianMerchantListVO>> merchantList
|
|
|
- (Page < MaTechnicianMerchantListVO > page, MaTechnicianMerchantQueryDTO dto){
|
|
|
- try {
|
|
|
- return R.ok(maTechnicianService.selectMerchantList(page, dto));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 查询商户列表
|
|
|
+ *
|
|
|
+ * @param page 分页参数
|
|
|
+ * @param dto 商户查询DTO
|
|
|
+ * @return Page 商户分页列表
|
|
|
+ */
|
|
|
+ @ApiOperation("后台查询商户列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:list')")
|
|
|
+ @GetMapping("/merchant/list")
|
|
|
+ public R<Page<MaTechnicianMerchantListVO>> merchantList
|
|
|
+ (Page<MaTechnicianMerchantListVO> page, MaTechnicianMerchantQueryDTO dto) {
|
|
|
+ try {
|
|
|
+ return R.ok(maTechnicianService.selectMerchantList(page, dto));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 查询商户详情
|
|
|
- *
|
|
|
- * @param id 商户ID
|
|
|
- * @return R<MaTechnicianMerchantDetailVO> 商户详情
|
|
|
- */
|
|
|
- @ApiOperation("后台查询商户详情")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
- @GetMapping("/merchant/detail/{id}")
|
|
|
- public R<MaTechnicianMerchantDetailVO> merchantDetail (@PathVariable("id") Long id){
|
|
|
- try {
|
|
|
- return R.ok(maTechnicianService.selectMerchantDetail(id));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 查询商户详情
|
|
|
+ *
|
|
|
+ * @param id 商户ID
|
|
|
+ * @return R<MaTechnicianMerchantDetailVO> 商户详情
|
|
|
+ */
|
|
|
+ @ApiOperation("后台查询商户详情")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
+ @GetMapping("/merchant/detail/{id}")
|
|
|
+ public R<MaTechnicianMerchantDetailVO> merchantDetail(@PathVariable("id") Long id) {
|
|
|
+ try {
|
|
|
+ return R.ok(maTechnicianService.selectMerchantDetail(id));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 查看商户证照
|
|
|
- *
|
|
|
- * @param id 商户ID
|
|
|
- * @return R<MaTechnicianCertificateVO> 商户证照
|
|
|
- */
|
|
|
- @ApiOperation("后台查看商户证照")
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
- @GetMapping("/merchant/{id}/certificate")
|
|
|
- public R<MaTechnicianCertificateVO> merchantCertificate (@PathVariable("id") Integer id){
|
|
|
- try {
|
|
|
- return R.ok(maTechnicianService.selectMerchantCertificate(id));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 查看商户证照
|
|
|
+ *
|
|
|
+ * @param id 商户ID
|
|
|
+ * @return R<MaTechnicianCertificateVO> 商户证照
|
|
|
+ */
|
|
|
+ @ApiOperation("后台查看商户证照")
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:query')")
|
|
|
+ @GetMapping("/merchant/{id}/certificate")
|
|
|
+ public R<MaTechnicianCertificateVO> merchantCertificate(@PathVariable("id") Integer id) {
|
|
|
+ try {
|
|
|
+ return R.ok(maTechnicianService.selectMerchantCertificate(id));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 修改技师
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
- @Log(title = "技师", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping
|
|
|
- public AjaxResult edit (@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo){
|
|
|
- return toAjax(maTechnicianService.updateMaTechnician(maTechnicianAppAddVo));
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 修改技师
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
|
|
|
+ @Log(title = "技师", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
|
|
|
+ return toAjax(maTechnicianService.updateMaTechnician(maTechnicianAppAddVo));
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 删除技师
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('technician:technician:remove')")
|
|
|
- @Log(title = "技师", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove (@PathVariable Long[]ids){
|
|
|
- return toAjax(maTechnicianService.deleteMaTechnicianByIds(ids));
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 删除技师
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('technician:technician:remove')")
|
|
|
+ @Log(title = "技师", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(maTechnicianService.deleteMaTechnicianByIds(ids));
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 1. 获取服务类目列表 (对应图1、图3)
|
|
|
- */
|
|
|
- @GetMapping("/getServiceCategoryList")
|
|
|
- public AjaxResult getServiceCategoryList () {
|
|
|
- List<ServiceCategory> list = serviceCategoryService.listH5ServiceCategory();
|
|
|
- return AjaxResult.success(list);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 1. 获取服务类目列表 (对应图1、图3)
|
|
|
+ */
|
|
|
+ @GetMapping("/getServiceCategoryList")
|
|
|
+ public AjaxResult getServiceCategoryList() {
|
|
|
+ List<ServiceCategory> list = serviceCategoryService.listH5ServiceCategory();
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 1. 获取技能列表 (对应图1、图3)
|
|
|
- * 支持 Tab 切换:all(全部), active(已开通), applying(申请中), rejected(驳回)
|
|
|
- */
|
|
|
- @PostMapping("/getSkillList")
|
|
|
- public TableDataInfo getSkillList (@RequestBody MaProjectGetVo req){
|
|
|
- startPage();
|
|
|
- List<MaProject> list = maTechnicianService.selectMaTechnicianListBy(req.getUserId(), req.getAuditStatus());
|
|
|
- if (ObjectUtils.isEmpty(list)) {
|
|
|
- List<Project> projectslist = maTechnicianService.selectTechnicianListBy(req.getTypeId());
|
|
|
- return getDataTable(projectslist);
|
|
|
- } else {
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 1. 获取技能列表 (对应图1、图3)
|
|
|
+ * 支持 Tab 切换:all(全部), active(已开通), applying(申请中), rejected(驳回)
|
|
|
+ */
|
|
|
+ @PostMapping("/getSkillList")
|
|
|
+ public TableDataInfo getSkillList(@RequestBody MaProjectGetVo req) {
|
|
|
+ startPage();
|
|
|
+ List<MaProject> list = maTechnicianService.selectMaTechnicianListBy(req.getUserId(), req.getAuditStatus());
|
|
|
+ if (ObjectUtils.isEmpty(list)) {
|
|
|
+ List<Project> projectslist = maTechnicianService.selectTechnicianListBy(req.getTypeId());
|
|
|
+ return getDataTable(projectslist);
|
|
|
+ } else {
|
|
|
+ return getDataTable(list);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 查询未开通的服务项目列表
|
|
|
- *
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping("/getNotApplyList")
|
|
|
- public Result<?> getNotApplyList (@RequestBody MaProjectGetVo req){
|
|
|
+ /**
|
|
|
+ * 查询未开通的服务项目列表
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/getNotApplyList")
|
|
|
+ public Result<?> getNotApplyList(@RequestBody MaProjectGetVo req) {
|
|
|
|
|
|
- return Result.ok(maTechnicianService.getNotApplyList(req.getUserId(), req.getTypeId()));
|
|
|
+ return Result.ok(maTechnicianService.getNotApplyList(req.getUserId(), req.getTypeId()));
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 申请开通新服务
|
|
|
- */
|
|
|
- @PostMapping("/applyForService")
|
|
|
- public AjaxResult applyForService (@RequestBody MaProjectSaveDto dto){
|
|
|
+ /**
|
|
|
+ * 申请开通新服务
|
|
|
+ */
|
|
|
+ @PostMapping("/applyForService")
|
|
|
+ public AjaxResult applyForService(@RequestBody MaProjectSaveDto dto) {
|
|
|
+
|
|
|
+ return toAjax(maTechnicianService.applyForService(dto));
|
|
|
+ }
|
|
|
|
|
|
- return toAjax(maTechnicianService.applyForService(dto));
|
|
|
+ /**
|
|
|
+ * 重新申请开通新服务
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/updateApply")
|
|
|
+ public Result<?> updateApply(@RequestBody MaProjectUpdateDto req) {
|
|
|
+ if (StringUtils.isNotEmpty(req.getProjectId()) && StringUtils.isNotEmpty(req.getApplyReason())) {
|
|
|
+ LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
|
+ updateWrapper.set(MaProject::getApplyReason, req.getApplyReason());
|
|
|
+ updateWrapper.set(MaProject::getAuditStatus, 0);
|
|
|
+ maProjectService.update(updateWrapper);
|
|
|
}
|
|
|
+ return Result.ok("重新申请成功,提交到审核阶段");
|
|
|
|
|
|
- /**
|
|
|
- * 重新申请开通新服务
|
|
|
- *
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping("/updateApply")
|
|
|
- public Result<?> updateApply (@RequestBody MaProjectUpdateDto req){
|
|
|
- if (StringUtils.isNotEmpty(req.getProjectId()) && StringUtils.isNotEmpty(req.getApplyReason())) {
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 申请下架,删除服务项目,编辑售价价格
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/updateMaProject")
|
|
|
+ public Result<?> updateMaProject(@RequestBody MaProjectUpdateDto req) {
|
|
|
+ String message = "";
|
|
|
+ if (StringUtils.isNotEmpty(req.getProjectId())) {
|
|
|
+ if (req.getIsDelete()) {
|
|
|
+ LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(MaProject::getProjectId, req.getProjectId());
|
|
|
+ updateWrapper.set(MaProject::getIsDelete, 1);
|
|
|
+ maProjectService.update(updateWrapper);
|
|
|
+ message = "删除成功";
|
|
|
+ }
|
|
|
+ if (req.getIsPass()) {
|
|
|
LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
|
- updateWrapper.set(MaProject::getApplyReason, req.getApplyReason());
|
|
|
- updateWrapper.set(MaProject::getAuditStatus, 0);
|
|
|
+ updateWrapper.set(MaProject::getProjectIsEnable, 1);
|
|
|
maProjectService.update(updateWrapper);
|
|
|
+ message = "申请下架成功";
|
|
|
}
|
|
|
- return Result.ok("重新申请成功,提交到审核阶段");
|
|
|
+ if (req.getProjectCurrentPrice() != null) {
|
|
|
|
|
|
- }
|
|
|
+ LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
|
+ updateWrapper.set(MaProject::getProjectCurrentPrice, req.getProjectCurrentPrice());
|
|
|
+ maProjectService.update(updateWrapper);
|
|
|
+ message = "修改价格完成";
|
|
|
|
|
|
- /**
|
|
|
- * 申请下架,删除服务项目,编辑售价价格
|
|
|
- *
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping("/updateMaProject")
|
|
|
- public Result<?> updateMaProject (@RequestBody MaProjectUpdateDto req){
|
|
|
- String message = "";
|
|
|
- if (StringUtils.isNotEmpty(req.getProjectId())) {
|
|
|
- if (req.getIsDelete()) {
|
|
|
- LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
|
- updateWrapper.set(MaProject::getIsDelete, 1);
|
|
|
- maProjectService.update(updateWrapper);
|
|
|
- message = "删除成功";
|
|
|
- }
|
|
|
- if (req.getIsPass()) {
|
|
|
- LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
|
- updateWrapper.set(MaProject::getProjectIsEnable, 1);
|
|
|
- maProjectService.update(updateWrapper);
|
|
|
- message = "申请下架成功";
|
|
|
- }
|
|
|
- if (req.getProjectCurrentPrice() != null) {
|
|
|
-
|
|
|
- LambdaUpdateWrapper<MaProject> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(MaProject::getId, req.getProjectId());
|
|
|
- updateWrapper.set(MaProject::getProjectCurrentPrice, req.getProjectCurrentPrice());
|
|
|
- maProjectService.update(updateWrapper);
|
|
|
- message = "修改价格完成";
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
- return Result.ok(message);
|
|
|
- }
|
|
|
- /**
|
|
|
- * 商户入住信息
|
|
|
- *
|
|
|
- * @param userId
|
|
|
- * @return
|
|
|
- */
|
|
|
-
|
|
|
- @GetMapping("/getTechnicianList")
|
|
|
- public Result<?> getTechnicianList (@RequestParam(value = "userId") Long userId){
|
|
|
- return Result.ok(maTechnicianService.getTechnicianList(userId));
|
|
|
}
|
|
|
+ return Result.ok(message);
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 商户入住信息
|
|
|
+ *
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ @GetMapping("/getTechnicianList")
|
|
|
+ public Result<?> getTechnicianList(@RequestParam(value = "userId") Long userId) {
|
|
|
+ return Result.ok(maTechnicianService.getTechnicianList(userId));
|
|
|
}
|
|
|
+
|
|
|
+}
|