From 257d66798aa538f8737980f13d94c547bf0b51ea Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期三, 15 一月 2025 15:37:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java | 36 ++++++++++++++++++++++++++++--------
1 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
index fe74705..3691afe 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -61,9 +61,10 @@
*/
@GetMapping("/technicianListByShopId")
@ApiOperation(value = "技师列表", tags = {"技师列表-小程序"})
- public R<TableDataInfo<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId,@ApiParam("技师姓名") String name) {
+ public R<TableDataInfo<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId,@ApiParam("技师姓名") String name,@ApiParam("评分") Integer point) {
+ //@ApiParam("评分") Integer point 1倒序 2正序
startPage();
- List<TechnicianVO> technicianListByShopId = technicianService.getTechnicianListByShopId(shopId, name);
+ List<TechnicianVO> technicianListByShopId = technicianService.getTechnicianListByShopId(shopId, name,point);
TableDataInfo<TechnicianVO> dataTable = getDataTable(technicianListByShopId);
return R.ok(dataTable);
}
@@ -76,6 +77,7 @@
Page<Technician> page = technicianService.lambdaQuery().like(name != null, Technician::getName, name)
.like(phone != null, Technician::getPhone, phone)
.eq(Technician::getShopId, sysUser.getObjectId())
+ .eq(Technician::getDelFlag, 0)
.page(Page.of(pageNum, pageSize));
return R.ok(page);
}
@@ -84,14 +86,14 @@
@PostMapping("/manage/addorupdate")
@ApiOperation(value = "添加编辑", tags = {"门店-技师列表"})
public R<Page<Technician>> add(@RequestBody Technician technician) {
-
Long userid = tokenService.getLoginUser().getUserid();
SysUser sysUser = sysUserClient.getSysUser(userid).getData();
-
-
if (technician.getId()==null) {
technician.setSubscribeStatus(2);
- List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()).list();
+ List<Technician> list = technicianService.lambdaQuery()
+ .eq(Technician::getPhone, technician.getPhone())
+ .eq(Technician::getShopId, sysUser.getObjectId())
+ .eq(Technician::getDelFlag, 0).list();
if (!list.isEmpty()) {
return R.fail("当前号码已经添加");
}
@@ -111,7 +113,11 @@
}else {
Technician byId = technicianService.getById(technician.getId());
if (byId.getPhone()!=technician.getPhone()){
- List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()).list();
+ List<Technician> list = technicianService.lambdaQuery()
+ .eq(Technician::getPhone, technician.getPhone())
+ .eq(Technician::getShopId, sysUser.getObjectId())
+ .ne(Technician::getId, byId.getId())
+ .eq(Technician::getDelFlag, 0).list();
if (!list.isEmpty()) {
return R.fail("当前号码已经添加");
}
@@ -136,7 +142,21 @@
@GetMapping("/manage/delete")
@ApiOperation(value = "删除", tags = {"门店-技师列表"})
public R<Page<Technician>> delete(@RequestParam Integer id) {
- technicianService.removeById(id);
+ Technician technician = technicianService.getById(id);
+ technician.setDelFlag(1);
+ technicianService.updateById(technician);
+ //检查删除app_user_shop数据
+ AppUserShop appUserShop = new AppUserShop();
+ appUserShop.setAppUserId(technician.getAppUserId());
+ appUserShop.setShopId(technician.getShopId());
+ appUserShop.setRoleType(3);
+ appUserShopClient.delAppUserShop(appUserShop);
+ List<AppUserShop> userShopList = appUserShopClient.getAppUserShop(technician.getAppUserId()).getData();
+ if(userShopList.size() == 0){
+ AppUser appUser = appUserClient.getAppUserById(technician.getAppUserId());
+ appUser.setUserType(1);
+ appUserClient.editAppUserById(appUser);
+ }
return R.ok();
}
--
Gitblit v1.7.1