SendConfigTemplateServiceImpl.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package jnpf.message.service.impl;
  2. import jnpf.base.service.SuperServiceImpl;
  3. import jnpf.message.entity.SendConfigTemplateEntity;
  4. import jnpf.message.mapper.SendConfigTemplateMapper;
  5. import jnpf.message.model.sendmessageconfig.SendMessageConfigPagination;
  6. import jnpf.message.service.SendConfigTemplateService;
  7. import jnpf.permission.service.AuthorizeService;
  8. import org.springframework.stereotype.Service;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  11. import jnpf.util.*;
  12. import java.util.List;
  13. /**
  14. * 消息发送配置
  15. * 版本: V3.2.0
  16. * 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
  17. * 作者: JNPF开发平台组
  18. * 日期: 2022-08-19
  19. */
  20. @Service
  21. public class SendConfigTemplateServiceImpl extends SuperServiceImpl<SendConfigTemplateMapper, SendConfigTemplateEntity> implements SendConfigTemplateService {
  22. @Override
  23. public QueryWrapper<SendConfigTemplateEntity> getChild(SendMessageConfigPagination pagination, QueryWrapper<SendConfigTemplateEntity> sendConfigTemplateQueryWrapper) {
  24. // boolean pcPermission = false;
  25. // boolean appPermission = false;
  26. // boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
  27. // if (isPc) {
  28. // }
  29. return sendConfigTemplateQueryWrapper;
  30. }
  31. @Override
  32. public SendConfigTemplateEntity getInfo(String id) {
  33. QueryWrapper<SendConfigTemplateEntity> queryWrapper = new QueryWrapper<>();
  34. queryWrapper.lambda().eq(SendConfigTemplateEntity::getId, id);
  35. return this.getOne(queryWrapper);
  36. }
  37. @Override
  38. public List<SendConfigTemplateEntity> getDetailListByParentId(String id) {
  39. QueryWrapper<SendConfigTemplateEntity> queryWrapper = new QueryWrapper<>();
  40. queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id);
  41. return this.list(queryWrapper);
  42. }
  43. @Override
  44. public List<SendConfigTemplateEntity> getConfigTemplateListByConfigId(String id) {
  45. QueryWrapper<SendConfigTemplateEntity> queryWrapper = new QueryWrapper<>();
  46. queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id);
  47. queryWrapper.lambda().eq(SendConfigTemplateEntity::getEnabledMark, 1);
  48. return this.list(queryWrapper);
  49. }
  50. @Override
  51. public boolean isUsedAccount(String accountId) {
  52. QueryWrapper<SendConfigTemplateEntity> queryWrapper = new QueryWrapper<>();
  53. queryWrapper.lambda().eq(SendConfigTemplateEntity::getAccountConfigId, accountId);
  54. if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) {
  55. return true;
  56. } else {
  57. return false;
  58. }
  59. }
  60. @Override
  61. public boolean isUsedTemplate(String templateId) {
  62. QueryWrapper<SendConfigTemplateEntity> queryWrapper = new QueryWrapper<>();
  63. queryWrapper.lambda().eq(SendConfigTemplateEntity::getTemplateId, templateId);
  64. if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) {
  65. return true;
  66. } else {
  67. return false;
  68. }
  69. }
  70. }