From 1364b5595d2d9d0cfe0bb5c1f0eb825679b7561a Mon Sep 17 00:00:00 2001 From: phpcjl <phpcjl@gmail.com> Date: 星期一, 25 十一月 2024 18:37:01 +0800 Subject: [PATCH] 1.完善swagger配置配置信息 2.shop实体类添加字段:1.封面图 2.详情图 3.添加购物车实体类、mapper、service、controller --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java | 29 +- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java | 4 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java | 3 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java | 17 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianService.java | 6 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 41 +- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java | 4 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java | 50 ++++ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java | 5 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml | 45 ++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java | 70 ++++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java | 2 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java | 8 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java | 8 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java | 28 ++ ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml | 17 + ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java | 8 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java | 34 ++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java | 8 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java | 26 ++ ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml | 54 ++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java | 4 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java | 4 /dev/null | 24 -- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianVO.java | 28 ++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/AgreementController.java | 6 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianScore.java | 33 +++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java | 26 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/PhoneType.java | 22 ++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java | 16 30 files changed, 533 insertions(+), 97 deletions(-) diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java index b44742a..d9cba6a 100644 --- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java @@ -154,14 +154,6 @@ @TableField("custom_order_number") private Integer customOrderNumber; - @ApiModelProperty(value = "总评分") - @TableField("score") - private Integer score; - - @ApiModelProperty(value = "评分数量") - @TableField("score_number") - private Integer scoreNumber; - @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianScore.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianScore.java new file mode 100644 index 0000000..a87116c --- /dev/null +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianScore.java @@ -0,0 +1,33 @@ +package com.ruoyi.other.api.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("t_goods_evaluate") +@ApiModel(value="GoodsEvaluate对象", description="") +public class TechnicianScore implements Serializable { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "app_user_id") + private Long appUserId; + + @ApiModelProperty(value = "技师id") + private Long technicianId; + + @ApiModelProperty(value = "评分") + private BigDecimal score; + + @ApiModelProperty(value = "添加时间") + private LocalDateTime createTime; +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java index bf24222..50fec32 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java @@ -1,6 +1,7 @@ package com.ruoyi.account.controller; +import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -14,7 +15,11 @@ */ @RestController @RequestMapping("/user-point") +@Api("用户积分") public class UserPointController { + /** + * 积分 + */ } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/AgreementController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/AgreementController.java index d6d43c6..73291f1 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/AgreementController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/AgreementController.java @@ -1,7 +1,7 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.model.Agreement; import com.ruoyi.other.service.IAgreementService; import io.swagger.annotations.ApiImplicitParam; @@ -34,8 +34,8 @@ @ApiImplicitParams({ @ApiImplicitParam(value = "类型(1=用户协议,2=隐私协议,3=技师上门免责声明,4=注销协议,5门店提现免责声明)", name = "type", required = true, dataType = "int"), }) - public AjaxResult<String> getAgreement(@PathVariable("type") Integer type){ + public R<String> getAgreement(@PathVariable("type") Integer type){ Agreement one = agreementService.getOne(new LambdaQueryWrapper<Agreement>().eq(Agreement::getType, type)); - return AjaxResult.success(null == one ? "" : one.getContent()); + return R.ok(null == one ? "" : one.getContent()); } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java index 831a2f0..c60de73 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java @@ -1,7 +1,8 @@ package com.ruoyi.other.controller; -import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.other.api.domain.GoodsCategory; import com.ruoyi.other.service.GoodsCategoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -28,8 +30,8 @@ @GetMapping("/list") @ApiOperation(value = "商品分类列表", tags = {"小程序-商城-商城-首页-筛选"}) - public AjaxResult list(){ - return AjaxResult.success(goodsCategoryService.list()); + public R<List<GoodsCategory>> list(){ + return R.ok(goodsCategoryService.list()); } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java index 9789b16..6a4ad95 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java @@ -1,19 +1,20 @@ package com.ruoyi.other.controller; +import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.service.GoodsService; +import com.ruoyi.other.vo.GoodsVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -40,13 +41,26 @@ return getDataTable(goodsService.goodsList(goods)); } + + /** + * 指定门店商品 + */ + @GetMapping("/getGoodsListByShopId") + @ApiOperation(value = "商品列表", tags = {"小程序-首页-门店详情-商品购买列表"}) + public TableDataInfo getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { + startPage(); + List<Goods> goods = goodsService.getGoodsListByShopId(shopId); + return getDataTable(goods); + } + + /** * 商品详情 */ @GetMapping("/goodsDetail/{goodsId}") @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页-商品详情"}) - public AjaxResult goodsDetail(@PathVariable("goodsId") Long goodsId){ - return success(goodsService.goodsDetail(goodsId)); + public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId){ + return R.ok(goodsService.goodsDetail(goodsId)); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java deleted file mode 100644 index 174c2e9..0000000 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PersonalCenterController.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ruoyi.other.controller; - -import com.ruoyi.common.core.web.domain.AjaxResult; -import com.ruoyi.common.security.utils.SecurityUtils; -import com.ruoyi.other.vo.Home; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Api(tags = "个人中心") -@RestController -@RequestMapping("/personalCenter") -public class PersonalCenterController { - - @GetMapping("/getUserInfo") - @ApiOperation(value = "获取用户信息") - public AjaxResult getUserInfo(){ - Long userId = SecurityUtils.getUserId(); - Home home = new Home(); - return AjaxResult.success(home); - } -} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java index 7803f29..ff065e3 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java @@ -1,8 +1,21 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.other.api.domain.Phone; +import com.ruoyi.other.enums.PhoneType; +import com.ruoyi.other.service.PhoneService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -14,7 +27,20 @@ */ @RestController @RequestMapping("/phone") -public class PhoneController { +@Api("手机") +public class PhoneController extends BaseController { + @Resource + private PhoneService phoneService; + /** + * 查询指定门店手机号 + */ + @RequestMapping("/selectPhoneByShopId") + @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情"}) + public R<List<Phone>> getPhoneByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { + return R.ok(phoneService.list(new LambdaQueryWrapper<Phone>() + .eq(Phone::getType, PhoneType.SHOP.getCode()) + .eq(Phone::getShopId, shopId))); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java index d0df98b..8b75af1 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java @@ -2,10 +2,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; -import com.ruoyi.common.core.web.domain.AjaxResult; -import com.ruoyi.other.enums.ShareAddType; import com.ruoyi.other.api.domain.Share; +import com.ruoyi.other.enums.ShareAddType; import com.ruoyi.other.enums.ShareAuditStatus; import com.ruoyi.other.service.ShareService; import io.swagger.annotations.Api; @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -39,8 +40,8 @@ @ApiImplicitParam(value = "对象id(addType=1:平台添加,addType=2:推广人添加,addType=3:门店添加)", name = "objectId", required = true, dataType = "int"), }) @GetMapping("/list") - public AjaxResult list(@RequestParam Integer objectId){ - return AjaxResult.success(shareService.list(new LambdaQueryWrapper<Share>() + public R<List<Share>> list(@RequestParam Integer objectId){ + return R.ok(shareService.list(new LambdaQueryWrapper<Share>() .eq(Share::getObjectId, objectId))); } @@ -50,12 +51,13 @@ */ @ApiOperation(value = "小程序-个人中心-门店管理-分享添加", tags = {"分享添加-小程序"}) @PostMapping - public AjaxResult add(@RequestBody Share share){ + public R<Void> add(@RequestBody Share share){ share.setAddType(ShareAddType.STORE.getCode()); share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); share.setDelFlag(0); share.setAppletShare(1); - return toAjax(shareService.save(share)); + shareService.save(share); + return R.ok(); } /** @@ -63,8 +65,9 @@ */ @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理-分享删除-小程序"}) @DeleteMapping - public AjaxResult delete(@RequestBody Share share){ - return toAjax(shareService.removeById(share)); + public R<Void> delete(@RequestBody Share share){ + shareService.removeById(share); + return R.ok(); } /** @@ -72,9 +75,10 @@ */ @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理-分享编辑-小程序"}) @PutMapping - public AjaxResult edit(@RequestBody Share share){ + public R<Void> edit(@RequestBody Share share){ share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); - return toAjax(shareService.updateById(share)); + shareService.updateById(share); + return R.ok(); } /** @@ -82,8 +86,9 @@ */ @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理-分享详情-小程序"}) @GetMapping("/detail/{id}") - public AjaxResult detail(@PathVariable("id") Integer id){ - return AjaxResult.success(shareService.getById(id)); + public R<Void> detail(@PathVariable("id") Integer id){ + shareService.getById(id); + return R.ok(); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java index 6531a59..6105ae0 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java @@ -4,14 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; +import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; -import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.other.api.domain.Shop; -import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.enums.ShopStatus; import com.ruoyi.other.service.ShopService; import com.ruoyi.other.service.TechnicianService; +import com.ruoyi.other.vo.NearbyShopVO; +import com.ruoyi.other.vo.ShopDetailVO; import com.ruoyi.other.vo.VerifiableShopVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -23,7 +24,7 @@ /** * <p> - * 前端控制器 + * 前端控制器 * </p> * * @author luodangjia @@ -45,22 +46,20 @@ */ @GetMapping("/nearbyShopList") @ApiOperation(value = "附近门店列表", tags = {"小程序-首页-附近门店列表"}) - public AjaxResult nearbyShopList(@ApiParam("经度") @RequestParam String longitude, - @ApiParam("纬度") @RequestParam String latitude){ - return success(shopService.nearbyShopList(longitude,latitude)); + public R<List<NearbyShopVO>> nearbyShopList(@ApiParam("经度") @RequestParam String longitude, + @ApiParam("纬度") @RequestParam String latitude) { + return R.ok(shopService.nearbyShopList(longitude, latitude)); } - /** - * 指定门店技师列表 + * 门店详情 */ - @GetMapping("/technicianList") - @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) - public AjaxResult technicianList(@ApiParam("门店id") @RequestParam String shopId){ - return success(technicianService.list(new LambdaQueryWrapper<Technician>() - .eq(Technician::getShopId,shopId) - .eq(Technician::getStatus,2) - .eq(Technician::getSubscribeStatus,1))); + @GetMapping("/shopDetail") + @ApiOperation(value = "门店详情", tags = {"门店详情-小程序"}) + public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId, + @ApiParam("经度") @RequestParam String longitude, + @ApiParam("纬度") @RequestParam String latitude) { + return R.ok(shopService.getShopDetail(shopId, longitude, latitude)); } /** @@ -68,11 +67,11 @@ */ @GetMapping("/shopByUser") @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页-关联门店列表"}) - public AjaxResult shopByUser(){ + public R<List<Shop>> shopByUser() { List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() .eq(Shop::getAppUserId, SecurityUtils.getUserId()) .eq(Shop::getStatus, ShopStatus.SHOP_STATUS_NORMAL.getCode())); - return success(list); + return R.ok(list); } /** @@ -80,11 +79,11 @@ */ @GetMapping("/bindShop") @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心-绑定门店"}) - public AjaxResult bindShop(@ApiParam("门店id") @RequestParam Long shopId){ + public R<Void> bindShop(@ApiParam("门店id") @RequestParam Long shopId) { AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); appUser.setShopId(shopId); appUserClient.editAppUserById(appUser); - return success(); + return R.ok(); } @@ -92,9 +91,9 @@ @ResponseBody @GetMapping("/getVerifiableShop") @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"}) - public AjaxResult<List<VerifiableShopVo>> getVerifiableShop(){ + public R<List<VerifiableShopVo>> getVerifiableShop(){ // todo 待完善 pu - return AjaxResult.success(); + return R.ok(); } } 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 9a0c750..e7ff8cd 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 @@ -1,9 +1,20 @@ package com.ruoyi.other.controller; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.other.service.TechnicianService; +import com.ruoyi.other.vo.TechnicianDetailVO; +import com.ruoyi.other.vo.TechnicianVO; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -15,7 +26,26 @@ */ @RestController @RequestMapping("/technician") -public class TechnicianController { +public class TechnicianController extends BaseController { + @Resource + private TechnicianService technicianService; + /** + * 指定门店技师列表 + */ + @GetMapping("/technicianListByShopId") + @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) + public R<List<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId) { + return R.ok(technicianService.getTechnicianListByShopId(shopId)); + } + + /** + * 技师详情 + */ + @GetMapping("/technicianDetail") + @ApiOperation(value = "技师详情", tags = {"技师详情-小程序"}) + public R<TechnicianDetailVO> technicianDetail(@ApiParam("技师id") @RequestParam Long technicianId) { + return R.ok(technicianService.technicianDetail(technicianId)); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java index 36b76f0..6aa2f8b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java @@ -2,8 +2,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; -import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.other.api.domain.TechnicianSubscribe; @@ -53,17 +53,17 @@ */ @GetMapping("/cancel") @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理-预约列表-取消服务"}) - public AjaxResult cancel(@ApiParam(value = "预约id") @RequestParam Long id){ + public R<Void> cancel(@ApiParam(value = "预约id") @RequestParam Long id){ TechnicianSubscribe subscribe = technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>() .eq(TechnicianSubscribe::getId, id) .eq(TechnicianSubscribe::getStatus, 0)); if (null == subscribe){ - return error("不满足取消条件"); + return R.fail("不满足取消条件"); } subscribe.setStatus(2); technicianSubscribeService.updateById(subscribe); - return success(); + return R.ok(); } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/PhoneType.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/PhoneType.java new file mode 100644 index 0000000..830d7dd --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/enums/PhoneType.java @@ -0,0 +1,22 @@ +package com.ruoyi.other.enums; + +public enum PhoneType { + PLATFORM(1, "平台"), + SHOP(2, "门店"); + + private Integer code; + private String desc; + + PhoneType(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + public Integer getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java index 9fc6099..909c6f1 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java @@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Goods; +import java.util.List; + /** * <p> * Mapper 接口 @@ -12,5 +14,5 @@ * @since 2024-11-20 */ public interface GoodsMapper extends BaseMapper<Goods> { - + List<Goods> selectListByShopId(Integer shopId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java index 6f6779b..9255a70 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java @@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.vo.NearbyShopVO; +import com.ruoyi.other.vo.ShopDetailVO; import java.util.List; @@ -17,4 +18,7 @@ public interface ShopMapper extends BaseMapper<Shop> { List<NearbyShopVO> selectNearbyShopList(String longitude, String latitude); + + ShopDetailVO selectShopDetail(Integer shopId); + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java index 58a138a..c3b24f7 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java @@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.other.api.domain.Technician; +import com.ruoyi.other.vo.TechnicianDetailVO; +import com.ruoyi.other.vo.TechnicianVO; + +import java.util.List; /** * <p> @@ -13,4 +17,8 @@ */ public interface TechnicianMapper extends BaseMapper<Technician> { + List<TechnicianVO> selectTechnicianListByShopId(Long shopId); + + TechnicianDetailVO selectTechnicianDetail(Long technicianId); + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java index c12ae58..d33e0d5 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java @@ -19,4 +19,6 @@ List<GoodsVO> goodsList(Goods goods); GoodsVO goodsDetail(Long goodsId); + + List<Goods> getGoodsListByShopId(Integer shopId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java index d563bbe..eedaaca 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java @@ -1,8 +1,10 @@ package com.ruoyi.other.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.vo.NearbyShopVO; +import com.ruoyi.other.vo.ShopDetailVO; import java.util.List; @@ -17,4 +19,6 @@ public interface ShopService extends IService<Shop> { List<NearbyShopVO> nearbyShopList(String longitude, String latitude); + + ShopDetailVO getShopDetail(Integer shopId,String longitude, String latitude); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianService.java index aa24c23..7be2cbc 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianService.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianService.java @@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.other.api.domain.Technician; +import com.ruoyi.other.vo.TechnicianDetailVO; +import com.ruoyi.other.vo.TechnicianVO; + +import java.util.List; /** * <p> @@ -12,5 +16,7 @@ * @since 2024-11-20 */ public interface TechnicianService extends IService<Technician> { + List<TechnicianVO> getTechnicianListByShopId(Long shopId); + TechnicianDetailVO technicianDetail(Long technicianId); } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java index aff730b..b1de54c 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java @@ -1,9 +1,7 @@ package com.ruoyi.other.service.impl; -import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.bean.BeanUtils; import com.ruoyi.other.api.domain.Goods; @@ -11,13 +9,12 @@ import com.ruoyi.other.mapper.GoodsMapper; import com.ruoyi.other.service.GoodsService; import com.ruoyi.other.vo.GoodsVO; -import feignClient.RemoteOrderGoodsClient; -import model.OrderGood; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.*; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; /** * <p> @@ -30,7 +27,7 @@ @Service public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService { @Resource - private RemoteOrderGoodsClient orderGoodsClient; + private GoodsMapper goodsMapper; @Override public List<GoodsVO> goodsList(Goods search) { @@ -59,4 +56,9 @@ } return new GoodsVO(); } + + @Override + public List<Goods> getGoodsListByShopId(Integer shopId) { + return goodsMapper.selectListByShopId(shopId); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java index c5f851b..41a9c34 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java @@ -1,14 +1,22 @@ package com.ruoyi.other.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.exception.ServiceException; +import com.ruoyi.common.core.utils.GeodesyUtil; +import com.ruoyi.other.api.domain.Goods; +import com.ruoyi.other.mapper.GoodsMapper; import com.ruoyi.other.mapper.ShopMapper; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.service.ShopService; import com.ruoyi.other.vo.NearbyShopVO; +import com.ruoyi.other.vo.ShopDetailVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; /** * <p> @@ -27,4 +35,22 @@ public List<NearbyShopVO> nearbyShopList(String longitude, String latitude) { return shopMapper.selectNearbyShopList(longitude,latitude); } + + @Override + public ShopDetailVO getShopDetail(Integer shopId, String longitude, String latitude) { + // 查询店铺详情 + ShopDetailVO shopDetailVO = shopMapper.selectShopDetail(shopId); + if (shopDetailVO == null) { + throw new ServiceException("查询店铺不存在"); + } + + // 计算距离 + String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); + String userLocation = String.format("%s,%s", longitude, latitude); + Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); + Double wGs84 = distanceMap.get("WGs84"); + shopDetailVO.setDistance(wGs84); + return shopDetailVO; + } + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java index ead8ae5..519f02d 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java @@ -4,7 +4,13 @@ import com.ruoyi.other.mapper.TechnicianMapper; import com.ruoyi.other.api.domain.Technician; import com.ruoyi.other.service.TechnicianService; +import com.ruoyi.other.vo.TechnicianDetailVO; +import com.ruoyi.other.vo.TechnicianVO; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; /** * <p> @@ -16,5 +22,16 @@ */ @Service public class TechnicianServiceImpl extends ServiceImpl<TechnicianMapper, Technician> implements TechnicianService { + @Resource + private TechnicianMapper technicianMapper; + @Override + public List<TechnicianVO> getTechnicianListByShopId(Long shopId) { + return technicianMapper.selectTechnicianListByShopId(shopId); + } + + @Override + public TechnicianDetailVO technicianDetail(Long technicianId) { + return technicianMapper.selectTechnicianDetail(technicianId); + } } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java index 9916852..7ccccea 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/Home.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; + @Data @ApiModel(value="首页用户信息", description="") public class Home { @@ -80,7 +82,7 @@ * 评分 */ @ApiModelProperty(value = "评分") - private Integer score; + private BigDecimal score; /** * 经度 diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java index 8c2dfb1..e041a4c 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java @@ -18,7 +18,4 @@ @ApiModelProperty(value = "详细地址") private String address; - - @ApiModelProperty(value = "距离") - private String distance; } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java new file mode 100644 index 0000000..96b1aa0 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java @@ -0,0 +1,70 @@ +package com.ruoyi.other.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@ApiModel(value = "门店详情") +public class ShopDetailVO { + + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + private Integer id; + + /** + * 门店名称 + */ + @ApiModelProperty(value = "门店名称") + private String name; + + @ApiModelProperty(value = "详情图,多个逗号分隔") + private String detailsPicture; + + @ApiModelProperty(value = "资质证书图片") + private String certification; + + @ApiModelProperty(value = "营业星期(1,2,3,4,5,6,7)") + private String businessDate; + + @ApiModelProperty(value = "开始时间(HH:mm)") + private String startTime; + + @ApiModelProperty(value = "结束时间(HH:mm)") + private String endTime; + + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private List<String> phones; + + /** + * 评分 + */ + @ApiModelProperty(value = "评分") + private BigDecimal score; + + /** + * 地址 + */ + @ApiModelProperty(value = "地址") + private String address; + + /** + * 距离 + */ + @ApiModelProperty(value = "距离") + private Double distance; + + @ApiModelProperty(value = "经度") + private String longitude; + + @ApiModelProperty(value = "纬度") + private String latitude; +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java new file mode 100644 index 0000000..e5bc269 --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java @@ -0,0 +1,50 @@ +package com.ruoyi.other.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class TechnicianDetailVO { + + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + private Long id; + + /** + * 技师姓名 + */ + @ApiModelProperty(value = "技师姓名") + private String name; + + /** + * 服务次数 + */ + @ApiModelProperty(value = "服务次数") + private Integer serviceCount; + + /** + * 评分 + */ + @ApiModelProperty(value = "评分") + private BigDecimal score; + + /** + * 简介 + */ + @ApiModelProperty(value = "简介") + private String introduction; + + /** + * 技师封面图 + */ + @ApiModelProperty(value = "技师封面图") + private String homePicture; + + @ApiModelProperty(value = "技师详情图") + private String infoPicture; + +} diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianVO.java new file mode 100644 index 0000000..8b9c9ea --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianVO.java @@ -0,0 +1,28 @@ +package com.ruoyi.other.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class TechnicianVO { + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "技师姓名") + private String name; + + @ApiModelProperty(value = "简介") + private String introduction; + + @ApiModelProperty(value = "服务次数") + private Integer serviceCount; + + @ApiModelProperty(value = "技师封面图") + private String homePicture; + + @ApiModelProperty(value = "评分") + private BigDecimal score; +} diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml index c149142..f1c25ff 100644 --- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml @@ -2,4 +2,21 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.other.mapper.GoodsMapper"> + <select id="selectListByShopId" resultType="com.ruoyi.other.api.domain.Goods"> + SELECT + tg.id, + tg.`name`, + tg.type, + tg.introduction, + tg.selling_price, + tg.original_price, + tg.sale_num, + tg.home_page_picture + FROM + t_shop ts + LEFT JOIN t_goods_shop tgs ON ts.id = tgs.shop_id + LEFT JOIN t_goods tg ON tg.id = tgs.goods_id + where ts.id = #{shopId} + ORDER BY tg.sale_num DESC + </select> </mapper> \ No newline at end of file diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml index 6026678..a0589da 100644 --- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml @@ -3,6 +3,49 @@ <mapper namespace="com.ruoyi.other.mapper.ShopMapper"> <select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO"> - + SELECT id, + home_picture, + name, + address, + ( + 6371 * acos( + cos( + radians(#{latitude})) * cos( + radians(latitude)) * cos( + radians(longitude) - radians(#{longitude})) + sin( + radians(#{latitude})) * sin( + radians(latitude)) + )) AS distance + FROM t_shop + where del_flag = 0 and status = 1 + ORDER BY distance + </select> + <select id="selectShopDetail" resultType="com.ruoyi.other.vo.ShopDetailVO"> + SELECT + ts.id, + ts.details_picture, + ts.certification, + ts.`name`, + ts.address, + ts.business_date, + ts.start_time, + ts.end_time, + AVG( tss.score ) score + FROM + t_shop ts + LEFT JOIN t_shop_score tss ON ts.id = tss.shop_id + WHERE + ts.del_flag = 0 + AND ts.`status` = 1 + AND id = #{id} + GROUP BY + ts.id, + ts.details_picture, + ts.certification, + ts.`name`, + ts.address, + ts.business_date, + ts.start_time, + ts.end_time </select> </mapper> \ No newline at end of file diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml new file mode 100644 index 0000000..96b150a --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.other.mapper.TechnicianMapper"> + <select id="selectTechnicianListByShopId" resultType="com.ruoyi.other.vo.TechnicianVO"> + SELECT + tt.id, + tt.`name`, + tt.introduction, + tt.home_picture, + COUNT(tts.id) AS serviceCount, + AVG(ttsc.score) AS score + FROM + t_technician tt + LEFT JOIN t_technician_subscribe tts ON tt.id = tts.technician_id + LEFT JOIN t_technician_score ttsc ON ttsc.technician_id = tt.id + WHERE + tts.`status` != 0 + AND tt.`status` = 2 + AND tt.del_flag = 0 + AND tt.subscribe_status = 1 + AND tt.shop_id = #{shopId} + GROUP BY + tt.id, + tt.`name`, + tt.introduction, + tt.home_picture + </select> + <select id="selectTechnicianDetail" resultType="com.ruoyi.other.vo.TechnicianDetailVO"> + SELECT + tt.id, + tt.`name`, + tt.introduction, + tt.home_picture, + COUNT(tts.id) AS serviceCount, + AVG(ttsc.score) AS score, + tt.info_picture + FROM + t_technician tt + LEFT JOIN t_technician_subscribe tts ON tt.id = tts.technician_id + LEFT JOIN t_technician_score ttsc ON ttsc.technician_id = tt.id + WHERE + tts.`status` != 0 + AND tt.`status` = 2 + AND tt.del_flag = 0 + AND tt.subscribe_status = 1 + AND tt.id = #{technicianId} + GROUP BY + tt.id, + tt.`name`, + tt.introduction, + tt.home_picture, + tt.introduction + </select> +</mapper> \ No newline at end of file -- Gitblit v1.7.1