Skip to content

Commit

Permalink
!544 同步最新商城代码
Browse files Browse the repository at this point in the history
Merge pull request !544 from 芋道源码/feature/mall_product
  • Loading branch information
YunaiV authored and gitee-org committed Jul 26, 2023
2 parents 91769f0 + 6c174d9 commit b287fdb
Show file tree
Hide file tree
Showing 198 changed files with 3,229 additions and 956 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public interface WebFilterOrderEnum {

int TENANT_SECURITY_FILTER = -99; // 需要保证在 Spring Security 过滤器后面

int ACTIVITI_FILTER = -98; // 需要保证在 Spring Security 过滤后面

int FLOWABLE_FILTER = -98; // 需要保证在 Spring Security 过滤后面

int DEMO_FILTER = Integer.MAX_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,4 @@ public interface GlobalErrorCodeConstants {

ErrorCode UNKNOWN = new ErrorCode(999, "未知错误");

/**
* 是否为服务端错误,参考 HTTP 5XX 错误码段
*
* @param code 错误码
* @return 是否
*/
static boolean isServerErrorCode(Integer code) {
return code != null
&& code >= INTERNAL_SERVER_ERROR.getCode() && code <= INTERNAL_SERVER_ERROR.getCode() + 99;
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cn.iocoder.yudao.framework.common.pojo;

import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.exception.ServerException;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down Expand Up @@ -92,10 +91,6 @@ public void checkError() throws ServiceException {
if (isSuccess()) {
return;
}
// 服务端异常
if (GlobalErrorCodeConstants.isServerErrorCode(code)) {
throw new ServerException(code, msg);
}
// 业务异常
throw new ServiceException(code, msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
* 时间工具类,用于 {@link java.time.LocalDateTime}
Expand Down Expand Up @@ -50,7 +51,7 @@ public static LocalDateTime[] buildBetweenTime(int year1, int mouth1, int day1,
* 判断当前时间是否在该时间范围内
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param endTime 结束时间
* @return 是否
*/
public static boolean isBetween(LocalDateTime startTime, LocalDateTime endTime) {
Expand All @@ -60,4 +61,24 @@ public static boolean isBetween(LocalDateTime startTime, LocalDateTime endTime)
return LocalDateTimeUtil.isIn(LocalDateTime.now(), startTime, endTime);
}

/**
* 检查时间重叠 不包含日期
*
* @param startTime1 需要校验的开始时间
* @param endTime1 需要校验的结束时间
* @param startTime2 校验所需的开始时间
* @param endTime2 校验所需的结束时间
* @return 是否重叠
*/
// TODO @puhui999:LocalDateTimeUtil.isOverlap() 是不是可以满足呀?
public static boolean checkTimeOverlap(LocalTime startTime1, LocalTime endTime1, LocalTime startTime2, LocalTime endTime2) {
// 判断时间是否重叠
// 开始时间在已配置时段的结束时间之前 且 结束时间在已配置时段的开始时间之后 []
return startTime1.isBefore(endTime2) && endTime1.isAfter(startTime2)
// 开始时间在已配置时段的开始时间之前 且 结束时间在已配置时段的开始时间之后 (] 或 ()
|| startTime1.isBefore(startTime2) && endTime1.isAfter(startTime2)
// 开始时间在已配置时段的结束时间之前 且 结束时间在已配值时段的结束时间之后 [) 或 ()
|| startTime1.isBefore(endTime2) && endTime1.isAfter(endTime2);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class YudaoJacksonAutoConfiguration {
@Bean
public BeanPostProcessor objectMapperBeanPostProcessor() {
return new BeanPostProcessor() {

@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (!(bean instanceof ObjectMapper)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@
import org.flowable.task.api.history.HistoricTaskInstance;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.BeanUtils;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* Bpm 任务 Convert
Expand All @@ -34,37 +31,9 @@ public interface BpmTaskConvert {

BpmTaskConvert INSTANCE = Mappers.getMapper(BpmTaskConvert.class);

/**
* 复制对象
*
* @param source 源 要复制的对象
* @param target 目标 复制到此对象
* @param <T>
*
* @return
*/
public static <T> T copy(Object source, Class<T> target) {
if (source == null || target == null) {
return null;
}
try {
T newInstance = target.getDeclaredConstructor().newInstance();
BeanUtils.copyProperties(source, newInstance);
return newInstance;
} catch (Exception e) {
throw new RuntimeException(e);
}
}

default <T, K> List<K> copyList(List<T> source, Class<K> target) {
if (null == source || source.isEmpty()) {
return Collections.emptyList();
}
return source.stream().map(e -> copy(e, target)).collect(Collectors.toList());
}

default List<BpmTaskTodoPageItemRespVO> convertList1(List<Task> tasks,
Map<String, ProcessInstance> processInstanceMap, Map<Long, AdminUserRespDTO> userMap) {
Map<String, ProcessInstance> processInstanceMap,
Map<Long, AdminUserRespDTO> userMap) {
return CollectionUtils.convertList(tasks, task -> {
BpmTaskTodoPageItemRespVO respVO = convert1(task);
ProcessInstance processInstance = processInstanceMap.get(task.getProcessInstanceId());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Schema(description = "管理后台 - 代码生成预览 Response VO,注意,每个文件都是一个该对象")
@Schema(description = "管理后台 - 代码生成预览 Response VO注意,每个文件都是一个该对象")
@Data
public class CodegenPreviewRespVO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class CodegenColumnBaseVO {
@NotNull(message = "是否为 List 查询操作的字段不能为空")
private Boolean listOperation;

@Schema(description = "List 查询操作的条件类型,参见 CodegenColumnListConditionEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "LIKE")
@Schema(description = "List 查询操作的条件类型参见 CodegenColumnListConditionEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "LIKE")
@NotNull(message = "List 查询操作的条件类型不能为空")
private String listOperationCondition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@Data
public class CodegenTableBaseVO {

@Schema(description = "生成场景,参见 CodegenSceneEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "生成场景参见 CodegenSceneEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "导入类型不能为空")
private Integer scene;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
@ToString(callSuper = true)
public class CodegenTablePageReqVO extends PageParam {

@Schema(description = "表名称,模糊匹配", example = "yudao")
@Schema(description = "表名称模糊匹配", example = "yudao")
private String tableName;

@Schema(description = "表描述,模糊匹配", example = "芋道")
@Schema(description = "表描述模糊匹配", example = "芋道")
private String tableComment;

@Schema(description = "实体,模糊匹配", example = "Yudao")
@Schema(description = "实体模糊匹配", example = "Yudao")
private String className;

@Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class ConfigExportReqVO {
@Schema(description = "参数名称", example = "模糊匹配")
private String name;

@Schema(description = "参数键名,模糊匹配", example = "yunai.db.username")
@Schema(description = "参数键名模糊匹配", example = "yunai.db.username")
private String key;

@Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1")
@Schema(description = "参数类型参见 SysConfigTypeEnum 枚举", example = "1")
private Integer type;

@Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
@ToString(callSuper = true)
public class ConfigPageReqVO extends PageParam {

@Schema(description = "数据源名称,模糊匹配", example = "名称")
@Schema(description = "数据源名称模糊匹配", example = "名称")
private String name;

@Schema(description = "参数键名,模糊匹配", example = "yunai.db.username")
@Schema(description = "参数键名模糊匹配", example = "yunai.db.username")
private String key;

@Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1")
@Schema(description = "参数类型参见 SysConfigTypeEnum 枚举", example = "1")
private Integer type;

@Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ConfigRespVO extends ConfigBaseVO {
@Size(max = 100, message = "参数键名长度不能超过100个字符")
private String key;

@Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "参数类型参见 SysConfigTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer type;

@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@ToString(callSuper = true)
public class FileConfigCreateReqVO extends FileConfigBaseVO {

@Schema(description = "存储器,参见 FileStorageEnum 枚举类参见 FileStorageEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "存储器,参见 FileStorageEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "存储器不能为空")
private Integer storage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class FileConfigPageReqVO extends PageParam {
@Schema(description = "存储器", example = "1")
private Integer storage;

@Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@Schema(description = "创建时间")
private LocalDateTime[] createTime;

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class FileConfigRespVO extends FileConfigBaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;

@Schema(description = "存储器,参见 FileStorageEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "存储器参见 FileStorageEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "存储器不能为空")
private Integer storage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
@ToString(callSuper = true)
public class FilePageReqVO extends PageParam {

@Schema(description = "文件路径,模糊匹配", example = "yudao")
@Schema(description = "文件路径模糊匹配", example = "yudao")
private String path;

@Schema(description = "文件类型,模糊匹配", example = "application/octet-stream")
@Schema(description = "文件类型模糊匹配", example = "jpg")
private String type;

@Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@Schema(description = "创建时间")
private LocalDateTime[] createTime;

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
@ToString(callSuper = true)
public class JobPageReqVO extends PageParam {

@Schema(description = "任务名称,模糊匹配", example = "测试任务")
@Schema(description = "任务名称模糊匹配", example = "测试任务")
private String name;

@Schema(description = "任务状态,参见 JobStatusEnum 枚举", example = "1")
@Schema(description = "任务状态参见 JobStatusEnum 枚举", example = "1")
private Integer status;

@Schema(description = "处理器的名字,模糊匹配", example = "sysUserSessionTimeoutJob")
@Schema(description = "处理器的名字模糊匹配", example = "sysUserSessionTimeoutJob")
private String handlerName;

}
Loading

0 comments on commit b287fdb

Please sign in to comment.