Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZTGK
hzsomms
Commits
4e3cfb57
Commit
4e3cfb57
authored
Aug 01, 2023
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.动静态分析-参数配置
parent
35a12266
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
6 deletions
+111
-6
DictConstant.java
...rc/main/java/org/jeecg/modules/constant/DictConstant.java
+13
-0
ConfigGradeLimitController.java
...StaticAnalysis/controller/ConfigGradeLimitController.java
+5
-4
ConfigGradeLimitServiceImpl.java
...ticAnalysis/service/impl/ConfigGradeLimitServiceImpl.java
+93
-2
No files found.
jeecg-module-system/src/main/java/org/jeecg/modules/constant/DictConstant.java
0 → 100644
View file @
4e3cfb57
package
org
.
jeecg
.
modules
.
constant
;
/**
* @Description: 通用常量
* @author: hkl
* @data: 2023-08-01 16:41:33
*/
public
class
DictConstant
{
/**
* 设备速度等级
*/
public
static
final
String
EQUIPMENT_SPEED_OPTS
=
"equipment_speed_opts"
;
}
jeecg-module-system/src/main/java/org/jeecg/modules/dynamicStaticAnalysis/controller/ConfigGradeLimitController.java
View file @
4e3cfb57
...
@@ -26,16 +26,17 @@ import java.util.List;
...
@@ -26,16 +26,17 @@ import java.util.List;
@RequestMapping
(
"/dynamicStaticAnalysis/configGradeLimit"
)
@RequestMapping
(
"/dynamicStaticAnalysis/configGradeLimit"
)
@Api
(
tags
=
"动静态分析-配置参数-单元化管理阈值"
)
@Api
(
tags
=
"动静态分析-配置参数-单元化管理阈值"
)
public
class
ConfigGradeLimitController
extends
JeecgController
<
ConfigGradeLimit
,
IConfigGradeLimitService
>
{
public
class
ConfigGradeLimitController
extends
JeecgController
<
ConfigGradeLimit
,
IConfigGradeLimitService
>
{
@AutoLog
(
value
=
"动静态分析-配置参数-轨检车检查超限权值-获取记录"
)
@ApiOperation
(
value
=
"动静态分析-配置参数-轨检车检查超限权值-获取记录"
,
notes
=
"动静态分析-配置参数-轨检车检查超限权值-获取记录"
)
@AutoLog
(
value
=
"动静态分析-配置参数-单元化管理阈值-获取记录"
)
@ApiOperation
(
value
=
"动静态分析-配置参数-单元化管理阈值-获取记录"
,
notes
=
"动静态分析-配置参数-单元化管理阈值-获取记录"
)
@GetMapping
(
value
=
"/listRecord"
)
@GetMapping
(
value
=
"/listRecord"
)
public
Result
<
List
<
ConfigGradeLimit
>>
listRecord
()
{
public
Result
<
List
<
ConfigGradeLimit
>>
listRecord
()
{
List
<
ConfigGradeLimit
>
records
=
this
.
service
.
listRecord
();
List
<
ConfigGradeLimit
>
records
=
this
.
service
.
listRecord
();
return
Result
.
OK
(
records
);
return
Result
.
OK
(
records
);
}
}
@AutoLog
(
value
=
"动静态分析-配置参数-
轨检车检查超限权
值-更新参数"
)
@AutoLog
(
value
=
"动静态分析-配置参数-
单元化管理阈
值-更新参数"
)
@ApiOperation
(
value
=
"动静态分析-配置参数-
轨检车检查超限权值-更新参数"
,
notes
=
"动静态分析-配置参数-轨检车检查超限权
值-更新参数"
)
@ApiOperation
(
value
=
"动静态分析-配置参数-
单元化管理阈值-更新参数"
,
notes
=
"动静态分析-配置参数-单元化管理阈
值-更新参数"
)
@PostMapping
(
value
=
"/updateRecord"
)
@PostMapping
(
value
=
"/updateRecord"
)
public
Result
<
String
>
updateRecord
(
@RequestBody
ConfigGradeLimit
record
)
{
public
Result
<
String
>
updateRecord
(
@RequestBody
ConfigGradeLimit
record
)
{
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/dynamicStaticAnalysis/service/impl/ConfigGradeLimitServiceImpl.java
View file @
4e3cfb57
package
org
.
jeecg
.
modules
.
dynamicStaticAnalysis
.
service
.
impl
;
package
org
.
jeecg
.
modules
.
dynamicStaticAnalysis
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.jeecg.common.util.UUIDGenerator
;
import
org.jeecg.modules.constant.DictConstant
;
import
org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigGradeLimit
;
import
org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigGradeLimit
;
import
org.jeecg.modules.dynamicStaticAnalysis.mapper.ConfigGradeLimitMapper
;
import
org.jeecg.modules.dynamicStaticAnalysis.mapper.ConfigGradeLimitMapper
;
import
org.jeecg.modules.dynamicStaticAnalysis.service.IConfigGradeLimitService
;
import
org.jeecg.modules.dynamicStaticAnalysis.service.IConfigGradeLimitService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.jeecg.modules.system.entity.SysDict
;
import
org.jeecg.modules.system.entity.SysDictItem
;
import
org.jeecg.modules.system.mapper.SysDictItemMapper
;
import
org.jeecg.modules.system.mapper.SysDictMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
/**
/**
* <p>
* <p>
...
@@ -19,9 +33,86 @@ import java.util.List;
...
@@ -19,9 +33,86 @@ import java.util.List;
@Service
@Service
public
class
ConfigGradeLimitServiceImpl
extends
ServiceImpl
<
ConfigGradeLimitMapper
,
ConfigGradeLimit
>
implements
IConfigGradeLimitService
{
public
class
ConfigGradeLimitServiceImpl
extends
ServiceImpl
<
ConfigGradeLimitMapper
,
ConfigGradeLimit
>
implements
IConfigGradeLimitService
{
@Resource
private
SysDictMapper
sysDictMapper
;
@Resource
private
SysDictItemMapper
sysDictItemMapper
;
@Override
@Override
public
List
<
ConfigGradeLimit
>
listRecord
()
{
public
List
<
ConfigGradeLimit
>
listRecord
()
{
List
<
ConfigGradeLimit
>
list
=
this
.
lambdaQuery
().
eq
(
ConfigGradeLimit:
:
getDelFlag
,
"0"
).
list
();
List
<
ConfigGradeLimit
>
records
=
this
.
lambdaQuery
().
eq
(
ConfigGradeLimit:
:
getDelFlag
,
"0"
).
list
();
return
list
;
if
(
ObjectUtil
.
isEmpty
(
records
))
{
records
=
this
.
initConfigGradeLimit
();
}
return
records
;
}
/**
* 初始化参数
*
* @return
*/
private
List
<
ConfigGradeLimit
>
initConfigGradeLimit
()
{
List
<
ConfigGradeLimit
>
result
=
new
ArrayList
<>(
64
);
// 1.动态查找速度等级
// 字典
LambdaQueryWrapper
<
SysDict
>
sysDictWrapper
=
Wrappers
.
lambdaQuery
();
sysDictWrapper
.
eq
(
SysDict:
:
getDictCode
,
DictConstant
.
EQUIPMENT_SPEED_OPTS
).
last
(
"limit 1"
);
SysDict
sysDict
=
sysDictMapper
.
selectOne
(
sysDictWrapper
);
// 字典项目
LambdaQueryWrapper
<
SysDictItem
>
sysDictItemWrapper
=
Wrappers
.
lambdaQuery
();
sysDictItemWrapper
.
eq
(
SysDictItem:
:
getDictId
,
sysDict
.
getId
());
List
<
SysDictItem
>
sysDictItems
=
sysDictItemMapper
.
selectList
(
sysDictItemWrapper
);
// 2.循环生成
// 1-钢轨 2-道岔 3-曲线 4-竖曲线
List
<
Integer
>
deviceTypeList
=
IntStream
.
range
(
1
,
5
).
boxed
().
collect
(
Collectors
.
toList
());
for
(
Integer
deviceType
:
deviceTypeList
)
{
for
(
SysDictItem
sysDictItem
:
sysDictItems
)
{
// 优良
ConfigGradeLimit
a
=
new
ConfigGradeLimit
();
a
.
setId
(
UUIDGenerator
.
generate
());
a
.
setDictLabel
(
sysDictItem
.
getItemText
());
a
.
setDictValue
(
sysDictItem
.
getItemValue
());
a
.
setDeviceType
(
deviceType
);
a
.
setGradeLevel
(
1
);
//1-优良
a
.
setGradeMin
(
0
);
a
.
setGradeMax
(
100
);
result
.
add
(
a
);
// 合格
ConfigGradeLimit
b
=
new
ConfigGradeLimit
();
b
.
setId
(
UUIDGenerator
.
generate
());
b
.
setDictLabel
(
sysDictItem
.
getItemText
());
b
.
setDictValue
(
sysDictItem
.
getItemValue
());
b
.
setDeviceType
(
deviceType
);
b
.
setGradeLevel
(
1
);
//2-合格
b
.
setGradeMin
(
100
);
b
.
setGradeMax
(
200
);
result
.
add
(
b
);
// 失格
ConfigGradeLimit
c
=
new
ConfigGradeLimit
();
c
.
setId
(
UUIDGenerator
.
generate
());
c
.
setDictLabel
(
sysDictItem
.
getItemText
());
c
.
setDictValue
(
sysDictItem
.
getItemValue
());
c
.
setDeviceType
(
deviceType
);
c
.
setGradeLevel
(
3
);
//3-失格
c
.
setGradeMin
(
200
);
c
.
setGradeMax
(
99999
);
result
.
add
(
c
);
}
}
this
.
saveBatch
(
result
);
return
result
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment