proj_name
stringclasses
131 values
relative_path
stringlengths
30
228
class_name
stringlengths
1
68
func_name
stringlengths
1
48
masked_class
stringlengths
78
9.82k
func_body
stringlengths
46
9.61k
len_input
int64
29
2.01k
len_output
int64
14
1.94k
total
int64
55
2.05k
relevant_context
stringlengths
0
38.4k
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/aop/interceptor/PreventDuplicateSubmissionsInterceptor.java
PreventDuplicateSubmissionsInterceptor
getParams
class PreventDuplicateSubmissionsInterceptor { @Autowired private Cache<String> cache; @Before("@annotation(preventDuplicateSubmissions)") public void interceptor(PreventDuplicateSubmissions preventDuplicateSubmissions) { try { String redisKey = getParams(preventDuplicateSubmissi...
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); StringBuilder stringBuilder = new StringBuilder(); //拼接请求地址 stringBuilder.append(request.getRequestURI()); //参数不为空则拼接参数 if (!request.getParameterMap().isE...
360
243
603
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/aop/interceptor/RetryAspect.java
RetryAspect
retryOperation
class RetryAspect { @Around(value = "@annotation(retryOperation)") public Object retryOperation(ProceedingJoinPoint joinPoint, RetryOperation retryOperation) throws Throwable {<FILL_FUNCTION_BODY>} }
Object response = null; int retryCount = retryOperation.retryCount(); int waitSeconds = retryOperation.waitSeconds(); boolean successful = false; do { try { response = joinPoint.proceed(); successful = true; } catch (Retr...
69
215
284
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/context/ThreadContextHolder.java
ThreadContextHolder
getHttpResponse
class ThreadContextHolder { public static HttpServletResponse getHttpResponse() {<FILL_FUNCTION_BODY>} public static HttpServletRequest getHttpRequest() { ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); assert servletR...
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); assert servletRequestAttributes != null; return servletRequestAttributes.getResponse();
97
49
146
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/exception/GlobalControllerExceptionHandler.java
GlobalControllerExceptionHandler
handleServiceException
class GlobalControllerExceptionHandler { /** * 如果超过长度,则前后段交互体验不佳,使用默认错误消息 */ static Integer MAX_LENGTH = 200; /** * 自定义异常 * * @param e * @return */ @ExceptionHandler(ServiceException.class) @ResponseStatus(value = HttpStatus.BAD_REQUEST) public ResultMessage<...
//如果是自定义异常,则获取异常,返回自定义错误消息 if (e instanceof ServiceException) { ServiceException serviceException = ((ServiceException) e); ResultCode resultCode = serviceException.getResultCode(); Integer code = null; String message = null; if (resultCod...
1,078
497
1,575
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/listener/TransactionCommitSendMQListener.java
TransactionCommitSendMQListener
send
class TransactionCommitSendMQListener { /** * rocketMq */ @Autowired private RocketMQTemplate rocketMQTemplate; @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void send(TransactionCommitSendMQEvent event) {<FILL_FUNCTION_BODY>} }
log.info("事务提交,发送mq信息!{}", event); String destination = event.getTopic() + ":" + event.getTag(); //发送订单变更mq消息 rocketMQTemplate.asyncSend(destination, event.getMessage(), RocketmqSendCallbackBuilder.commonCallback());
99
85
184
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/properties/StatisticsProperties.java
StatisticsProperties
getOnlineMember
class StatisticsProperties { /** * 在线人数统计 X 小时 */ private Integer onlineMember = 48; /** * 当前在线人数 刷新时间间隔 */ private Integer currentOnlineUpdate = 600; public Integer getOnlineMember() {<FILL_FUNCTION_BODY>} public Integer getCurrentOnlineUpdate() { if (currentOnli...
if (onlineMember == null) { return 48; } return onlineMember;
132
29
161
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/properties/SystemSettingProperties.java
SystemSettingProperties
getSensitiveLevel
class SystemSettingProperties { /** * 是否是演示站点 */ private Boolean isDemoSite = false; /** * 测试模式 * 验证码短信为6个1 */ private Boolean isTestModel = false; /** * 脱敏级别: * 0:不做脱敏处理 * 1:管理端用户手机号等信息脱敏 * 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏) * <p> * PS: */ ...
if (sensitiveLevel == null) { return 0; } return sensitiveLevel;
273
29
302
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/properties/VerificationCodeProperties.java
VerificationCodeProperties
getInterfereNum
class VerificationCodeProperties { /** * 过期时间 * 包含滑块验证码有效时间, 以及验证通过之后,缓存中存储的验证结果有效时间 */ private Long effectiveTime = 600L; /** * 水印 */ private String watermark = ""; /** * 干扰数量 最大数量 */ private Integer interfereNum = 0; /** * 容错像素 */ privat...
if (interfereNum > 2) { return 2; } return interfereNum;
184
30
214
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/security/SecurityBean.java
SecurityBean
corsConfigurationSource
class SecurityBean { @Bean public BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } /** * 定义跨域配置 * * @return bean */ @Bean CorsConfigurationSource corsConfigurationSource() {<FILL_FUNCTION_BODY>} }
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); config.setAllowedOriginPatterns(Collections.singletonList(CorsConfiguration.ALL)); config.addAllowedHeader(CorsCo...
91
117
208
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/security/sensitive/SensitiveJsonSerializer.java
SensitiveJsonSerializer
createContextual
class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer, ApplicationContextAware { private SensitiveStrategy strategy; //系统配置 private SystemSettingProperties systemSettingProperties; @Override public void serialize(String value, JsonGenerator gen, Seria...
// 判定是否 需要脱敏处理 if (desensitization()) { //获取敏感枚举 Sensitive annotation = property.getAnnotation(Sensitive.class); //如果有敏感注解,则加入脱敏规则 if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) { this.s...
406
137
543
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/security/token/SecretKeyUtil.java
SecretKeyUtil
generalKey
class SecretKeyUtil { public static SecretKey generalKey() {<FILL_FUNCTION_BODY>} public static SecretKey generalKeyByDecoders() { return Keys.hmacShaKeyFor(Decoders.BASE64.decode("cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ=")); } }
//自定义 byte[] encodedKey = Base64.decodeBase64("cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ="); SecretKey key = Keys.hmacShaKeyFor(encodedKey); return key;
110
88
198
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/security/token/TokenUtil.java
TokenUtil
createToken
class TokenUtil { @Autowired private JWTTokenProperties tokenProperties; @Autowired private Cache cache; /** * 构建token * * @param authUser 私有声明 * @return TOKEN */ public Token createToken(AuthUser authUser) { Token token = new Token(); //访问token ...
//JWT 生成 return Jwts.builder() //jwt 私有声明 .claim(SecurityEnum.USER_CONTEXT.getValue(), new Gson().toJson(authUser)) //JWT的主体 .setSubject(authUser.getUsername()) //失效时间 当前时间+过期分钟 .setExpiration(new Date(Syste...
1,164
150
1,314
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/sensitive/StringPointer.java
StringPointer
nextStartsWith
class StringPointer implements Serializable, CharSequence, Comparable<StringPointer> { private static final long serialVersionUID = 1L; protected final char[] value; protected final int offset; protected final int length; private int hash = 0; public StringPointer(String str) { val...
//是否长度超出 if (word.length > length - i) { return false; } //从尾开始判断 for (int c = word.length - 1; c >= 0; c--) { if (value[offset + i + c] != word.value[word.offset + c]) { return false; } } return true;
1,188
102
1,290
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/sensitive/init/SensitiveWordsLoader.java
SensitiveWordsLoader
run
class SensitiveWordsLoader implements ApplicationRunner { @Autowired private Cache<List<String>> cache; /** * 程序启动时,获取最新的需要过滤的敏感词 * <p> * 这里即便缓存中为空也没关系,定时任务会定时重新加载敏感词 * * @param args 启动参数 */ @Override public void run(ApplicationArguments args) {<FILL_FUNCTION_BODY>} ...
List<String> sensitives = cache.get(CachePrefix.SENSITIVE.getPrefix()); log.info("系统初始化敏感词"); if (sensitives == null || sensitives.isEmpty()) { return; } SensitiveWordsFilter.init(sensitives);
128
76
204
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/sensitive/quartz/QuartzConfig.java
QuartzConfig
sensitiveQuartzTrigger
class QuartzConfig { @Bean public JobDetail sensitiveQuartzDetail() { return JobBuilder.newJob(SensitiveQuartz.class).withIdentity("sensitiveQuartz").storeDurably().build(); } @Bean public Trigger sensitiveQuartzTrigger() {<FILL_FUNCTION_BODY>} }
SimpleScheduleBuilder scheduleBuilder = SimpleScheduleBuilder.simpleSchedule() .withIntervalInSeconds(3600) .repeatForever(); return TriggerBuilder.newTrigger().forJob(sensitiveQuartzDetail()) .withIdentity("sensitiveQuartz") .withSchedule...
91
91
182
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/sensitive/quartz/SensitiveQuartz.java
SensitiveQuartz
executeInternal
class SensitiveQuartz extends QuartzJobBean { @Autowired private Cache<List<String>> cache; /** * 定时更新敏感词信息 * * @param jobExecutionContext */ @Override protected void executeInternal(JobExecutionContext jobExecutionContext) {<FILL_FUNCTION_BODY>} }
log.info("敏感词定时更新"); List<String> sensitives = cache.get(CachePrefix.SENSITIVE.getPrefix()); if (sensitives == null || sensitives.isEmpty()) { return; } SensitiveWordsFilter.init(sensitives);
93
75
168
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/thread/ThreadConfig.java
ThreadConfig
getAsyncExecutor
class ThreadConfig implements AsyncConfigurer { @Autowired private ThreadProperties threadProperties; @Override public Executor getAsyncExecutor() {<FILL_FUNCTION_BODY>} }
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); // 核心线程数,默认为5 executor.setCorePoolSize(threadProperties.getCorePoolSize()); // 最大线程数,默认为10 executor.setMaxPoolSize(threadProperties.getMaxPoolSize()); // 队列最大长度,一般需要设置值为足够大 executor.setQueueCapacity(threadPr...
57
203
260
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/BeanUtil.java
BeanUtil
getFiledName
class BeanUtil { /** * 复制属性 * * @param objectFrom 源自对象 * @param objectTo 复制给对象 */ public static void copyProperties(Object objectFrom, Object objectTo) { BeanUtils.copyProperties(objectFrom, objectTo); } /** * 获取属性名数组 * * @param o 获取字段的对象 * @retu...
Field[] fields = o.getClass().getDeclaredFields(); Field[] superFields = o.getClass().getSuperclass().getDeclaredFields(); String[] fieldNames = new String[fields.length + superFields.length]; int index = 0; for (int i = 0; i < fields.length; i++) { fieldNames[index]...
935
179
1,114
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/CommonUtil.java
CommonUtil
rename
class CommonUtil { public static final String BASE_NUMBER = "0123456789"; /** * 以UUID重命名 * @param fileName 文件名称 * @return 格式化名称 */ public static String rename(String fileName) {<FILL_FUNCTION_BODY>} /** * 随机6位数生成 */ public static String getRandomNum() { Stri...
String extName = fileName.substring(fileName.lastIndexOf(".")); return UUID.randomUUID().toString().replace("-", "") + extName;
255
44
299
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/CookieUtil.java
CookieUtil
addCookie
class CookieUtil { /** * 新增cookie * * @param key key值 * @param value 对应值 * @param maxAge cookie 有效时间 * @param response 响应 */ public static void addCookie(String key, String value, Integer maxAge, HttpServletResponse response) {<FILL_FUNCTION_BODY>} /** * ...
try { Cookie c = new Cookie(key, value); c.setMaxAge(maxAge); c.setPath("/"); response.addCookie(c); } catch (Exception e) { log.error("新增cookie错误",e); }
409
77
486
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/CurrencyUtil.java
CurrencyUtil
mul
class CurrencyUtil { /** * 默认除法运算精度 */ private static final int DEF_DIV_SCALE = 2; /** * 这个类不能实例化 */ private CurrencyUtil() { } /** * 提供精确的加法运算。 * * @return 累加之和 */ public static Double add(double... params) { BigDecimal result = new BigDecim...
if (scale < 0) { throw new IllegalArgumentException( "The scale must be a positive integer or zero"); } BigDecimal b1 = BigDecimal.valueOf(v1); BigDecimal b2 = BigDecimal.valueOf(v2); return b1.multiply(b2).setScale(scale, RoundingMode.HALF_UP).do...
1,124
102
1,226
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/HttpClientUtils.java
HttpClientUtils
init
class HttpClientUtils { /** * org.apache.http.impl.client.CloseableHttpClient */ private static CloseableHttpClient httpClient = null; //这里就直接默认固定了,因为以下三个参数在新建的method中仍然可以重新配置并被覆盖. /** * ms毫秒,从池中获取链接超时时间 */ static final int CONNECTION_REQUEST_TIMEOUT = 30000; /** * ms毫...
CloseableHttpClient newHotpoint; //设置连接池 ConnectionSocketFactory plainsf = PlainConnectionSocketFactory.getSocketFactory(); LayeredConnectionSocketFactory sslsf = SSLConnectionSocketFactory.getSocketFactory(); Registry<ConnectionSocketFactory> registry = RegistryBuilder.<Connec...
976
650
1,626
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/IpHelper.java
IpHelper
getIpCity
class IpHelper { /** * qq lbs 地区查询key */ @Value("${lili.lbs.key}") private String key; /** * qq lbs 地区查询key */ @Value("${lili.lbs.sk}") private String sk; private static final String API = "https://apis.map.qq.com"; /** * 获取IP返回地理信息 * * @param reque...
String url = "/ws/location/v1/ip?key=" + key + "&ip=" + IpUtils.getIpAddress(request); String sign = SecureUtil.md5(url + sk); url = API + url + "&sign=" + sign; String result = "未知"; try { String json = HttpUtil.get(url, 3000); JsonObject jsonObject = J...
175
379
554
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/JasyptUtil.java
JasyptUtil
decryptPwd
class JasyptUtil { /** * Jasypt生成加密结果 * @param password 配置文件中设定的加密密码 jasypt.encryptor.password * @param value 待加密值 * @return 加密字符串 */ public static String encryptPwd(String password, String value){ PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor(); enc...
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor(); encryptor.setConfig(encryptor(password)); encryptor.decrypt(value); return encryptor.decrypt(value);
593
65
658
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/RegularUtil.java
RegularUtil
sqlReplace
class RegularUtil { /** * 手机号 */ private static final Pattern MOBILE = Pattern.compile("^1[3|4|5|8][0-9]\\d{8}$"); /** * 邮箱 */ private static final Pattern EMAIL = Pattern.compile("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$"); //sql正则 static Pa...
if (StringUtils.isEmpty(str)) { return ""; } Matcher sqlMatcher = sqlPattern.matcher(str); return sqlMatcher.replaceAll("");
823
49
872
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/SnowflakeInitiator.java
SnowflakeInitiator
init
class SnowflakeInitiator { /** * 缓存前缀 */ private static final String KEY = "{Snowflake}"; @Autowired private Cache cache; /** * 尝试初始化 * * @return */ @PostConstruct public void init() {<FILL_FUNCTION_BODY>} public static void main(String[] args) { ...
Long num = cache.incr(KEY); long dataCenter = num / 32; long workedId = num % 32; //如果数据中心大于32,则抹除缓存,从头开始 if (dataCenter >= 32) { cache.remove(KEY); num = cache.incr(KEY); dataCenter = num / 32; workedId = num % 32; } ...
149
130
279
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/SpelUtil.java
SpelUtil
compileParams
class SpelUtil { /** * spel表达式解析器 */ private static SpelExpressionParser spelExpressionParser = new SpelExpressionParser(); /** * 参数名发现器 */ private static DefaultParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer(); /** * 转换 jspl参数 *...
//Spel表达式解析日志信息 //获得方法参数名数组 MethodSignature signature = (MethodSignature) joinPoint.getSignature(); String[] parameterNames = parameterNameDiscoverer.getParameterNames(signature.getMethod()); if (parameterNames != null && parameterNames.length > 0) { EvaluationContext conte...
424
200
624
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/StringUtils.java
StringUtils
toFen
class StringUtils extends StrUtil { /** * MD5加密方法 * * @param str String * @return String */ public static String md5(String str) { MessageDigest messageDigest = null; try { messageDigest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmExc...
String str = doubleValue.toString(); if (!str.contains(".")) { str = str + ".00"; } else if (str.substring(str.indexOf(".")).length() == 2) { str = str + "0"; } return str;
1,414
75
1,489
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/utils/UrlBuilder.java
UrlBuilder
queryParam
class UrlBuilder { private final Map<String, String> params = new LinkedHashMap<>(7); private String baseUrl; private UrlBuilder() { } /** * @param baseUrl 基础路径 * @return the new {@code UrlBuilder} */ public static UrlBuilder fromBaseUrl(String baseUrl) { UrlBuilder bu...
if (StringUtils.isEmpty(key)) { throw new RuntimeException("参数名不能为空"); } String valueAsString = (value != null ? value.toString() : null); this.params.put(key, valueAsString); return this;
534
71
605
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/validation/impl/MobileValidator.java
MobileValidator
isValid
class MobileValidator implements ConstraintValidator<Mobile, String> { private static final Pattern PHONE = Pattern.compile("^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$"); private static final Pattern AREA_MOBILE = Pattern.compile("0\\d{2,3}[-]?\\d{7,8}|0\\d{2,3}\\s?\\d{7,8}|13[0-9]\\...
Matcher m = null; // 验证手机号 if (value.length() == 11) { m = PHONE.matcher(value); // 验证带区号的电话 } else if (value.length() > 9) { m = AREA_MOBILE.matcher(value); //验证没有区号的电话 } else { m = MOBILE.matcher(value); } ...
274
124
398
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/vo/PageVO.java
PageVO
getSort
class PageVO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "页号") private Integer pageNumber = 1; @ApiModelProperty(value = "页面大小") private Integer pageSize = 10; @ApiModelProperty(value = "排序字段") private String sort; @ApiModelPr...
if (CharSequenceUtil.isNotEmpty(sort)) { if (notConvert == null || Boolean.FALSE.equals(notConvert)) { return StringUtils.camel2Underline(sort); } else { return sort; } } return sort;
190
72
262
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/common/vo/SearchVO.java
SearchVO
getConvertStartDate
class SearchVO implements Serializable { @ApiModelProperty(value = "起始日期") private String startDate; @ApiModelProperty(value = "结束日期") private String endDate; public Date getConvertStartDate() {<FILL_FUNCTION_BODY>} public Date getConvertEndDate() { if (StringUtils.isEmpty(endDate)) ...
if (StringUtils.isEmpty(startDate)) { return null; } return DateUtil.toDate(startDate, DateUtil.STANDARD_DATE_FORMAT);
229
47
276
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/elasticsearch/config/ElasticsearchConfig.java
ElasticsearchConfig
clientClose
class ElasticsearchConfig extends AbstractElasticsearchConfiguration { @Autowired private ElasticsearchProperties elasticsearchProperties; private RestHighLevelClient client; @Override @Bean public RestHighLevelClient elasticsearchClient() { String username = elasticsearchProperties.g...
try { this.client.close(); } catch (IOException e) { log.error("es clientClose错误", e); }
783
40
823
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/connect/request/BaseAuthAlipayRequest.java
BaseAuthAlipayRequest
getUserInfo
class BaseAuthAlipayRequest extends BaseAuthRequest { private final AlipayClient alipayClient; public BaseAuthAlipayRequest(AuthConfig config, Cache cache) { super(config, ConnectAuthEnum.ALIPAY, cache); this.alipayClient = new DefaultAlipayClient(ConnectAuthEnum.ALIPAY.accessToken(), config....
String accessToken = authToken.getAccessToken(); AlipayUserInfoShareRequest request = new AlipayUserInfoShareRequest(); AlipayUserInfoShareResponse response = null; try { response = this.alipayClient.execute(request, accessToken); } catch (AlipayApiException e) { ...
873
339
1,212
<methods>public void <init>(cn.lili.modules.connect.config.AuthConfig, cn.lili.modules.connect.config.ConnectAuth, Cache#RAW) ,public java.lang.String authorize(java.lang.String) ,public AuthResponse#RAW login(cn.lili.modules.connect.entity.dto.AuthCallback) <variables>protected Cache#RAW cache,protected cn.lili.module...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/connect/request/BaseAuthQQRequest.java
BaseAuthQQRequest
getOpenId
class BaseAuthQQRequest extends BaseAuthRequest { public BaseAuthQQRequest(AuthConfig config, Cache cache) { super(config, ConnectAuthEnum.QQ, cache); } @Override protected AuthToken getAccessToken(AuthCallback authCallback) { String response = doGetAuthorizationCode(authCallback.getCo...
String response = new HttpUtils(config.getHttpConfig()).get(UrlBuilder.fromBaseUrl("https://graph.qq.com/oauth2.0/me") .queryParam("access_token", authToken.getAccessToken()) .queryParam("unionid", config.isUnionId() ? 1 : 0) .build()); String removePrefi...
1,007
270
1,277
<methods>public void <init>(cn.lili.modules.connect.config.AuthConfig, cn.lili.modules.connect.config.ConnectAuth, Cache#RAW) ,public java.lang.String authorize(java.lang.String) ,public AuthResponse#RAW login(cn.lili.modules.connect.entity.dto.AuthCallback) <variables>protected Cache#RAW cache,protected cn.lili.module...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/connect/request/BaseAuthWeChatPCRequest.java
BaseAuthWeChatPCRequest
userInfoUrl
class BaseAuthWeChatPCRequest extends BaseAuthRequest { public BaseAuthWeChatPCRequest(AuthConfig config, Cache cache) { super(config, ConnectAuthEnum.WECHAT_PC, cache); } /** * 微信的特殊性,此时返回的信息同时包含 openid 和 access_token * * @param authCallback 回调返回的参数 * @return 所有信息 */ ...
return UrlBuilder.fromBaseUrl(source.userInfo()) .queryParam("access_token", authToken.getAccessToken()) .queryParam("openid", authToken.getOpenId()) .queryParam("lang", "zh_CN") .build();
1,346
71
1,417
<methods>public void <init>(cn.lili.modules.connect.config.AuthConfig, cn.lili.modules.connect.config.ConnectAuth, Cache#RAW) ,public java.lang.String authorize(java.lang.String) ,public AuthResponse#RAW login(cn.lili.modules.connect.entity.dto.AuthCallback) <variables>protected Cache#RAW cache,protected cn.lili.module...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/connect/request/BaseAuthWeChatRequest.java
BaseAuthWeChatRequest
getUserInfo
class BaseAuthWeChatRequest extends BaseAuthRequest { public BaseAuthWeChatRequest(AuthConfig config, Cache cache) { super(config, ConnectAuthEnum.WECHAT, cache); } /** * 微信的特殊性,此时返回的信息同时包含 openid 和 access_token * * @param authCallback 回调返回的参数 * @return 所有信息 */ @Overrid...
String openId = authToken.getOpenId(); String response = doGetUserInfo(authToken); JSONObject object = JSONObject.parseObject(response); this.checkResponse(object); String location = String.format("%s-%s-%s", object.getString("country"), object.getString("province"), object.g...
1,163
263
1,426
<methods>public void <init>(cn.lili.modules.connect.config.AuthConfig, cn.lili.modules.connect.config.ConnectAuth, Cache#RAW) ,public java.lang.String authorize(java.lang.String) ,public AuthResponse#RAW login(cn.lili.modules.connect.entity.dto.AuthCallback) <variables>protected Cache#RAW cache,protected cn.lili.module...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/connect/request/BaseAuthWeiboRequest.java
BaseAuthWeiboRequest
revoke
class BaseAuthWeiboRequest extends BaseAuthRequest { public BaseAuthWeiboRequest(AuthConfig config, Cache cache) { super(config, ConnectAuthEnum.WEIBO, cache); } @Override protected AuthToken getAccessToken(AuthCallback authCallback) { String response = doPostAuthorizationCode(authCall...
String response = doGetRevoke(authToken); JSONObject object = JSONObject.parseObject(response); if (object.containsKey("error")) { return AuthResponse.builder() .code(AuthResponseStatus.FAILURE.getCode()) .msg(object.getString("error")) ...
813
158
971
<methods>public void <init>(cn.lili.modules.connect.config.AuthConfig, cn.lili.modules.connect.config.ConnectAuth, Cache#RAW) ,public java.lang.String authorize(java.lang.String) ,public AuthResponse#RAW login(cn.lili.modules.connect.entity.dto.AuthCallback) <variables>protected Cache#RAW cache,protected cn.lili.module...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/connect/util/AuthChecker.java
AuthChecker
checkCode
class AuthChecker { /** * 是否支持第三方登录 * * @param config config * @param connectAuth source * @return true or false * @since 1.6.1-beta */ public static boolean isSupportedAuth(AuthConfig config, ConnectAuth connectAuth) { boolean isSupported = StringUtils.isNotEm...
String code = callback.getCode(); if (connectAuth == ConnectAuthEnum.ALIPAY) { code = callback.getAuthCode(); } if (StringUtils.isEmpty(code)) { throw new AuthException(AuthResponseStatus.ILLEGAL_CODE, connectAuth); }
807
78
885
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/entity/dto/DistributionGoodsSearchParams.java
DistributionGoodsSearchParams
distributionQueryWrapper
class DistributionGoodsSearchParams extends PageVO { @ApiModelProperty(value = "商品ID") private String goodsId; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "是否已选择") private boolean isChecked; public <T> QueryWrapper<T> queryWrapper() { Que...
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); queryWrapper.like(CharSequenceUtil.isNotEmpty(goodsName), "dg.goods_name", goodsName); return queryWrapper;
281
55
336
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/entity/dto/DistributionSearchParams.java
DistributionSearchParams
queryWrapper
class DistributionSearchParams { @ApiModelProperty(value = "会员名称") private String memberName; @ApiModelProperty(value = "分销员状态", allowableValues = "APPLY,RETREAT,REFUSE,PASS") private String distributionStatus; public <T> QueryWrapper<T> queryWrapper() {<FILL_FUNCTION_BODY>} }
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); queryWrapper.like(StringUtils.isNotEmpty(memberName), "member_name", memberName); queryWrapper.eq(StringUtils.isNotEmpty(distributionStatus), "distribution_status", distributionStatus); return queryWrapper;
100
74
174
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/entity/vos/DistributionCashSearchParams.java
DistributionCashSearchParams
queryWrapper
class DistributionCashSearchParams extends PageVO { /** * 编号 */ @ApiModelProperty(value = "编号") private String sn; /** * 会员名称 */ @ApiModelProperty(value = "会员名称") private String memberName; /** * 分销员提现状态 */ @ApiModelProperty(value = "分销员提现状态",allowableValu...
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); if (StringUtils.isNotEmpty(memberName)) { queryWrapper.like("distribution_name", memberName); } if (StringUtils.isNotEmpty(sn)) { queryWrapper.like("sn", sn); } if (StringUtils.isNotEmpty(distri...
167
123
290
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/entity/vos/DistributionOrderSearchParams.java
DistributionOrderSearchParams
queryWrapper
class DistributionOrderSearchParams extends PageVO { private static final long serialVersionUID = -8736018687663645064L; @ApiModelProperty(value = "分销员名称") private String distributionName; @ApiModelProperty(value = "订单sn") private String orderSn; @ApiModelProperty(value = "分销员ID", hidden = t...
QueryWrapper<T> queryWrapper = Wrappers.query(); queryWrapper.like(StringUtils.isNotBlank(distributionName), "distribution_name", distributionName); queryWrapper.eq(StringUtils.isNotBlank(distributionOrderStatus), "distribution_order_status", distributionOrderStatus); queryWrapper.eq(St...
344
211
555
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionCashServiceImpl.java
DistributionCashServiceImpl
cash
class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMapper, DistributionCash> implements DistributionCashService { /** * 分销员 */ @Autowired private DistributionService distributionService; /** * 会员余额 */ @Autowired private MemberWalletService memberWalletServi...
//检查分销功能开关 distributionService.checkDistributionSetting(); //获取分销员 Distribution distribution = distributionService.getDistribution(); //如果未找到分销员或者分销员状态不是已通过则无法申请提现 if (distribution != null && distribution.getDistributionStatus().equals(DistributionStatusEnum.PASS.name(...
1,119
500
1,619
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionGoodsServiceImpl.java
DistributionGoodsServiceImpl
checked
class DistributionGoodsServiceImpl extends ServiceImpl<DistributionGoodsMapper, DistributionGoods> implements DistributionGoodsService { /** * 分销员 */ @Autowired private DistributionService distributionService; /** * 规格商品 */ @Autowired private GoodsSkuService goodsSkuService;...
//检查分销功能开关 distributionService.checkDistributionSetting(); //判断是否存在分销商品,如果存在不能添加 QueryWrapper queryWrapper = Wrappers.query().eq("sku_id", skuId); if (this.getOne(queryWrapper) != null) { throw new ServiceException(ResultCode.DISTRIBUTION_GOODS_DOUBLE); } ...
912
217
1,129
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionSelectedGoodsServiceImpl.java
DistributionSelectedGoodsServiceImpl
add
class DistributionSelectedGoodsServiceImpl extends ServiceImpl<DistributionSelectedGoodsMapper, DistributionSelectedGoods> implements DistributionSelectedGoodsService { /** * 分销员 */ @Autowired private DistributionService distributionService; @Override public boolean add(String distributi...
//检查分销功能开关 distributionService.checkDistributionSetting(); String distributionId = distributionService.getDistribution().getId(); DistributionSelectedGoods distributionSelectedGoods = new DistributionSelectedGoods(distributionId, distributionGoodsId); return this.save(distribut...
283
77
360
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/distribution/serviceimpl/DistributionServiceImpl.java
DistributionServiceImpl
applyDistribution
class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Distribution> implements DistributionService { /** * 会员 */ @Autowired private MemberService memberService; /** * 缓存 */ @Autowired private Cache cache; /** * 设置 */ @Autowired private S...
//检查分销开关 checkDistributionSetting(); //判断用户是否申请过分销 Distribution distribution = getDistribution(); //如果分销员非空并未审核则提示用户请等待,如果分销员为拒绝状态则重新提交申请 if (Optional.ofNullable(distribution).isPresent()) { switch (DistributionStatusEnum.valueOf(distribution.getDistributi...
1,084
295
1,379
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/file/entity/dto/FileOwnerDTO.java
FileOwnerDTO
getConvertEndDate
class FileOwnerDTO extends PageVO { @ApiModelProperty(value = "拥有者id") private String ownerId; @ApiModelProperty(value = "拥有者名称") private String ownerName; @ApiModelProperty(value = "用户类型") private String userEnums; @ApiModelProperty(value = "原文件名") private String name; @ApiMode...
if (StringUtils.isEmpty(endDate)) { return null; } //结束时间等于结束日期+1天 -1秒, Date date = DateUtil.toDate(endDate, DateUtil.STANDARD_DATE_FORMAT); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DAY_OF_MONTH, calend...
294
140
434
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/file/plugin/FilePluginFactory.java
FilePluginFactory
filePlugin
class FilePluginFactory { @Autowired private SettingService settingService; /** * 获取oss client * * @return */ public FilePlugin filePlugin() {<FILL_FUNCTION_BODY>} }
OssSetting ossSetting = null; try { Setting setting = settingService.get(SettingEnum.OSS_SETTING.name()); ossSetting = JSONUtil.toBean(setting.getSettingValue(), OssSetting.class); switch (OssEnum.valueOf(ossSetting.getType())) { case MINIO: ...
70
206
276
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/file/plugin/impl/AliFilePlugin.java
AliFilePlugin
inputStreamUpload
class AliFilePlugin implements FilePlugin { private OssSetting ossSetting; public AliFilePlugin(OssSetting ossSetting) { this.ossSetting = ossSetting; } @Override public OssEnum pluginName() { return OssEnum.ALI_OSS; } /** * 获取oss client * * @return */...
OSS ossClient = getOssClient(); try { ObjectMetadata meta = new ObjectMetadata(); meta.setContentType("image/jpg"); ossClient.putObject(ossSetting.getAliyunOSSBucketName(), key, inputStream, meta); } catch (OSSException oe) { log.error("Caught an ...
1,008
369
1,377
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/file/plugin/impl/TencentFilePlugin.java
TencentFilePlugin
getCOSClient
class TencentFilePlugin implements FilePlugin { private OssSetting ossSetting; public TencentFilePlugin(OssSetting ossSetting) { this.ossSetting = ossSetting; } @Override public OssEnum pluginName() { return OssEnum.TENCENT_COS; } /** * 获取oss client * * @re...
// 1 初始化用户身份信息(secretId, secretKey)。 COSCredentials cred = new BasicCOSCredentials(ossSetting.getTencentCOSSecretId(), ossSetting.getTencentCOSSecretKey()); // 2 设置 bucket 的地域, COS 地域的简称请参见 https://cloud.tencent.com/document/product/436/6224 ClientConfig clientConfig = new ClientConfig(...
752
189
941
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/file/serviceimpl/FileDirectoryServiceImpl.java
FileDirectoryServiceImpl
initChild
class FileDirectoryServiceImpl extends ServiceImpl<FileDirectoryMapper, FileDirectory> implements FileDirectoryService { @Override public void addFileDirectory(UserEnums userEnum, String id, String ownerName) { FileDirectory fileDirectory = new FileDirectory(); fileDirectory.setOwnerId(id); ...
if (fileDirectoryList == null) { return; } fileDirectoryList.stream() .filter(item -> (item.getParentId().equals(fileDirectoryDTO.getId()))) .forEach(child -> { FileDirectoryDTO childTree = new FileDirectoryDTO(child); ...
341
110
451
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/file/serviceimpl/FileServiceImpl.java
FileServiceImpl
batchDelete
class FileServiceImpl extends ServiceImpl<FileMapper, File> implements FileService { @Autowired private FilePluginFactory filePluginFactory; @Override public void batchDelete(List<String> ids) { LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(File::...
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(File::getId, ids); queryWrapper.eq(File::getUserEnums, authUser.getRole().name()); //操作图片属性判定 switch (authUser.getRole()) { case MEMBER: queryWrapper.eq(File::getOwne...
990
245
1,235
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/dos/GoodsSku.java
GoodsSku
getCreateTime
class GoodsSku extends BaseEntity { private static final long serialVersionUID = 4865908658161118934L; @ApiModelProperty(value = "商品id") private String goodsId; @ApiModelProperty(value = "规格信息json", hidden = true) @JsonIgnore private String specs; @ApiModelProperty(value = "规格信息") pr...
if (super.getCreateTime() == null) { return new Date(1593571928); } else { return super.getCreateTime(); }
1,650
51
1,701
<methods>public non-sealed void <init>() <variables>private java.lang.String createBy,private java.util.Date createTime,private java.lang.Boolean deleteFlag,private java.lang.String id,private static final long serialVersionUID,private java.lang.String updateBy,private java.util.Date updateTime
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/dto/CategorySearchParams.java
CategorySearchParams
queryWrapper
class CategorySearchParams { @ApiModelProperty(value = "分类名称") private String name; @ApiModelProperty(value = "父id") private String parentId; @ApiModelProperty(value = "层级") private Integer level; @ApiModelProperty(value = "排序值") private BigDecimal sortOrder; @ApiModelProperty(v...
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); queryWrapper.like(name != null, "name", name); queryWrapper.like(parentTitle != null, "parent_title", parentTitle); queryWrapper.eq(parentId != null, "parent_id", parentId); queryWrapper.eq(level != null, "level", level); ...
193
165
358
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/dto/DraftGoodsSearchParams.java
DraftGoodsSearchParams
queryWrapper
class DraftGoodsSearchParams extends GoodsSearchParams { private static final long serialVersionUID = -1057830772267228050L; /** * @see DraftGoodsSaveType */ @ApiModelProperty(value = "草稿商品保存类型") private String saveType; @Override public <T> QueryWrapper<T> queryWrapper() {<FILL_FUN...
QueryWrapper<T> queryWrapper = super.queryWrapper(); if (CharSequenceUtil.isNotEmpty(saveType)) { queryWrapper.eq("save_type", saveType); } return queryWrapper;
123
57
180
<methods>public non-sealed void <init>() ,public QueryWrapper<T> queryWrapper() <variables>private java.lang.Boolean alertQuantity,private java.lang.String authFlag,private java.lang.String categoryPath,private java.lang.Integer geQuantity,private java.lang.String goodsId,private java.lang.String goodsName,private java...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsSearchParams.java
GoodsSearchParams
queryWrapper
class GoodsSearchParams extends PageVO { private static final long serialVersionUID = 2544015852728566887L; @ApiModelProperty(value = "商品编号") private String goodsId; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "商品编号") private String id; @Api...
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); if (CharSequenceUtil.isNotEmpty(goodsId)) { queryWrapper.eq("goods_id", goodsId); } if (CharSequenceUtil.isNotEmpty(goodsName)) { queryWrapper.like("goods_name", goodsName); } if (CharSequenceUt...
686
645
1,331
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsSkuSearchParams.java
GoodsSkuSearchParams
queryWrapper
class GoodsSkuSearchParams extends GoodsSearchParams { private static final long serialVersionUID = -6235885068610635045L; @ApiModelProperty(value = "商品id") private String goodsId; @Override public <T> QueryWrapper<T> queryWrapper() {<FILL_FUNCTION_BODY>} }
QueryWrapper<T> queryWrapper = super.queryWrapper(); queryWrapper.eq(StringUtils.isNotEmpty(goodsId), "goods_id", goodsId); return queryWrapper;
104
51
155
<methods>public non-sealed void <init>() ,public QueryWrapper<T> queryWrapper() <variables>private java.lang.Boolean alertQuantity,private java.lang.String authFlag,private java.lang.String categoryPath,private java.lang.Integer geQuantity,private java.lang.String goodsId,private java.lang.String goodsName,private java...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/vos/CategoryVO.java
CategoryVO
getChildren
class CategoryVO extends Category { private static final long serialVersionUID = 3775766246075838410L; @ApiModelProperty(value = "父节点名称") private String parentTitle; @ApiModelProperty("子分类列表") private List<CategoryVO> children; @ApiModelProperty("分类关联的品牌列表") private List<Brand> brandList...
if (children != null) { children.sort(new Comparator<CategoryVO>() { @Override public int compare(CategoryVO o1, CategoryVO o2) { return o1.getSortOrder().compareTo(o2.getSortOrder()); } }); return children...
267
90
357
<methods>public void <init>(java.lang.String, java.lang.String, java.util.Date, java.lang.String, java.util.Date, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.Integer, java.math.BigDecimal, java.lang.Double, java.lang.String, java.lang.Boolean) ,public void <init>(java.lang.String, java.lang.String,...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsParamsVO.java
GoodsParamsVO
getOptionList
class GoodsParamsVO extends GoodsParamsDTO { private static final long serialVersionUID = -4904700751774005326L; @ApiModelProperty("1 输入项 2 选择项") private Integer paramType; @ApiModelProperty(" 选择项的内容获取值,使用optionList") private String options; @ApiModelProperty("是否必填是 1 否 0") private ...
if (options != null) { return options.replaceAll("\r|\n", "").split(","); } return optionList;
228
41
269
<methods>public non-sealed void <init>() <variables>private List<cn.lili.modules.goods.entity.dto.GoodsParamsItemDTO> goodsParamsItemDTOList,private java.lang.String groupId,private java.lang.String groupName,private static final long serialVersionUID
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java
BrandServiceImpl
checkBind
class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements BrandService { /** * 分类品牌绑定 */ @Autowired private CategoryBrandService categoryBrandService; @Autowired private CategoryService categoryService; @Autowired private GoodsService goodsService; @Override...
//分了绑定关系查询 List<CategoryBrand> categoryBrands = categoryBrandService.getCategoryBrandListByBrandId(brandIds); if (!categoryBrands.isEmpty()) { List<String> categoryIds = categoryBrands.stream().map(CategoryBrand::getCategoryId).collect(Collectors.toList()); throw new Ser...
977
245
1,222
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryBrandServiceImpl.java
CategoryBrandServiceImpl
saveCategoryBrandList
class CategoryBrandServiceImpl extends ServiceImpl<CategoryBrandMapper, CategoryBrand> implements CategoryBrandService { @Override public List<CategoryBrandVO> getCategoryBrandList(String categoryId) { return this.baseMapper.getCategoryBrandList(categoryId); } @Override public void deleteB...
//删除分类品牌绑定信息 this.deleteByCategoryId(categoryId); //绑定品牌信息 if (!brandIds.isEmpty()) { List<CategoryBrand> categoryBrands = new ArrayList<>(); for (String brandId : brandIds) { categoryBrands.add(new CategoryBrand(categoryId, brandId)); ...
249
108
357
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryParameterGroupServiceImpl.java
CategoryParameterGroupServiceImpl
updateCategoryGroup
class CategoryParameterGroupServiceImpl extends ServiceImpl<CategoryParameterGroupMapper, CategoryParameterGroup> implements CategoryParameterGroupService { /** * 商品参数 */ @Autowired private ParametersService parametersService; @Autowired private GoodsService goodsService; @Override ...
CategoryParameterGroup origin = this.getById(categoryParameterGroup.getId()); if (origin == null) { throw new ServiceException(ResultCode.CATEGORY_PARAMETER_NOT_EXIST); } LambdaQueryWrapper<Goods> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.select(Goods::...
686
351
1,037
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CommodityServiceImpl.java
CommodityServiceImpl
addCommodity
class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity> implements CommodityService { @Autowired private WechatLivePlayerUtil wechatLivePlayerUtil; @Autowired private GoodsSkuService goodsSkuService; @Override @Transactional(rollbackFor = Exception.class) public boolean ...
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); for (Commodity commodity : commodityList) { //检测直播商品 checkCommodity(commodity); commodity.setStoreId(storeId); //添加直播商品 JSONObject json = wechatLivePlayerUtil....
1,038
235
1,273
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/DraftGoodsServiceImpl.java
DraftGoodsServiceImpl
saveGoodsDraft
class DraftGoodsServiceImpl extends ServiceImpl<DraftGoodsMapper, DraftGoods> implements DraftGoodsService { /** * 分类 */ @Autowired private CategoryService categoryService; /** * 商品相册 */ @Autowired private GoodsGalleryService goodsGalleryService; /** * 规格商品 */ ...
if (draftGoods.getGoodsGalleryList() != null && !draftGoods.getGoodsGalleryList().isEmpty()) { GoodsGallery goodsGallery = goodsGalleryService.getGoodsGallery(draftGoods.getGoodsGalleryList().get(0)); draftGoods.setOriginal(goodsGallery.getOriginal()); draftGoods.setSmall(g...
991
582
1,573
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java
GoodsGalleryServiceImpl
getUrl
class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, GoodsGallery> implements GoodsGalleryService { /** * 设置 */ @Autowired private SettingService settingService; @Override @Transactional(rollbackFor = Exception.class) public void add(List<String> goodsGalleryList, St...
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name()); OssSetting ossSetting = JSONUtil.toBean(setting.getSettingValue(), OssSetting.class); switch (OssEnum.valueOf(ossSetting.getType())) { case MINIO: //缩略图全路径 return url; c...
751
230
981
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/ParametersServiceImpl.java
ParametersServiceImpl
setGoodsItemDTO
class ParametersServiceImpl extends ServiceImpl<ParametersMapper, Parameters> implements ParametersService { @Autowired private GoodsService goodsService; @Autowired private RocketmqCustomProperties rocketmqCustomProperties; @Autowired private RocketMQTemplate rocketMQTemplate; /** ...
if (goodsParamsItemDTO.getParamId().equals(parameters.getId())) { goodsParamsItemDTO.setParamId(parameters.getId()); goodsParamsItemDTO.setParamName(parameters.getParamName()); goodsParamsItemDTO.setRequired(parameters.getRequired()); goodsParamsItemDTO.setIsInde...
905
243
1,148
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/SpecificationServiceImpl.java
SpecificationServiceImpl
deleteSpecification
class SpecificationServiceImpl extends ServiceImpl<SpecificationMapper, Specification> implements SpecificationService { /** * 分类-规格绑定 */ @Autowired private CategorySpecificationService categorySpecificationService; /** * 分类 */ @Autowired private CategoryServiceImpl category...
boolean result = false; for (String id : ids) { //如果此规格绑定分类则不允许删除 List<CategorySpecification> list = categorySpecificationService.list(new QueryWrapper<CategorySpecification>().eq("specification_id", id)); if (!list.isEmpty()) { List<String> categoryI...
121
183
304
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/StoreGoodsLabelServiceImpl.java
StoreGoodsLabelServiceImpl
removeStoreGoodsLabel
class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMapper, StoreGoodsLabel> implements StoreGoodsLabelService { /** * 缓存 */ @Autowired private Cache cache; @Override public List<StoreGoodsLabelVO> listByStoreId(String storeId) { //从缓存中获取店铺分类 if (cache.ha...
AuthUser tokenUser = UserContext.getCurrentUser(); if (tokenUser == null || CharSequenceUtil.isEmpty(tokenUser.getStoreId())) { throw new ServiceException(ResultCode.USER_NOT_LOGIN); } //删除店铺分类 this.removeById(storeLabelId); //清除缓存 removeCache(token...
1,470
100
1,570
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/serviceimpl/WholesaleServiceImpl.java
WholesaleServiceImpl
removeByTemplateId
class WholesaleServiceImpl extends ServiceImpl<WholesaleMapper, Wholesale> implements WholesaleService { @Autowired private Cache<List<Wholesale>> cache; @Override @Cacheable(key = "#goodsId") public List<Wholesale> findByGoodsId(String goodsId) { LambdaQueryWrapper<Wholesale> queryWrapper...
LambdaQueryWrapper<Wholesale> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Wholesale::getTemplateId, templateId); cache.remove("{wholesale}_" + templateId + "_template"); return this.remove(queryWrapper);
677
71
748
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/sku/GoodsSkuBuilder.java
GoodsSkuBuilder
builderSingle
class GoodsSkuBuilder { private static final String IMAGES_KEY = "images"; /** * 构建商品sku * * @param goods 商品 * @param skuInfo sku信息列表 * @return 商品sku */ public static GoodsSku build(Goods goods, Map<String, Object> skuInfo) { GoodsSku goodsSku = new GoodsSku(goods...
Assert.notNull(goodsSku, "goodsSku不能为空"); Assert.notEmpty(skuInfo, "skuInfo不能为空"); //规格简短信息 StringBuilder simpleSpecs = new StringBuilder(); //商品名称 StringBuilder goodsName = new StringBuilder(goodsSku.getGoodsName()); //规格值 Map<String, Object> specMap = n...
387
568
955
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/sku/render/impl/WholesaleSaleModelRenderImpl.java
WholesaleSaleModelRenderImpl
checkWholesaleList
class WholesaleSaleModelRenderImpl implements SalesModelRender { /** * 批发商品 */ @Autowired private WholesaleService wholesaleService; @Override @Transactional(rollbackFor = Exception.class) public void renderSingle(GoodsSku goodsSku, GoodsOperationDTO goodsOperationDTO) { Asse...
if (CollUtil.isEmpty(wholesaleList)) { throw new ServiceException(ResultCode.MUST_HAVE_SALES_MODEL); } for (WholesaleDTO wholesaleDTO : wholesaleList) { if (wholesaleDTO.getPrice() == null || wholesaleDTO.getPrice() <= 0 || wholesaleDTO.getNum() == null || wholesaleDTO.g...
652
188
840
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/goods/util/WechatMediaUtil.java
WechatMediaUtil
uploadMedia
class WechatMediaUtil { @Autowired private WechatAccessTokenUtil wechatAccessTokenUtil; /** * 上传多媒体数据到微信服务器 * * @param mediaFileUrl 来自网络上面的媒体文件地址 * @return */ public String uploadMedia(String type, String mediaFileUrl) {<FILL_FUNCTION_BODY>} /** * 通过传过来的contentType判断是...
//获取token String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.WECHAT_MP); /* * 上传媒体文件到微信服务器需要请求的地址 */ String MEDIA_URL = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE"; StringBuffer resultStr = null; ...
269
1,131
1,400
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/config/WebSocketConfigurator.java
WebSocketConfigurator
customSpringConfigurator
class WebSocketConfigurator { @Bean public CustomSpringConfigurator customSpringConfigurator() {<FILL_FUNCTION_BODY>} }
// This is just to get context return new CustomSpringConfigurator();
44
23
67
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/entity/dto/ImQueryParams.java
ImQueryParams
queryWrapper
class ImQueryParams extends PageVO { private static final long serialVersionUID = 5792718094087541134L; @ApiModelProperty("用户Id") private String memberId; @ApiModelProperty("店铺Id") private String storeId; public <T> QueryWrapper<T> queryWrapper() {<FILL_FUNCTION_BODY>} }
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); if (CharSequenceUtil.isNotEmpty(memberId)) { queryWrapper.eq("member_id", memberId); } if (CharSequenceUtil.isNotEmpty(storeId)) { queryWrapper.eq("store_id", storeId); } queryWrapper.eq("delete...
108
116
224
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/entity/dto/MessageQueryParams.java
MessageQueryParams
initQueryWrapper
class MessageQueryParams extends PageVO { private static final long serialVersionUID = 3504156704697214077L; /** * 聊天窗口 */ private String talkId; /** * 最后一个消息 */ private String lastMessageId; /** * 获取消息数量 */ private Integer num; public LambdaQueryWrapper<...
if (CharSequenceUtil.isEmpty(talkId)) { throw new ServiceException(ResultCode.ERROR); } if (num == null || num > 50) { num = 50; } LambdaQueryWrapper<ImMessage> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ImMessage::get...
134
178
312
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/serviceimpl/ImMessageServiceImpl.java
ImMessageServiceImpl
ListSort
class ImMessageServiceImpl extends ServiceImpl<ImMessageMapper, ImMessage> implements ImMessageService { @Autowired private ImTalkService imTalkService; @Override public void read(String talkId, String accessToken) { LambdaUpdateWrapper<ImMessage> updateWrapper = new LambdaUpdateWrapper<>(); ...
list.sort(new Comparator<ImMessage>() { @Override public int compare(ImMessage e1, ImMessage e2) { try { if (e1.getCreateTime().before(e2.getCreateTime())) { return -1; } else { retur...
1,147
117
1,264
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/serviceimpl/QAServiceImpl.java
QAServiceImpl
getStoreQA
class QAServiceImpl extends ServiceImpl<QAMapper, QA> implements QAService { @Override public IPage<QA> getStoreQA(String word, PageVO pageVo) {<FILL_FUNCTION_BODY>} }
LambdaQueryWrapper<QA> qaLambdaQueryWrapper = new LambdaQueryWrapper<>(); qaLambdaQueryWrapper.eq(QA::getTenantId, UserContext.getCurrentUser().getTenantId()); qaLambdaQueryWrapper.like(QA::getQuestion, word); return this.page(PageUtil.initPage(pageVo), qaLambdaQueryWrapper);
66
97
163
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/serviceimpl/SeatServiceImpl.java
SeatServiceImpl
usernameLogin
class SeatServiceImpl extends ServiceImpl<SeatMapper, Seat> implements SeatService { @Autowired private SeatTokenGenerate seatTokenGenerate; @Autowired private Cache<String> cache; /** * 快捷登录缓存前缀 */ private static String prefix = "{quick_login}_"; @Override public List<Se...
Seat seat = this.findByUsername(username); //判断用户是否存在 if (seat == null || !seat.getDisabled()) { throw new ServiceException(ResultCode.ERROR); } //判断密码是否输入正确 if (!new BCryptPasswordEncoder().matches(password, seat.getPassword())) { throw new Serv...
561
121
682
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/serviceimpl/SeatSettingServiceImpl.java
SeatSettingServiceImpl
updateByStore
class SeatSettingServiceImpl extends ServiceImpl<SeatSettingMapper, SeatSetting> implements SeatSettingService { @Override public SeatSetting getSetting(String storeId) { LambdaQueryWrapper<SeatSetting> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(SeatSetting::getTenantId, storeId)...
SeatSetting oldSetting = this.baseMapper.selectById(seatSetting.getId()); if (oldSetting.getTenantId().equals(seatSetting.getTenantId())) { this.updateById(seatSetting); } else { throw new ServiceException(ResultCode.ERROR); } return seatSetting;
281
86
367
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/im/token/SeatTokenGenerate.java
SeatTokenGenerate
createToken
class SeatTokenGenerate extends AbstractTokenGenerate<Seat> { @Autowired private TokenUtil tokenUtil; @Override public Token createToken(Seat seat, Boolean longTerm) {<FILL_FUNCTION_BODY>} @Override public Token refreshToken(String refreshToken) { return tokenUtil.refreshToken(refreshT...
AuthUser authUser = AuthUser.builder() .username(seat.getUsername()) .id(seat.getId()) .nickName(seat.getNickName()) .face(seat.getFace()) .role(UserEnums.SEAT) .longTerm(longTerm) .tenantId(seat.get...
104
126
230
<methods>public non-sealed void <init>() ,public abstract cn.lili.common.security.token.Token createToken(cn.lili.modules.im.entity.dos.Seat, java.lang.Boolean) ,public abstract cn.lili.common.security.token.Token refreshToken(java.lang.String) <variables>public cn.lili.common.security.enums.UserEnums role
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/logistics/LogisticsPluginFactory.java
LogisticsPluginFactory
filePlugin
class LogisticsPluginFactory { @Autowired private SettingService settingService; /** * 获取logistics client * * @return */ public LogisticsPlugin filePlugin() {<FILL_FUNCTION_BODY>} }
LogisticsSetting logisticsSetting = null; try { Setting setting = settingService.get(SettingEnum.LOGISTICS_SETTING.name()); logisticsSetting = JSONUtil.toBean(setting.getSettingValue(), LogisticsSetting.class); switch (LogisticsEnum.valueOf(logisticsSetting.getType(...
73
191
264
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/logistics/plugin/kuaidi100/Kuaidi100Plugin.java
Kuaidi100Plugin
pollQuery
class Kuaidi100Plugin implements LogisticsPlugin { @Autowired private LogisticsSetting logisticsSetting; public Kuaidi100Plugin(LogisticsSetting logisticsSetting) { this.logisticsSetting = logisticsSetting; } @Override public LogisticsEnum pluginName() { return LogisticsEnum....
try { QueryTrackReq queryTrackReq = new QueryTrackReq(); QueryTrackParam queryTrackParam = new QueryTrackParam(); queryTrackParam.setCom(logistics.getCode()); queryTrackParam.setNum(expNo); queryTrackParam.setPhone(phone); String param = n...
1,390
401
1,791
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/aop/interceptor/PointLogInterceptor.java
PointLogInterceptor
doAfter
class PointLogInterceptor { @Autowired private MemberPointsHistoryService memberPointsHistoryService; @Autowired private MemberService memberService; @After("@annotation(cn.lili.modules.member.aop.annotation.PointLogPoint)") public void doAfter(JoinPoint pjp) {<FILL_FUNCTION_BODY>} }
//参数 Object[] obj = pjp.getArgs(); try { //变动积分 Long point = 0L; if (obj[0] != null) { point = Long.valueOf(obj[0].toString()); } //变动类型 String type = PointTypeEnum.INCREASE.name(); if (obj[1] !=...
99
448
547
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/entity/dto/EvaluationQueryParams.java
EvaluationQueryParams
queryWrapper
class EvaluationQueryParams extends PageVO { private static final long serialVersionUID = 2038158669175297129L; @ApiModelProperty(value = "ID") private String id; @ApiModelProperty(value = "买家ID") private String memberId; @ApiModelProperty(value = "skuID") private String skuId; @Api...
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); if (CharSequenceUtil.isNotEmpty(id)) { queryWrapper.eq("id", id); } if (CharSequenceUtil.isNotEmpty(startTime) && CharSequenceUtil.isNotEmpty(endTime)) { queryWrapper.between("create_time", startTime, endTime);...
398
456
854
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/entity/dto/FootPrintQueryParams.java
FootPrintQueryParams
queryWrapper
class FootPrintQueryParams extends PageVO { @ApiModelProperty("用户Id") private String memberId; @ApiModelProperty("店铺Id") private String storeId; public <T> QueryWrapper<T> queryWrapper() {<FILL_FUNCTION_BODY>} }
QueryWrapper<T> queryWrapper = new QueryWrapper<>(); if (CharSequenceUtil.isNotEmpty(memberId)) { queryWrapper.eq("member_id", memberId); } if (CharSequenceUtil.isNotEmpty(storeId)) { queryWrapper.eq("store_id", storeId); } queryWrapper.eq("delete...
77
116
193
<methods>public non-sealed void <init>() ,public java.lang.String getSort() <variables>private java.lang.Boolean notConvert,private java.lang.String order,private java.lang.Integer pageNumber,private java.lang.Integer pageSize,private static final long serialVersionUID,private java.lang.String sort
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/entity/vo/MemberReceiptVO.java
MemberReceiptVO
lambdaQueryWrapper
class MemberReceiptVO { private static final long serialVersionUID = -8210927982915677995L; @ApiModelProperty(value = "会员ID") private String memberId; @ApiModelProperty(value = "会员名称") private String memberName; /** * @see cn.lili.modules.member.entity.enums.MemberReceiptEnum */ ...
LambdaQueryWrapper<MemberReceipt> queryWrapper = new LambdaQueryWrapper<>(); //会员名称查询 if (StringUtils.isNotEmpty(memberName)) { queryWrapper.like(MemberReceipt::getMemberName, memberName); } //会员id查询 if (StringUtils.isNotEmpty(memberId)) { queryW...
172
205
377
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/entity/vo/StoreMenuVO.java
StoreMenuVO
getChildren
class StoreMenuVO extends StoreMenu { @ApiModelProperty(value = "子菜单") private List<StoreMenuVO> children = new ArrayList<>(); public StoreMenuVO() { } public StoreMenuVO(StoreMenu storeMenu) { BeanUtil.copyProperties(storeMenu, this); } public List<StoreMenuVO> getChildren() {<...
if (children != null) { children.sort(new Comparator<StoreMenuVO>() { @Override public int compare(StoreMenuVO o1, StoreMenuVO o2) { return o1.getSortOrder().compareTo(o2.getSortOrder()); } }); return childr...
111
92
203
<methods>public non-sealed void <init>() <variables>private java.lang.String frontRoute,private java.lang.Integer level,private java.lang.String name,private java.lang.String parentId,private java.lang.String path,private java.lang.String permission,private static final long serialVersionUID,private java.lang.Double so...
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/FootprintServiceImpl.java
FootprintServiceImpl
footPrintPage
class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint> implements FootprintService { @Autowired private GoodsSkuService goodsSkuService; @Override public FootPrint saveFootprint(FootPrint footPrint) { LambdaQueryWrapper<FootPrint> queryWrapper = Wrappers.lambdaQuery(); ...
params.setSort("createTime"); Page<FootPrint> footPrintPages = this.page(PageUtil.initPage(params), params.queryWrapper()); //定义结果 Page<EsGoodsIndex> esGoodsIndexIPage = new Page<>(); if (footPrintPages.getRecords() != null && !footPrintPages.getRecords().isEmpty()) { ...
615
582
1,197
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/GoodsCollectionServiceImpl.java
GoodsCollectionServiceImpl
deleteGoodsCollection
class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMapper, GoodsCollection> implements GoodsCollectionService { @Override public IPage<GoodsCollectionVO> goodsCollection(PageVO pageVo) { QueryWrapper<GoodsCollectionVO> queryWrapper = new QueryWrapper(); queryWrapper.eq("gc.mem...
QueryWrapper<GoodsCollection> queryWrapper = new QueryWrapper(); queryWrapper.eq("member_id", UserContext.getCurrentUser().getId()); queryWrapper.eq(skuId != null, "sku_id", skuId); return this.remove(queryWrapper);
582
73
655
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberAddressServiceImpl.java
MemberAddressServiceImpl
updateMemberAddress
class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, MemberAddress> implements MemberAddressService { @Override public IPage<MemberAddress> getAddressByMember(PageVO page, String memberId) { return this.page(PageUtil.initPage(page), new QueryWrapper<MemberAddress>() ...
MemberAddress originalMemberAddress = this.getMemberAddress(memberAddress.getId()); if (originalMemberAddress != null) { if (memberAddress.getIsDefault() == null) { memberAddress.setIsDefault(false); } //判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认 r...
625
120
745
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberNoticeSenterServiceImpl.java
MemberNoticeSenterServiceImpl
customSave
class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSenterMapper, MemberNoticeSenter> implements MemberNoticeSenterService { /** * 会员 */ @Autowired private MemberService memberService; /** * 会员站内信 */ @Autowired private MemberNoticeService memberNoticeService;...
if (this.saveOrUpdate(memberNoticeSenter)) { List<MemberNotice> memberNotices = new ArrayList<>(); //如果是选中会员发送 if (memberNoticeSenter.getSendType().equals(SendTypeEnum.SELECT.name())) { //判定消息是否有效 if (!CharSequenceUtil.isEmpty(memberNoticeSen...
136
435
571
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberPointsHistoryServiceImpl.java
MemberPointsHistoryServiceImpl
MemberPointsHistoryList
class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHistoryMapper, MemberPointsHistory> implements MemberPointsHistoryService { @Autowired private MemberService memberService; @Override public MemberPointsHistoryVO getMemberPointsHistoryVO(String memberId) { //获取会员积分历史 ...
LambdaQueryWrapper<MemberPointsHistory> lambdaQueryWrapper = new LambdaQueryWrapper<MemberPointsHistory>() .eq(CharSequenceUtil.isNotEmpty(memberId), MemberPointsHistory::getMemberId, memberId) .like(CharSequenceUtil.isNotEmpty(memberName), MemberPointsHistory::getMemberName, me...
217
158
375
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberReceiptServiceImpl.java
MemberReceiptServiceImpl
addMemberReceipt
class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, MemberReceipt> implements MemberReceiptService { @Autowired private MemberService memberService; @Override public IPage<MemberReceipt> getPage(MemberReceiptVO memberReceiptVO, PageVO pageVO) { return this.page(PageUtil.init...
//校验发票抬头是否重复 List<MemberReceipt> receipts = this.baseMapper.selectList(new QueryWrapper<MemberReceipt>() .eq("member_id", memberId) .eq("receipt_title", memberReceiptAddVO.getReceiptTitle()) ); if (!receipts.isEmpty()) { throw new ServiceExcep...
741
510
1,251
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberSignServiceImpl.java
MemberSignServiceImpl
memberSign
class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberSign> implements MemberSignService { /** * RocketMQ */ @Autowired private RocketMQTemplate rocketMQTemplate; /** * RocketMQ 配置 */ @Autowired private RocketmqCustomProperties rocketmqCustomProperties; ...
//获取当前会员信息 AuthUser authUser = UserContext.getCurrentUser(); if (ObjectUtil.isNotNull(authUser)) { //获取当前用户当日签到日信息 LambdaQueryWrapper<MemberSign> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(MemberSign::getMemberId, authUser.getId()); ...
643
545
1,188
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreClerkRoleServiceImpl.java
StoreClerkRoleServiceImpl
listId
class StoreClerkRoleServiceImpl extends ServiceImpl<StoreClerkRoleMapper, StoreClerkRole> implements StoreClerkRoleService { @Override public List<StoreClerkRole> listByUserId(String clerkId) { QueryWrapper<StoreClerkRole> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("clerk_id", clerkId...
List<StoreClerkRole> userRoleList = this.listByUserId(clerkId); List<String> strings = new ArrayList<>(); userRoleList.forEach(item -> strings.add(item.getRoleId())); return strings;
240
65
305
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java
StoreCollectionServiceImpl
deleteStoreCollection
class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMapper, StoreCollection> implements StoreCollectionService { @Autowired private StoreService storeService; @Override public IPage<StoreCollectionVO> storeCollection(PageVO pageVo) { QueryWrapper<StoreCollectionVO> queryWrappe...
QueryWrapper<StoreCollection> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("member_id", UserContext.getCurrentUser().getId()); queryWrapper.eq("store_id", storeId); storeService.updateStoreCollectionNum(new CollectionDTO(storeId, -1)); return this.remove(queryWrapper); ...
459
84
543
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreDepartmentRoleServiceImpl.java
StoreDepartmentRoleServiceImpl
updateByDepartmentId
class StoreDepartmentRoleServiceImpl extends ServiceImpl<StoreDepartmentRoleMapper, StoreDepartmentRole> implements StoreDepartmentRoleService { @Autowired private Cache cache; @Override public List<StoreDepartmentRole> listByDepartmentId(String storeDepartmentId) { QueryWrapper queryWrapper =...
if (!storeDepartmentRoles.isEmpty()) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("department_id", storeDepartmentId); this.remove(queryWrapper); this.saveBatch(storeDepartmentRoles); cache.vagueDel(CachePrefix.PERMISSION_LIST.g...
282
123
405
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreDepartmentServiceImpl.java
StoreDepartmentServiceImpl
initChild
class StoreDepartmentServiceImpl extends ServiceImpl<StoreDepartmentMapper, StoreDepartment> implements StoreDepartmentService { @Autowired private StoreDepartmentRoleService storeDepartmentRoleService; @Autowired private ClerkService clerkService; @Override public void deleteByIds(List<Strin...
departmentVOS.stream() .filter(item -> (item.getParentId().equals(tree.getId()))) .forEach(child -> { StoreDepartmentVO childTree = new StoreDepartmentVO(child); initChild(childTree, departmentVOS); tree.getChildren().a...
729
86
815
<no_super_class>
lilishop_lilishop
lilishop/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreLogisticsServiceImpl.java
StoreLogisticsServiceImpl
add
class StoreLogisticsServiceImpl extends ServiceImpl<StoreLogisticsMapper, StoreLogistics> implements StoreLogisticsService { @Override public List<StoreLogisticsVO> getStoreLogistics(String storeId) { return this.baseMapper.getStoreLogistics(storeId); } @Override public List<StoreLogistics...
//判断是否已经选择过,如果没有选择则进行添加 LambdaQueryWrapper<StoreLogistics> lambdaQueryWrapper = Wrappers.lambdaQuery(); lambdaQueryWrapper.eq(StoreLogistics::getLogisticsId, logisticsId); lambdaQueryWrapper.eq(StoreLogistics::getStoreId, storeId); StoreLogistics storeLogistics = null; i...
697
182
879
<no_super_class>