Pu Zhibing
2025-01-14 2a2f435d52d358cba6e239e29b586777678c2baf
修改bug
8个文件已修改
80 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUserShop.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShopController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUserShop.java
@@ -28,4 +28,9 @@
     */
    @TableField("shop_id")
    private Integer shopId;
    /**
     * 角色(1=店长,2=店员,3=技师)
     */
    @TableField("role_type")
    private Integer roleType;
}
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -164,6 +164,7 @@
                    AppUserShop appUserShop = new AppUserShop();
                    appUserShop.setAppUserId(appUser.getId());
                    appUserShop.setShopId(sysUser1.getObjectId());
                    appUserShop.setRoleType(2);
                    appUserShopClient.saveAppUserShop(appUserShop);
                    appUser.setUserType(2);
                    appUserClient.editAppUserById(appUser);
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShopController.java
@@ -59,6 +59,9 @@
        if(null != appUserShop.getShopId()){
            wrapper.eq(AppUserShop::getShopId, appUserShop.getShopId());
        }
        if(null != appUserShop.getRoleType()){
            wrapper.eq(AppUserShop::getRoleType, appUserShop.getRoleType());
        }
        appUserShopService.remove(wrapper);
        return R.ok();
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java
@@ -170,18 +170,21 @@
    private void count(Long userid, List<CouponInfo> list1, List<CouponInfo> returnList) {
        for (CouponInfo couponInfo : list1) {
            Long count = appUserClient.getCouponCount(-1L, couponInfo.getId()).getData();
            if(couponInfo.getSendNum() <= count){
                couponInfo.setMaxNum(count.intValue() - couponInfo.getSendNum());
                for (int i = 0; i < couponInfo.getMaxNum(); i++) {
                    returnList.add(couponInfo);
                }
            if(count >= couponInfo.getSendNum()){
                continue;
            }
            count = appUserClient.getCouponCount(userid, couponInfo.getId()).getData();
            couponInfo.setMaxNum(couponInfo.getMaxNum() - count.intValue());
            for (int i = 0; i < couponInfo.getMaxNum(); i++) {
                returnList.add(couponInfo);
            if((couponInfo.getSendNum() - count) >= couponInfo.getMaxNum()){
                for (int i = 0; i < couponInfo.getMaxNum(); i++) {
                    returnList.add(couponInfo);
                }
            }else{
                for (int i = 0; i < (couponInfo.getSendNum() - count); i++) {
                    returnList.add(couponInfo);
                }
            }
        }
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
@@ -8,6 +8,7 @@
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.feignClient.OrderClient;
import com.ruoyi.order.model.Order;
@@ -56,10 +57,12 @@
    @GetMapping("/goodsList")
    @ApiOperation(value = "获取商品评价", tags = {"小程序-获取商品评价"})
    public R<List<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId){
        List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).eq(GoodsEvaluate::getDelFlag, 0)
                .eq(GoodsEvaluate::getStatus, 2).isNotNull(GoodsEvaluate::getComment).ne(GoodsEvaluate::getComment, "").orderByDesc(GoodsEvaluate::getCreateTime).list();
        for (GoodsEvaluate goodsEvaluate : list) {
    public R<PageInfo<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId, Integer pageNum, Integer pageSize){
        PageInfo<GoodsEvaluate> pageInfo = new PageInfo<>(pageNum, pageSize);
        PageInfo<GoodsEvaluate> page = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).eq(GoodsEvaluate::getDelFlag, 0)
                .eq(GoodsEvaluate::getStatus, 2).isNotNull(GoodsEvaluate::getComment).ne(GoodsEvaluate::getComment, "")
                .orderByDesc(GoodsEvaluate::getCreateTime).page(pageInfo);
        for (GoodsEvaluate goodsEvaluate : page.getRecords()) {
            AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId());
            if(null != appUserById){
                goodsEvaluate.setUserName(appUserById.getName());
@@ -67,7 +70,7 @@
                goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId()));
            }
        }
        return R.ok(list);
        return R.ok(page);
    }
    /**
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -124,6 +124,7 @@
        AppUserShop appUserShop = new AppUserShop();
        appUserShop.setAppUserId(appUser.getId());
        appUserShop.setShopId(shopId);
        appUserShop.setRoleType(1);
        R<Void> r = appUserClient.addAppUserShop(appUserShop);
        if (R.isError(r)){
            throw new RuntimeException("添加失败");
@@ -284,6 +285,7 @@
        AppUserShop appUserShop = new AppUserShop();
        appUserShop.setAppUserId(appUser.getId());
        appUserShop.setShopId(shop.getId());
        appUserShop.setRoleType(1);
        appUserShopClient.delAppUserShop(appUserShop);
        //添加新管理员
@@ -291,6 +293,7 @@
        appUserShop = new AppUserShop();
        appUserShop.setAppUserId(appUser.getId());
        appUserShop.setShopId(shop.getId());
        appUserShop.setRoleType(1);
        appUserClient.addAppUserShop(appUserShop);
        //修改管理员
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -50,7 +50,8 @@
    private SysUserClient sysUserClient;
    @Resource
    private AppUserShopClient appUserShopClient;
    @Resource
    private AppUserClient appUserClient;
@@ -79,8 +80,7 @@
        return R.ok(page);
    }
    @Resource
    private AppUserClient appUserClient;
    @PostMapping("/manage/addorupdate")
    @ApiOperation(value = "添加编辑", tags = {"门店-技师列表"})
    public R<Page<Technician>> add(@RequestBody Technician technician) {
@@ -105,6 +105,7 @@
            AppUserShop appUserShop = new AppUserShop();
            appUserShop.setShopId(sysUser.getObjectId());
            appUserShop.setAppUserId(appUser.getId());
            appUserShop.setRoleType(3);
            appUserShopClient.saveAppUserShop(appUserShop);
        }else {
@@ -128,12 +129,21 @@
        technicianService.saveOrUpdate(technician);
        return R.ok();
    }
    @GetMapping("/manage/delete")
    @ApiOperation(value = "删除", tags = {"门店-技师列表"})
    public R<Page<Technician>> delete(@RequestParam Integer id) {
        technicianService.removeById(id);
        return R.ok();
    }
    @GetMapping("/manage/changeStatus")
    @ApiOperation(value = "上下架", tags = {"门店-技师列表"})
    public R<Page<Technician>> changeStatus(@RequestParam Integer id,@RequestParam@ApiParam("状态(1=下架,2=上架)") Integer status) {
@@ -142,6 +152,10 @@
        technicianService.updateById(byId);
        return R.ok();
    }
    @GetMapping("/manage/changesubscri")
    @ApiOperation(value = "修改预约状态", tags = {"门店-技师列表"})
    public R<Page<Technician>> changesubscri(@RequestParam Integer id,@RequestParam@ApiParam("预约状态(1=可预约,2=不可预约)") Integer subscribeStatus) {
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -5,9 +5,12 @@
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.feignClient.AppUserShopClient;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.api.model.AppUserShop;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.order.feignClient.RemoteOrderGoodsClient;
import com.ruoyi.other.api.domain.TechnicianSubscribe;
@@ -24,6 +27,7 @@
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
@@ -45,6 +49,11 @@
    @Resource
    private AppUserClient appUserClient;
    
    @Resource
    private TokenService tokenService;
    @Resource
    private AppUserShopClient appUserShopClient;
    
    
    
@@ -52,6 +61,15 @@
    @Override
    public PageInfo<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long shopId, Integer status, Integer pageCurr, Integer pageSize) {
        PageInfo<TechnicianSubscribeVO> pageInfo = new PageInfo(pageCurr, pageSize);
        Long userid = tokenService.getLoginUserApplet().getUserid();
        List<AppUserShop> data = appUserShopClient.getAppUserShop(userid).getData();
        Optional<AppUserShop> first = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() == 3).findFirst();
        if(first.isPresent()){
        }
        List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status);
        for (TechnicianSubscribeVO technicianSubscribeVO : list) {
            String id = technicianSubscribeVO.getId();