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
bd6c41e0
Commit
bd6c41e0
authored
Aug 02, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.1代码是直接调用service,需要在4.1中增加fegin接口进行适配。增加 generatePlanDistributeRecord fegin接口
parent
5ff39dc1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
1 deletion
+85
-1
ExtDistributeRecordController.java
...s/plan/core/controller/ExtDistributeRecordController.java
+15
-1
ExtDistributeRecordServiceImpl.java
...lan/core/service/impl/ExtDistributeRecordServiceImpl.java
+58
-0
ExtDistributeRecordServiceFeign.java
...yonde/dcs/plan/feign/ExtDistributeRecordServiceFeign.java
+12
-0
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtDistributeRecordController.java
View file @
bd6c41e0
package
com
.
yonde
.
dcs
.
plan
.
core
.
controller
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -32,7 +33,6 @@ public class ExtDistributeRecordController<V extends ExtDistributeRecordVO, S ex
@Autowired
private
ExtDistributeRecordService
distributeRecordService
;
/**
* 收发记录接口
*
...
...
@@ -58,6 +58,20 @@ public class ExtDistributeRecordController<V extends ExtDistributeRecordVO, S ex
public
ApiResult
searchOrgByUserId
(
@RequestParam
(
"userId"
)
Long
userId
,
@RequestParam
(
"code"
)
String
code
)
{
return
ApiResult
.
ok
(
distributeRecordService
.
searchOrgNameByUserId
(
userId
,
code
),
"查询成功"
);
}
/**
* 生成计划分发记录对象方法
*
* @param extPlanVO
* @return
*/
@ApiOperation
(
"生成计划分发记录对象方法"
)
@GetMapping
(
"/generatePlanDistributeRecord"
)
public
ApiResult
generatePlanDistributeRecord
(
@RequestBody
ExtPlanVO
extPlanVO
)
{
distributeRecordService
.
generatePlanDistributeRecord
(
extPlanVO
);
return
ApiResult
.
ok
(
"生成计划分发记录成功"
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtDistributeRecordServiceImpl.java
View file @
bd6c41e0
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.yonde.dcs.plan.common.vo.ExtDisReocredLinkVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
com.yonde.dcs.plan.core.service.ExtDisReocredLinkService
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.entity.data.OperatorType
;
import
com.yonde.dex.basedata.utils.obj.DxEntityUtils
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -18,6 +22,7 @@ import com.yonde.dcs.plan.common.vo.ExtDistributeRecordVO;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
com.yonde.dcs.plan.core.service.ExtDistributeRecordService
;
...
...
@@ -83,6 +88,59 @@ public class ExtDistributeRecordServiceImpl<V extends ExtDistributeRecordVO> imp
public
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
)
{
return
autoTaskService
.
searchOrgNameByUserId
(
userId
,
code
);
}
/**
* 生成计划分发记录对象方法
*
* @param extPlanVO
*/
@Override
public
void
generatePlanDistributeRecord
(
ExtPlanVO
extPlanVO
)
{
List
<
ExtDisReocredLinkVO
>
list
=
new
ArrayList
<>();
//创建分发记录对象
ExtDistributeRecordVO
recordVO
=
new
ExtDistributeRecordVO
();
//分发类型
recordVO
.
setDistributeType
(
"planFeedback"
);
//名称
recordVO
.
setBoTitle
(
"完成计划反馈任务"
);
//分发时间
recordVO
.
setDistributTime
(
LocalDateTime
.
now
());
recordVO
.
setDistributDepart
(
null
);
//发送者
//todo wq: 暂时将获取用户信息代码注释,后续讨论后更改
Long
userId
=
null
;
// Long userId = this.searchUserId(extPlanVO.getPlanExecutor());
// recordVO.setSenderId(extPlanVO.getCreatorId());
// //接收者(计划执行人)
// recordVO.setHandlerId(userId);
//接收时间
recordVO
.
setReceiveTime
(
LocalDateTime
.
now
());
List
<
DxOrganizationVO
>
organizationVOS
=
this
.
searchOrgNameByUserId
(
userId
,
"002"
);
//接收单位
if
(
CollectionUtils
.
isEmpty
(
organizationVOS
))
{
recordVO
.
setReceiver
(
null
);
}
else
{
for
(
DxOrganizationVO
org
:
organizationVOS
)
{
//todo wq:将org.getOrgName() 修改为 org.getName();
//org.getOrgName();
org
.
getName
();
}
recordVO
.
setReceiver
(
organizationVOS
.
get
(
0
).
getName
());
}
//是否需回复
recordVO
.
setReplyDistribute
(
"是"
);
recordVO
.
setReceiveType
(
"planFeedback"
);
ExtDisReocredLinkVO
disReocredLinkVO
=
new
ExtDisReocredLinkVO
();
//disReocredLinkVO.setTarget(DxObjectVo.class.cast(extPlanVO));
disReocredLinkVO
.
setTargetId
(
extPlanVO
.
getId
());
disReocredLinkVO
.
setTargetIdType
(
DxEntityUtils
.
getModelName
(
ExtPlanVO
.
class
));
disReocredLinkVO
.
setOperator
(
OperatorType
.
ADD
);
list
.
add
(
disReocredLinkVO
);
recordVO
.
setExtDisReocredLink
(
list
);
recordVO
.
setOperator
(
OperatorType
.
ADD
);
this
.
saveRecursion
((
V
)
recordVO
);
}
}
dcs-plan-feign/src/main/java/com/yonde/dcs/plan/feign/ExtDistributeRecordServiceFeign.java
View file @
bd6c41e0
package
com
.
yonde
.
dcs
.
plan
.
feign
;
import
com.yonde.dcs.plan.common.vo.ExtDistributeRecordVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
io.swagger.annotations.Api
;
...
...
@@ -42,4 +43,15 @@ public interface ExtDistributeRecordServiceFeign<V extends ExtDistributeRecordVO
@ApiOperation
(
"通过用户id和code查询组织"
)
@GetMapping
(
"/searchOrgByUserId"
)
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
@RequestParam
(
"userId"
)
Long
userId
,
@RequestParam
(
"code"
)
String
code
);
/**
* 生成计划分发记录对象方法
*
* @param extPlanVO
*/
@ApiOperation
(
"生成计划分发记录对象方法"
)
@GetMapping
(
"/generatePlanDistributeRecord"
)
void
generatePlanDistributeRecord
(
ExtPlanVO
extPlanVO
);
}
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