Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
68fc642e
Commit
68fc642e
authored
Mar 06, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
城燃管道相关业务提交2
parent
d0da511f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
2 deletions
+76
-2
GenStageEnum.java
...m/yeejoin/amos/boot/module/ugp/api/Enum/GenStageEnum.java
+8
-1
ProblemCodeLibController.java
...t/module/ugp/biz/controller/ProblemCodeLibController.java
+1
-0
ProblemCodeLibServiceImpl.java
...odule/ugp/biz/service/impl/ProblemCodeLibServiceImpl.java
+67
-1
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/GenStageEnum.java
View file @
68fc642e
...
@@ -19,8 +19,15 @@ public enum GenStageEnum {
...
@@ -19,8 +19,15 @@ public enum GenStageEnum {
* 监管指标类型
* 监管指标类型
*/
*/
NUM_TYPE
(
"numType"
,
"数值型"
),
NUM_TYPE
(
"numType"
,
"数值型"
),
SYMBOL_TYPE
(
"symbolType"
,
"符号型"
)
;
SYMBOL_TYPE
(
"symbolType"
,
"符号型"
)
,
/**
* 监管指标类型对应值的枚举
*/
NUM_TYPE_START
(
"NUM_TYPE_START"
,
"最小值"
),
NUM_TYPE_END
(
"NUM_TYPE_END"
,
"最大值"
),
SYMBOL_TYPE_START
(
"SYMBOL_TYPE_START"
,
"正常"
),
SYMBOL_TYPE_END
(
"SYMBOL_TYPE_END"
,
"异常"
);
private
final
String
code
;
private
final
String
code
;
private
final
String
name
;
private
final
String
name
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProblemCodeLibController.java
View file @
68fc642e
...
@@ -64,6 +64,7 @@ public class ProblemCodeLibController extends BaseController {
...
@@ -64,6 +64,7 @@ public class ProblemCodeLibController extends BaseController {
}
}
problemCodeLib
.
setIdxThresholds
(
JSON
.
toJSONString
(
idxThresholds
));
problemCodeLib
.
setIdxThresholds
(
JSON
.
toJSONString
(
idxThresholds
));
}
}
problemCodeLib
.
setCode
(
Objects
.
isNull
(
problemCodeLib
.
getSequenceNbr
())
?
problemCodeLibServiceImpl
.
getProblemCode
()
:
problemCodeLib
.
getCode
());
problemCodeLibService
.
saveOrUpdate
(
problemCodeLib
);
problemCodeLibService
.
saveOrUpdate
(
problemCodeLib
);
model
.
setSequenceNbr
(
problemCodeLib
.
getSequenceNbr
());
model
.
setSequenceNbr
(
problemCodeLib
.
getSequenceNbr
());
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProblemCodeLibServiceImpl.java
View file @
68fc642e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.GenStageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.GenStageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProblemCodeLibDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProblemCodeLibDto
;
...
@@ -13,6 +15,7 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
...
@@ -13,6 +15,7 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -32,9 +35,11 @@ public class ProblemCodeLibServiceImpl extends BaseService<ProblemCodeLibDto, Pr
...
@@ -32,9 +35,11 @@ public class ProblemCodeLibServiceImpl extends BaseService<ProblemCodeLibDto, Pr
public
IPage
<
ProblemCodeLib
>
queryProblemCodeInfoPage
(
Page
<
ProblemCodeLib
>
page
)
{
public
IPage
<
ProblemCodeLib
>
queryProblemCodeInfoPage
(
Page
<
ProblemCodeLib
>
page
)
{
LambdaQueryWrapper
<
ProblemCodeLib
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ProblemCodeLib
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
ProblemCodeLib:
:
getIsDelete
,
Boolean
.
FALSE
);
lambdaQueryWrapper
.
eq
(
ProblemCodeLib:
:
getIsDelete
,
Boolean
.
FALSE
);
lambdaQueryWrapper
.
orderByDesc
(
ProblemCodeLib:
:
getRecDate
);
Map
<
String
,
String
>
dictValueMap
=
getDictInfoMapByCode
(
unitManage
);
Map
<
String
,
String
>
dictValueMap
=
getDictInfoMapByCode
(
unitManage
);
IPage
<
ProblemCodeLib
>
problemCodeLibIPage
=
problemCodeLibMapper
.
selectPage
(
page
,
lambdaQueryWrapper
);
IPage
<
ProblemCodeLib
>
problemCodeLibIPage
=
problemCodeLibMapper
.
selectPage
(
page
,
lambdaQueryWrapper
);
problemCodeLibIPage
.
getRecords
().
forEach
(
item
->
{
problemCodeLibIPage
.
getRecords
().
forEach
(
item
->
{
item
.
setIdxThresholds
(
doDataToString
(
item
.
getIdxThresholds
(),
item
.
getIdxType
()));
item
.
setGenStage
(
GenStageEnum
.
getTypeByCode
(
item
.
getGenStage
()));
item
.
setGenStage
(
GenStageEnum
.
getTypeByCode
(
item
.
getGenStage
()));
item
.
setIdxType
(
GenStageEnum
.
getTypeByCode
(
item
.
getIdxType
()));
item
.
setIdxType
(
GenStageEnum
.
getTypeByCode
(
item
.
getIdxType
()));
item
.
setIdxUnit
(
dictValueMap
.
get
(
item
.
getIdxUnit
()));
item
.
setIdxUnit
(
dictValueMap
.
get
(
item
.
getIdxUnit
()));
...
@@ -42,10 +47,71 @@ public class ProblemCodeLibServiceImpl extends BaseService<ProblemCodeLibDto, Pr
...
@@ -42,10 +47,71 @@ public class ProblemCodeLibServiceImpl extends BaseService<ProblemCodeLibDto, Pr
return
problemCodeLibIPage
;
return
problemCodeLibIPage
;
}
}
/**
* 处理监管指标类型列表展示问题
* @param idxThresholds
* @param idxType
* @return
*/
private
String
doDataToString
(
String
idxThresholds
,
String
idxType
)
{
StringBuilder
resultString
=
new
StringBuilder
();
if
(
StringUtils
.
isNotEmpty
(
idxThresholds
))
{
List
<
Map
<
String
,
String
>>
listObject
=
JSON
.
parseObject
(
idxThresholds
,
List
.
class
);
for
(
Map
<
String
,
String
>
map
:
listObject
)
{
String
startValue
=
map
.
get
(
"startValue"
);
String
endValue
=
map
.
get
(
"endValue"
);
if
(
idxType
.
equals
(
GenStageEnum
.
NUM_TYPE
.
getCode
()))
{
resultString
.
append
(
GenStageEnum
.
NUM_TYPE_START
.
getName
()).
append
(
startValue
).
append
(
","
).
append
(
GenStageEnum
.
NUM_TYPE_END
.
getName
()).
append
(
endValue
);
}
else
if
(
idxType
.
equals
(
GenStageEnum
.
SYMBOL_TYPE
.
getCode
()))
{
resultString
.
append
(
GenStageEnum
.
SYMBOL_TYPE_START
.
getName
()).
append
(
startValue
).
append
(
","
).
append
(
GenStageEnum
.
SYMBOL_TYPE_END
.
getName
()).
append
(
endValue
);
}
}
}
return
resultString
.
toString
();
}
/**
* 列表查询全量数据
* @return
*/
public
List
<
ProblemCodeLib
>
queryProblemCodeInfoList
()
{
public
List
<
ProblemCodeLib
>
queryProblemCodeInfoList
()
{
LambdaQueryWrapper
<
ProblemCodeLib
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ProblemCodeLib
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
ProblemCodeLib:
:
getIsDelete
,
Boolean
.
FALSE
);
lambdaQueryWrapper
.
eq
(
ProblemCodeLib:
:
getIsDelete
,
Boolean
.
FALSE
);
return
problemCodeLibMapper
.
selectList
(
lambdaQueryWrapper
);
lambdaQueryWrapper
.
orderByDesc
(
ProblemCodeLib:
:
getRecDate
);
List
<
ProblemCodeLib
>
problemCodeLibs
=
problemCodeLibMapper
.
selectList
(
lambdaQueryWrapper
);
Map
<
String
,
String
>
dictValueMap
=
getDictInfoMapByCode
(
unitManage
);
problemCodeLibs
.
forEach
(
item
->
{
item
.
setIdxThresholds
(
doDataToString
(
item
.
getIdxThresholds
(),
item
.
getIdxType
()));
item
.
setGenStage
(
GenStageEnum
.
getTypeByCode
(
item
.
getGenStage
()));
item
.
setIdxType
(
GenStageEnum
.
getTypeByCode
(
item
.
getIdxType
()));
item
.
setIdxUnit
(
dictValueMap
.
get
(
item
.
getIdxUnit
()));
});
return
problemCodeLibs
;
}
/**
* 获取不重复的code
* @return
*/
public
String
getProblemCode
()
{
LambdaQueryWrapper
<
ProblemCodeLib
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
ProblemCodeLib:
:
getIsDelete
,
Boolean
.
FALSE
);
lambdaQueryWrapper
.
orderByDesc
(
ProblemCodeLib:
:
getCreateDate
);
lambdaQueryWrapper
.
last
(
"limit 1"
);
ProblemCodeLib
problemCodeLib
=
problemCodeLibMapper
.
selectOne
(
lambdaQueryWrapper
);
String
resultCode
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
problemCodeLib
))
{
if
(
problemCodeLib
.
getCode
()
!=
null
)
{
String
[]
codeNum
=
problemCodeLib
.
getCode
().
split
(
"QD"
);
long
num
=
Long
.
parseLong
(
codeNum
[
1
])
+
1
;
resultCode
=
"QD"
+
num
;
}
else
{
resultCode
=
"QD"
+
"100001"
;
}
}
else
{
resultCode
=
"QD"
+
"100001"
;
}
return
resultCode
;
}
}
/**
/**
...
...
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