| | |
| | | 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> |
| | |
| | | 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(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 导出门店分佣统计 |
| | |
| | | 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; |
| | |
| | | public class ShopPointController { |
| | | @Resource |
| | | private ShopPointService shopPointService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 导出门店积分统计 |
| | | */ |
| | |
| | | |
| | | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 预约列表 |
| | |
| | | * 取消服务 |
| | | */ |
| | | @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>() |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | * 查询用于指定门店的相关预约记录 |
| | | */ |
| | | 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); |
| | | |
| | |
| | | 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)) |
| | |
| | | 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); |
| | | } |
| | |
| | | </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 ( |