|
@@ -1,5 +1,7 @@
|
|
|
package com.gis.db.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.lang.Snowflake;
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -25,6 +27,7 @@ import com.gis.db.mapper.FieldMapper;
|
|
|
import com.gis.db.service.FieldService;
|
|
|
import com.gis.db.service.TableService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.junit.Test;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -185,9 +188,14 @@ public class FieldServiceImpl extends ServiceImpl<FieldMapper, FieldEntity> impl
|
|
|
@Override
|
|
|
public Result insertRecord(RecordDto param) {
|
|
|
|
|
|
+ Long userId = baseService.getUserId();
|
|
|
+
|
|
|
String tableName = tableService.getTableName(param.getTableId());
|
|
|
|
|
|
Map<String, Object> record = param.getRecord();
|
|
|
+ // 固定添加这两个字段值
|
|
|
+ record.put("creator_id", userId);
|
|
|
+ record.put("uuid", IdUtil.simpleUUID());
|
|
|
// 字段
|
|
|
List<String> fieldList = new ArrayList<>();
|
|
|
// 字段对应的值
|
|
@@ -195,6 +203,7 @@ public class FieldServiceImpl extends ServiceImpl<FieldMapper, FieldEntity> impl
|
|
|
for (Map.Entry<String, Object> entry : record.entrySet()) {
|
|
|
fieldList.add(entry.getKey());
|
|
|
fieldData.add(entry.getValue());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
ddlMapper.insertRecord(tableName, fieldList, fieldData);
|