提交代码
parent
e589f4c11b
commit
6a0fa6d652
|
@ -1,4 +1,4 @@
|
||||||
package com.yanzhu.system.api.domain;
|
package com.yanzhu.api.domain;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
|
@ -154,4 +154,18 @@ public interface SurProjectAttendanceDataMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SurProjectAttendanceData> getRealAttendance(@Param("prjId") Long prjId,@Param("year") int year);
|
List<SurProjectAttendanceData> getRealAttendance(@Param("prjId") Long prjId,@Param("year") int year);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目统计今日考勤
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsAttendanceDaysByProId(SurProjectAttendanceData where);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计人员出勤信息
|
||||||
|
* @param where
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsAttendanceViewByProId(SurProjectAttendanceData where);
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,4 +190,11 @@ public interface SurProjectAttendanceUserMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SurProjectAttendanceUser> getAttendanceAlert(@Param("projectId")Long prjId, @Param("year")int year);
|
List<SurProjectAttendanceUser> getAttendanceAlert(@Param("projectId")Long prjId, @Param("year")int year);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计劳务人员信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsSubDeptsUsersByProId(Long proId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import com.yanzhu.common.core.constant.CacheConstants;
|
import com.yanzhu.common.core.constant.CacheConstants;
|
||||||
import com.yanzhu.common.core.utils.SpringUtils;
|
import com.yanzhu.common.core.utils.SpringUtils;
|
||||||
import com.yanzhu.common.core.utils.StringUtils;
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
import com.yanzhu.common.redis.service.RedisService;
|
import com.yanzhu.common.redis.service.RedisService;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典工具类
|
* 字典工具类
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package com.yanzhu.system.mapper;
|
package com.yanzhu.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典表 数据层
|
* 字典表 数据层
|
||||||
|
|
|
@ -226,26 +226,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="statsAttendanceDays" parameterType="AttendanceUbiData" resultType="Map">
|
<select id="statsAttendanceDays" parameterType="AttendanceUbiData" resultType="Map">
|
||||||
select u.craft_type as craftType, count(1) as total from attendance_ubi_data d
|
select u.craft_type as craftType, count(1) as total from attendance_ubi_data d
|
||||||
left join pro_project_info_subdepts_users u on u.user_id = d.userId
|
left join pro_project_info_subdepts_users u on u.user_id = d.userId
|
||||||
where u.id is not null and u.use_status = '0'
|
<where>
|
||||||
<if test="comId != null "> and d.comId = #{comId}</if>
|
|
||||||
<if test="projectId != null "> and d.projectId = #{projectId}</if>
|
<if test="projectId != null "> and d.projectId = #{projectId}</if>
|
||||||
<if test="subDeptId != null "> and d.sub_dept_id = #{subDeptId}</if>
|
<if test="subDeptId != null "> and d.sub_dept_id = #{subDeptId}</if>
|
||||||
<if test="subDeptGroup != null "> and d.sub_dept_group = #{subDeptGroup}</if>
|
<if test="subDeptGroup != null "> and d.sub_dept_group = #{subDeptGroup}</if>
|
||||||
<if test="params.createTime != null and params.createTime != ''"> and date(d.create_time) = #{params.createTime}</if>
|
and u.use_status = '0' and date(d.create_time) = CURDATE()
|
||||||
|
</where>
|
||||||
group by u.craft_type
|
group by u.craft_type
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="statsAttendanceView" parameterType="AttendanceUbiData" resultType="Map">
|
<select id="statsAttendanceView" parameterType="AttendanceUbiData" resultType="Map">
|
||||||
select DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
select DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
||||||
select date(d.inTime) as attendanceTime, count(1) as total from attendance_ubi_data d
|
select date(d.create_time) as attendanceTime, count(1) as total from attendance_ubi_data d
|
||||||
where 1=0
|
<where>
|
||||||
<if test="comId != null "> and d.comId = #{comId}</if>
|
|
||||||
<if test="projectId != null "> and d.projectId = #{projectId}</if>
|
<if test="projectId != null "> and d.projectId = #{projectId}</if>
|
||||||
<if test="subDeptId != null "> and d.sub_dept_id = #{subDeptId}</if>
|
<if test="subDeptId != null "> and d.sub_dept_id = #{subDeptId}</if>
|
||||||
<if test="subDeptGroup != null "> and d.sub_dept_group = #{subDeptGroup}</if>
|
<if test="subDeptGroup != null "> and d.sub_dept_group = #{subDeptGroup}</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(d.create_time) between #{params.beginTime} and #{params.endTime}</if>
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(d.create_time) between #{params.beginTime} and #{params.endTime}</if>
|
||||||
group by date(d.inTime)
|
</where>
|
||||||
order by date(d.inTime)
|
group by attendanceTime
|
||||||
|
order by attendanceTime
|
||||||
)days
|
)days
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -664,7 +664,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRealAttendance" resultMap="SurProjectAttendanceDataResult">
|
<select id="getRealAttendance" resultMap="SurProjectAttendanceDataResult">
|
||||||
|
|
||||||
select * from sur_project_attendance_data_${year}
|
select * from sur_project_attendance_data_${year}
|
||||||
where date(attendance_time)=date(now()) or date(attendance_out_time)=date(now())
|
where date(attendance_time)=date(now()) or date(attendance_out_time)=date(now())
|
||||||
and is_del!=1
|
and is_del!=1
|
||||||
|
@ -672,4 +671,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by ifnull(attendance_time,attendance_out_time) DESC
|
order by ifnull(attendance_time,attendance_out_time) DESC
|
||||||
LIMIT 4
|
LIMIT 4
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="statsAttendanceDaysByProId" parameterType="SurProjectAttendanceData" resultType="Map">
|
||||||
|
select '1' as craftType,count(1) as total from sur_project_attendance_data_${year}
|
||||||
|
where projectId=#{projectId} and specWorkType = 1 and companyTypeId != 1
|
||||||
|
UNION ALL
|
||||||
|
select '2' as craftType,count(1) as total from sur_project_attendance_data_${year}
|
||||||
|
where projectId=#{projectId} and specWorkType = 0 and companyTypeId != 1
|
||||||
|
UNION ALL
|
||||||
|
select '3' as craftType,count(1) as total from sur_project_attendance_data_${year}
|
||||||
|
where projectId=#{projectId} and companyTypeId = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="statsAttendanceViewByProId" parameterType="SurProjectAttendanceData" resultType="Map">
|
||||||
|
select DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
||||||
|
select date(d.create_time) as attendanceTime, count(1) as total from sur_project_attendance_data_${year} d
|
||||||
|
<where>
|
||||||
|
<if test="projectId != null "> and d.projectId = #{projectId}</if>
|
||||||
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(d.create_time) between #{params.beginTime} and #{params.endTime}</if>
|
||||||
|
</where>
|
||||||
|
group by attendanceTime
|
||||||
|
order by attendanceTime
|
||||||
|
)days
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -829,8 +829,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
|
|
||||||
<select id="getAttendanceAlert" resultMap="SurProjectAttendanceUserResult">
|
<select id="getAttendanceAlert" resultMap="SurProjectAttendanceUserResult">
|
||||||
|
|
||||||
|
|
||||||
select u.*,TIMESTAMPDIFF(Day, att.dt,now()) id
|
select u.*,TIMESTAMPDIFF(Day, att.dt,now()) id
|
||||||
from (
|
from (
|
||||||
select su.workerId,su.name,pi.project_name companyName, pdept.sub_dept_name teamName
|
select su.workerId,su.name,pi.project_name companyName, pdept.sub_dept_name teamName
|
||||||
|
@ -842,15 +840,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
su.is_del!=1 and su.state=0
|
su.is_del!=1 and su.state=0
|
||||||
and cfg.project_id=#{projectId} ) u
|
and cfg.project_id=#{projectId} ) u
|
||||||
join
|
join
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
||||||
select workerId,max(ifnull(attendance_time,attendance_out_time)) dt
|
select workerId,max(ifnull(attendance_time,attendance_out_time)) dt
|
||||||
from sur_project_attendance_data_${year}
|
from sur_project_attendance_data_${year}
|
||||||
where projectid=#{projectId} and is_del!=1
|
where projectid=#{projectId} and is_del!=1
|
||||||
GROUP BY workerId
|
GROUP BY workerId
|
||||||
order by max(ifnull(attendance_time,attendance_out_time))
|
order by max(ifnull(attendance_time,attendance_out_time))
|
||||||
) att on u.workerId=att.workerId
|
) att on u.workerId=att.workerId
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="statsSubDeptsUsersByProId" resultType="Map">
|
||||||
|
select '1' as craftType, u.state as useStatus, count(1) as total from sur_project_attendance_user u
|
||||||
|
left join sur_project_attendance_group g on g.serverid = u.groupId
|
||||||
|
where u.cfgid=#{proId} and u.specWorkType = 1 and g.companyTypeId != 1
|
||||||
|
group by u.state
|
||||||
|
UNION ALL
|
||||||
|
select '2' as craftType, u.state as useStatus, count(1) as total from sur_project_attendance_user u
|
||||||
|
left join sur_project_attendance_group g on g.serverid = u.groupId
|
||||||
|
where u.cfgid=#{proId} and u.specWorkType = 0 and g.companyTypeId != 1
|
||||||
|
group by u.state
|
||||||
|
UNION ALL
|
||||||
|
select '3' as craftType, u.state as useStatus, count(1) as total from sur_project_attendance_user u
|
||||||
|
left join sur_project_attendance_group g on g.serverid = u.groupId
|
||||||
|
where u.cfgid=#{proId} and g.companyTypeId = 1
|
||||||
|
group by u.state
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,6 +1,7 @@
|
||||||
package com.yanzhu.manage.controller;
|
package com.yanzhu.manage.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import com.yanzhu.common.core.domain.R;
|
import com.yanzhu.common.core.domain.R;
|
||||||
import com.yanzhu.common.core.enums.UseStateEnums;
|
import com.yanzhu.common.core.enums.UseStateEnums;
|
||||||
import com.yanzhu.common.core.text.Convert;
|
import com.yanzhu.common.core.text.Convert;
|
||||||
|
@ -22,7 +23,6 @@ import com.yanzhu.common.core.enums.UserPostEnums;
|
||||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
||||||
import com.yanzhu.manage.service.IUniService;
|
import com.yanzhu.manage.service.IUniService;
|
||||||
import com.yanzhu.security.utils.DictUtils;
|
import com.yanzhu.security.utils.DictUtils;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
package com.yanzhu.manage.controller.wechat;
|
package com.yanzhu.manage.controller.wechat;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
import com.yanzhu.common.core.web.controller.BaseController;
|
import com.yanzhu.common.core.web.controller.BaseController;
|
||||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||||
import com.yanzhu.common.redis.service.RedisService;
|
import com.yanzhu.common.redis.service.RedisService;
|
||||||
|
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||||
import com.yanzhu.manage.service.IAttendanceUbiDataService;
|
import com.yanzhu.manage.domain.SurProjectAttendanceData;
|
||||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
import com.yanzhu.manage.service.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -30,9 +33,18 @@ public class WXAttendanceController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAttendanceCfgService attendanceCfgService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAttendanceUbiDataService attendanceUbiDataService;
|
private IAttendanceUbiDataService attendanceUbiDataService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISurProjectAttendanceUserService surProjectAttendanceUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISurProjectAttendanceDataService surProjectAttendanceDataService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IProProjectInfoSubdeptsUsersService proProjectInfoSubdeptsUsersService;
|
private IProProjectInfoSubdeptsUsersService proProjectInfoSubdeptsUsersService;
|
||||||
|
|
||||||
|
@ -43,8 +55,16 @@ public class WXAttendanceController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/v1/findSubDeptsUsers/{proId}")
|
@GetMapping("/v1/findSubDeptsUsers/{proId}")
|
||||||
public AjaxResult findSubDeptsUsers(@PathVariable("proId") Long proId){
|
public AjaxResult findSubDeptsUsers(@PathVariable("proId") Long proId){
|
||||||
|
AttendanceCfg attendanceCfgQuery = new AttendanceCfg();
|
||||||
|
attendanceCfgQuery.setProjectId(proId);
|
||||||
|
List<AttendanceCfg> cfgList = attendanceCfgService.selectAttendanceCfgList(attendanceCfgQuery);
|
||||||
|
if(cfgList.size()>0 && (StringUtils.eqObj(cfgList.get(0).getVendorsCode(),"uni") || StringUtils.eqObj(cfgList.get(0).getVendorsCode(),"jgw"))){
|
||||||
List<Map<String, Object>> list = proProjectInfoSubdeptsUsersService.statsSubDeptsUsersByProId(proId);
|
List<Map<String, Object>> list = proProjectInfoSubdeptsUsersService.statsSubDeptsUsersByProId(proId);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
|
}else{
|
||||||
|
List<Map<String, Object>> list = surProjectAttendanceUserService.statsSubDeptsUsersByProId(cfgList.size()>0?cfgList.get(0).getId():0);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,8 +74,16 @@ public class WXAttendanceController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/v1/findDaysAttendanceView/{proId}")
|
@GetMapping("/v1/findDaysAttendanceView/{proId}")
|
||||||
public AjaxResult findDaysAttendanceView(@PathVariable("proId") Long proId){
|
public AjaxResult findDaysAttendanceView(@PathVariable("proId") Long proId){
|
||||||
|
AttendanceCfg attendanceCfgQuery = new AttendanceCfg();
|
||||||
|
attendanceCfgQuery.setProjectId(proId);
|
||||||
|
List<AttendanceCfg> cfgList = attendanceCfgService.selectAttendanceCfgList(attendanceCfgQuery);
|
||||||
|
if(cfgList.size()>0 && (StringUtils.eqObj(cfgList.get(0).getVendorsCode(),"uni") || StringUtils.eqObj(cfgList.get(0).getVendorsCode(),"jgw"))){
|
||||||
List<Map<String, Object>> list = attendanceUbiDataService.statsAttendanceDaysByProId(proId);
|
List<Map<String, Object>> list = attendanceUbiDataService.statsAttendanceDaysByProId(proId);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
|
}else{
|
||||||
|
List<Map<String, Object>> list = surProjectAttendanceDataService.statsAttendanceDaysByProId(proId);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +93,15 @@ public class WXAttendanceController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/v1/findSubDeptsAttendanceView/{proId}")
|
@GetMapping("/v1/findSubDeptsAttendanceView/{proId}")
|
||||||
public AjaxResult findSubDeptsAttendanceView(@PathVariable("proId") Long proId){
|
public AjaxResult findSubDeptsAttendanceView(@PathVariable("proId") Long proId){
|
||||||
List<Map<String, Object>> list = attendanceUbiDataService.statsAttendanceViewByProId(proId);
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
AttendanceCfg attendanceCfgQuery = new AttendanceCfg();
|
||||||
|
attendanceCfgQuery.setProjectId(proId);
|
||||||
|
List<AttendanceCfg> cfgList = attendanceCfgService.selectAttendanceCfgList(attendanceCfgQuery);
|
||||||
|
if(cfgList.size()>0 && (StringUtils.eqObj(cfgList.get(0).getVendorsCode(),"uni") || StringUtils.eqObj(cfgList.get(0).getVendorsCode(),"jgw"))){
|
||||||
|
list = attendanceUbiDataService.statsAttendanceViewByProId(proId);
|
||||||
|
}else{
|
||||||
|
list = surProjectAttendanceDataService.statsAttendanceViewByProId(proId);
|
||||||
|
}
|
||||||
Map<String, Object> data = new HashMap<>();
|
Map<String, Object> data = new HashMap<>();
|
||||||
data.put("list",list);
|
data.put("list",list);
|
||||||
data.put("user",list.stream().mapToInt((u) -> Integer.valueOf(String.valueOf(u.get("total")))).sum());
|
data.put("user",list.stream().mapToInt((u) -> Integer.valueOf(String.valueOf(u.get("total")))).sum());
|
||||||
|
|
|
@ -157,4 +157,18 @@ public interface ISurProjectAttendanceDataService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SurProjectAttendanceData> getRealAttendance(Long prjId, int year);
|
List<SurProjectAttendanceData> getRealAttendance(Long prjId, int year);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计今日出勤信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsAttendanceDaysByProId(Long proId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计人员出勤信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsAttendanceViewByProId(Long proId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,4 +183,11 @@ public interface ISurProjectAttendanceUserService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SurProjectAttendanceUser> getAttendanceAlert(Long prjId, int year);
|
List<SurProjectAttendanceUser> getAttendanceAlert(Long prjId, int year);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计劳务人员信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsSubDeptsUsersByProId(Long proId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
package com.yanzhu.manage.service.impl;
|
package com.yanzhu.manage.service.impl;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||||
import com.yanzhu.common.core.enums.ShiFouEnums;
|
import com.yanzhu.common.core.enums.ShiFouEnums;
|
||||||
|
import com.yanzhu.common.core.enums.SubDeptsEnums;
|
||||||
|
import com.yanzhu.common.core.enums.UserPostEnums;
|
||||||
import com.yanzhu.common.core.utils.DateUtils;
|
import com.yanzhu.common.core.utils.DateUtils;
|
||||||
import com.yanzhu.common.core.utils.StringUtils;
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||||
import com.yanzhu.common.core.enums.SubDeptsEnums;
|
|
||||||
import com.yanzhu.common.core.enums.UserPostEnums;
|
|
||||||
import com.yanzhu.manage.mapper.AttendanceUbiDataMapper;
|
import com.yanzhu.manage.mapper.AttendanceUbiDataMapper;
|
||||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
||||||
import com.yanzhu.manage.service.IAttendanceUbiDataService;
|
import com.yanzhu.manage.service.IAttendanceUbiDataService;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
import com.yanzhu.system.mapper.SysDictDataMapper;
|
import com.yanzhu.system.mapper.SysDictDataMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 考勤管理Service业务层处理
|
* 考勤管理Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
|
@ -331,6 +331,36 @@ public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanc
|
||||||
return surProjectAttendanceDataMapper.getRealAttendance(prjId,year);
|
return surProjectAttendanceDataMapper.getRealAttendance(prjId,year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计今日出勤信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> statsAttendanceDaysByProId(Long proId){
|
||||||
|
SurProjectAttendanceData query = new SurProjectAttendanceData();
|
||||||
|
query.setProjectId(proId);
|
||||||
|
return surProjectAttendanceDataMapper.statsAttendanceDaysByProId(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计人员出勤信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsAttendanceViewByProId(Long proId){
|
||||||
|
SurProjectAttendanceData query = new SurProjectAttendanceData();
|
||||||
|
query.setProjectId(proId);
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
params.put("beginTime",DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD));
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -6);
|
||||||
|
params.put("endTime",DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD));
|
||||||
|
query.setParams(params);
|
||||||
|
return surProjectAttendanceDataMapper.statsAttendanceViewByProId(query);
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Date dateEnd=new DateTime();
|
Date dateEnd=new DateTime();
|
||||||
Date dateStart=DateUtil.offsetDay(dateEnd,-7);
|
Date dateStart=DateUtil.offsetDay(dateEnd,-7);
|
||||||
|
|
|
@ -381,6 +381,15 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
|
||||||
return surProjectAttendanceUserMapper.getAttendanceAlert(prjId,year);
|
return surProjectAttendanceUserMapper.getAttendanceAlert(prjId,year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计劳务人员信息
|
||||||
|
* @param proId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> statsSubDeptsUsersByProId(Long proId){
|
||||||
|
return surProjectAttendanceUserMapper.statsSubDeptsUsersByProId(proId);
|
||||||
|
}
|
||||||
|
|
||||||
private Date findDate(List<SurProjectAttendanceUser> datas, SurProjectAttendanceUser u, String type) {
|
private Date findDate(List<SurProjectAttendanceUser> datas, SurProjectAttendanceUser u, String type) {
|
||||||
for (SurProjectAttendanceUser user:datas) {
|
for (SurProjectAttendanceUser user:datas) {
|
||||||
if(user.getWorkerId().equals(u.getWorkerId()) && user.getName().equals(type)){
|
if(user.getWorkerId().equals(u.getWorkerId()) && user.getName().equals(type)){
|
||||||
|
|
|
@ -14,9 +14,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import net.hasor.dataway.config.DatawayUtils;
|
import net.hasor.dataway.config.DatawayUtils;
|
||||||
import net.hasor.utils.ResourcesUtils;
|
|
||||||
import net.hasor.utils.StringUtils;
|
import net.hasor.utils.StringUtils;
|
||||||
import net.hasor.utils.io.FilenameUtils;
|
import net.hasor.utils.io.FilenameUtils;
|
||||||
import net.hasor.utils.io.IOUtils;
|
import net.hasor.utils.io.IOUtils;
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
package com.yanzhu.system.controller;
|
package com.yanzhu.system.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.yanzhu.common.core.utils.StringUtils;
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||||
import com.yanzhu.common.core.web.controller.BaseController;
|
import com.yanzhu.common.core.web.controller.BaseController;
|
||||||
|
@ -22,9 +10,15 @@ import com.yanzhu.common.log.annotation.Log;
|
||||||
import com.yanzhu.common.log.enums.BusinessType;
|
import com.yanzhu.common.log.enums.BusinessType;
|
||||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
import com.yanzhu.system.service.ISysDictDataService;
|
import com.yanzhu.system.service.ISysDictDataService;
|
||||||
import com.yanzhu.system.service.ISysDictTypeService;
|
import com.yanzhu.system.service.ISysDictTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典信息
|
* 数据字典信息
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.yanzhu.system.service;
|
package com.yanzhu.system.service;
|
||||||
|
|
||||||
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层
|
* 字典 业务层
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package com.yanzhu.system.service;
|
package com.yanzhu.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
import com.yanzhu.system.api.domain.SysDictType;
|
import com.yanzhu.system.api.domain.SysDictType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层
|
* 字典 业务层
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package com.yanzhu.system.service.impl;
|
package com.yanzhu.system.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
|
|
||||||
import com.yanzhu.security.utils.DictUtils;
|
import com.yanzhu.security.utils.DictUtils;
|
||||||
import com.yanzhu.system.mapper.SysDictDataMapper;
|
import com.yanzhu.system.mapper.SysDictDataMapper;
|
||||||
|
import com.yanzhu.system.service.ISysDictDataService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
import com.yanzhu.system.service.ISysDictDataService;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典 业务层处理
|
* 字典 业务层处理
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package com.yanzhu.system.service.impl;
|
package com.yanzhu.system.service.impl;
|
||||||
|
|
||||||
|
import com.yanzhu.api.domain.SysDictData;
|
||||||
import com.yanzhu.common.core.constant.UserConstants;
|
import com.yanzhu.common.core.constant.UserConstants;
|
||||||
import com.yanzhu.common.core.exception.ServiceException;
|
import com.yanzhu.common.core.exception.ServiceException;
|
||||||
import com.yanzhu.common.core.utils.StringUtils;
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
import com.yanzhu.security.utils.DictUtils;
|
import com.yanzhu.security.utils.DictUtils;
|
||||||
import com.yanzhu.system.api.domain.SysDictData;
|
|
||||||
import com.yanzhu.system.api.domain.SysDictType;
|
import com.yanzhu.system.api.domain.SysDictType;
|
||||||
import com.yanzhu.system.mapper.SysDictDataMapper;
|
import com.yanzhu.system.mapper.SysDictDataMapper;
|
||||||
import com.yanzhu.system.mapper.SysDictTypeMapper;
|
import com.yanzhu.system.mapper.SysDictTypeMapper;
|
||||||
|
|
Loading…
Reference in New Issue