Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
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
b5604af9
Commit
b5604af9
authored
Jan 25, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapper参数注解
parent
88fb91cc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
23 deletions
+21
-23
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+1
-1
WorkDeptMapper.xml
...nergy-mapper/src/main/resources/mapper/WorkDeptMapper.xml
+2
-3
WorkUserMapper.xml
...nergy-mapper/src/main/resources/mapper/WorkUserMapper.xml
+1
-0
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+2
-0
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+1
-4
WorkUserServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkUserServiceImpl.java
+1
-1
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+13
-0
WorkUserController.java
...isenergy/web/admin/controller/app/WorkUserController.java
+0
-14
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
b5604af9
...
...
@@ -44,7 +44,7 @@ public enum BASE_RESP_CODE_ENUM {
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN
(
"623"
,
"您不是管理员,请登录管理员账号"
),
DEPT_NOT_HAVE_USER
(
"624"
,
"该部门下没有人员"
),
PROJECT_NOT_HAVE_USER
(
"624"
,
"该部门下没有项目"
),
USER_
PHONE_IS_ERROR
(
"625"
,
"用户名/手机号
不正确"
),
USER_
LOGIN_NAME_OR_PASSWORD_IS_ERROR
(
"625"
,
"用户名或密码
不正确"
),
DELETE_OLD_WORK_ORDER_FAIL
(
"626"
,
"删除旧工单数据失败"
),
WORK_DAY_THAN_DATE
(
"627"
,
"填报的日期超过系统默认日期"
),
DES_NOT_NULL
(
"628"
,
"工作简述不能为空"
),
...
...
wisenergy-mapper/src/main/resources/mapper/WorkDeptMapper.xml
View file @
b5604af9
...
...
@@ -25,9 +25,8 @@
dept_name, create_time, modify_time
</sql>
<!-- 通用查询结果列 -->
<sql
id=
"criteria"
>
<if
test=
"id != null"
>
AND id = #{id}
</if>
<if
test=
"deptName != null"
>
AND dept_name = #{deptName}
</if>
<if
test=
"centreId != null"
>
AND centre_id = #{centreId}
</if>
<if
test=
"managerId != null"
>
AND manager_id = #{managerId}
</if>
...
...
@@ -35,7 +34,7 @@
<if
test=
"modifyTime != null"
>
AND modify_time = #{modifyTime}
</if>
</sql>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, oa_dept_id, dept_name, create_time, modify_time
</sql>
...
...
wisenergy-mapper/src/main/resources/mapper/WorkUserMapper.xml
View file @
b5604af9
...
...
@@ -59,6 +59,7 @@
<if
test=
"oaUserId != null"
>
and oa_user_id = #{oaUserId}
</if>
<if
test=
"name != null"
>
and name = #{name}
</if>
<if
test=
"loginName != null"
>
and login_name = #{loginName}
</if>
<if
test=
"password != null"
>
and password = #{password}
</if>
<if
test=
"phone != null"
>
and phone =#{phone}
</if>
<if
test=
"deptId != null"
>
and dept_id = #{deptId}
</if>
<if
test=
"email != null"
>
and email = #{email}
</if>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
b5604af9
...
...
@@ -177,7 +177,9 @@ public class StatisticsServiceImpl implements StatisticsService {
currentMonthWorkDays
.
removeAll
(
currentMonthFilledDays
);
int
notFilledCount
=
currentMonthWorkDays
.
size
();
//本月被现存驳回数
map
.
clear
();
map
.
put
(
"status"
,
3
);
map
.
put
(
"userId"
,
userId
);
map
.
put
(
"startDay"
,
firstDayOfMonth
);
Integer
countByCondition
=
workTimeOrderMapper
.
getCountByCondition
(
map
);
String
currentDayOfMonth
=
DateUtil
.
convertDateToYMDStr
(
firstDayOfMonth
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
b5604af9
...
...
@@ -135,12 +135,10 @@ public class WorkProjectServiceImpl implements WorkProjectService {
//项目级别查询项目管理员为用户的项目
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
IS_PROJECT_DIRECTOR
.
getCode
()))
{
map
.
put
(
"managerId"
,
userId
);
workProjects
=
workProjectMapper
.
getProjectsByCriteria
(
map
);
}
//用户是部门级别,查询该部门下的所有项目
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
IS_DEPARTMENT_DIRECTOR
.
getCode
()))
{
map
.
put
(
"deptId"
,
user
.
getDeptId
());
workProjects
=
workProjectMapper
.
getProjectsByCriteria
(
map
);
}
//中心级别的用户查看中心下所有部门的所有项目
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
IS_CENTRE_DIRECTOR
.
getCode
()))
{
...
...
@@ -159,9 +157,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
List
<
Integer
>
deptIds
=
workDepts
.
stream
().
map
(
WorkDept:
:
getId
).
collect
(
Collectors
.
toList
());
map
.
clear
();
map
.
put
(
"deptIds"
,
deptIds
);
workProjects
=
workProjectMapper
.
getProjectsByCriteria
(
map
);
}
workProjects
=
workProjectMapper
.
getProjectsByCriteria
(
map
);
return
workProjects
;
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkUserServiceImpl.java
View file @
b5604af9
...
...
@@ -103,7 +103,7 @@ public class WorkUserServiceImpl implements WorkUserService {
map
.
put
(
"password"
,
md5Password
);
WorkUser
user
=
workUserMapper
.
getUserInfo
(
map
);
if
(
null
==
user
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_
PHONE
_IS_ERROR
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_
LOGIN_NAME_OR_PASSWORD
_IS_ERROR
);
}
//如果登录来源是PC,判断用户是不是管理员
if
(
LOGIN_SOURCE
.
equals
(
source
))
{
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
b5604af9
...
...
@@ -2,6 +2,7 @@ package cn.wisenergy.web.admin.controller.app;
import
cn.wisenergy.common.utils.exception.BASE_RESP_CODE_ENUM
;
import
cn.wisenergy.common.utils.exception.BaseCustomException
;
import
cn.wisenergy.common.utils.exception.Result
;
import
cn.wisenergy.model.app.WorkDept
;
import
cn.wisenergy.model.dto.GetMonthlyCollectParam
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
...
...
@@ -65,4 +66,16 @@ public class StatisticsController extends BaseController {
return
currentMonthWorkTimeCollect
;
}
@ApiOperation
(
value
=
"获取本月工时统计和审核统计"
,
notes
=
"获取本月"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户主键"
,
dataType
=
"int"
,
required
=
true
)
@GetMapping
(
"/getMonthlyWorkingHours"
)
public
Result
<
List
<
Object
>>
getMonthlyWorkingHours
(
Integer
userId
){
log
.
info
(
"WorkOrderController[]getMonthlyWorkingHours[]input.param"
+
userId
);
if
(
userId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
List
<
Object
>
monthlyStatistics
=
statisticsService
.
getMonthlyStatistics
(
userId
);
return
getResult
(
monthlyStatistics
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkUserController.java
View file @
b5604af9
...
...
@@ -16,8 +16,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @description:
* @author: nh
...
...
@@ -78,17 +76,5 @@ public class WorkUserController extends BaseController {
}
@ApiOperation
(
value
=
"获取本月工时统计和审核统计"
,
notes
=
"获取本月"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户主键"
,
dataType
=
"int"
,
required
=
true
)
@GetMapping
(
"/getMonthlyWorkingHours"
)
public
Result
<
List
<
Object
>>
getMonthlyWorkingHours
(
Integer
userId
){
log
.
info
(
"WorkOrderController[]getMonthlyWorkingHours[]input.param"
+
userId
);
if
(
userId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
List
<
Object
>
monthlyStatistics
=
statisticsService
.
getMonthlyStatistics
(
userId
);
return
getResult
(
monthlyStatistics
);
}
}
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