Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work_service
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
licc
work_service
Commits
3e08e172
Commit
3e08e172
authored
Feb 03, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
508c9b38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
8 deletions
+31
-8
WorkProjectMapper.java
.../src/main/java/cn/wisenergy/mapper/WorkProjectMapper.java
+4
-0
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+18
-0
WorkProjectService.java
...rc/main/java/cn/wisenergy/service/WorkProjectService.java
+2
-2
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+4
-3
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+3
-3
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkProjectMapper.java
View file @
3e08e172
...
...
@@ -2,6 +2,7 @@ package cn.wisenergy.mapper;
import
cn.wisenergy.model.app.WorkProject
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -22,4 +23,7 @@ public interface WorkProjectMapper extends BaseMapper<WorkProject> {
* @return
*/
List
<
WorkProject
>
getProjectsByCriteria
(
Map
<
String
,
Object
>
map
);
List
<
WorkProject
>
getProjectsByIds
(
@Param
(
"ids"
)
List
<
Integer
>
ids
,
@Param
(
"isConclusion"
)
Integer
isConclusion
);
}
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
3e08e172
...
...
@@ -57,5 +57,23 @@
</if>
</where>
</select>
<select
id=
"getProjectsByIds"
resultType=
"cn.wisenergy.model.app.WorkProject"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"table"
/>
<where>
<if
test=
"ids != null"
>
AND id IN
<foreach
collection=
"ids"
item=
"id"
separator=
","
open=
"("
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"null !=isConclusion"
>
AND is_conclusion = #{isConclusion}
</if>
</where>
</select>
</mapper>
wisenergy-service/src/main/java/cn/wisenergy/service/WorkProjectService.java
View file @
3e08e172
...
...
@@ -23,7 +23,7 @@ public interface WorkProjectService {
WorkProject
getById
(
Integer
id
);
List
<
WorkProject
>
getNameById
(
List
<
Integer
>
ids
);
List
<
WorkProject
>
getNameById
s
(
List
<
Integer
>
ids
,
Integer
isConclusion
);
/**
...
...
@@ -31,7 +31,7 @@ public interface WorkProjectService {
* @param id
* @return
*/
List
<
ProjectDto
>
getByManagerId
(
Integer
id
);
List
<
ProjectDto
>
getByManagerId
(
Integer
id
,
Integer
isConclusion
);
/**
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
3e08e172
...
...
@@ -69,12 +69,12 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
@Override
public
List
<
WorkProject
>
getNameById
(
List
<
Integer
>
ids
)
{
public
List
<
WorkProject
>
getNameById
s
(
List
<
Integer
>
ids
,
Integer
isConclusion
)
{
log
.
info
(
"WorkProjectServiceImpl[]getNameById[]input.param.ids:"
+
ids
);
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
null
;
}
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
selectBatchIds
(
ids
);
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
getProjectsByIds
(
ids
,
isConclusion
);
if
(
CollectionUtils
.
isEmpty
(
workProjects
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
MANAGER_NOT_PROJECT
);
}
...
...
@@ -88,13 +88,14 @@ public class WorkProjectServiceImpl implements WorkProjectService {
* @return dto
*/
@Override
public
List
<
ProjectDto
>
getByManagerId
(
Integer
id
)
{
public
List
<
ProjectDto
>
getByManagerId
(
Integer
id
,
Integer
isConclusion
)
{
log
.
info
(
"WorkProjectServiceImpl[]getByManagerId[]input.param.id:"
+
id
);
if
(
null
==
id
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
QueryWrapper
<
WorkProject
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"manager_id"
,
id
);
wrapper
.
eq
(
"is_conclusion"
,
isConclusion
);
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
selectList
(
wrapper
);
if
(!
CollectionUtils
.
isEmpty
(
workProjects
))
{
return
workProjectToDto
(
workProjects
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
3e08e172
...
...
@@ -539,7 +539,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 2.获取可审批的项目
if
(
0
!=
user
.
getLevel
())
{
List
<
ProjectManagerDto
>
projectManagerDtos
=
new
ArrayList
<>();
List
<
ProjectDto
>
projectDtos
=
workProjectService
.
getByManagerId
(
userId
);
List
<
ProjectDto
>
projectDtos
=
workProjectService
.
getByManagerId
(
userId
,
1
);
if
(!
CollectionUtils
.
isEmpty
(
projectDtos
))
{
QueryWrapper
<
WorkTimeOrder
>
wrapper
=
new
QueryWrapper
<>();
List
<
Integer
>
projectIds
=
new
ArrayList
<>();
...
...
@@ -600,8 +600,8 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
String
deptManagerName
=
workUserService
.
getById
(
workDeptService
.
getById
(
deptId
).
getDeptManagerId
()).
getName
();
// 2.获取可填报的类型
List
<
ProjectInfoDto
>
projectList
=
new
ArrayList
<>();
List
<
WorkProject
>
projects
=
workProjectService
.
getNameById
(
projectIds
);
// 3.获取正在进行中的项目/商机
List
<
WorkProject
>
projects
=
workProjectService
.
getNameById
s
(
projectIds
,
1
);
ProjectInfoDto
projectInfoDto
;
for
(
ProjectTypeEnum
value
:
ProjectTypeEnum
.
values
())
{
projectInfoDto
=
new
ProjectInfoDto
().
setType
(
value
.
getType
()).
setTypeName
(
value
.
getTypeName
()).
setDeptManagerName
(
deptManagerName
);
...
...
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