Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
aroad_aqsc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
许言琪
aroad_aqsc
Commits
bd44434f
提交
bd44434f
authored
4月 16, 2019
作者:
宋文杰
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(attendance): add attendance list api to query attendance member count and shift
上级
68ad0f86
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
120 行增加
和
5 行删除
+120
-5
pom.xml
pom.xml
+0
-5
AttendanceController.java
...ad/module/attendance/controller/AttendanceController.java
+12
-0
AttendanceDto.java
...ork/galaxy/aroad/module/attendance/dto/AttendanceDto.java
+52
-0
AttendanceMapper.java
...laxy/aroad/module/attendance/mapper/AttendanceMapper.java
+11
-0
AttendanceService.java
...xy/aroad/module/attendance/service/AttendanceService.java
+11
-0
AttendanceServiceImpl.java
...module/attendance/service/impl/AttendanceServiceImpl.java
+13
-0
AttendanceMapper.xml
src/main/resources/mapper/attendance/AttendanceMapper.xml
+21
-0
没有找到文件。
pom.xml
浏览文件 @
bd44434f
...
@@ -179,11 +179,6 @@
...
@@ -179,11 +179,6 @@
<artifactId>
gson
</artifactId>
<artifactId>
gson
</artifactId>
<version>
2.8.2
</version>
<version>
2.8.2
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.47
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<artifactId>
jackson-databind
</artifactId>
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/attendance/controller/AttendanceController.java
浏览文件 @
bd44434f
...
@@ -46,6 +46,18 @@ public class AttendanceController extends BaseController {
...
@@ -46,6 +46,18 @@ public class AttendanceController extends BaseController {
return
new
R
<>(
attendanceService
.
getById
(
attendanceId
));
return
new
R
<>(
attendanceService
.
getById
(
attendanceId
));
}
}
/**
* @Description: 查询部门下的排班计划
* @Param: [deptId]
* @return: com.elephant.framework.galaxy.aroad.response.R
* @Author: songwenjie
* @Date: 2019/4/16
*/
@GetMapping
(
"/list/{deptId}"
)
public
R
getAttance
(
@PathVariable
(
"deptId"
)
Integer
deptId
){
return
new
R
<>(
attendanceService
.
getAttendance
(
deptId
));
}
/**
/**
* 新增排班表
* 新增排班表
* @param attendance 排班表
* @param attendance 排班表
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/attendance/dto/AttendanceDto.java
0 → 100644
浏览文件 @
bd44434f
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @program:
* @description:
* @author: songwenjie
* @create: 2019-04-16 16:37
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttendanceDto
{
/**
* 排班id
*/
private
int
attendanceId
;
/**
部门id
*/
private
int
unitId
;
/**
* 班次id
*/
private
int
shiftId
;
/**
* 班次名称
*/
private
String
shiftName
;
/**
* 值班人数
*/
private
int
count
;
/**
* 值班时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
time
;
}
src/main/java/com/elephant/framework/galaxy/aroad/module/attendance/mapper/AttendanceMapper.java
浏览文件 @
bd44434f
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
mapper
;
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto
;
import
com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance
;
import
com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance
;
import
java.util.List
;
/**
/**
* 排班表
* 排班表
*
*
...
@@ -11,4 +14,12 @@ import com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance;
...
@@ -11,4 +14,12 @@ import com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance;
*/
*/
public
interface
AttendanceMapper
extends
BaseMapper
<
Attendance
>
{
public
interface
AttendanceMapper
extends
BaseMapper
<
Attendance
>
{
/**
* @Description: 查询部门下的排班计划
* @Param: [deptId]
* @return: java.util.List<com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto>
* @Author: songwenjie
* @Date: 2019/4/16
*/
List
<
AttendanceDto
>
getAttendance
(
int
deptId
);
}
}
src/main/java/com/elephant/framework/galaxy/aroad/module/attendance/service/AttendanceService.java
浏览文件 @
bd44434f
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
service
;
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto
;
import
com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance
;
import
com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance
;
import
java.util.List
;
/**
/**
* 排班表
* 排班表
*
*
...
@@ -11,4 +14,12 @@ import com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance;
...
@@ -11,4 +14,12 @@ import com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance;
*/
*/
public
interface
AttendanceService
extends
IService
<
Attendance
>
{
public
interface
AttendanceService
extends
IService
<
Attendance
>
{
/**
* @Description: 查询部门下的排班计划
* @Param: [deptId]
* @return: java.util.List<com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto>
* @Author: songwenjie
* @Date: 2019/4/16
*/
List
<
AttendanceDto
>
getAttendance
(
int
deptId
);
}
}
src/main/java/com/elephant/framework/galaxy/aroad/module/attendance/service/impl/AttendanceServiceImpl.java
浏览文件 @
bd44434f
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
service
.
impl
;
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
attendance
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto
;
import
com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance
;
import
com.elephant.framework.galaxy.aroad.module.attendance.entity.Attendance
;
import
com.elephant.framework.galaxy.aroad.module.attendance.mapper.AttendanceMapper
;
import
com.elephant.framework.galaxy.aroad.module.attendance.mapper.AttendanceMapper
;
import
com.elephant.framework.galaxy.aroad.module.attendance.service.AttendanceService
;
import
com.elephant.framework.galaxy.aroad.module.attendance.service.AttendanceService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
/**
* 排班表
* 排班表
*
*
...
@@ -15,4 +18,14 @@ import org.springframework.stereotype.Service;
...
@@ -15,4 +18,14 @@ import org.springframework.stereotype.Service;
@Service
@Service
public
class
AttendanceServiceImpl
extends
ServiceImpl
<
AttendanceMapper
,
Attendance
>
implements
AttendanceService
{
public
class
AttendanceServiceImpl
extends
ServiceImpl
<
AttendanceMapper
,
Attendance
>
implements
AttendanceService
{
/**
* @Description: 查询部门下的排班计划
* @Param: [deptId]
* @return: java.util.List<com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto>
* @Author: songwenjie
* @Date: 2019/4/16
*/
public
List
<
AttendanceDto
>
getAttendance
(
int
deptId
){
return
baseMapper
.
getAttendance
(
deptId
);
}
}
}
src/main/resources/mapper/attendance/AttendanceMapper.xml
浏览文件 @
bd44434f
...
@@ -8,4 +8,25 @@
...
@@ -8,4 +8,25 @@
<id
property=
"attendanceId"
column=
"attendance_id"
/>
<id
property=
"attendanceId"
column=
"attendance_id"
/>
<result
property=
"shiftId"
column=
"shift_id"
/>
<result
property=
"shiftId"
column=
"shift_id"
/>
</resultMap>
</resultMap>
<resultMap
id=
"attendanceDtoMap"
type=
"com.elephant.framework.galaxy.aroad.module.attendance.dto.AttendanceDto"
>
<result
property=
"attendanceId"
column=
"attendance_id"
/>
<result
property=
"shiftId"
column=
"shift_id"
/>
<result
property=
"unitId"
column=
"unit_id"
/>
<result
property=
"time"
column=
"time"
/>
<result
property=
"shiftName"
column=
"shift_name"
/>
<result
property=
"count"
column=
"count"
/>
</resultMap>
<select
id=
"getAttendance"
resultMap=
"attendanceDtoMap"
>
SELECT
a.attendance_id,a.unit_id,a.time,t.shift_id,t.shift_name,COUNT(m.id) as count
FROM `attendance` a
INNER JOIN attendance_templates t
ON a.shift_id = t.shift_id
INNER JOIN attendance_members m
ON a.attendance_id = m.attendance_id
WHERE a.unit_id = #{unitId}
GROUP BY a.time,a.shift_id
</select>
</mapper>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论