Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-plan
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
INET-TWO
server
dcs-plan
Commits
f38ddacc
Commit
f38ddacc
authored
Oct 10, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改tapd bug
【ID1010954】【项目中心】IED计划:实际开始时间,根据规则自动取值; 【ID1010966】【项目中心】IED计划:导入新增时,需要校验,下列三个编号都得是唯一的
parent
43ce681e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
4 deletions
+54
-4
IEDPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
+48
-2
ExtIEDPlanServiceImpl.java
...nde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
+6
-2
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
View file @
f38ddacc
...
...
@@ -145,12 +145,26 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
if
(!
operationList
.
contains
(
extIEDPlanExcelVO
.
getOperation
()))
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的操作符无法识别!!"
);
errorList
.
add
(
errorString
);
return
;
}
//文件代号不能为空
if
(
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getFileCode
())){
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的文件代号不能为空!!"
);
errorList
.
add
(
errorString
);
return
;
}
//管理系统编码不能为空
if
(
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getSystemNumber
())){
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的管理信息系统编码不能为空!!"
);
errorList
.
add
(
errorString
);
return
;
}
//如果是新增,查看一下数据库中是不是已经存在
if
(
Constants
.
EXCEL_ADD
.
equals
(
extIEDPlanExcelVO
.
getOperation
()))
{
ExtIEDPlanVO
extIEDPlanVO
=
getIEDPlanByFileNumber
(
extIEDPlanExcelVO
.
getFileNumber
());
//文件编码、文件代号、管理系统编码只要有一个存在就不能新增。
ExtIEDPlanVO
extIEDPlanVO
=
getIEDPlanByFileNumberAndFileCodeAndSystemNumber
(
extIEDPlanExcelVO
.
getFileNumber
(),
extIEDPlanExcelVO
.
getFileCode
(),
extIEDPlanExcelVO
.
getSystemNumber
());
if
(!
ObjectUtils
.
isEmpty
(
extIEDPlanVO
))
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行,新增IED计划的文件编号
:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"
已存在,不能重复添加!"
);
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行,新增IED计划的文件编号
、文件代号或者管理信息系统编码
已存在,不能重复添加!"
);
errorList
.
add
(
errorString
);
}
}
else
if
(
Constants
.
EXCEL_DELETE
.
equals
(
extIEDPlanExcelVO
.
getOperation
())){
...
...
@@ -225,6 +239,38 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
return
null
;
}
/**
* 查询系统中文件编码、文件代号、管理系统编码是否存在,保证数据在数据库中是唯一。
* @param fileNumber
* @param fileCode
* @param systemNumber
* @return
*/
public
ExtIEDPlanVO
getIEDPlanByFileNumberAndFileCodeAndSystemNumber
(
String
fileNumber
,
String
fileCode
,
String
systemNumber
)
{
SearchQueryCondition
searchQuery
=
SearchQueryCondition
.
builder
().
searchItems
(
SearchItems
.
builder
().
child
(
SearchItems
.
builder
()
.
item
(
new
SearchItem
(
"fileNumber"
,
SearchItem
.
Operator
.
EQ
,
fileNumber
,
(
Object
)
null
))
.
item
(
new
SearchItem
(
"fileCode"
,
SearchItem
.
Operator
.
EQ
,
fileCode
,
(
Object
)
null
))
.
item
(
new
SearchItem
(
"systemNumber"
,
SearchItem
.
Operator
.
EQ
,
systemNumber
,
(
Object
)
null
))
.
operator
(
SearchItems
.
BooleanOperator
.
OR
).
build
())
.
item
(
new
SearchItem
(
"dxContextId"
,
SearchItem
.
Operator
.
EQ
,
projectId
,
(
Object
)
null
)).
operator
(
SearchItems
.
BooleanOperator
.
AND
).
build
()
).
build
();
//根据文件编号查询IED计划
// DxPageImpl<ExtIEDPlanVO> IEDPlanPage = extIEDPlanService.findRecursion(SearchUtil.buildQuery("fileNumber", SearchItem.Operator.EQ, fileNumber));
DxPageImpl
<
ExtIEDPlanVO
>
IEDPlanPage
=
extIEDPlanService
.
findRecursion
(
searchQuery
);
if
(!
CollectionUtils
.
isEmpty
(
IEDPlanPage
.
getContent
()))
{
ExtIEDPlanVO
extIEDPlanVOForDB
=
DxPageUtils
.
getFirst
(
IEDPlanPage
);
return
extIEDPlanVOForDB
;
}
else
{
log
.
info
(
"根据计划的文件编码:{},未查到相关计划"
,
fileNumber
);
}
return
null
;
}
/**
* 根据fileNumber查询已经删除的计划
* @param fileNumber
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
View file @
f38ddacc
...
...
@@ -211,8 +211,12 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
extIEDPlanDocLinkVO
.
setSourceId
(
extIEDPlanVO
.
getId
());
extIEDPlanDocLinkVO
.
setOperator
(
OperatorType
.
ADD
);
extIEDPlanDocLinkService
.
saveRecursion
(
extIEDPlanDocLinkVO
);
//修改计划的实际开始时间
DxPageImpl
<
V
>
dxPage
=
this
.
findRecursion
(
SearchUtil
.
buildQuery
(
"id"
,
SearchItem
.
Operator
.
EQ
,
extIEDPlanVO
.
getId
()));
ExtIEDPlanVO
extIEDPlanForDB
=
dxPage
.
getContent
().
get
(
0
);
extIEDPlanForDB
.
setOperator
(
OperatorType
.
MODIFY
);
extIEDPlanForDB
.
setActualStartTime
(
LocalDateTime
.
now
());
this
.
saveRecursion
((
V
)
extIEDPlanForDB
);
return
ApiResult
.
SUCCESS
;
}
...
...
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