| | |
| | | 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; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserShopClient appUserShopClient; |
| | | @Resource |
| | | private TechnicianService technicianService; |
| | | |
| | | |
| | | |
| | |
| | | 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, 2)); |
| | | if(null != technician){ |
| | | technicianId = technician.getId(); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status); |
| | | List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status, technicianId); |
| | | for (TechnicianSubscribeVO technicianSubscribeVO : list) { |
| | | String id = technicianSubscribeVO.getId(); |
| | | TechnicianSubscribe technicianSubscribe = this.getById(id); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void switchingTechnician(TechnicianSubscribe technicianSubscribe) { |
| | | List<TechnicianSubscribe> list = this.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, technicianSubscribe.getOrderId()) |
| | | .eq(TechnicianSubscribe::getDelFlag, 0).eq(TechnicianSubscribe::getStatus, 0)); |
| | | for (TechnicianSubscribe subscribe : list) { |
| | | if(subscribe.getTechnicianId().equals(technicianSubscribe.getTechnicianId())){ |
| | | throw new RuntimeException("不能切换相同的技师"); |
| | | } |
| | | subscribe.setTechnicianId(technicianSubscribe.getTechnicianId()); |
| | | this.updateById(subscribe); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 定时修改到期状态 |