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
9534e123
Commit
9534e123
authored
Oct 09, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ICM计划绑定技术联系单功能开发
parent
c14b7cd3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
3 deletions
+57
-3
ExtICMPlanDocLinkController.java
...dcs/plan/core/controller/ExtICMPlanDocLinkController.java
+18
-0
ExtICMPlanDocLinkService.java
...yonde/dcs/plan/core/service/ExtICMPlanDocLinkService.java
+2
-0
ExtICMPlanDocLinkServiceImpl.java
.../plan/core/service/impl/ExtICMPlanDocLinkServiceImpl.java
+37
-3
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtICMPlanDocLinkController.java
View file @
9534e123
...
...
@@ -3,6 +3,8 @@ package com.yonde.dcs.plan.core.controller;
import
org.springframework.stereotype.Controller
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
java.io.IOException
;
import
java.util.List
;
import
com.yonde.dcs.plan.common.vo.ExtICMPlanDocLinkVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
...
...
@@ -13,6 +15,8 @@ import com.yonde.dcs.plan.core.service.ExtICMPlanDocLinkService;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtICMPlanDocLinkControllerShadow
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Controller
;
/**
...
...
@@ -28,6 +32,20 @@ import org.springframework.stereotype.Controller;
public
class
ExtICMPlanDocLinkController
<
V
extends
ExtICMPlanDocLinkVO
,
S
extends
ExtICMPlanDocLinkService
<
V
>>
extends
ExtICMPlanDocLinkControllerShadow
<
V
,
S
>
{
@Autowired
private
ExtICMPlanDocLinkService
extICMPlanDocLinkService
;
/**
* 导出计划
* @param sourceId 计划id
* @param targetId 技术联系单id
* @throws IOException
*/
@ApiOperation
(
value
=
"绑定计划与技术联系单的关系"
,
notes
=
"绑定计划与技术联系单的关系"
,
httpMethod
=
"GET"
)
@PostMapping
(
value
=
"/bindPlanAndDoc"
)
public
ApiResult
bindPlanAndDoc
(
@RequestParam
(
"sourceId"
)
Long
sourceId
,
@RequestParam
(
"targetId"
)
Long
targetId
)
throws
IOException
{
return
ApiResult
.
ok
(
extICMPlanDocLinkService
.
bindPlanAndDoc
(
sourceId
,
targetId
),
"绑定成功"
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtICMPlanDocLinkService.java
View file @
9534e123
...
...
@@ -16,4 +16,6 @@ import java.util.List;
**/
public
interface
ExtICMPlanDocLinkService
<
V
extends
ExtICMPlanDocLinkVO
>
extends
ExtICMPlanDocLinkServiceShadow
<
V
>
{
public
String
bindPlanAndDoc
(
Long
sourceId
,
Long
targetId
);
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtICMPlanDocLinkServiceImpl.java
View file @
9534e123
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.alibaba.excel.EasyExcel
;
import
com.yonde.dcs.plan.common.vo.ExtICMPlanExcelVO
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanExcelVO
;
import
com.yonde.dcs.plan.common.constants.Constants
;
import
com.yonde.dcs.plan.common.utils.SearchUtil
;
import
com.yonde.dcs.plan.common.vo.*
;
import
com.yonde.dcs.plan.core.listener.ICMPlanExcelListenner
;
import
com.yonde.dcs.plan.core.listener.IEDPlanExcelListenner
;
import
com.yonde.dcs.plan.core.service.ExtICMExternalInterfacePlanService
;
import
com.yonde.dcs.plan.core.service.ExtIEDPlanService
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.basedata.entity.data.OperatorType
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
com.yonde.dcs.plan.common.vo.ExtICMPlanDocLinkVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
com.yonde.dcs.plan.core.service.ExtICMPlanDocLinkService
;
import
com.yonde.dcs.plan.core.repository.ExtICMPlanDocLinkRepository
;
...
...
@@ -38,7 +46,33 @@ public class ExtICMPlanDocLinkServiceImpl<V extends ExtICMPlanDocLinkVO> impleme
@Autowired
ExtICMPlanDocLinkRepository
<
ExtICMPlanDocLink
>
extICMPlanDocLinkRepository
;
@Autowired
private
ExtICMExternalInterfacePlanService
<
ExtICMExternalInterfacePlanVO
>
extICMExternalInterfacePlanService
;
/**
* 绑定计划与技术联系单的关系,并且修改计划的状态为已打开
* @param sourceId 计划id
* @param targetId 文档id
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
bindPlanAndDoc
(
Long
sourceId
,
Long
targetId
)
{
ExtICMPlanDocLinkVO
extICMPlanDocLinkVO
=
new
ExtICMPlanDocLinkVO
();
extICMPlanDocLinkVO
.
setSourceId
(
sourceId
);
extICMPlanDocLinkVO
.
setTargetId
(
targetId
);
extICMPlanDocLinkVO
.
setOperator
(
OperatorType
.
ADD
);
this
.
saveRecursion
((
V
)
extICMPlanDocLinkVO
);
//更改计划状态未已打开
SearchQueryCondition
queryIEDPlanCondition
=
SearchUtil
.
buildQuery
(
"id"
,
SearchItem
.
Operator
.
EQ
,
sourceId
);
ExtICMExternalInterfacePlanVO
extICMPlanForDB
=
extICMExternalInterfacePlanService
.
findRecursion
(
queryIEDPlanCondition
).
getContent
().
get
(
0
);
extICMPlanForDB
.
setOperator
(
OperatorType
.
MODIFY
);
extICMPlanForDB
.
setState
(
Constants
.
OPENED
);
extICMPlanForDB
.
setPlanOpenDate
(
LocalDateTime
.
now
());
extICMExternalInterfacePlanService
.
saveRecursion
(
extICMPlanForDB
);
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