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
574572f0
Commit
574572f0
authored
Feb 25, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
86d31ace
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
7 deletions
+28
-7
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+1
-1
WorkTypeManagerService.java
...ain/java/cn/wisenergy/service/WorkTypeManagerService.java
+1
-0
WorkTypeManagerServiceImpl.java
...cn/wisenergy/service/impl/WorkTypeManagerServiceImpl.java
+13
-1
WorkTypeServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
+11
-2
WorkProjectController.java
...nergy/web/admin/controller/app/WorkProjectController.java
+2
-3
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
574572f0
...
...
@@ -53,7 +53,7 @@ public enum BASE_RESP_CODE_ENUM {
DEPT_IS_NULL
(
"631"
,
"该部门不存在"
),
MANAGER_NOT_PROJECT
(
"632"
,
"该管理没有可管理的项目"
),
DEPT_NOT_FOUND
(
"633"
,
"部门信息未找到"
),
DATE_IS_ERROR
(
"634"
,
"时间不匹配
"
),
FAILEDTO_DELETE_DATA
(
"634"
,
"删除数据失败
"
),
CENTRE_NOT_FOUND
(
"635"
,
"中心信息未找到"
),
TIME_NOT_IS_NULL
(
"636"
,
"请选择今日工时"
),
WORKDAY_NOT_NULL
(
"637"
,
"工时日期不能为空"
),
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/WorkTypeManagerService.java
View file @
574572f0
...
...
@@ -37,5 +37,6 @@ public interface WorkTypeManagerService {
*/
List
<
WorkTypeManager
>
getType
();
Boolean
deleteByType
(
Integer
type
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeManagerServiceImpl.java
View file @
574572f0
...
...
@@ -13,7 +13,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Service
...
...
@@ -77,7 +79,17 @@ public class WorkTypeManagerServiceImpl implements WorkTypeManagerService {
return
addName
(
workTypeManagers
);
}
@Override
public
Boolean
deleteByType
(
Integer
type
)
{
log
.
info
(
"WorkTypeManagerServiceImpl[]deleteByType[]input.param.type:{}"
+
type
);
if
(
null
==
type
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
2
);
map
.
put
(
"type"
,
type
);
int
i
=
workTypeManagerMapper
.
deleteByMap
(
map
);
return
i
>
0
;
}
private
List
<
WorkTypeManager
>
getWorkTypes
(
Integer
userId
,
String
column
)
{
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
View file @
574572f0
...
...
@@ -4,10 +4,12 @@ import cn.wisenergy.common.utils.exception.BASE_RESP_CODE_ENUM;
import
cn.wisenergy.common.utils.exception.BaseCustomException
;
import
cn.wisenergy.mapper.WorkTypeMapper
;
import
cn.wisenergy.model.app.WorkType
;
import
cn.wisenergy.service.WorkTypeManagerService
;
import
cn.wisenergy.service.WorkTypeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -26,6 +28,9 @@ public class WorkTypeServiceImpl implements WorkTypeService {
@Autowired
private
WorkTypeMapper
workTypeMapper
;
@Autowired
private
WorkTypeManagerService
workTypeManagerService
;
@Override
public
List
<
WorkType
>
getAll
()
{
...
...
@@ -51,6 +56,7 @@ public class WorkTypeServiceImpl implements WorkTypeService {
return
ids
;
}
@Transactional
@Override
public
Boolean
addAndModifyWorkType
(
WorkType
workType
)
{
log
.
info
(
"WorkTypeServiceImpl[]modifyTypeById[]input.param.workType:{}"
+
workType
);
...
...
@@ -72,6 +78,7 @@ public class WorkTypeServiceImpl implements WorkTypeService {
}
}
@Transactional
@Override
public
Boolean
deleteTypeById
(
Integer
id
)
{
log
.
info
(
"WorkTypeServiceImpl[]deleteTypeById[]input.param.id:{}"
+
id
);
...
...
@@ -79,8 +86,10 @@ public class WorkTypeServiceImpl implements WorkTypeService {
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
int
i
=
workTypeMapper
.
deleteById
(
id
);
return
i
>
0
;
if
(
i
==
0
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
FAILEDTO_DELETE_DATA
);
}
return
workTypeManagerService
.
deleteByType
(
id
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkProjectController.java
View file @
574572f0
...
...
@@ -2,7 +2,6 @@ package cn.wisenergy.web.admin.controller.app;
import
cn.wisenergy.common.utils.exception.Result
;
import
cn.wisenergy.model.app.WorkProjectChange
;
import
cn.wisenergy.model.dto.ManagerProjectsDto
;
import
cn.wisenergy.model.vo.CreateProjectVo
;
import
cn.wisenergy.model.vo.GetManagerProjectsVo
;
import
cn.wisenergy.model.vo.ModifyProjectVo
;
...
...
@@ -42,8 +41,8 @@ public class WorkProjectController extends BaseController {
@PostMapping
(
value
=
"/getProject"
)
public
Result
<
PageInfo
>
getProject
(
@RequestBody
GetManagerProjectsVo
gmpv
)
{
log
.
info
(
"WorkProjectController[]getProject[]input.param.GetManagerProjectsVo:{}"
+
gmpv
);
PageInfo
managerProje
e
ts
=
workProjectService
.
getManagerProjects
(
gmpv
);
return
getResult
(
managerProje
e
ts
);
PageInfo
managerProje
c
ts
=
workProjectService
.
getManagerProjects
(
gmpv
);
return
getResult
(
managerProje
c
ts
);
}
@ApiOperation
(
value
=
"结束项目/商机"
,
notes
=
"结束项目/商机"
,
httpMethod
=
"PUT"
)
...
...
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