无关风月
2025-01-14 307c8e5628e4c822db4d2a465cc65ede0b54cfc4
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
23个文件已修改
1个文件已添加
201 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUserShop.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/pom.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/uuid/QRCodeGenerator.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShopController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/WithQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/BalanceChangeRecordMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/WithdrawalRequestsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderInfoVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | 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/GoodsCategoryController.java 1 ●●●● 补丁 | 查看 | 原始文档 | 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 8 ●●●● 补丁 | 查看 | 原始文档 | 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/mapper/TechnicianSubscribeMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | 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-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
@@ -89,4 +89,7 @@
    @ApiModelProperty(value = "预约单id")
    private String technicianSubscribeId;
    @ApiModelProperty("核销码BASE64")
    private String writeOffCode;
}
ruoyi-common/pom.xml
@@ -31,6 +31,17 @@
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>core</artifactId>
            <version>3.4.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>javase</artifactId>
            <version>3.4.1</version>
        </dependency>
    </dependencies>
</project>
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/uuid/QRCodeGenerator.java
New file
@@ -0,0 +1,44 @@
package com.ruoyi.common.core.utils.uuid;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Base64;
public class QRCodeGenerator {
    /**
     * 生成二维码图片的base64编码
     * @param text
     * @param width
     * @param height
     * @return
     * @throws WriterException
     * @throws IOException
     */
    public static String generateQRCodeBase64(String text, int width, int height) throws WriterException, IOException {
        QRCodeWriter qrCodeWriter = new QRCodeWriter();
        BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height);
        ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream();
        MatrixToImageWriter.writeToStream(bitMatrix, "PNG", pngOutputStream);
        byte[] pngData = pngOutputStream.toByteArray();
        return Base64.getEncoder().encodeToString(pngData);
    }
    public static void main(String[] args) {
        try {
            String text = "Hello, World!";
            String base64QRCode = generateQRCodeBase64(text, 200, 200);
            System.out.println("Base64 QR Code: " + base64QRCode);
        } catch (WriterException | IOException e) {
            e.printStackTrace();
        }
    }
}
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-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
@@ -207,6 +207,7 @@
             <if test="roleType != null and roleType != ''">role_type,</if>
             <if test="remark != null and remark != ''">remark,</if>
             <if test="objectId != null and objectId != ''">objectId,</if>
            <if test="appUserId != null and appUserId != ''">app_user_id,</if>
             create_time
         )values(
             <if test="userId != null and userId != ''">#{userId},</if>
@@ -223,6 +224,7 @@
             <if test="roleType != null and roleType != ''">#{roleType},</if>
             <if test="remark != null and remark != ''">#{remark},</if>
             <if test="objectId != null and objectId != ''">#{objectId},</if>
            <if test="appUserId != null and appUserId != ''">#{appUserId},</if>
             sysdate()
         )
    </insert>
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -137,6 +137,8 @@
    @PostMapping("/editAppUserById")
    public R<Void> editAppUserById(@RequestBody AppUser appUser) {
        appUserService.updateById(appUser);
        appUserService.update(new LambdaUpdateWrapper<AppUser>().eq(AppUser::getId, appUser.getId())
                .set(AppUser::getLastShopTime, appUser.getLastShopTime()));
        return R.ok();
    }
