SysQuoteRedisService.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.ydtech.modules.order.service;
  2. import com.baomidou.mybatisplus.extension.service.IService;
  3. import com.ydtech.modules.order.entity.po.SysQuoteConfig;
  4. import com.ydtech.modules.order.entity.po.SysQuoteRecord;
  5. import com.ydtech.modules.order.entity.po.SysQuoteUserConfigAppend;
  6. import com.ydtech.modules.order.entity.vo.QuoteNumRedisVo;
  7. import org.springframework.data.redis.core.RedisTemplate;
  8. import java.math.BigDecimal;
  9. import java.util.List;
  10. /**
  11. * 针对表【SysQuoteConfig】的数据库操作Service
  12. */
  13. public interface SysQuoteRedisService {
  14. /**
  15. * 模糊搜索报价次数的keys
  16. * @param pattern
  17. * @return
  18. */
  19. public List<String> searchKeysWithScan(String pattern);
  20. /**
  21. * 组装报价次数的redis数据
  22. * @return
  23. */
  24. public QuoteNumRedisVo assembleQuoteRedisData(String userId,List<SysQuoteConfig> sysQuoteConfigs);
  25. /**
  26. * 保存redis数据
  27. * @param quoteNumberRedis
  28. */
  29. public void saveRedisData(QuoteNumRedisVo quoteNumberRedis);
  30. /**
  31. * 获取报价次数缓存key
  32. * @param userId
  33. * @return
  34. */
  35. public String getQuoteNumberRedisKey(String userId);
  36. /**
  37. * 从redis获取用户报价次数的数据
  38. * @param userId
  39. * @return
  40. */
  41. public QuoteNumRedisVo getQuoteNumberRedisData(String userId);
  42. public void setQuoteRecordRedis(String userId, QuoteNumRedisVo quoteNumRedisVo);
  43. public void delQuoteRedis(String userId);
  44. /**
  45. * 更新所有的缓存数据
  46. * @param sysQuoteConfig
  47. * @return
  48. */
  49. public boolean updateAllQuoteRedis(SysQuoteConfig sysQuoteConfig);
  50. /**
  51. * 更新用户追加的缓存数据
  52. * @param sysQuoteUserConfigAppend
  53. * @return
  54. */
  55. public boolean updateUserQuoteAppendRedis(SysQuoteUserConfigAppend sysQuoteUserConfigAppend);
  56. /**
  57. * 报价之后redis数据更新
  58. * @param companyId
  59. * @param userId
  60. * @param licenseNo
  61. * @param num
  62. * @return
  63. */
  64. public void quoteAfterRedisData(String companyId,String userId,String licenseNo,Integer num);
  65. /**
  66. * 根据车辆信息获取最大的报价次数
  67. */
  68. public Integer getMaxQuoteNum(String companyId,String userId,String licenseNo);
  69. /**
  70. * 获取出单比例
  71. * @param companyId
  72. * @param userId
  73. * @return
  74. */
  75. public BigDecimal getQuoteRatio(String companyId, String userId);
  76. /**
  77. * 刷新报价次数
  78. * @param companyId
  79. * @param userId
  80. * @return
  81. */
  82. public void refreshQuoteNum(String companyId, String userId, List<SysQuoteRecord> sysQuoteRecords);
  83. }