已删除1个文件
已修改35个文件
已添加11个文件
| | |
| | | /iailab-module-ai/ |
| | | /*/*/target/ |
| | | /.idea/ |
| | | /derby.log |
| | |
| | | package com.iailab.framework.ip.core.enums; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @AllArgsConstructor |
| | | @Getter |
| | | public enum AreaTypeEnum implements IntArrayValuable { |
| | | public enum AreaTypeEnum implements ArrayValuable { |
| | | |
| | | COUNTRY(1, "国家"), |
| | | PROVINCE(2, "省份"), |
| | |
| | | DISTRICT(4, "地区"), // 县、镇、区等 |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AreaTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(AreaTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.excel.core.util; |
| | | |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.write.handler.AbstractRowWriteHandler; |
| | | import com.iailab.framework.excel.core.handler.SelectSheetWriteHandler; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.converters.longconverter.LongStringConverter; |
| | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | EasyExcel.write(response.getOutputStream(), head) |
| | | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度 |
| | | .registerWriteHandler(new SelectSheetWriteHandler(head,false)) // 基于固定 sheet 实现下拉框 |
| | | .registerWriteHandler(new SelectSheetWriteHandler(head, false)) // 基于固定 sheet 实现下拉框 |
| | | .registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度 |
| | | .sheet(sheetName).doWrite(data); |
| | | // 设置 header 和 contentType。写在最后的原因是,避免报错时,响应 contentType 已经被修改了 |
| | |
| | | EasyExcel.write(response.getOutputStream(), head) |
| | | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度 |
| | | .registerWriteHandler(new SelectSheetWriteHandler(head,selectFlag)) // 基于固定 sheet 实现下拉框 |
| | | .registerWriteHandler(new SelectSheetWriteHandler(head, selectFlag)) // 基于固定 sheet 实现下拉框 |
| | | .registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度 |
| | | .sheet(sheetName).doWrite(data); |
| | | // 设置 header 和 contentType。写在最后的原因是,避免报错时,响应 contentType 已经被修改了 |
| | | response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, StandardCharsets.UTF_8.name())); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | } |
| | | |
| | | public static void write(HttpServletResponse response, String filename, String sheetName, |
| | | List<String> column, List<List<Object>> data) throws IOException { |
| | | |
| | | List<List<String>> head = new ArrayList<>(); |
| | | if (column != null && column.size() > 0) { |
| | | for (String columnName : column) { |
| | | List<String> item = new ArrayList<>(); |
| | | item.add(columnName); |
| | | head.add(item); |
| | | } |
| | | } |
| | | |
| | | EasyExcelFactory.write(response.getOutputStream()) |
| | | .head(head) |
| | | // handle |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .sheet(sheetName).doWrite(data); |
| | | // 设置 header 和 contentType。写在最后的原因是,避免报错时,响应 contentType 已经被修改了 |
| | | response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, StandardCharsets.UTF_8.name())); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum CommonStatusEnum implements IntArrayValuable { |
| | | public enum CommonStatusEnum implements ArrayValuable { |
| | | |
| | | ENABLE(0, "开启"), |
| | | DISABLE(1, "关闭"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(CommonStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 状态值 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum DateIntervalEnum implements IntArrayValuable { |
| | | public enum DateIntervalEnum implements ArrayValuable { |
| | | |
| | | DAY(1, "天"), |
| | | WEEK(2, "周"), |
| | |
| | | YEAR(5, "年") |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DateIntervalEnum::getInterval).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(DateIntervalEnum::getInterval).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum TerminalEnum implements IntArrayValuable { |
| | | public enum TerminalEnum implements ArrayValuable { |
| | | |
| | | UNKNOWN(0, "未知"), // 目的:在无法解析到 terminal 时,使用它 |
| | | WECHAT_MINI_PROGRAM(10, "微信小程序"), |
| | |
| | | APP(31, "手机 App"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(TerminalEnum::getTerminal).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 终端 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @AllArgsConstructor |
| | | @Getter |
| | | public enum UserTypeEnum implements IntArrayValuable { |
| | | public enum UserTypeEnum implements ArrayValuable { |
| | | |
| | | MEMBER(1, "会员"), // 面向 c 端,普通用户 |
| | | ADMIN(2, "管理员"); // 面向 b 端,管理后台 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserTypeEnum::getValue).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(UserTypeEnum::getValue).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.common.validation; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | |
| | | import javax.validation.Constraint; |
| | | import javax.validation.Payload; |
| | |
| | | /** |
| | | * @return 实现 EnumValuable 接口的 |
| | | */ |
| | | Class<? extends IntArrayValuable> value(); |
| | | Class<? extends ArrayValuable> value(); |
| | | |
| | | String message() default "必须在指定范围 {value}"; |
| | | |
| | |
| | | package com.iailab.framework.common.validation; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | |
| | | import javax.validation.ConstraintValidator; |
| | | import javax.validation.ConstraintValidatorContext; |
| | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<Integer>> { |
| | | |
| | | private List<Integer> values; |
| | | public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<?>> { |
| | | |
| | | private List<?> values; |
| | | |
| | | @Override |
| | | public void initialize(InEnum annotation) { |
| | | IntArrayValuable[] values = annotation.value().getEnumConstants(); |
| | | ArrayValuable<?>[] values = annotation.value().getEnumConstants(); |
| | | if (values.length == 0) { |
| | | this.values = Collections.emptyList(); |
| | | } else { |
| | | this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList()); |
| | | this.values = Arrays.asList(values[0].array()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean isValid(Collection<Integer> list, ConstraintValidatorContext context) { |
| | | public boolean isValid(Collection<?> list, ConstraintValidatorContext context) { |
| | | if (list == null) { |
| | | return true; |
| | | } |
| | | // 校验通过 |
| | | if (CollUtil.containsAll(values, list)) { |
| | | return true; |
| | | } |
| | | // 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值) |
| | | // 校验不通过,自定义提示语句 |
| | | context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值 |
| | | context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate() |
| | | .replaceAll("\\{value}", CollUtil.join(list, ","))).addConstraintViolation(); // 重新添加错误提示语句 |
| | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.iailab.framework.common.validation; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | |
| | | import javax.validation.ConstraintValidator; |
| | | import javax.validation.ConstraintValidatorContext; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class InEnumValidator implements ConstraintValidator<InEnum, Integer> { |
| | | public class InEnumValidator implements ConstraintValidator<InEnum, Object> { |
| | | |
| | | private List<Integer> values; |
| | | private List<?> values; |
| | | |
| | | @Override |
| | | public void initialize(InEnum annotation) { |
| | | IntArrayValuable[] values = annotation.value().getEnumConstants(); |
| | | ArrayValuable<?>[] values = annotation.value().getEnumConstants(); |
| | | if (values.length == 0) { |
| | | this.values = Collections.emptyList(); |
| | | } else { |
| | | this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList()); |
| | | this.values = Arrays.asList(values[0].array()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean isValid(Integer value, ConstraintValidatorContext context) { |
| | | public boolean isValid(Object value, ConstraintValidatorContext context) { |
| | | // 为空时,默认不校验,即认为通过 |
| | | if (value == null) { |
| | | return true; |
| | |
| | | if (values.contains(value)) { |
| | | return true; |
| | | } |
| | | // 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值) |
| | | // 校验不通过,自定义提示语句 |
| | | context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值 |
| | | context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate() |
| | | .replaceAll("\\{value}", values.toString())).addConstraintViolation(); // 重新添加错误提示语句 |
| | |
| | | |
| | | } |
| | | |
| | | |
对比新文件 |
| | |
| | | # Default ignored files |
| | | /shelf/ |
| | | /workspace.xml |
| | | # Editor-based HTTP Client requests |
| | | /httpRequests/ |
| | | # Datasource local storage ignored files |
| | | /dataSources/ |
| | | /dataSources.local.xml |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="SonarLintProjectSettings"> |
| | | <option name="moduleMapping"> |
| | | <map> |
| | | <entry key="iailab-module-ai-biz" value="yudao-module-ai-biz" /> |
| | | <entry key="iailab-spring-boot-starter-ai" value="yudao-spring-boot-starter-ai" /> |
| | | </map> |
| | | </option> |
| | | </component> |
| | | </project> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="VcsDirectoryMappings"> |
| | | <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> |
| | | </component> |
| | | </project> |
| | |
| | | package com.iailab.module.ai.api.chat; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.module.ai.enums.ApiConstants; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | // ========== AI 模型模板 ========== |
| | | ErrorCode QUESTION_TEMPLATE_NOT_EXISTS = new ErrorCode(1_040_012_001, "大模型问题模板不存在"); |
| | | ErrorCode QUESTION_PARAM_SETTING_NOT_EXISTS = new ErrorCode(1_040_012_002, "大模型问题设置参数不存在"); |
| | | ErrorCode SCHEDULE_SUGGEST_NOT_EXISTS = new ErrorCode(1_040_012_003, "大模型调度建议不存在"); |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.controller.admin.schedulesuggest; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | |
| | | import jakarta.validation.*; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | import com.iailab.module.ai.controller.admin.schedulesuggest.vo.*; |
| | | import com.iailab.module.ai.dal.dataobject.schedulesuggest.ScheduleSuggestDO; |
| | | import com.iailab.module.ai.service.schedulesuggest.ScheduleSuggestService; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Tag(name = "管理后台 - 大模型调度建议") |
| | | @RestController |
| | | @RequestMapping("/ai/schedule-suggest") |
| | | @Validated |
| | | public class ScheduleSuggestController { |
| | | |
| | | @Resource |
| | | private ScheduleSuggestService scheduleSuggestService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建大模型调度建议") |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:create')") |
| | | public CommonResult<Long> createScheduleSuggest(@Valid @RequestBody ScheduleSuggestSaveReqVO createReqVO) { |
| | | return success(scheduleSuggestService.createScheduleSuggest(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新大模型调度建议") |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:update')") |
| | | public CommonResult<Boolean> updateScheduleSuggest(@Valid @RequestBody ScheduleSuggestSaveReqVO updateReqVO) { |
| | | scheduleSuggestService.updateScheduleSuggest(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除大模型调度建议") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:delete')") |
| | | public CommonResult<Boolean> deleteScheduleSuggest(@RequestParam("id") Long id) { |
| | | scheduleSuggestService.deleteScheduleSuggest(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得大模型调度建议") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:query')") |
| | | public CommonResult<ScheduleSuggestRespVO> getScheduleSuggest(@RequestParam("id") Long id) { |
| | | ScheduleSuggestDO scheduleSuggest = scheduleSuggestService.getScheduleSuggest(id); |
| | | return success(BeanUtils.toBean(scheduleSuggest, ScheduleSuggestRespVO.class)); |
| | | } |
| | | |
| | | @PutMapping("/operate-suggest") |
| | | @Operation(summary = "采纳忽略取消采纳") |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:update')") |
| | | public CommonResult<Boolean> operateScheduleSuggest(@RequestBody ScheduleSuggestSaveReqVO updateReqVO) { |
| | | ScheduleSuggestDO scheduleSuggest = scheduleSuggestService.getScheduleSuggest(updateReqVO.getId()); |
| | | scheduleSuggest.setStatus(updateReqVO.getStatus()); |
| | | scheduleSuggestService.operateScheduleSuggest(scheduleSuggest); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/simple-list") |
| | | @Operation(summary = "获得n条大模型调度建议") |
| | | @Parameter(name = "top", description = "编号", required = true, example = "5") |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:query')") |
| | | public CommonResult<List<ScheduleSuggestRespVO>> getTopScheduleSuggests(@RequestParam("top") Long top) { |
| | | List<ScheduleSuggestDO> scheduleSuggests = scheduleSuggestService.getTopScheduleSuggests(top); |
| | | return success(BeanUtils.toBean(scheduleSuggests, ScheduleSuggestRespVO.class)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得大模型调度建议分页") |
| | | @PreAuthorize("@ss.hasPermission('ai:schedule-suggest:query')") |
| | | public CommonResult<PageResult<ScheduleSuggestRespVO>> getScheduleSuggestPage(@Valid ScheduleSuggestPageReqVO pageReqVO) { |
| | | PageResult<ScheduleSuggestDO> pageResult = scheduleSuggestService.getScheduleSuggestPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, ScheduleSuggestRespVO.class)); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.controller.admin.schedulesuggest.vo; |
| | | |
| | | import lombok.*; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import static com.iailab.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| | | |
| | | @Schema(description = "管理后台 - 大模型调度建议分页 Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class ScheduleSuggestPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "模型id", example = "5706") |
| | | private Long modelId; |
| | | |
| | | @Schema(description = "会话id", example = "3684") |
| | | private Long conversationId; |
| | | |
| | | @Schema(description = "消息id", example = "8512") |
| | | private Long messageId; |
| | | |
| | | @Schema(description = "调度建议") |
| | | private String content; |
| | | |
| | | @Schema(description = "状态(0-未处理 1-已采纳 2-已忽略)", example = "2") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "创建时间") |
| | | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| | | private LocalDateTime[] createTime; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.controller.admin.schedulesuggest.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管理后台 - 大模型调度建议 Response VO") |
| | | @Data |
| | | public class ScheduleSuggestRespVO { |
| | | |
| | | @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26874") |
| | | private Long id; |
| | | |
| | | @Schema(description = "模型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5706") |
| | | private Long modelId; |
| | | |
| | | @Schema(description = "会话id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3684") |
| | | private Long conversationId; |
| | | |
| | | @Schema(description = "消息id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8512") |
| | | private Long messageId; |
| | | |
| | | @Schema(description = "调度建议") |
| | | private String content; |
| | | |
| | | @Schema(description = "状态(0-未处理 1-已采纳 2-已忽略)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.controller.admin.schedulesuggest.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | @Schema(description = "管理后台 - 大模型调度建议新增/修改 Request VO") |
| | | @Data |
| | | public class ScheduleSuggestSaveReqVO { |
| | | |
| | | @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26874") |
| | | private Long id; |
| | | |
| | | @Schema(description = "模型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5706") |
| | | @NotNull(message = "模型id不能为空") |
| | | private Long modelId; |
| | | |
| | | @Schema(description = "会话id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3684") |
| | | @NotNull(message = "会话id不能为空") |
| | | private Long conversationId; |
| | | |
| | | @Schema(description = "消息id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8512") |
| | | @NotNull(message = "消息id不能为空") |
| | | private Long messageId; |
| | | |
| | | @Schema(description = "调度建议") |
| | | private String content; |
| | | |
| | | @Schema(description = "状态(0-未处理 1-已采纳 2-已忽略)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
| | | @NotNull(message = "状态(0-未处理 1-已采纳 2-已忽略)不能为空") |
| | | private Integer status; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.dal.dataobject.schedulesuggest; |
| | | |
| | | import lombok.*; |
| | | import java.util.*; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.iailab.framework.mybatis.core.dataobject.BaseDO; |
| | | |
| | | import static com.baomidou.mybatisplus.annotation.IdType.ASSIGN_ID; |
| | | |
| | | /** |
| | | * 大模型调度建议 DO |
| | | * |
| | | * @author 超级管理员 |
| | | */ |
| | | @TableName("ai_schedule_suggest") |
| | | @KeySequence("ai_schedule_suggest_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class ScheduleSuggestDO extends BaseDO { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(value = "id",type = ASSIGN_ID) |
| | | private Long id; |
| | | /** |
| | | * 模型id |
| | | */ |
| | | private Long modelId; |
| | | /** |
| | | * 会话id |
| | | */ |
| | | private Long conversationId; |
| | | /** |
| | | * 消息id |
| | | */ |
| | | private Long messageId; |
| | | /** |
| | | * 调度建议 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 状态(0-未处理 1-已采纳 2-已忽略) |
| | | */ |
| | | private Integer status; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.dal.mysql.schedulesuggest; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.module.ai.dal.dataobject.schedulesuggest.ScheduleSuggestDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.iailab.module.ai.controller.admin.schedulesuggest.vo.*; |
| | | |
| | | /** |
| | | * 大模型调度建议 Mapper |
| | | * |
| | | * @author 超级管理员 |
| | | */ |
| | | @Mapper |
| | | public interface ScheduleSuggestMapper extends BaseMapperX<ScheduleSuggestDO> { |
| | | |
| | | default PageResult<ScheduleSuggestDO> selectPage(ScheduleSuggestPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<ScheduleSuggestDO>() |
| | | .eqIfPresent(ScheduleSuggestDO::getModelId, reqVO.getModelId()) |
| | | .eqIfPresent(ScheduleSuggestDO::getConversationId, reqVO.getConversationId()) |
| | | .eqIfPresent(ScheduleSuggestDO::getMessageId, reqVO.getMessageId()) |
| | | .eqIfPresent(ScheduleSuggestDO::getContent, reqVO.getContent()) |
| | | .eqIfPresent(ScheduleSuggestDO::getStatus, reqVO.getStatus()) |
| | | .betweenIfPresent(ScheduleSuggestDO::getCreateTime, reqVO.getCreateTime()) |
| | | .orderByDesc(ScheduleSuggestDO::getId)); |
| | | } |
| | | |
| | | } |
| | |
| | | public PageResult<AiChatMessageDO> getChatMessagePage(AiChatMessagePageReqVO pageReqVO) { |
| | | return chatMessageMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.service.schedulesuggest; |
| | | |
| | | import jakarta.validation.*; |
| | | import com.iailab.module.ai.controller.admin.schedulesuggest.vo.*; |
| | | import com.iailab.module.ai.dal.dataobject.schedulesuggest.ScheduleSuggestDO; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 大模型调度建议 Service 接口 |
| | | * |
| | | * @author 超级管理员 |
| | | */ |
| | | public interface ScheduleSuggestService { |
| | | |
| | | /** |
| | | * 创建大模型调度建议 |
| | | * |
| | | * @param createReqVO 创建信息 |
| | | * @return 编号 |
| | | */ |
| | | Long createScheduleSuggest(@Valid ScheduleSuggestSaveReqVO createReqVO); |
| | | |
| | | /** |
| | | * 更新大模型调度建议 |
| | | * |
| | | * @param updateReqVO 更新信息 |
| | | */ |
| | | void updateScheduleSuggest(@Valid ScheduleSuggestSaveReqVO updateReqVO); |
| | | |
| | | /** |
| | | * 删除大模型调度建议 |
| | | * |
| | | * @param id 编号 |
| | | */ |
| | | void deleteScheduleSuggest(Long id); |
| | | |
| | | /** |
| | | * 获得大模型调度建议 |
| | | * |
| | | * @param id 编号 |
| | | * @return 大模型调度建议 |
| | | */ |
| | | ScheduleSuggestDO getScheduleSuggest(Long id); |
| | | |
| | | /** |
| | | * 采纳忽略取消采纳 |
| | | * |
| | | * @return 大模型调度建议 |
| | | */ |
| | | void operateScheduleSuggest(ScheduleSuggestDO scheduleSuggestDO); |
| | | |
| | | /** |
| | | * 获得n条大模型调度建议 |
| | | * |
| | | * @param top 数量 |
| | | * @return 大模型调度建议 |
| | | */ |
| | | List<ScheduleSuggestDO> getTopScheduleSuggests(Long top); |
| | | |
| | | /** |
| | | * 获得大模型调度建议分页 |
| | | * |
| | | * @param pageReqVO 分页查询 |
| | | * @return 大模型调度建议分页 |
| | | */ |
| | | PageResult<ScheduleSuggestDO> getScheduleSuggestPage(ScheduleSuggestPageReqVO pageReqVO); |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.ai.service.schedulesuggest; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import org.springframework.stereotype.Service; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import com.iailab.module.ai.controller.admin.schedulesuggest.vo.*; |
| | | import com.iailab.module.ai.dal.dataobject.schedulesuggest.ScheduleSuggestDO; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | |
| | | import com.iailab.module.ai.dal.mysql.schedulesuggest.ScheduleSuggestMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static com.iailab.module.ai.enums.ErrorCodeConstants.*; |
| | | |
| | | /** |
| | | * 大模型调度建议 Service 实现类 |
| | | * |
| | | * @author 超级管理员 |
| | | */ |
| | | @Service |
| | | @Validated |
| | | public class ScheduleSuggestServiceImpl implements ScheduleSuggestService { |
| | | |
| | | @Resource |
| | | private ScheduleSuggestMapper scheduleSuggestMapper; |
| | | |
| | | @Override |
| | | public Long createScheduleSuggest(ScheduleSuggestSaveReqVO createReqVO) { |
| | | // 插入 |
| | | ScheduleSuggestDO scheduleSuggest = BeanUtils.toBean(createReqVO, ScheduleSuggestDO.class); |
| | | scheduleSuggestMapper.insert(scheduleSuggest); |
| | | // 返回 |
| | | return scheduleSuggest.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void updateScheduleSuggest(ScheduleSuggestSaveReqVO updateReqVO) { |
| | | // 校验存在 |
| | | validateScheduleSuggestExists(updateReqVO.getId()); |
| | | // 更新 |
| | | ScheduleSuggestDO updateObj = BeanUtils.toBean(updateReqVO, ScheduleSuggestDO.class); |
| | | scheduleSuggestMapper.updateById(updateObj); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteScheduleSuggest(Long id) { |
| | | // 校验存在 |
| | | validateScheduleSuggestExists(id); |
| | | // 删除 |
| | | scheduleSuggestMapper.deleteById(id); |
| | | } |
| | | |
| | | private void validateScheduleSuggestExists(Long id) { |
| | | if (scheduleSuggestMapper.selectById(id) == null) { |
| | | throw exception(SCHEDULE_SUGGEST_NOT_EXISTS); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ScheduleSuggestDO getScheduleSuggest(Long id) { |
| | | return scheduleSuggestMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void operateScheduleSuggest(ScheduleSuggestDO scheduleSuggestDO) { |
| | | scheduleSuggestMapper.updateById(scheduleSuggestDO); |
| | | } |
| | | |
| | | @Override |
| | | public List<ScheduleSuggestDO> getTopScheduleSuggests(Long top) { |
| | | return scheduleSuggestMapper.selectList(new LambdaQueryWrapper<ScheduleSuggestDO>() |
| | | .orderByDesc(ScheduleSuggestDO::getCreateTime) |
| | | .last("limit " + top)); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<ScheduleSuggestDO> getScheduleSuggestPage(ScheduleSuggestPageReqVO pageReqVO) { |
| | | return scheduleSuggestMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmModelFormTypeEnum implements IntArrayValuable { |
| | | public enum BpmModelFormTypeEnum implements ArrayValuable { |
| | | |
| | | NORMAL(10, "流程表单"), // 对应 BpmFormDO |
| | | CUSTOM(20, "业务表单") // 业务自己定义的表单,自己进行数据的存储 |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelFormTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmModelFormTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmModelTypeEnum implements IntArrayValuable { |
| | | public enum BpmModelTypeEnum implements ArrayValuable { |
| | | |
| | | BPMN(10, "BPMN 设计器"), // https://bpmn.io/toolkit/bpmn-js/ |
| | | SIMPLE(20, "SIMPLE 设计器"); // 参考钉钉、飞书工作流的设计器 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmModelTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmSimpleModeConditionType implements IntArrayValuable { |
| | | public enum BpmSimpleModeConditionType implements ArrayValuable { |
| | | |
| | | EXPRESSION(1, "条件表达式"), |
| | | RULE(2, "条件规则"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModeConditionType::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmSimpleModeConditionType::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmSimpleModelNodeType implements IntArrayValuable { |
| | | public enum BpmSimpleModelNodeType implements ArrayValuable { |
| | | |
| | | // 0 ~ 1 开始和结束 |
| | | START_NODE(0, "开始", "startEvent"), |
| | |
| | | INCLUSIVE_BRANCH_NODE(53, "包容分支", "inclusiveGateway"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmSimpleModelNodeType::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | private final String name; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskApproveMethodEnum implements ArrayValuable { |
| | | |
| | | RANDOM(1, "随机挑选一人审批", null), |
| | | RATIO(2, "多人会签(按通过比例)", "${ nrOfCompletedInstances/nrOfInstances >= %s}"), // 会签(按通过比例) |
| | |
| | | */ |
| | | private final String completionCondition; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveMethodEnum::getMethod).toArray(Integer[]::new); |
| | | |
| | | public static BpmUserTaskApproveMethodEnum valueOf(Integer method) { |
| | | return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values()); |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskApproveTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskApproveTypeEnum implements ArrayValuable { |
| | | |
| | | USER(1), // 人工审批 |
| | | AUTO_APPROVE(2), // 自动通过 |
| | | AUTO_REJECT(3); // 自动拒绝 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements ArrayValuable { |
| | | |
| | | APPROVE(1), // 自动通过 |
| | | REJECT(2), // 自动拒绝 |
| | |
| | | ASSIGN_ADMIN(4), // 转交给流程管理员 |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements ArrayValuable { |
| | | |
| | | START_USER_AUDIT(1), // 由发起人对自己审批 |
| | | SKIP(2), // 自动跳过【参考飞书】:1)如果当前节点还有其他审批人,则交由其他审批人进行审批;2)如果当前节点没有其他审批人,则该节点自动通过 |
| | | TRANSFER_DEPT_LEADER(3); // 转交给部门负责人审批【参考飞书】:若部门负责人为空,则自动通过 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskRejectHandlerType implements IntArrayValuable { |
| | | public enum BpmUserTaskRejectHandlerType implements ArrayValuable { |
| | | |
| | | FINISH_PROCESS_INSTANCE(1, "终止流程"), |
| | | RETURN_USER_TASK(2, "驳回到指定任务节点"); |
| | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskRejectHandlerType::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskRejectHandlerType::getType).toArray(Integer[]::new); |
| | | |
| | | public static BpmUserTaskRejectHandlerType typeOf(Integer type) { |
| | | return ArrayUtil.firstMatch(item -> item.getType().equals(type), values()); |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskTimeoutHandlerTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskTimeoutHandlerTypeEnum implements ArrayValuable { |
| | | |
| | | REMINDER(1,"自动提醒"), |
| | | APPROVE(2, "自动同意"), |
| | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskTimeoutHandlerTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskTimeoutHandlerTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.task; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import com.iailab.framework.common.util.object.ObjectUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmProcessInstanceStatusEnum implements IntArrayValuable { |
| | | public enum BpmProcessInstanceStatusEnum implements ArrayValuable { |
| | | |
| | | NOT_START(-1, "未开始"), |
| | | RUNNING(1, "审批中"), |
| | |
| | | REJECT(3, "审批不通过"), |
| | | CANCEL(4, "已取消"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmProcessInstanceStatusEnum::getStatus).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmProcessInstanceStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | private final String desc; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.framework.flowable.core.enums; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmTaskCandidateStrategyEnum implements IntArrayValuable { |
| | | public enum BpmTaskCandidateStrategyEnum implements ArrayValuable { |
| | | |
| | | ROLE(10, "角色"), |
| | | DEPT_MEMBER(20, "部门的成员"), // 包括负责人 |
| | |
| | | ASSIGN_EMPTY(1, "审批人为空"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmTaskCandidateStrategyEnum::getStrategy).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmTaskCandidateStrategyEnum::getStrategy).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping(PREFIX + "/predict-data/tn-value") |
| | | @Operation(summary = "根据预测时间获取T+N预测值") |
| | | List<MdkPredictDataDTO> getPredictTnValue(PredictTnValueReqVO reqVO); |
| | | List<MdkPredictDataDTO> getPredictTnValue(@RequestBody PredictTnValueReqVO reqVO); |
| | | |
| | | @GetMapping(PREFIX + "/predict/model/setting/update") |
| | | @Operation(summary = "修改预测模型配置") |
| | |
| | | |
| | | private String outId; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | private long startTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | private long endTime; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<MdkPredictDataDTO> getPredictTnValue(PredictTnValueReqVO reqVO) { |
| | | List<DataValueVO> list = mmItemResultService.getPredictValue(reqVO.getOutId(), reqVO.getStartTime(), reqVO.getEndTime()); |
| | | List<DataValueVO> list = mmItemResultService.getPredictValue(reqVO.getOutId(), new Date(reqVO.getStartTime()), new Date(reqVO.getEndTime())); |
| | | return ConvertUtils.sourceToTarget(list, MdkPredictDataDTO.class); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/predict-data/tn-value") |
| | | @Operation(summary = "获取T+N预测数据") |
| | | public CommonResult<List<MdkPredictDataDTO>> getPredictTnValue(PredictTnValueReqVO reqVO) { |
| | | public CommonResult<List<MdkPredictDataDTO>> getPredictTnValue(@RequestBody PredictTnValueReqVO reqVO) { |
| | | List<MdkPredictDataDTO> list = mcsApi.getPredictTnValue(reqVO); |
| | | return success(list); |
| | | } |
| | |
| | | ROW_NUMBER() OVER ( PARTITION BY schedule_obj ORDER BY schedule_time DESC ) AS rn |
| | | FROM t_st_schedule_suggest |
| | | WHERE schedule_obj in |
| | | ('BFG_ALARM', 'COG_ALARM', 'LDG1_ALARM', 'LDG2_ALARM', 'LDGt_ALARM') |
| | | ('BFG_FLOW_WARNING_ALARM', 'COG_ALARM', 'LDG1', 'LDG2', 'LDGt') |
| | | and schedule_time >= DATE_SUB(NOW(), INTERVAL 15 MINUTE )) |
| | | SELECT * |
| | | FROM t_st_schedule_suggest |
| | |
| | | package com.iailab.module.system.enums.permission; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum DataScopeEnum implements IntArrayValuable { |
| | | public enum DataScopeEnum implements ArrayValuable { |
| | | |
| | | ALL(1), // 全部数据权限 |
| | | |
| | |
| | | */ |
| | | private final Integer scope; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DataScopeEnum::getScope).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(DataScopeEnum::getScope).toArray(Integer[]::new); |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.system.enums.sms; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum SmsSceneEnum implements IntArrayValuable { |
| | | public enum SmsSceneEnum implements ArrayValuable { |
| | | |
| | | MEMBER_LOGIN(1, "user-sms-login", "会员用户 - 手机号登陆"), |
| | | MEMBER_UPDATE_MOBILE(2, "user-update-mobile", "会员用户 - 修改手机"), |
| | |
| | | |
| | | ADMIN_MEMBER_LOGIN(21, "admin-sms-login", "后台用户 - 手机号登录"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SmsSceneEnum::getScene).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(SmsSceneEnum::getScene).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 验证场景的编号 |
| | |
| | | private final String description; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.system.enums.social; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum SocialTypeEnum implements IntArrayValuable { |
| | | public enum SocialTypeEnum implements ArrayValuable { |
| | | |
| | | /** |
| | | * Gitee |
| | |
| | | */ |
| | | WECHAT_MINI_APP(34, "WECHAT_MINI_APP"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SocialTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(SocialTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | private final String source; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | <artifactId>iailab-common-monitor</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- <!– 三方云服务相关 –>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.xingyuv</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-justauth</artifactId> <!– 社交登陆(例如说,个人微信、企业微信等等) –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.aliyun</groupId>--> |
| | | <!-- <artifactId>aliyun-java-sdk-core</artifactId> <!– 短信(阿里云) –>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.aliyun</groupId>--> |
| | | <!-- <artifactId>aliyun-java-sdk-dysmsapi</artifactId> <!– 短信(阿里云) –>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.tencentcloudapi</groupId>--> |
| | | <!-- <artifactId>tencentcloud-sdk-java-sms</artifactId> <!– 短信(腾讯云) –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.xingyuv</groupId> |
| | | <artifactId>spring-boot-starter-captcha-plus</artifactId> <!-- 验证码,一般用于登录使用 --> |
| | |
| | | <!-- 设置构建的 jar 包名 --> |
| | | <finalName>${project.artifactId}</finalName> |
| | | <plugins> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>com.github.wvengen</groupId>--> |
| | | <!-- <artifactId>proguard-maven-plugin</artifactId>--> |
| | | <!-- <version>2.7.0</version>--> |
| | | <!-- <executions>--> |
| | | <!-- <!– 以下配置说明执行mvn的package命令时候,会执行proguard–>--> |
| | | <!-- <execution>--> |
| | | <!-- <phase>package</phase>--> |
| | | <!-- <goals>--> |
| | | <!-- <goal>proguard</goal>--> |
| | | <!-- </goals>--> |
| | | <!-- </execution>--> |
| | | <!-- </executions>--> |
| | | <!-- <configuration>--> |
| | | <!-- <!– 就是输入Jar的名称,我们要知道,代码混淆其实是将一个原始的jar,生成一个混淆后的jar,那么就会有输入输出。 –>--> |
| | | <!-- <injar>${project.build.finalName}.jar</injar>--> |
| | | <!-- <!– 输出jar名称,输入输出jar同名的时候就是覆盖,也是比较常用的配置。 –>--> |
| | | <!-- <outjar>${project.build.finalName}.jar</outjar>--> |
| | | <!-- <!– 是否混淆 默认是true –>--> |
| | | <!-- <obfuscate>true</obfuscate>--> |
| | | <!-- <putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>--> |
| | | <!-- <!– 配置一个文件,通常叫做proguard.cfg,该文件主要是配置options选项,也就是说使用proguard.cfg那么options下的所有内容都可以移到proguard.cfg中 –>--> |
| | | <!-- <proguardInclude>${project.basedir}/proguard.cfg</proguardInclude>--> |
| | | <!-- <!– 额外的jar包,通常是项目编译所需要的jar –>--> |
| | | <!-- <libs>--> |
| | | <!-- <lib>${java.home}/lib/rt.jar</lib>--> |
| | | <!-- <lib>${java.home}/lib/jce.jar</lib>--> |
| | | <!-- <lib>${java.home}/lib/jsse.jar</lib>--> |
| | | <!-- </libs>--> |
| | | <!-- <!– 对输入jar进行过滤比如,如下配置就是对META-INFO文件不处理。 –>--> |
| | | <!-- <inLibsFilter>!META-INF/**,!META-INF/versions/9/**.class</inLibsFilter>--> |
| | | <!-- <!– 这是输出路径配置,但是要注意这个路径必须要包括injar标签填写的jar –>--> |
| | | <!-- <outputDirectory>${project.basedir}/target</outputDirectory>--> |
| | | <!-- <!–这里特别重要,此处主要是配置混淆的一些细节选项,比如哪些类不需要混淆,哪些需要混淆–>--> |
| | | <!-- <options>--> |
| | | <!-- <!– 可以在此处写option标签配置,不过我上面使用了proguardInclude,故而我更喜欢在proguard.cfg中配置 –>--> |
| | | <!-- </options>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <!-- 步骤1:在prepare-package阶段加密YAML文件 --> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | <version>3.0.0</version> |
| | | <executions> |
| | | <execution> |
| | | <id>encrypt-yaml-files</id> |
| | | <phase>prepare-package</phase> |
| | | <goals> |
| | | <goal>run</goal> |
| | | </goals> |
| | | <configuration> |
| | | <target> |
| | | <!-- 对target/classes下的所有YAML文件进行Base64编码(实际使用应替换为加密算法) --> |
| | | <echo message="Encrypting YAML files..." /> |
| | | <apply executable="base64" dest="${project.build.outputDirectory}" verbose="true"> |
| | | <fileset dir="${project.build.outputDirectory}" includes="**/*.yml, **/*.yaml"/> |
| | | <mapper type="glob" from="*" to="*" /> |
| | | <srcfile/> |
| | | </apply> |
| | | <!-- 实际项目中应使用Java/Groovy脚本实现加密 --> |
| | | </target> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <!-- 步骤2:使用ProGuard混淆代码 --> |
| | | <plugin> |
| | | <groupId>com.github.wvengen</groupId> |
| | | <artifactId>proguard-maven-plugin</artifactId> |
| | | <version>2.7.0</version> |
| | | <executions> |
| | | <!-- 以下配置说明执行mvn的package命令时候,会执行proguard--> |
| | | <execution> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>proguard</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | <configuration> |
| | | <!-- 就是输入Jar的名称,我们要知道,代码混淆其实是将一个原始的jar,生成一个混淆后的jar,那么就会有输入输出。 --> |
| | | <injar>${project.build.finalName}.jar</injar> |
| | | <!-- 输出jar名称,输入输出jar同名的时候就是覆盖,也是比较常用的配置。 --> |
| | | <outjar>${project.build.finalName}.jar</outjar> |
| | | <!-- 是否混淆 默认是true --> |
| | | <obfuscate>true</obfuscate> |
| | | <putLibraryJarsInTempDir>true</putLibraryJarsInTempDir> |
| | | <!-- 配置一个文件,通常叫做proguard.cfg,该文件主要是配置options选项,也就是说使用proguard.cfg那么options下的所有内容都可以移到proguard.cfg中 --> |
| | | <proguardInclude>${project.basedir}/proguard.cfg</proguardInclude> |
| | | <!-- 额外的jar包,通常是项目编译所需要的jar --> |
| | | <libs> |
| | | <lib>${java.home}/lib/rt.jar</lib> |
| | | <lib>${java.home}/lib/jce.jar</lib> |
| | | <lib>${java.home}/lib/jsse.jar</lib> |
| | | </libs> |
| | | <!-- 对输入jar进行过滤比如,如下配置就是对META-INFO文件不处理。 --> |
| | | <inLibsFilter>!META-INF/**,!META-INF/versions/9/**.class</inLibsFilter> |
| | | <!-- 这是输出路径配置,但是要注意这个路径必须要包括injar标签填写的jar --> |
| | | <outputDirectory>${project.basedir}/target</outputDirectory> |
| | | <!--这里特别重要,此处主要是配置混淆的一些细节选项,比如哪些类不需要混淆,哪些需要混淆--> |
| | | <options> |
| | | <!-- 可以在此处写option标签配置,不过我上面使用了proguardInclude,故而我更喜欢在proguard.cfg中配置 --> |
| | | </options> |
| | | </configuration> |
| | | </plugin> |
| | | <!-- 打包 --> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | |
| | | @Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" + |
| | | "在多租户的场景下,会只返回租户所在套餐有的菜单") |
| | | public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() { |
| | | List<MenuDO> list = menuService.getMenuListByTenant( |
| | | new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); |
| | | List<MenuDO> list = menuService.getMenuListByTenant(new MenuListReqVO()); |
| | | list.sort(Comparator.comparing(MenuDO::getSort)); |
| | | return success(BeanUtils.toBean(list, MenuSimpleRespVO.class)); |
| | | } |