Merge remote-tracking branch 'origin/master'
| | |
| | | */ |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | /** |
| | | * 角色(1=店长,2=店员,3=技师) |
| | | */ |
| | | @TableField("role_type") |
| | | private Integer roleType; |
| | | } |
| | |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(sysUser1.getObjectId()); |
| | | appUserShop.setRoleType(2); |
| | | appUserShopClient.saveAppUserShop(appUserShop); |
| | | appUser.setUserType(2); |
| | | appUserClient.editAppUserById(appUser); |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | @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()); |
| | |
| | | goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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("添加失败"); |
| | |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShop.setRoleType(1); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | |
| | | //添加新管理员 |
| | |
| | | appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShop.setRoleType(1); |
| | | appUserClient.addAppUserShop(appUserShop); |
| | | |
| | | //修改管理员 |
| | |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private AppUserShopClient appUserShopClient; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @PostMapping("/manage/addorupdate") |
| | | @ApiOperation(value = "添加编辑", tags = {"门店-技师列表"}) |
| | | public R<Page<Technician>> add(@RequestBody Technician technician) { |
| | |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setShopId(sysUser.getObjectId()); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setRoleType(3); |
| | | appUserShopClient.saveAppUserShop(appUserShop); |
| | | |
| | | }else { |
| | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | 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; |
| | |
| | | import java.time.ZoneId; |
| | | import java.time.ZoneOffset; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserShopClient appUserShopClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @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(); |