@@ -896,7 +898,8 @@
                .limit(daysBetween + 1)
                .collect(Collectors.toList());
    }
    
    /**
     * 上传图片
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-account/src/main/java/com/ruoyi/account/dto/WithQuery.java
@@ -11,7 +11,7 @@
    private String userName;
    @ApiModelProperty("电话")
    private String phone;
    private String userPhone;
    private Integer pageNum;
    private Integer pageSize;
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
@@ -43,7 +43,7 @@
        longitude,
        latitude,
        phone
        from t_app_user where city_code = #{cityCode} and del_flag = 0 and status = 1 and vip_id >= 4
        from t_app_user where ((city_code = #{cityCode} and vip_id >= 4) or id = 1) and del_flag = 0 and status = 1
        <if test="null != nearbyReferrer.name and '' != nearbyReferrer.name">
            and `name` like CONCAT('%', #{nearbyReferrer.name}, '%')
        </if>
@@ -86,7 +86,7 @@
        SELECT ta.id, ta.phone, ta.`name`, ta.vip_id, ta.shop_id, ta.status
        FROM t_app_user ta
        <where>
            ta.del_flag = 0
            ta.del_flag = 0 and ta.status != 3
            <if test="null != appUser.name and '' != appUser.name">
                and ta.`name` like CONCAT('%',#{appUser.name},'%')
            </if>
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/BalanceChangeRecordMapper.xml
@@ -34,8 +34,9 @@
        tbcr.after_amount
        FROM
            t_balance_change_record tbcr
                LEFT JOIN t_app_user tau ON tbcr.app_user_id = tau.id
        LEFT JOIN t_app_user tau ON tbcr.app_user_id = tau.id
        <where>
            and tbcr.change_type = 4
            <if test="changeRecord.userName != null and changeRecord.userName != ''">
                and tau.name like concat('%',#{changeRecord.userName},'%')
            </if>
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/WithdrawalRequestsMapper.xml
@@ -23,8 +23,9 @@
        select t1.*,t2.name as userName,t2.phone as userPhone
        from t_withdrawal_requests t1
        left join t_app_user t2 on t1.app_user_id = t2.id
        <if test="withQuery.phone != null and withQuery.phone != ''">
            AND t2.phone LIKE concat('%',#{withQuery.phone},'%')
        where 1 = 1
        <if test="withQuery.userPhone != null and withQuery.userPhone != ''">
            AND t2.phone LIKE concat('%',#{withQuery.userPhone},'%')
        </if>
        <if test="withQuery.userName != null and withQuery.userName != ''">
            AND t2.name LIKE concat('%',#{withQuery.userName},'%')
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -14,6 +14,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.uuid.QRCodeGenerator;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.enums.OrderStatus;
@@ -41,6 +42,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
@@ -215,6 +217,14 @@
                Long id = data.get(0).getId();
                orderDetailVO.setTechnicianSubscribeId(id.toString());
            }
        }
        // 生成核销码BASE64
        try {
            String base64 = QRCodeGenerator.generateQRCodeBase64(order.getOrderNumber(), 124, 124);
            orderDetailVO.setWriteOffCode(base64);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("生成核销码失败");
        }
        return orderDetailVO;
    }
@@ -439,11 +449,12 @@
            appUser.setBalance(balance.add(paymentAmount).setScale(2, RoundingMode.HALF_EVEN));
            appUser.setShopAmount(appUser.getShopAmount().subtract(paymentAmount).setScale(2, RoundingMode.HALF_EVEN));
            //查询最后一次的消费订单
            Order order1 = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getAppUserId, order.getAppUserId()).eq(Order::getPayStatus, 2).eq(Order::getDelFlag, 0).in(Order::getOrderStatus, Arrays.asList(2, 3, 4, 8)).ne(Order::getId, order.getId()).last(" order by create_time desc limit 0, 1"));
            Order order1 = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getAppUserId, order.getAppUserId()).eq(Order::getPayStatus, 2)
                    .eq(Order::getDelFlag, 0).in(Order::getOrderStatus, Arrays.asList(1, 2, 3, 4, 8)).ne(Order::getId, order.getId()).last(" order by create_time desc limit 0, 1"));
            if(null != order1){
                appUser.setLastShopTime(order1.getCreateTime());
            }else{
                appUser.setLastShopTime(LocalDateTime.MIN);
                appUser.setLastShopTime(null);
            }
        
            //构建账户余额流水明细
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -569,11 +569,11 @@
                        }
                    }else{
                        //部分商品适用
                        BigDecimal goodsMoney = BigDecimal.ZERO;
                         BigDecimal goodsMoney = BigDecimal.ZERO;
                        for (MyShoppingCartVo myShoppingCartVo : goodsList) {
                            Integer goodsId = myShoppingCartVo.getGoodsId();
                            BigDecimal cash = myShoppingCartVo.getCash();
                            if(forGoodIds.contains(goodsId)){
                            if(forGoodIds.contains(String.valueOf(goodsId))){
                                goodsMoney = goodsMoney.add(cash);
                            }
                        }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderInfoVo.java
@@ -71,5 +71,7 @@
    private String afterSaleTime;
    @ApiModelProperty("活动名称")
    private String activityName;
    @ApiModelProperty("核销码BASE64")
    private String writeOffCode;
    
}
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -93,7 +93,7 @@
        SELECT
            count(*) as total,
            SUM( CASE WHEN tor.order_type = 1 THEN 1 ELSE 0 END ) as serviceTotal,
            SUM( CASE WHEN tor.order_type = 2 THEN 1 ELSE 0 END ) as singleTotal,
            SUM( CASE WHEN tor.order_type = 2 and distribution_mode = 1 THEN 1 ELSE 0 END ) as singleTotal,
            SUM( tor.total_amount ) as totalMoney,
            SUM( CASE WHEN tor.order_type = 1 THEN tor.total_amount ELSE 0 END ) as serviceTotalMoney,
            SUM( CASE WHEN tor.order_type = 2 THEN tor.total_amount ELSE 0 END ) as singleTotalMoney
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/GoodsCategoryController.java
@@ -64,6 +64,7 @@
    public R<Page<GoodsCategory>> list(@ApiParam("页码") @RequestParam Integer pageNum,@ApiParam("每一页数据大小") Integer pageSize, GoodsCategory goodsCategory){
        Page<GoodsCategory> page = goodsCategoryService.lambdaQuery()
                .like(StringUtils.isNotEmpty(goodsCategory.getName()),GoodsCategory::getName, goodsCategory.getName())
                .eq(GoodsCategory::getDelFlag,0)
                .page(Page.of(pageNum, pageSize));
        return R.ok(page);
    }
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("添加失败");
@@ -176,7 +177,7 @@
            userShop.setShopId(shopId);
            userShop.setRoleType(1);
            userShop.setRoleId(2L);
            userShop.setNickName(sysUser.getNickName());
            userShop.setNickName(user.getNickName());
            userShop.setCreateTime(LocalDateTime.now());
            userShopClient.saveUserShop(userShop);
        }
@@ -291,6 +292,7 @@
        AppUserShop appUserShop = new AppUserShop();
        appUserShop.setAppUserId(appUser.getId());
        appUserShop.setShopId(shop.getId());
        appUserShop.setRoleType(1);
        appUserShopClient.delAppUserShop(appUserShop);
        //添加新管理员
@@ -298,7 +300,11 @@
        appUserShop = new AppUserShop();
        appUserShop.setAppUserId(appUser.getId());
        appUserShop.setShopId(shop.getId());
        appUserShop.setRoleType(1);
        appUserClient.addAppUserShop(appUserShop);
        appUser.setUserType(2);
        appUserClient.editAppUserById(appUser);
        //修改管理员
        shop.setAppUserId(appUser.getId());
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 {
@@ -130,12 +131,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) {
@@ -144,6 +154,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/mapper/TechnicianSubscribeMapper.java
@@ -27,7 +27,8 @@
     */
    List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(PageInfo<TechnicianSubscribeVO> pageInfo,
                                                                    @Param("shopId") Long shopId,
                                                                    @Param("status") Integer status);
                                                                    @Param("status") Integer status,
                                                                    @Param("technicianId") Integer technicianId);
    List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop1(PageInfo<TechnicianSubscribeVO> pageInfo,
                                                                    @Param("shopId") Long shopId,
                                                                     @Param("status") Integer status, @Param("phone")String phone,
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -5,14 +5,19 @@
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.Technician;
import com.ruoyi.other.api.domain.TechnicianSubscribe;
import com.ruoyi.other.enums.TechnicianStatus;
import com.ruoyi.other.mapper.TechnicianSubscribeMapper;
import com.ruoyi.other.service.TechnicianService;
import com.ruoyi.other.service.TechnicianSubscribeService;
import com.ruoyi.other.vo.TechnicianSubscribeVO;
import org.springframework.data.redis.connection.RedisZSetCommands;
@@ -24,6 +29,7 @@
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
@@ -45,6 +51,13 @@
    @Resource
    private AppUserClient appUserClient;
    
    @Resource
    private TokenService tokenService;
    @Resource
    private AppUserShopClient appUserShopClient;
    @Resource
    private TechnicianService technicianService;
    
    
    
@@ -52,7 +65,17 @@
    @Override
    public PageInfo<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long shopId, Integer status, Integer pageCurr, Integer pageSize) {
        PageInfo<TechnicianSubscribeVO> pageInfo = new PageInfo(pageCurr, pageSize);
        List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status);
        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();
        Integer technicianId = null;
        if(first.isPresent()){
            AppUserShop appUserShop = first.get();
            Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId())
                    .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 1));
            technicianId = technician.getId();
        }
        List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status, technicianId);
        for (TechnicianSubscribeVO technicianSubscribeVO : list) {
            String id = technicianSubscribeVO.getId();
            TechnicianSubscribe technicianSubscribe = this.getById(id);
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -24,6 +24,9 @@
        <if test="status != null">
            AND tts.status = #{status}
        </if>
        <if test="technicianId != null">
            AND tts.technician_id = #{technicianId}
        </if>
        ORDER BY tts.create_time DESC
    </select>
    <select id="getTechnicianSubscribeByUserAndShop1" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">