SysWechatCustomerDutyService.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.ydtech.modules.admin.service;
  2. import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  3. import com.baomidou.mybatisplus.extension.service.IService;
  4. import com.ydtech.exception.SystemException;
  5. import com.ydtech.modules.admin.model.po.SysWechatCustomer;
  6. import com.ydtech.modules.admin.model.po.SysWechatCustomerDuty;
  7. import com.ydtech.modules.admin.model.vo.wechat.SysWechatCustomerDutyRulesVo;
  8. import java.util.List;
  9. /**
  10. * @author Administrator
  11. * @description 针对表【sys_wechat_customer_duty(微信客服值班时间)】的数据库操作Service
  12. * @createDate 2025-04-17 10:14:27
  13. */
  14. public interface SysWechatCustomerDutyService extends IService<SysWechatCustomerDuty> {
  15. /**
  16. * 清除值班配置
  17. *
  18. * @param customerId 客服id
  19. */
  20. default void clearCustomerDuty(String customerId) {
  21. LambdaUpdateWrapper<SysWechatCustomerDuty> wr = new LambdaUpdateWrapper<SysWechatCustomerDuty>()
  22. .eq(SysWechatCustomerDuty::getCustomerId, customerId);
  23. remove(wr);
  24. }
  25. default List<SysWechatCustomerDuty> getByCustomerId(String customerId){
  26. LambdaUpdateWrapper<SysWechatCustomerDuty> wr = new LambdaUpdateWrapper<SysWechatCustomerDuty>()
  27. .eq(SysWechatCustomerDuty::getCustomerId, customerId);
  28. return list(wr);
  29. }
  30. default void isDutyCustomerId(Long customerId) {
  31. List<SysWechatCustomerDuty> list = lambdaQuery().eq(SysWechatCustomerDuty::getDutyCustomerId, customerId).list();
  32. if (!list.isEmpty()) {
  33. throw new SystemException("此客服还在值班客服中配置,请删除后重试");
  34. }
  35. }
  36. }