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
ada8bd82
Commit
ada8bd82
authored
Jul 26, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ExtDistributeRecordController:业务代码迁入(2.x版本->4.1版本)
parent
18ebc712
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
189 additions
and
0 deletions
+189
-0
ExtDistributeRecordController.java
...s/plan/core/controller/ExtDistributeRecordController.java
+32
-0
AutoTaskService.java
...java/com/yonde/dcs/plan/core/service/AutoTaskService.java
+19
-0
ExtDistributeRecordService.java
...nde/dcs/plan/core/service/ExtDistributeRecordService.java
+9
-0
ExtPlanService.java
.../java/com/yonde/dcs/plan/core/service/ExtPlanService.java
+12
-0
AutoTaskServiceImpl.java
...yonde/dcs/plan/core/service/impl/AutoTaskServiceImpl.java
+37
-0
ExtDistributeRecordServiceImpl.java
...lan/core/service/impl/ExtDistributeRecordServiceImpl.java
+42
-0
ExtPlanServiceImpl.java
.../yonde/dcs/plan/core/service/impl/ExtPlanServiceImpl.java
+38
-0
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtDistributeRecordController.java
View file @
ada8bd82
package
com
.
yonde
.
dcs
.
plan
.
core
.
controller
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
org.springframework.stereotype.Controller
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -27,7 +29,37 @@ import org.springframework.stereotype.Controller;
@Controller
(
ExtDistributeRecordController
.
BEAN_NAME
)
public
class
ExtDistributeRecordController
<
V
extends
ExtDistributeRecordVO
,
S
extends
ExtDistributeRecordService
<
V
>>
extends
ExtDistributeRecordControllerShadow
<
V
,
S
>
{
@Autowired
private
ExtDistributeRecordService
distributeRecordService
;
@Autowired
private
AutoTaskService
autoTaskService
;
/**
* 收发记录接口
*
* @param id
* @return
*/
@ApiOperation
(
"获取收发记录接口"
)
@GetMapping
(
"/getDisRecord"
)
public
ApiResult
getDisRecord
(
@RequestParam
(
"id"
)
Long
id
)
{
List
<
ExtDistributeRecordVO
>
disRecord
=
distributeRecordService
.
getDisRecord
(
id
);
return
ApiResult
.
ok
(
disRecord
,
"查询成功"
);
}
/**
* 通过用户id和code查询组织
*
* @param userId
* @param code
* @return
*/
@ApiOperation
(
"通过用户id和code查询组织"
)
@GetMapping
(
"/searchOrgByUserId"
)
public
ApiResult
searchOrgByUserId
(
@RequestParam
(
"userId"
)
Long
userId
,
@RequestParam
(
"code"
)
String
code
)
{
List
<
DxOrganizationVO
>
organizationVOS
=
autoTaskService
.
searchOrgNameByUserId
(
userId
,
code
);
return
ApiResult
.
ok
(
organizationVOS
,
"查询成功"
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/AutoTaskService.java
0 → 100644
View file @
ada8bd82
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
java.util.List
;
import
java.util.Map
;
/**
* @program: inet-pdm-service
* @description: 自动任务服务接口
* @author: dang wei
* @create: 2021-09-27 09:41
*/
public
interface
AutoTaskService
{
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
);
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtDistributeRecordService.java
View file @
ada8bd82
...
...
@@ -2,6 +2,9 @@ package com.yonde.dcs.plan.core.service;
import
com.yonde.dcs.plan.common.vo.ExtDistributeRecordVO
;
import
com.yonde.dcs.plan.core.service.shadow.ExtDistributeRecordServiceShadow
;
import
java.util.List
;
/**
* @description: ExtDistributeRecord-service
* @author: dexadmin
...
...
@@ -10,4 +13,10 @@ import com.yonde.dcs.plan.core.service.shadow.ExtDistributeRecordServiceShadow;
**/
public
interface
ExtDistributeRecordService
<
V
extends
ExtDistributeRecordVO
>
extends
ExtDistributeRecordServiceShadow
<
V
>
{
/**
* 获取收发记录接口
* @param id
*/
List
<
ExtDistributeRecordVO
>
getDisRecord
(
Long
id
);
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtPlanService.java
View file @
ada8bd82
...
...
@@ -2,6 +2,10 @@ package com.yonde.dcs.plan.core.service;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.core.service.shadow.ExtPlanServiceShadow
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
java.util.List
;
/**
* @description: ExtPlan-service
* @author: dexadmin
...
...
@@ -10,4 +14,12 @@ import com.yonde.dcs.plan.core.service.shadow.ExtPlanServiceShadow;
**/
public
interface
ExtPlanService
<
V
extends
ExtPlanVO
>
extends
ExtPlanServiceShadow
<
V
>
{
/**
* 通过userId和组织code获取组织信息
*
* @param userId
* @return
*/
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
);
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/AutoTaskServiceImpl.java
0 → 100644
View file @
ada8bd82
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
com.yonde.dcs.plan.core.service.ExtPlanService
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @program: inet-pdm-service
* @description: 自动任务服务接口
* @author: dang wei
* @create: 2021-09-27 09:42
*/
@Service
@Slf4j
public
class
AutoTaskServiceImpl
implements
AutoTaskService
{
@Autowired
private
ExtPlanService
extPlanService
;
/**
* 通过userId获取组织名
*
* @param userId
* @return
*/
@Override
public
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
)
{
return
extPlanService
.
searchOrgNameByUserId
(
userId
,
code
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtDistributeRecordServiceImpl.java
View file @
ada8bd82
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.yonde.dcs.plan.common.vo.ExtDisReocredLinkVO
;
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
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
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.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
com.yonde.dcs.plan.core.service.ExtDistributeRecordService
;
import
com.yonde.dcs.plan.core.repository.ExtDistributeRecordRepository
;
...
...
@@ -28,6 +38,38 @@ public class ExtDistributeRecordServiceImpl<V extends ExtDistributeRecordVO> imp
@Autowired
ExtDistributeRecordRepository
<
ExtDistributeRecord
>
extDistributeRecordRepository
;
@Autowired
private
ExtDisReocredLinkService
disRecordLink
;
@Override
public
List
<
ExtDistributeRecordVO
>
getDisRecord
(
Long
id
)
{
//通过id查询分发记录Link
List
<
ExtDisReocredLinkVO
>
disReocredLinkVOS
=
this
.
recursionDisRecordLinks
(
id
);
List
<
ExtDistributeRecordVO
>
list
=
new
ArrayList
<>();
disReocredLinkVOS
.
stream
().
forEach
(
item
->
{
list
.
add
(
item
.
getSource
());
});
return
list
;
}
/**
* 通过id查询分发记录Link
*
* @param id
*/
private
List
<
ExtDisReocredLinkVO
>
recursionDisRecordLinks
(
Long
id
)
{
SearchQueryCondition
condition
=
SearchQueryCondition
.
builder
()
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"source"
)
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"objFileLinks"
)
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"target"
).
build
()).
build
()).
build
())
.
searchItems
(
SearchItems
.
builder
()
.
item
(
new
SearchItem
(
"targetId"
,
SearchItem
.
Operator
.
EQ
,
id
,
null
)).
build
()).
build
();
DxPageImpl
recursion
=
disRecordLink
.
findRecursion
(
condition
);
if
(!
ObjectUtils
.
isEmpty
(
recursion
))
{
return
recursion
.
getContent
();
}
return
null
;
}
}
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtPlanServiceImpl.java
View file @
ada8bd82
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -29,6 +35,38 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
@Autowired
ExtPlanRepository
<
ExtPlan
>
extPlanRepository
;
/**
* 通过userId获取组织名
*
* @param userId
* @return
*/
@Override
public
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
)
{
//todo 4.1中未找到对应的userservice,业务逻辑暂时注释
// UserVO user = this.userService.get(userId);
// List<UserGroupRefVO> vos = this.userGroupRefService.findAllByUserAccount(user.getUserAccount());
// List<Long> groupIds = (List) vos.stream().filter((o) -> {
// return Objects.nonNull(o.getGroupId());
// }).map((vo) -> {
// return vo.getGroupId();
// }).collect(Collectors.toList());
// if (org.apache.commons.collections.CollectionUtils.isNotEmpty(groupIds)) {
// List<DxOrganizationVO> orgs = this.organizationService.getAllById(groupIds);
// if (org.apache.commons.collections.CollectionUtils.isEmpty(orgs)) {
// return user.getOrganizations();
// }
// List<DxOrganizationVO> organizationVOS = (List) orgs.stream().filter((org) -> {
// return OrgType.ORGANIZATION.equals(org.getOrgType());
// }).collect(Collectors.toList());
// user.setOrganizations(orgs);
// }
// List<OrganizationVO> organizationVO = this.searchOrganization(user, code);
// return organizationVO;
return
null
;
}
}
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