update code
parent
ff87c12d35
commit
47bc7fe61a
File diff suppressed because it is too large
Load Diff
|
@ -139,6 +139,42 @@ public class ProjectAttendanceController extends BaseController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/workerOnDuty")
|
||||
public TableDataInfo queryWorkerOnDuty(SurProjectAttendanceUser where){
|
||||
Long deptId= where.getDeptId();
|
||||
if(deptId==null || deptId<=0){
|
||||
if (SecurityUtils.isUserB()) {
|
||||
where.setPrjIds(getProjectIds());
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
List<SurProjectAttendanceUser> list=attendanceUserService.queryWorkerOnDuty(where);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/groupByWorkerOnDuty")
|
||||
public AjaxResult groupByWorkerOnDuty(SurProjectAttendanceData where){
|
||||
Long deptId= where.getDeptId();
|
||||
if(deptId==null || deptId<=0){
|
||||
if (SecurityUtils.isUserB()) {
|
||||
where.setPrjIds(getProjectIds());
|
||||
}
|
||||
}
|
||||
List<SurProjectAttendanceData> list=attendanceUserService.groupByWorkerOnDutyByDept(where);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 今日出勤详情
|
||||
*/
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||
|
||||
/**
|
||||
|
@ -116,4 +117,17 @@ public interface SurProjectAttendanceUserMapper
|
|||
|
||||
public List<SurProjectAttendanceUser> todayAttendanceOtherData(Map<String,Object> data);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SurProjectAttendanceData> groupByWorkerOnDutyByDept(SurProjectAttendanceData where);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||
|
||||
/**
|
||||
|
@ -110,4 +111,18 @@ public interface ISurProjectAttendanceUserService
|
|||
* @return
|
||||
*/
|
||||
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(SurProjectAttendanceUser surProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SurProjectAttendanceData> groupByWorkerOnDutyByDept(SurProjectAttendanceData where);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,8 @@ public class SurProjectAttendanceGroupServiceImpl implements ISurProjectAttendan
|
|||
@Override
|
||||
public void add(SurProjectAttendanceGroup group) {
|
||||
SurProjectAttendanceGroup where=new SurProjectAttendanceGroup();
|
||||
where.setServerid(group.getServerid());
|
||||
where.setServerid(group.getCompanyId());
|
||||
where.setCfgid(group.getCfgid());
|
||||
List<SurProjectAttendanceGroup> list=selectSurProjectAttendanceGroupViewList(where);
|
||||
if(list.size()==0){
|
||||
insertSurProjectAttendanceGroup(group);
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectAttendanceUserMapper;
|
||||
|
@ -221,6 +222,26 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
|
|||
return surProjectAttendanceUserMapper.selectSurProjectAttendanceUserListJgw(surProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where) {
|
||||
return surProjectAttendanceUserMapper.queryWorkerOnDuty(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SurProjectAttendanceData> groupByWorkerOnDutyByDept(SurProjectAttendanceData where) {
|
||||
return surProjectAttendanceUserMapper.groupByWorkerOnDutyByDept(where);
|
||||
}
|
||||
|
||||
private Date findDate(List<SurProjectAttendanceUser> datas, SurProjectAttendanceUser u, String type) {
|
||||
for (SurProjectAttendanceUser user:datas) {
|
||||
if(user.getWorkerId().equals(u.getWorkerId()) && user.getName().equals(type)){
|
||||
|
|
|
@ -354,7 +354,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.state=0
|
||||
and g.companyTypeId in (1,2,3,4,5,6,8)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
|
|
|
@ -405,7 +405,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (2,3,4,5)
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
|
@ -438,7 +438,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (2,3,4,5)
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
|
@ -469,7 +469,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (2,3,4,5)
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
|
@ -509,4 +509,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
group by workerid
|
||||
</select>
|
||||
|
||||
<select id="queryWorkerOnDuty" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
|
||||
SELECT u.*,b.project_id,b.sub_dept_id
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,sur_project_attendance_group g
|
||||
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId
|
||||
<if test="id==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and b.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="groupByWorkerOnDutyByDept" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select p.id, p.projectName name,g.companyTypeId companyId,count(1) cfgid
|
||||
from sur_project_attendance_user u,sur_project_attendance_cfg b,sur_project_attendance_group g,sur_project p
|
||||
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id
|
||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and b.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by p.projectName,g.companyTypeId,p.id
|
||||
order by p.id
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue