Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataWareHose
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
dataWareHose
Commits
6e686f5a
提交
6e686f5a
authored
7月 02, 2021
作者:
ww1xhqc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[数据模型] 部分优化更新
上级
16572591
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
31 行增加
和
35 行删除
+31
-35
DataWarehouseApplication.java
...java/com/tykj/datawarehouse/DataWarehouseApplication.java
+3
-0
ModelController.java
.../tykj/datawarehouse/model/controller/ModelController.java
+12
-18
QuoteController.java
.../tykj/datawarehouse/model/controller/QuoteController.java
+0
-6
RuleController.java
...m/tykj/datawarehouse/model/controller/RuleController.java
+0
-1
ConnectionType.java
...atawarehouse/model/entity/customEnums/ConnectionType.java
+6
-0
ModelHelper.java
...om/tykj/datawarehouse/model/service/impl/ModelHelper.java
+1
-1
ModelImpl.java
.../com/tykj/datawarehouse/model/service/impl/ModelImpl.java
+9
-9
没有找到文件。
src/main/java/com/tykj/datawarehouse/DataWarehouseApplication.java
浏览文件 @
6e686f5a
...
@@ -3,6 +3,9 @@ package com.tykj.datawarehouse;
...
@@ -3,6 +3,9 @@ package com.tykj.datawarehouse;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
/**
* @author HASEE
*/
@SpringBootApplication
@SpringBootApplication
public
class
DataWarehouseApplication
{
public
class
DataWarehouseApplication
{
...
...
src/main/java/com/tykj/datawarehouse/model/controller/ModelController.java
浏览文件 @
6e686f5a
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -80,9 +81,8 @@ public class ModelController {
...
@@ -80,9 +81,8 @@ public class ModelController {
Rule
rule
;
Rule
rule
;
try
{
try
{
rule
=
ruleDao
.
findAllByColumnId
(
columnInfo
.
getId
());
rule
=
ruleDao
.
findAllByColumnId
(
columnInfo
.
getId
());
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
){
throw
new
ApiException
(
"规则不唯一!"
);
throw
new
ApiException
(
"规则不唯一!"
);
}
}
columnInfo
.
setRule
(
rule
);
columnInfo
.
setRule
(
rule
);
columnInfo
.
setQuoteList
(
allQuote
);
columnInfo
.
setQuoteList
(
allQuote
);
...
@@ -99,7 +99,7 @@ public class ModelController {
...
@@ -99,7 +99,7 @@ public class ModelController {
**/
**/
@ApiOperation
(
"新增数据模型"
)
@ApiOperation
(
"新增数据模型"
)
@PostMapping
(
value
=
"/addModel"
)
@PostMapping
(
value
=
"/addModel"
)
public
ResponseEntity
addModel
(
@RequestBody
TableVO
tableVO
)
throws
Exception
{
public
ResponseEntity
addModel
(
@RequestBody
TableVO
tableVO
)
{
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
modelService
.
newTable
(
tableVO
);
modelService
.
newTable
(
tableVO
);
...
@@ -197,8 +197,8 @@ public class ModelController {
...
@@ -197,8 +197,8 @@ public class ModelController {
@ApiOperation
(
"获得获得非聚合对象example"
)
@ApiOperation
(
"获得获得非聚合对象example"
)
@GetMapping
(
"/example"
)
@GetMapping
(
"/example"
)
public
ResponseEntity
get
json
Example
(
Integer
id
)
{
public
ResponseEntity
get
JSON
Example
(
Integer
id
)
{
return
ResultUtil
.
success
(
modelHelper
.
getJsonEx
p
ample
(
id
),
return
ResultUtil
.
success
(
modelHelper
.
getJsonExample
(
id
),
"获得example成功!"
);
"获得example成功!"
);
}
}
...
@@ -227,18 +227,12 @@ public class ModelController {
...
@@ -227,18 +227,12 @@ public class ModelController {
@GetMapping
(
"/type"
)
@GetMapping
(
"/type"
)
public
ResponseEntity
type
()
{
public
ResponseEntity
type
()
{
//这代码狗都不改
//这代码狗都不改
List
<
ColumnTypeVO
>
list
=
new
ArrayList
<>();
List
<
ColumnTypeVO
>
columnTypeVOS
=
Arrays
.
asList
(
ColumnTypeVO
c1
=
new
ColumnTypeVO
(
"数字"
,
"java.lang.Integer"
,
"11"
);
new
ColumnTypeVO
(
"数字"
,
"java.lang.Integer"
,
"11"
)
ColumnTypeVO
c2
=
new
ColumnTypeVO
(
"浮点数"
,
"java.lang.Double"
,
"11"
);
,
new
ColumnTypeVO
(
"浮点数"
,
"java.lang.Double"
,
"11"
)
ColumnTypeVO
c3
=
new
ColumnTypeVO
(
"单/多行文本"
,
"java.lang.String"
,
"255"
);
,
new
ColumnTypeVO
(
"单/多行文本"
,
"java.lang.String"
,
"255"
)
ColumnTypeVO
c4
=
new
ColumnTypeVO
(
"布尔值"
,
"java.lang.Boolean"
,
"1"
);
,
new
ColumnTypeVO
(
"布尔值"
,
"java.lang.Boolean"
,
"1"
));
return
ResultUtil
.
success
(
columnTypeVOS
,
"查询成功!"
);
list
.
add
(
c1
);
list
.
add
(
c2
);
list
.
add
(
c3
);
list
.
add
(
c4
);
return
ResultUtil
.
success
(
list
,
"查询成功!"
);
}
}
}
}
src/main/java/com/tykj/datawarehouse/model/controller/QuoteController.java
浏览文件 @
6e686f5a
...
@@ -27,12 +27,6 @@ public class QuoteController {
...
@@ -27,12 +27,6 @@ public class QuoteController {
@Autowired
@Autowired
private
QuoteService
quoteService
;
private
QuoteService
quoteService
;
@Autowired
ModelImpl
model
;
@Autowired
ColumnInfoDao
columnInfoDao
;
@ApiOperation
(
"引用删除"
)
@ApiOperation
(
"引用删除"
)
@GetMapping
(
"/delete"
)
@GetMapping
(
"/delete"
)
public
ResponseEntity
deleteQuote
(
Integer
id
)
{
public
ResponseEntity
deleteQuote
(
Integer
id
)
{
...
...
src/main/java/com/tykj/datawarehouse/model/controller/RuleController.java
浏览文件 @
6e686f5a
...
@@ -4,7 +4,6 @@ import com.tykj.datawarehouse.base.result.ResultUtil;
...
@@ -4,7 +4,6 @@ import com.tykj.datawarehouse.base.result.ResultUtil;
import
com.tykj.datawarehouse.model.entity.vo.RuleVo
;
import
com.tykj.datawarehouse.model.entity.vo.RuleVo
;
import
com.tykj.datawarehouse.model.service.RuleService
;
import
com.tykj.datawarehouse.model.service.RuleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
...
src/main/java/com/tykj/datawarehouse/model/entity/customEnums/ConnectionType.java
浏览文件 @
6e686f5a
...
@@ -9,7 +9,13 @@ package com.tykj.datawarehouse.model.entity.customEnums;
...
@@ -9,7 +9,13 @@ package com.tykj.datawarehouse.model.entity.customEnums;
*/
*/
public
enum
ConnectionType
{
public
enum
ConnectionType
{
/**
* or
*/
OR
(
" or "
),
OR
(
" or "
),
/**
* and
*/
AND
(
" and "
);
AND
(
" and "
);
private
final
String
type
;
private
final
String
type
;
...
...
src/main/java/com/tykj/datawarehouse/model/service/impl/ModelHelper.java
浏览文件 @
6e686f5a
...
@@ -35,7 +35,7 @@ public class ModelHelper {
...
@@ -35,7 +35,7 @@ public class ModelHelper {
* @param tableInfoId 指定id
* @param tableInfoId 指定id
* @return json格式的数据示例
* @return json格式的数据示例
*/
*/
public
String
getJsonEx
p
ample
(
Integer
tableInfoId
)
{
public
String
getJsonExample
(
Integer
tableInfoId
)
{
/* 你要放10个元素,10/0.75+1=14 */
/* 你要放10个元素,10/0.75+1=14 */
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
TableInfo
tableInfo
=
tableInfoDao
.
findById
(
tableInfoId
)
TableInfo
tableInfo
=
tableInfoDao
.
findById
(
tableInfoId
)
...
...
src/main/java/com/tykj/datawarehouse/model/service/impl/ModelImpl.java
浏览文件 @
6e686f5a
...
@@ -167,15 +167,15 @@ public class ModelImpl implements ModelService {
...
@@ -167,15 +167,15 @@ public class ModelImpl implements ModelService {
);
);
ColumnInfo
save
=
columnInfoDao
.
save
(
columnInfo
);
ColumnInfo
save
=
columnInfoDao
.
save
(
columnInfo
);
/***/
/***/
List
<
Quote
>
quoteList
=
columnVO
.
getQuoteList
();
//
List<Quote> quoteList = columnVO.getQuoteList();
if
(
quoteList
!=
null
)
{
//
if (quoteList != null) {
for
(
Quote
quote
:
quoteList
)
{
//
for (Quote quote : quoteList) {
if
(
isNotEmpty
(
quote
.
getValue
()))
{
//
if (isNotEmpty(quote.getValue())) {
quote
.
setColumnId
(
save
.
getId
());
//
quote.setColumnId(save.getId());
quoteDao
.
save
(
quote
);
//
quoteDao.save(quote);
}
//
}
}
//
}
}
//
}
}
}
//关闭会话
//关闭会话
return
tableInfo
;
return
tableInfo
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论