Compare commits

...

2 Commits

@ -3,7 +3,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:13306/sz_admin_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Yanfa2023@
password: 123456
hikari:
#连接池名
pool-name: HikariCP

@ -1,7 +1,7 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/sz_admin_preview?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://127.0.0.1:13306/sz_admin_preview?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:

@ -3,7 +3,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:13306/sz_admin_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Yanfa2023@
password: 123456
hikari:
#连接池名
pool-name: HikariCP

@ -3,7 +3,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:13306/sz_admin_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Yanfa2023@
password: 123456
hikari:
#连接池名
pool-name: HikariCP

@ -47,11 +47,13 @@ public class FileController {
}
@GetMapping("/getFile")
@SaIgnore
public ApiResult<FileStorageDTO> getFile(@RequestParam("id") String id) {
return fileService.getFile(id);
}
@PostMapping("/saveFile")
@SaIgnore
public ApiResult<FileStorageDTO> saveFile(@RequestParam("file") MultipartFile file) {
return fileService.saveFile(file);
}

@ -29,6 +29,11 @@ public class ModelContentDTO {
*/
private String id;
/**
*
*/
private Integer modelIndex=99;
/**
*
*/

@ -1,11 +1,14 @@
package com.sz.admin.monitor.pojo.dto.dataModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author xq
* @description:
@ -32,4 +35,12 @@ public class UserModelContentDTO {
*
*/
private String modelContentId;
/**
*
*/
private Date addTime;
/**
*
*/
private Date updateTime;
}

@ -18,7 +18,7 @@ import lombok.NoArgsConstructor;
* @author xq
* @date 2026/1/29 11:32
*/
@Table("ry_model_content")
@Table("ry_canvas_cfg")
@Schema(description = "画布配置数据对象")
@Data
@Builder

@ -34,6 +34,12 @@ public class ModelContentDO {
@Schema(description = "模型id")
private String id;
/**
*
*/
@Schema(description = "模型索引")
private Integer modelIndex=99;
/**
*
*/
@ -107,6 +113,7 @@ public class ModelContentDO {
private String events;
public static final String ID = "id";
public static final String MODEL_INDEX = "model_index";
public static final String TITLE = "title";
public static final String TYPE = "type";
public static final String BINFO = "binfo";

@ -10,6 +10,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @description:
@ -44,6 +45,16 @@ public class UserModelContentDO implements Serializable {
*/
@Schema(description = "模型内容")
private String modelContentId;
/**
*
*/
@Schema(description = "添加时间")
private Date addTime;
/**
*
*/
@Schema(description = "修改时间")
private Date updateTime;
public static final String ID="id";
public static final String USER_ID="user_id";

@ -114,7 +114,13 @@ public class DataModelServiceImpl {
.map(item -> item.getModelContentId())
.collect(Collectors.toList());
List<ModelContentDO> modelContentDOS = modelContentService.listByIds(collect);
List<ModelContentDO> modelContentDOS = modelContentService.list(QueryWrapper.create()
.from(ModelContentDO.class)
.in(ModelContentDO.ID, collect)
.orderBy(ModelContentDO.MODEL_INDEX, true)
);
// List<ModelContentDO> modelContentDOS = modelContentService.listByIds(collect);
for (ModelContentDO modelContentDO : modelContentDOS) {
objects.add(ModelContentDO.doConvertDTO(modelContentDO));
}
@ -175,8 +181,12 @@ public class DataModelServiceImpl {
throw new IllegalArgumentException("传值错误");
CanvasCfgDTO canvasCfg = dataModelDTO.getCanvasCfg();
GridCfgDTO gridCfg = dataModelDTO.getGridCfg();
List<ModelContentDTO> json = dataModelDTO.getJson();
List<ModelContentDTO> json=new ArrayList<>();
for (int i = 0; i < dataModelDTO.getJson().size(); i++) {
ModelContentDTO modelContentDTO = dataModelDTO.getJson().get(i);
modelContentDTO.setModelIndex(i);
json.add(modelContentDTO);
}
//保存、更新面板
canvasCfg.setUserId(userId);
canvasCfgService.saveOrUpdateCanvas(canvasCfg);
@ -209,11 +219,6 @@ public class DataModelServiceImpl {
.from(UserModelContentDO.class)
.eq(UserModelContentDO.USER_ID, userId)
.eq(UserModelContentDO.MENU_TYPE, dataModelDTO.getMenuType()));
// userModelContentService.remove(new QueryWrapper<UserModelContentDO>()
// .eq(UserModelContentDO.USER_ID, userId) //先写死
// .eq(UserModelContentDO.MENU_TYPE, dataModelDTO.getMenuType()));
return ApiResult.success();
}

@ -60,14 +60,6 @@ public class ModelContentServiceImpl extends ServiceImpl<ModelContentMapper, Mod
.limit(1);
List<UserModelContentDO> doList = userModelContentService.list(queryWrapper);
// List<UserModelContentDO> doList = userModelContentService.list(new QueryWrapper<UserModelContentDO>()
// .eq(UserModelContentDO.MODEL_CONTENT_ID, modelContentDO.getId())
// .eq(UserModelContentDO.MENU_TYPE, menuType)
// .orderByDesc(UserModelContentDO.ID)
// .last("limit 1")
// );
if (CollectionUtil.isEmpty(doList))
modelContentDO.setId(null);
else

@ -7,6 +7,7 @@ create table ry_user_model_content
) comment '用户模型关系';
-- auto-generated definition
create table ry_model_content
(
id varchar(32) not null comment '模型id'
@ -14,7 +15,7 @@ create table ry_model_content
title varchar(32) null comment '模型名称',
type varchar(32) null comment '模型类型',
binfo varchar(128) null comment '位置json',
resize tinyint(1) null comment '调整大小',
resize tinyint(1) null comment '调整大小(bool)',
rotate tinyint(1) null comment '旋转',
`lock` tinyint(1) null comment '锁定',
active tinyint(1) null comment '动作(bool)',
@ -22,7 +23,8 @@ create table ry_model_content
props varchar(128) null comment '属性(json)',
tag varchar(128) null comment 'vue组件名称',
common_animations varchar(128) null comment '动画(json)',
events varchar(128) null comment '事件'
events varchar(128) null comment '事件',
`index` int null comment '索引'
)
comment '模型内容';

Loading…
Cancel
Save