luodangjia
2024-12-18 8f1c6a0bc33cb0c14d4113c4d5fe0a4cb978c713
12.18
10个文件已修改
1个文件已添加
180 ■■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PointSettingController.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopPointController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/PointSettingDto.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PointSettingController.java
@@ -1,16 +1,17 @@
package com.ruoyi.other.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.other.api.domain.PointSetting;
import com.ruoyi.other.dto.PointSettingDto;
import com.ruoyi.other.service.PointSettingService;
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 io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
 * <p>
@@ -32,6 +33,19 @@
        PointSetting pointSetting = pointSettingService.getById(id);
        return R.ok(pointSetting);
    }
    @GetMapping("/search")
    @ApiOperation(value = "积分配置查询", tags = {"后台"})
    public R<List<PointSetting>> search(@RequestParam Integer id) {
        List<PointSetting> list = pointSettingService.list();
        return R.ok(list);
    }
    @PostMapping("/save")
    @ApiOperation(value = "积分配置", tags = {"后台"})
    public R<PointSetting> save(@RequestBody PointSettingDto pointSettingDto) {
        pointSettingService.remove(Wrappers.lambdaQuery());
        pointSettingService.saveBatch(pointSettingDto.getPointSettings());
        return R.ok();
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
@@ -45,6 +45,14 @@
        ShopCommissionStatisticsVO shopCommissionStatisticsVO = shopBalanceStatementService.shopCommissionStatistics(Page.of(pageNum, pageSize), shopBalanceStatement);
        return R.ok(shopCommissionStatisticsVO);
    }
    @GetMapping("/commissionStatistics/list")
    @ApiOperation(value = "门店余额明细", notes = "门店余额明细", tags = {"门店后台"})
    public R<ShopCommissionStatisticsVO> shopCommissionStatisticslist(@ApiParam("页码") @RequestParam Integer pageNum,
                                                                  @ApiParam("每一页数据大小") Integer pageSize,
                                                                  ShopBalanceStatement shopBalanceStatement){
        ShopCommissionStatisticsVO shopCommissionStatisticsVO = shopBalanceStatementService.shopCommissionStatistics(Page.of(pageNum, pageSize), shopBalanceStatement);
        return R.ok(shopCommissionStatisticsVO);
    }
    /**
     * 导出门店分佣统计
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopPointController.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.ShopPoint;
import com.ruoyi.other.excel.ShopPointEX;
import com.ruoyi.other.service.ShopPointService;
@@ -35,6 +36,8 @@
public class ShopPointController {
    @Resource
    private ShopPointService shopPointService;
    @Resource
    private TokenService tokenService;
    /**
@@ -47,6 +50,23 @@
        return R.ok(statistics);
    }
    @GetMapping("/shop/statistics")
    @ApiOperation(value = "门店积分统计", notes = "门店积分统计", tags = {"门店后台"})
    public R<ShopPointStatistics> shopstatistics(ShopPoint shopPoint) {
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        shopPoint.setShopId(objectId);
        ShopPointStatistics statistics = shopPointService.statistics(Page.of(shopPoint.getPageNum(), shopPoint.getPageSize()), shopPoint);
        return R.ok(statistics);
    }
    @GetMapping("/shop/statistics/list")
    @ApiOperation(value = "门店积分统计列表", notes = "门店积分统计", tags = {"门店后台"})
    public R<Page<ShopPoint>> shopstatisticslist(ShopPoint shopPoint,Integer pageNum,Integer pageSize) {
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        Page<ShopPoint> page = shopPointService.lambdaQuery().eq(ShopPoint::getShopId, objectId).eq(ShopPoint::getType, shopPoint.getType())
                .page(Page.of(pageNum, pageSize));
        return R.ok(page);
    }
    /**
     * 导出门店积分统计
     */
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -105,8 +106,53 @@
        return R.ok(getDataTable(technicianService.getTechnicianListByShopId(shopId,name)));
    }
    @GetMapping("/manage/list")
    @ApiOperation(value = "技师列表", tags = {"门店-技师列表"})
    public R<Page<Technician>> managelist(@RequestParam Integer pageNum,@RequestParam Integer pageSize,@ApiParam("技师姓名") String name,@ApiParam("技师电话") String phone) {
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        Page<Technician> page = technicianService.lambdaQuery().like(name != null, Technician::getName, name)
                .like(phone != null, Technician::getPhone, phone)
                .eq(Technician::getShopId, objectId)
                .page(Page.of(pageNum, pageSize));
        return R.ok(page);
    }
    @PostMapping("/manage/addorupdate")
    @ApiOperation(value = "添加编辑", tags = {"门店-技师列表"})
    public R<Page<Technician>> add(@RequestBody Technician technician) {
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        technician.setShopId(objectId);
        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) {
        Technician byId = technicianService.getById(id);
        byId.setStatus(status);
        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) {
        Technician byId = technicianService.getById(id);
        byId.setSubscribeStatus(subscribeStatus);
        technicianService.updateById(byId);
        return R.ok();
    }
    @GetMapping("/getById")
    @ApiOperation(value = "技师详情", tags = {"技师详情-小程序"})
    @ApiOperation(value = "技师详情", tags = {"技师详情-小程序","门店-技师列表"})
    public R<Technician> getById(@RequestParam("id") Integer id){
        Technician byId = technicianService.getById(id);
        return R.ok(byId);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java
@@ -8,6 +8,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.other.api.domain.TechnicianSubscribe;
import com.ruoyi.other.service.TechnicianSubscribeService;
@@ -32,6 +33,23 @@
public class TechnicianSubscribeController extends BaseController {
    @Resource
    private TechnicianSubscribeService technicianSubscribeService;
    @Resource
    private TokenService tokenService;
    @GetMapping("/shop/list")
    @ApiOperation(value = "预约列表", tags = {"门店-预约列表"})
    public TableDataInfo<TechnicianSubscribeVO> shoplist(@ApiParam(value = "状态") Integer status,
                                                         @ApiParam("电话")String phone,
                                                         @ApiParam("姓名")String name,
                                                         @ApiParam("服务方式:1=上门服务,2=到店服务")Integer serviceMode
                                                         ) {
        Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
        startPage();
        List<TechnicianSubscribeVO> list = technicianSubscribeService
                .getTechnicianSubscribeByUserAndShop1(Long.valueOf(objectId),status,phone,name,serviceMode);
        return getDataTable(list);
    }
    /**
     * 预约列表
@@ -60,7 +78,7 @@
     * 取消服务
     */
    @GetMapping("/cancel")
    @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理,小程序-个人中心-我的预约"})
    @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理,小程序-个人中心-我的预约","门店-预约管理"})
    public R<Void> cancel(@ApiParam(value = "预约id") @RequestParam Long id) {
        TechnicianSubscribe subscribe = technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>()
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/dto/PointSettingDto.java
New file
@@ -0,0 +1,11 @@
package com.ruoyi.other.dto;
import com.ruoyi.other.api.domain.PointSetting;
import lombok.Data;
import java.util.List;
@Data
public class PointSettingDto {
    private List<PointSetting> pointSettings;
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java
@@ -27,6 +27,11 @@
    List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(
                                                                    @Param("shopId") Long shopId,
                                                                    @Param("status") Integer status);
    List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop1(
                                                                    @Param("shopId") Long shopId,
                                                                    @Param("status") Integer status,@Param("phone")String phone,
                                                                    @Param("name")String name,
                                                                    @Param("serviceMode")Integer serviceMode);
    IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(@Param("page") Page<TechnicianSubscribe> page, @Param("userId") Long userId,
                                       @Param("status") Integer status);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.other.api.domain.TechnicianSubscribe;
import com.ruoyi.other.vo.TechnicianSubscribeVO;
import io.swagger.annotations.ApiParam;
import java.util.List;
@@ -22,6 +23,9 @@
     * 查询用于指定门店的相关预约记录
     */
    List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long shopId, Integer status);
    List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop1(Long shopId, Integer status ,String phone,
                                                                     String name,
                                                                     Integer serviceMode);
    IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java
@@ -40,8 +40,10 @@
        String shopName = shopPoint.getShopName();
        String phone = shopPoint.getPhone();
        String shopLeaderName = shopPoint.getShopLeaderName();
        Integer shopId = shopPoint.getShopId();
        List<Integer> shopIds = shopService.listObjs(new LambdaQueryWrapper<Shop>()
                        .select(Shop::getId)
                        .eq(shopId!=null,Shop::getId,shopId)
                        .like(StringUtils.isNotEmpty(shopName), Shop::getName, shopName)
                        .like(StringUtils.isNotEmpty(phone), Shop::getPhone, phone)
                        .like(StringUtils.isNotEmpty(shopLeaderName), Shop::getShopManager, shopLeaderName))
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -41,6 +41,12 @@
        return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(shopId,status);
    }
    @Override
    public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop1(Long shopId, Integer status ,String phone,
                                                                            String name,
                                                                            Integer serviceMode) {
        return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop1(shopId,status,phone,name,serviceMode);
    }
    @Override
    public IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status) {
        return technicianSubscribeMapper.getTechnicianSubscribeByUser(page, userId, status);
    }
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -26,6 +26,40 @@
        </if>
        ORDER BY tts.create_time DESC
    </select>
    <select id="getTechnicianSubscribeByUserAndShop1" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">
        SELECT
            CAST(tts.id AS CHAR) id,
            tts.user_address,
            ts.`name` shopName,
            ts.address shopAddress,
            tt.name technicianName,
            ts.longitude,
            ts.latitude,
            tts.subscribe_time,
            tts.service_mode,
            tts.status
        FROM
            t_technician_subscribe tts
                LEFT JOIN t_technician tt ON tts.technician_id = tt.id AND tt.del_flag = 0
                LEFT JOIN t_shop ts ON tt.shop_id = ts.id AND ts.del_flag = 0
        WHERE
            ts.id = #{shopId}
            AND tts.del_flag = 0
        <if test="status != null">
            AND tts.status = #{status}
        </if>
        <if test="name != null and name != ''">
            AND tt.`name` LIKE concat('%', #{name}, '%')
        </if>
        <if test="phone != null and phone != ''">
            AND tt.`phone` LIKE concat('%', #{phone}, '%')
        </if>
        <if test="serviceMode != null">
            AND tts.service_mode = #{serviceMode}
        </if>
        ORDER BY tts.create_time DESC
    </select>
    <select id="getTechnicianSubscribeByUser" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">
        SELECT  * from (