园历展示增加幼儿考勤人数统计
This commit is contained in:
parent
ebe4d92d1f
commit
56fd60a4cf
@ -65,6 +65,8 @@ public class ByCalendarController extends BaseController {
|
||||
private IByChildService byChildService;
|
||||
@Autowired
|
||||
private IByClassService byClassService;
|
||||
@Autowired
|
||||
private IByChildCheckinDetailService byChildCheckinDetailService;
|
||||
|
||||
/**
|
||||
* 查询园历管理(本一)列表
|
||||
@ -185,6 +187,9 @@ public class ByCalendarController extends BaseController {
|
||||
listvi.addAll(getbychilds(classId, formatter));
|
||||
}
|
||||
|
||||
//幼儿出勤人数
|
||||
listvi.addAll(getbychildcheckdata(classId,formatter));
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("calendarData", listvi);
|
||||
return ajax;
|
||||
@ -203,8 +208,8 @@ public class ByCalendarController extends BaseController {
|
||||
//班级类型
|
||||
String classId = schoolCommon.getClassId();
|
||||
if (!schoolCommon.isStringEmpty(classId)) {
|
||||
ByClass byClass=new ByClass();
|
||||
byClass=byClassService.selectByClassById(classId);
|
||||
ByClass byClass = new ByClass();
|
||||
byClass = byClassService.selectByClassById(classId);
|
||||
bySchoolcalendar.setScope(byClass.getBjtype());
|
||||
}
|
||||
|
||||
@ -398,4 +403,30 @@ public class ByCalendarController extends BaseController {
|
||||
return listvi;
|
||||
}
|
||||
|
||||
//获取学校或班级考勤数据列表
|
||||
private List<ByCalendarShow> getbychildcheckdata(String classId, SimpleDateFormat formatter) {
|
||||
List<ByCalendarShow> listvi = new ArrayList<>();
|
||||
|
||||
Long deptId = SecurityUtils.getLoginUser().getUser().getDept().getDeptId();
|
||||
ByChildCheckinDetail byChildCheckinDetail = new ByChildCheckinDetail();
|
||||
byChildCheckinDetail.setSchoolid(deptId);
|
||||
byChildCheckinDetail.setClassid(classId);
|
||||
List<ByChildCheckinDetail> list = byChildCheckinDetailService.selectByChildCheckinGroupDaysList(byChildCheckinDetail);
|
||||
if (list != null && list.size() > 0) {
|
||||
ByCalendarShow by = null;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
by = new ByCalendarShow();
|
||||
ByChildCheckinDetail byNewChildCheckinDetail = list.get(i);
|
||||
|
||||
by.setTitle("幼儿出勤人数:"+byNewChildCheckinDetail.getCount());
|
||||
String timefor = formatter.format(byNewChildCheckinDetail.getCreateTime());
|
||||
by.setStart(timefor);
|
||||
by.setEnd(timefor);
|
||||
by.setColor("#85a5ff");
|
||||
listvi.add(by);
|
||||
}
|
||||
}
|
||||
return listvi;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ public class ByChildCheckinDetail extends BaseEntity {
|
||||
@Excel(name = "创建人")
|
||||
private Long createuserid;
|
||||
|
||||
private int count;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
@ -111,6 +113,10 @@ public class ByChildCheckinDetail extends BaseEntity {
|
||||
return createuserid;
|
||||
}
|
||||
|
||||
public void setCount(int count){this.count=count;}
|
||||
|
||||
public int getCount(){return count;}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -122,6 +128,7 @@ public class ByChildCheckinDetail extends BaseEntity {
|
||||
.append("type", getType())
|
||||
.append("createuserid", getCreateuserid())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("count", getCount())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,14 @@ public interface ByChildCheckinDetailMapper {
|
||||
*/
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinDetailList(ByChildCheckinDetail byChildCheckinDetail);
|
||||
|
||||
/**
|
||||
* 查询幼儿考勤列表根据每天进行分组
|
||||
*
|
||||
* @param byChildCheckinDetail 幼儿考勤
|
||||
* @return 幼儿考勤集合
|
||||
*/
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinGroupDaysList(ByChildCheckinDetail byChildCheckinDetail);
|
||||
|
||||
/**
|
||||
* 新增幼儿考勤
|
||||
*
|
||||
|
@ -27,6 +27,15 @@ public interface IByChildCheckinDetailService
|
||||
*/
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinDetailList(ByChildCheckinDetail byChildCheckinDetail);
|
||||
|
||||
/**
|
||||
* 查询幼儿考勤列表根据每天进行分组
|
||||
*
|
||||
* @param byChildCheckinDetail 幼儿考勤
|
||||
* @return 幼儿考勤集合
|
||||
*/
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinGroupDaysList(ByChildCheckinDetail byChildCheckinDetail);
|
||||
|
||||
|
||||
/**
|
||||
* 新增幼儿考勤
|
||||
*
|
||||
|
@ -1,8 +1,9 @@
|
||||
package com.ruoyi.project.benyi.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.project.benyi.mapper.ByChildCheckinDetailMapper;
|
||||
import com.ruoyi.project.benyi.domain.ByChildCheckinDetail;
|
||||
@ -15,8 +16,7 @@ import com.ruoyi.project.benyi.service.IByChildCheckinDetailService;
|
||||
* @date 2020-07-21
|
||||
*/
|
||||
@Service
|
||||
public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailService
|
||||
{
|
||||
public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailService {
|
||||
@Autowired
|
||||
private ByChildCheckinDetailMapper byChildCheckinDetailMapper;
|
||||
|
||||
@ -27,8 +27,7 @@ public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailSer
|
||||
* @return 幼儿考勤
|
||||
*/
|
||||
@Override
|
||||
public ByChildCheckinDetail selectByChildCheckinDetailById(Long id)
|
||||
{
|
||||
public ByChildCheckinDetail selectByChildCheckinDetailById(Long id) {
|
||||
return byChildCheckinDetailMapper.selectByChildCheckinDetailById(id);
|
||||
}
|
||||
|
||||
@ -39,11 +38,21 @@ public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailSer
|
||||
* @return 幼儿考勤
|
||||
*/
|
||||
@Override
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinDetailList(ByChildCheckinDetail byChildCheckinDetail)
|
||||
{
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinDetailList(ByChildCheckinDetail byChildCheckinDetail) {
|
||||
return byChildCheckinDetailMapper.selectByChildCheckinDetailList(byChildCheckinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询幼儿考勤列表根据每天进行分组
|
||||
*
|
||||
* @param byChildCheckinDetail 幼儿考勤
|
||||
* @return 幼儿考勤集合
|
||||
*/
|
||||
@Override
|
||||
public List<ByChildCheckinDetail> selectByChildCheckinGroupDaysList(ByChildCheckinDetail byChildCheckinDetail) {
|
||||
return byChildCheckinDetailMapper.selectByChildCheckinGroupDaysList(byChildCheckinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增幼儿考勤
|
||||
*
|
||||
@ -51,10 +60,9 @@ public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailSer
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertByChildCheckinDetail(ByChildCheckinDetail byChildCheckinDetail)
|
||||
{
|
||||
byChildCheckinDetail.setCreateTime(DateUtils.getNowDate());
|
||||
return byChildCheckinDetailMapper.insertByChildCheckinDetail(byChildCheckinDetail);
|
||||
public int insertByChildCheckinDetail(ByChildCheckinDetail byChildCheckinDetail) {
|
||||
byChildCheckinDetail.setCreateTime(DateUtils.getNowDate());
|
||||
return byChildCheckinDetailMapper.insertByChildCheckinDetail(byChildCheckinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,9 +72,8 @@ public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailSer
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateByChildCheckinDetail(ByChildCheckinDetail byChildCheckinDetail)
|
||||
{
|
||||
return byChildCheckinDetailMapper.updateByChildCheckinDetail(byChildCheckinDetail);
|
||||
public int updateByChildCheckinDetail(ByChildCheckinDetail byChildCheckinDetail) {
|
||||
return byChildCheckinDetailMapper.updateByChildCheckinDetail(byChildCheckinDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,8 +83,7 @@ public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailSer
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByChildCheckinDetailByIds(Long[] ids)
|
||||
{
|
||||
public int deleteByChildCheckinDetailByIds(Long[] ids) {
|
||||
return byChildCheckinDetailMapper.deleteByChildCheckinDetailByIds(ids);
|
||||
}
|
||||
|
||||
@ -88,8 +94,7 @@ public class ByChildCheckinDetailServiceImpl implements IByChildCheckinDetailSer
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByChildCheckinDetailById(Long id)
|
||||
{
|
||||
public int deleteByChildCheckinDetailById(Long id) {
|
||||
return byChildCheckinDetailMapper.deleteByChildCheckinDetailById(id);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
<result property="type" column="type"/>
|
||||
<result property="createuserid" column="createuserid"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="count" column="count"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectByChildCheckinDetailVo">
|
||||
@ -33,6 +34,17 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByChildCheckinGroupDaysList" parameterType="ByChildCheckinDetail"
|
||||
resultMap="ByChildCheckinDetailResult">
|
||||
select count(*) as count, t.create_time from (select id, schoolid, classid, childid, childname, type, createuserid, DATE_FORMAT(create_time,'%Y-%m-%d') as create_time
|
||||
from by_child_checkin_detail
|
||||
where type='01'
|
||||
<if test="schoolid != null ">and schoolid = #{schoolid}</if>
|
||||
<if test="classid != null and classid != ''">and classid = #{classid}</if>
|
||||
) t
|
||||
group by t.create_time
|
||||
</select>
|
||||
|
||||
<select id="selectByChildCheckinDetailById" parameterType="Long" resultMap="ByChildCheckinDetailResult">
|
||||
<include refid="selectByChildCheckinDetailVo"/>
|
||||
where id = #{id}
|
||||
|
Loading…
x
Reference in New Issue
Block a user