Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
245fec19
提交
245fec19
authored
3月 08, 2020
作者:
马晨俊
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect
上级
21d050ce
e0f37b70
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
31 行增加
和
13 行删除
+31
-13
RuleDao.java
src/main/java/com/zjty/inspect/dao/RuleDao.java
+1
-0
RuleServiceImpl.java
...n/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
+21
-9
ExcelReader.java
src/main/java/com/zjty/inspect/utils/ExcelReader.java
+1
-0
WorkLoadUtil.java
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
+5
-1
application.properties
src/main/resources/application.properties
+3
-3
没有找到文件。
src/main/java/com/zjty/inspect/dao/RuleDao.java
浏览文件 @
245fec19
...
@@ -24,6 +24,7 @@ public interface RuleDao extends JpaRepository<Rule,String>,JpaSpecificationExec
...
@@ -24,6 +24,7 @@ public interface RuleDao extends JpaRepository<Rule,String>,JpaSpecificationExec
Rule
findAllByTargetEqualsAndTechnologyIdEquals
(
String
target
,
String
techId
);
Rule
findAllByTargetEqualsAndTechnologyIdEquals
(
String
target
,
String
techId
);
List
<
Rule
>
findAllByTargetLike
(
String
target
);
List
<
Rule
>
findAllByTargetLike
(
String
target
);
List
<
Rule
>
findAllByTarget
(
String
target
);
Rule
findByTarget
(
String
target
);
Rule
findByTarget
(
String
target
);
...
...
src/main/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
浏览文件 @
245fec19
...
@@ -2,11 +2,13 @@ package com.zjty.inspect.service.impl;
...
@@ -2,11 +2,13 @@ package com.zjty.inspect.service.impl;
import
com.zjty.inspect.dao.TechnologyDao
;
import
com.zjty.inspect.dao.TechnologyDao
;
import
com.zjty.inspect.dao.RuleDao
;
import
com.zjty.inspect.dao.RuleDao
;
import
com.zjty.inspect.entity.ExcelDataVo
;
import
com.zjty.inspect.entity.Technology
;
import
com.zjty.inspect.entity.Technology
;
import
com.zjty.inspect.entity.Rule
;
import
com.zjty.inspect.entity.Rule
;
import
com.zjty.inspect.entity.RuleQo
;
import
com.zjty.inspect.entity.RuleQo
;
import
com.zjty.inspect.service.RuleService
;
import
com.zjty.inspect.service.RuleService
;
import
com.zjty.inspect.service.TechnologyService
;
import
com.zjty.inspect.service.TechnologyService
;
import
com.zjty.inspect.utils.ExcelReader
;
import
com.zjty.inspect.utils.UUIDUtil
;
import
com.zjty.inspect.utils.UUIDUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
...
@@ -20,10 +22,7 @@ import javax.persistence.criteria.CriteriaBuilder;
...
@@ -20,10 +22,7 @@ import javax.persistence.criteria.CriteriaBuilder;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
/**
/**
* 规则库
* 规则库
...
@@ -46,12 +45,25 @@ public class RuleServiceImpl implements RuleService {
...
@@ -46,12 +45,25 @@ public class RuleServiceImpl implements RuleService {
@Override
@Override
public
void
test
()
{
public
void
test
()
{
List
<
Rule
>
rules
=
ruleDao
.
findAll
();
List
<
ExcelDataVo
>
excelDataVos
=
ExcelReader
.
readExcel
(
"C:\\Users\\Jey\\Desktop\\生成代码\\规则表.xlsx"
);
for
(
Rule
rule
:
rules
)
{
System
.
out
.
println
(
excelDataVos
);
Technology
technology
=
technologyService
.
findByid
(
rule
.
getTechnologyId
());
HashSet
<
String
>
set
=
new
HashSet
();
rule
.
setTechnologyName
(
technology
.
getTechnologyName
());
for
(
ExcelDataVo
excelDataVo
:
excelDataVos
)
{
List
<
Rule
>
rules
=
ruleDao
.
findAllByTarget
(
excelDataVo
.
getName
());
if
(
rules
==
null
||
rules
.
size
()==
0
){
set
.
add
(
excelDataVo
.
getName
());
}
}
}
ruleDao
.
saveAll
(
rules
);
for
(
String
s
:
set
)
{
Rule
rule
=
new
Rule
();
rule
.
setTechnologyName
(
"国产化依赖(支持)"
);
rule
.
setTechnologyId
(
"967a8bd0-eb27-4fb6-ba1d-1bca21cea5b4"
);
rule
.
setSuffix
(
"java"
);
rule
.
setTarget
(
s
);
rule
.
setId
(
UUIDUtil
.
getUUID
());
ruleDao
.
save
(
rule
);
}
}
}
/**
/**
...
...
src/main/java/com/zjty/inspect/utils/ExcelReader.java
浏览文件 @
245fec19
...
@@ -37,6 +37,7 @@ public class ExcelReader {
...
@@ -37,6 +37,7 @@ public class ExcelReader {
return
workbook
;
return
workbook
;
}
}
/**
/**
* 读取Excel文件内容
* 读取Excel文件内容
* @param fileName 要读取的Excel文件所在路径
* @param fileName 要读取的Excel文件所在路径
...
...
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
浏览文件 @
245fec19
...
@@ -401,7 +401,11 @@ public class WorkLoadUtil {
...
@@ -401,7 +401,11 @@ public class WorkLoadUtil {
string
.
append
(
"其中"
);
string
.
append
(
"其中"
);
}
}
for
(
TechnologyReport
technologyReport:
report
.
getTechnologyList
().
getTechnologyReports
()){
for
(
TechnologyReport
technologyReport:
report
.
getTechnologyList
().
getTechnologyReports
()){
string
.
append
(
technologyReport
.
getTechnology
()+
"修改项"
+
technologyReport
.
getTechnologyContents
().
size
()+
"个,"
);
int
size
=
technologyReport
.
getTechnologyContents
().
size
();
if
(
technologyReport
.
getTechnology
().
contains
(
"国产化依赖(支持)"
)){
size
=
report
.
getDifficultyAssessment
().
getMiddlewareDifficulty
().
getDependOnNum
();
}
string
.
append
(
technologyReport
.
getTechnology
()+
"修改项"
+
size
+
"个,"
);
}
}
report
.
getTechnologyList
().
setDes
(
string
.
substring
(
0
,
string
.
length
()-
1
)+
"。"
);
report
.
getTechnologyList
().
setDes
(
string
.
substring
(
0
,
string
.
length
()-
1
)+
"。"
);
String
type
=
""
;
String
type
=
""
;
...
...
src/main/resources/application.properties
浏览文件 @
245fec19
...
@@ -28,8 +28,8 @@ spring.jpa.open-in-view=true
...
@@ -28,8 +28,8 @@ spring.jpa.open-in-view=true
spring.jpa.properties.javax.persistence.validation.mode
=
none
spring.jpa.properties.javax.persistence.validation.mode
=
none
# spring-http-\u6587\u4EF6\u4E0A\u4F20\u76F8\u5173\u914D\u7F6E
# spring-http-\u6587\u4EF6\u4E0A\u4F20\u76F8\u5173\u914D\u7F6E
spring.servlet.multipart.max-file-size
=
2
00MB
spring.servlet.multipart.max-file-size
=
5
00MB
spring.servlet.multipart.max-request-size
=
2
00MB
spring.servlet.multipart.max-request-size
=
5
00MB
#\u914D\u7F6E\u65F6\u95F4\u683C\u5F0F
#\u914D\u7F6E\u65F6\u95F4\u683C\u5F0F
spring.jacksondate-format
=
yyyy-MM-dd HH:mm:ss
spring.jacksondate-format
=
yyyy-MM-dd HH:mm:ss
...
@@ -50,7 +50,7 @@ spring.resources.static-locations=classpath:/uploads/
...
@@ -50,7 +50,7 @@ spring.resources.static-locations=classpath:/uploads/
# mysql\u6570\u636E\u5E93\u914D\u7F6E
# mysql\u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://192.168.1.249:3306/bservice?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
#spring.datasource.url=jdbc:mysql://192.168.1.249:3306/bservice?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://
120.55.57.35
:3306/adaptation?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://
localhost
:3306/adaptation?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.datasource.password
=
root
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论