update code
parent
f2dce819a3
commit
56be8f69c9
|
@ -7,9 +7,11 @@ import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||||
|
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||||
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
|
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
|
||||||
import com.yanzhu.jh.project.domain.SurProjectWorkAttendance;
|
import com.yanzhu.jh.project.domain.SurProjectWorkAttendance;
|
||||||
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
|
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
|
||||||
|
import com.yanzhu.jh.project.service.ISurProjectAttendanceUserService;
|
||||||
import com.yanzhu.jh.project.service.ISurProjectDeptWroksService;
|
import com.yanzhu.jh.project.service.ISurProjectDeptWroksService;
|
||||||
import com.yanzhu.jh.project.service.ISurProjectWorkAttendanceService;
|
import com.yanzhu.jh.project.service.ISurProjectWorkAttendanceService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -34,6 +36,9 @@ public class ProjectAttendanceController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
ISurProjectAttendanceDataService attendanceDataService;
|
ISurProjectAttendanceDataService attendanceDataService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISurProjectAttendanceUserService attendanceUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询在岗人数
|
* 查询在岗人数
|
||||||
* @param deptId
|
* @param deptId
|
||||||
|
@ -76,9 +81,28 @@ public class ProjectAttendanceController extends BaseController {
|
||||||
return getDataTable(surProjectWorkAttendanceService.selectBgscreenWorkAttendanceList(surProjectWorkAttendance));
|
return getDataTable(surProjectWorkAttendanceService.selectBgscreenWorkAttendanceList(surProjectWorkAttendance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日出勤统计
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/groupByComany")
|
@PostMapping("/groupByComany")
|
||||||
public AjaxResult groupByComany(@RequestBody SurProjectAttendanceData where){
|
public AjaxResult groupByComany(@RequestBody SurProjectAttendanceData where){
|
||||||
List<SurProjectAttendanceData> list=attendanceDataService.groupByComany(where);
|
List<SurProjectAttendanceData> list=attendanceDataService.groupByComany(where);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日出勤详情
|
||||||
|
*/
|
||||||
|
@PostMapping("/todayAttendance")
|
||||||
|
public TableDataInfo todayAttendance(@RequestBody SurProjectAttendanceUser where){
|
||||||
|
long cnt=attendanceUserService.countTodayAttendance(where);
|
||||||
|
List<SurProjectAttendanceUser> list=attendanceUserService.todayAttendance(where);
|
||||||
|
TableDataInfo dataInfo=new TableDataInfo();
|
||||||
|
dataInfo.setTotal(cnt);
|
||||||
|
dataInfo.setRows(list);
|
||||||
|
return dataInfo;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,6 +176,25 @@ public class SurProjectAttendanceUser extends BaseEntity
|
||||||
private Long subDeptId;
|
private Long subDeptId;
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
private int size;
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(int size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int index;
|
||||||
public Long getProjectId() {
|
public Long getProjectId() {
|
||||||
return projectId;
|
return projectId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,4 +62,8 @@ public interface SurProjectAttendanceUserMapper
|
||||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
|
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
|
||||||
|
|
||||||
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceCfg where);
|
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceCfg where);
|
||||||
|
|
||||||
|
public long countTodayAttendance(SurProjectAttendanceUser where);
|
||||||
|
|
||||||
|
public List<SurProjectAttendanceUser> todayAttendance(SurProjectAttendanceUser where);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.yanzhu.jh.project.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||||
|
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 劳务实名制管理Service接口
|
* 劳务实名制管理Service接口
|
||||||
|
@ -64,4 +65,5 @@ public interface ISurProjectAttendanceDataService
|
||||||
public long getLastServerId(SurProjectAttendanceData where);
|
public long getLastServerId(SurProjectAttendanceData where);
|
||||||
|
|
||||||
public List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where);
|
public List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,8 @@ public interface ISurProjectAttendanceUserService
|
||||||
public void add(SurProjectAttendanceUser user);
|
public void add(SurProjectAttendanceUser user);
|
||||||
|
|
||||||
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceCfg where);
|
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceCfg where);
|
||||||
|
|
||||||
|
public long countTodayAttendance(SurProjectAttendanceUser where);
|
||||||
|
|
||||||
|
public List<SurProjectAttendanceUser> todayAttendance(SurProjectAttendanceUser where);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,4 +116,18 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
|
||||||
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceCfg where) {
|
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceCfg where) {
|
||||||
return surProjectAttendanceUserMapper.queryAttendanceData(where);
|
return surProjectAttendanceUserMapper.queryAttendanceData(where);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long countTodayAttendance(SurProjectAttendanceUser where) {
|
||||||
|
return surProjectAttendanceUserMapper.countTodayAttendance(where);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SurProjectAttendanceUser> todayAttendance(SurProjectAttendanceUser where) {
|
||||||
|
if(where.getIndex()<1){
|
||||||
|
where.setIndex(1);
|
||||||
|
}
|
||||||
|
where.setIndex((where.getIndex()-1)* where.getSize());
|
||||||
|
return surProjectAttendanceUserMapper.todayAttendance(where);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<if test="year != null "> and year = #{year}</if>
|
<if test="year != null "> and year = #{year}</if>
|
||||||
<if test="quarterly != null "> and quarterly = #{quarterly}</if>
|
<if test="quarterly != null "> and quarterly = #{quarterly}</if>
|
||||||
order by p.projectType
|
order by p.projectSort
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -279,4 +279,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
) m left join sur_project_attendance_user n on m.workerId=n.workerId
|
) m left join sur_project_attendance_user n on m.workerId=n.workerId
|
||||||
) oo
|
) oo
|
||||||
</select>
|
</select>
|
||||||
|
<select id="countTodayAttendance" resultType="Long" parameterType="SurProjectAttendanceUser">
|
||||||
|
select count(1) cnt from sur_project_attendance_user u, sur_project_attendance_cfg c,vw_sur_project_attendance_group g
|
||||||
|
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||||
|
<if test="id==1">
|
||||||
|
and g.companyTypeId =1
|
||||||
|
</if>
|
||||||
|
<if test="id==2">
|
||||||
|
and g.companyTypeId in (2,3)
|
||||||
|
</if>
|
||||||
|
<if test="id==8">
|
||||||
|
and g.companyTypeId =8
|
||||||
|
</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and c.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="deptId!=null and deptId>0">
|
||||||
|
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="todayAttendance" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||||
|
select a.* ,
|
||||||
|
(select min(attendance_time) from sur_project_attendance_data b where b.workerId=a.workerId and date(b.attendance_time)='2023-09-28' and b.attendance_type='e') inTime,
|
||||||
|
(SELECT Max(attendance_time) FROM sur_project_attendance_data b WHERE b.workerId=a.workerId AND DATE(b.attendance_time)='2023-09-28' AND b.attendance_type='l') outTime
|
||||||
|
from (
|
||||||
|
select u.* from sur_project_attendance_user u, sur_project_attendance_cfg c,vw_sur_project_attendance_group g
|
||||||
|
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||||
|
<if test="id==1">
|
||||||
|
and g.companyTypeId =1
|
||||||
|
</if>
|
||||||
|
<if test="id==2">
|
||||||
|
and g.companyTypeId in (2,3)
|
||||||
|
</if>
|
||||||
|
<if test="id==8">
|
||||||
|
and g.companyTypeId =8
|
||||||
|
</if>
|
||||||
|
<if test="projectId!=null and projectId>0">
|
||||||
|
and c.project_id=#{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="deptId!=null and deptId>0">
|
||||||
|
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||||
|
</if>
|
||||||
|
order by u.id limit #{index},#{size} ) a
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE LENGTH(node_lvl)=2
|
WHERE LENGTH(node_lvl)=2
|
||||||
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
|
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
|
||||||
<if test="id!=null and id!=0">and project_id in (SELECT id FROM sur_project WHERE deptid=#{id})</if>
|
<if test="id!=null and id!=0">and project_id in (SELECT id FROM sur_project WHERE deptid=#{id})</if>
|
||||||
GROUP BY project_id)
|
GROUP BY project_id) order by projectSort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCurrent" parameterType="SurProjectBuildNodeData" resultMap="SurProjectBuildNodeDataResultNode">
|
<select id="selectCurrent" parameterType="SurProjectBuildNodeData" resultMap="SurProjectBuildNodeDataResultNode">
|
||||||
|
|
Loading…
Reference in New Issue