phpcjl
2024-12-11 c0fd242e5bd99b5c0b3a4428fbbe90f9f4449c3d
1.后台管理-商品管理
3个文件已修改
34 ■■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -59,6 +59,10 @@
    @ApiOperation(value = "新增门店", tags = {"后台管理-门店管理"})
    @Transactional(rollbackFor = Exception.class)
    public R<Void> add(@RequestBody Shop shop){
        String phone = shop.getPhone();
        if (!shopService.cheUserByPhone(phone)) {
            return R.fail("该手机号未注册");
        }
        shop.setShopAllPoint(0);
        shop.setShopPoint(0);
        shop.setSharePoint(0);
@@ -121,15 +125,8 @@
     */
    @PostMapping("/cheUserByPhone")
    @ApiOperation(value = "通过手机号校验店长", tags = {"后台管理-门店管理"})
    public R<Void> cheUserByPhone(@RequestParam("phone") String phone) {
        R<AppUser> r = appUserClient.getAppUserByPhone(phone);
        if (R.isError(r)){
            return R.fail("检验失败");
        }
        if (r.getData() == null){
            return R.fail("未查询到用户");
        }
        return R.ok();
    public R<Boolean> cheUserByPhone(@RequestParam("phone") String phone) {
        return R.ok(shopService.cheUserByPhone(phone));
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java
@@ -27,4 +27,6 @@
    ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude);
    Boolean cheUserByPhone(String phone);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -5,12 +5,13 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.exception.ServiceException;
import com.ruoyi.common.core.utils.GeodesyUtil;
import com.ruoyi.order.feignClient.RemoteOrderGoodsClient;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.domain.ShopScore;
import com.ruoyi.other.mapper.ShopMapper;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.service.ShopScoreService;
import com.ruoyi.other.service.ShopService;
import com.ruoyi.other.vo.NearbyShopVO;
@@ -40,7 +41,7 @@
    @Resource
    private ShopScoreService shopScoreService;
    @Resource
    private RemoteOrderGoodsClient remoteOrderGoodsClient;
    private AppUserClient appUserClient;
    @Override
@@ -99,6 +100,12 @@
        return shopDetailVO;
    }
    @Override
    public Boolean cheUserByPhone(String phone) {
        R<AppUser> r = appUserClient.getAppUserByPhone(phone);
        if (R.isError(r)){
            return false;
        }
        return r.getData() != null;
    }
}