增加加班时长/

This commit is contained in:
aikai 2024-06-21 09:34:53 +08:00
parent c1b3031691
commit 1257d8e288
10 changed files with 88 additions and 7 deletions

View File

@ -63,7 +63,8 @@ public class DeptDataPermissionRule implements DataPermissionRule {
"work_log_statistics", "work_log_statistics",
"work_log_instance_ext", "work_log_instance_ext",
"bpm_oa_work_task", "bpm_oa_work_task",
"zc_dept_assets" "zc_dept_assets",
"zc_dept_assets_in_out_stock"
); );
/** /**

View File

@ -24,6 +24,10 @@ public class AssetsSecondmentRecordRespVO {
@ExcelProperty("资产名称") @ExcelProperty("资产名称")
private String assetsName; private String assetsName;
@Schema(description = "资产编号", example = "13886")
@ExcelProperty("资产编号")
private String assetsNo;
@Schema(description = "使用人id", example = "12905") @Schema(description = "使用人id", example = "12905")
@ExcelProperty("使用人id") @ExcelProperty("使用人id")
private Long useUserId; private Long useUserId;

View File

@ -0,0 +1,53 @@
package cn.iocoder.yudao.module.system.controller.admin.attendance.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class AttendanceExportExcelByCycleVO {
@Schema(description = "用户名称")
private String name;
@Schema(description = "考勤组名称")
private String groupName;
@Schema(description = "部门名称")
private String deptName;
@Schema(description = "职位名称")
private String postName;
@Schema(description = "出勤天数")
private String attendanceDays;
@Schema(description = "休息天数")
private String restDays;
@Schema(description = "工作时长")
private String lengthOfWork;
@Schema(description = "迟到次数")
private String lateNum;
@Schema(description = "迟到时长")
private String lateTime;
@Schema(description = "早退次数")
private String leaveEarlyNum;
@Schema(description = "早退时长")
private String leaveEarlyTime;
@Schema(description = "上班缺卡次数")
private String upMissingCardsNum;
@Schema(description = "下班缺卡次数")
private String downMissingCardsNum;
@Schema(description = "旷工天数")
private String absenteeismNum;
// @Schema(description = "出差时长")
// private String onBusinessTripTime;
// @Schema(description = "加班-审批单统计")
// private String overtimeApprovalOrderStatistics;
@Data
public class OvertimeVO {
@Schema(description = "工作日加班")
private String workingOvertimeOnWorkingDays;
@Schema(description = "休息日加班")
private String workOvertimeOnRestDays;
@Schema(description = "节假日加班")
private String workOvertimeOnHolidays;
}
}

View File

@ -13,4 +13,6 @@ public class RoleSimpleRespVO {
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道") @Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
private String name; private String name;
@Schema(description = "角色编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "admin")
private String code;
} }

View File

@ -78,6 +78,9 @@ public class AttendancePunchRecordSaveReqVO {
@Schema(description = "早退时长时间戳") @Schema(description = "早退时长时间戳")
private Long leaveEarlyTime; private Long leaveEarlyTime;
@Schema(description = "加班时长时间戳")
private Long workOvertimeTime;
/** /**
* 打卡类型(0上班卡 1下班卡 2迟到卡 3早退卡 4未到打卡时间) 打卡状态 0正常 1迟到 2早退 3缺卡 4未打卡(还没到打卡时间) 5补卡 * 打卡类型(0上班卡 1下班卡 2迟到卡 3早退卡 4未到打卡时间) 打卡状态 0正常 1迟到 2早退 3缺卡 4未打卡(还没到打卡时间) 5补卡

View File

@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.system.controller.admin.user;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSimpleRespVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileRespVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileRespVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
@ -73,6 +75,18 @@ public class UserProfileController {
return success(UserConvert.INSTANCE.convert(user, userRoles, dept, posts, socialUsers)); return success(UserConvert.INSTANCE.convert(user, userRoles, dept, posts, socialUsers));
} }
@GetMapping("/getRoles")
@Operation(summary = "获得登录用户角色信息")
@DataPermission(enable = false) // 关闭数据权限避免只查看自己时查询不到部门
public CommonResult<List<RoleSimpleRespVO>> getRoles() {
// 获得用户基本信息
AdminUserDO user = userService.getUser(getLoginUserId());
// 获得用户角色
List<RoleDO> userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId()));
List<RoleSimpleRespVO> bean = BeanUtils.toBean(userRoles, RoleSimpleRespVO.class);
return success(bean);
}
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "修改用户个人信息") @Operation(summary = "修改用户个人信息")
public CommonResult<Boolean> updateUserProfile(@Valid @RequestBody UserProfileUpdateReqVO reqVO) { public CommonResult<Boolean> updateUserProfile(@Valid @RequestBody UserProfileUpdateReqVO reqVO) {

View File

@ -125,6 +125,11 @@ public class AttendancePunchRecordDO extends BaseDO {
*/ */
private Long leaveEarlyTime; private Long leaveEarlyTime;
/**
* 加班时长时间戳
*/
private Long workOvertimeTime;
/** /**
* 是否已提醒 0否 1是 * 是否已提醒 0否 1是
*/ */

View File

@ -63,7 +63,7 @@ public class RemindJob {
if (attendancePunchRecordDO.getWorkType().equals(Constants.ZERO) && futureTime.isAfter(attendancePunchRecordDO.getShouldPunchTime())) { if (attendancePunchRecordDO.getWorkType().equals(Constants.ZERO) && futureTime.isAfter(attendancePunchRecordDO.getShouldPunchTime())) {
AttendanceWorkDTO dto = new AttendanceWorkDTO(); AttendanceWorkDTO dto = new AttendanceWorkDTO();
dto.setWorkTypeStr("上班打卡"); dto.setWorkTypeStr("上班打卡");
dto.setData(String.format("还有%s钟就要上班了,别忘记打卡哦~", dto.setData(String.format("还有%s钟就要上班了,别忘记打卡哦~",
DateUtil.formatBetween(LocalDateTimeUtil.between(localDateTime, attendancePunchRecordDO.getShouldPunchTime()).toMillis(), BetweenFormatter.Level.MINUTE))); DateUtil.formatBetween(LocalDateTimeUtil.between(localDateTime, attendancePunchRecordDO.getShouldPunchTime()).toMillis(), BetweenFormatter.Level.MINUTE)));
map.put(attendancePunchRecordDO.getUserId(), dto); map.put(attendancePunchRecordDO.getUserId(), dto);
attendancePunchRecordDO.setRemindFlag(Constants.TRUE); attendancePunchRecordDO.setRemindFlag(Constants.TRUE);

View File

@ -163,6 +163,7 @@ public class AttendanceServiceImpl implements AttendanceService {
//取绝对值 如果status是负数则变为正数 //取绝对值 如果status是负数则变为正数
.setLateTime(Constants.ONE.equals(status) ? Math.abs(LocalDateTimeUtil.between(dto.getLocalDateTime(), pageVO.getShouldPunchTime(), ChronoUnit.MILLIS)) : 0L) .setLateTime(Constants.ONE.equals(status) ? Math.abs(LocalDateTimeUtil.between(dto.getLocalDateTime(), pageVO.getShouldPunchTime(), ChronoUnit.MILLIS)) : 0L)
.setLeaveEarlyTime(Constants.TWO.equals(status) ? Math.abs(LocalDateTimeUtil.between(dto.getLocalDateTime(), pageVO.getShouldPunchTime(), ChronoUnit.MILLIS)) : 0L) .setLeaveEarlyTime(Constants.TWO.equals(status) ? Math.abs(LocalDateTimeUtil.between(dto.getLocalDateTime(), pageVO.getShouldPunchTime(), ChronoUnit.MILLIS)) : 0L)
.setWorkOvertimeTime(Constants.ZERO.equals(status) && Constants.ONE.equals(pageVO.getPunchType()) ? Math.abs(LocalDateTimeUtil.between(dto.getLocalDateTime(), pageVO.getShouldPunchTime(), ChronoUnit.MILLIS)) : 0L)
.setRemark(dto.getRemark()) .setRemark(dto.getRemark())
.setImage(dto.getImage()) .setImage(dto.getImage())
.setPunchAddress(dto.getPunchAddress()); .setPunchAddress(dto.getPunchAddress());
@ -760,10 +761,6 @@ public class AttendanceServiceImpl implements AttendanceService {
@Override @Override
public void exportAttendanceExcel(HttpServletResponse response, ExportAttendanceExcelDTO dto) { public void exportAttendanceExcel(HttpServletResponse response, ExportAttendanceExcelDTO dto) {
// 导出 Excel
// ExcelUtils.write(response, "考勤组人员.xls", "数据", AttendanceGroupUserRespVO.class,
// BeanUtils.toBean(list, AttendanceGroupUserRespVO.class));
} }
/** /**

View File

@ -14,6 +14,7 @@
SELECT a.id, SELECT a.id,
a.assets_id, a.assets_id,
b.name as assetsName, b.name as assetsName,
b.assets_no as assetsNo,
a.use_user_id, a.use_user_id,
c.nickname as useUserName, c.nickname as useUserName,
a.use_dept_id, a.use_dept_id,
@ -36,6 +37,7 @@
left join system_users as d on a.principal_user_id = d.id left join system_users as d on a.principal_user_id = d.id
left join system_dept as e on a.use_dept_id = e.id left join system_dept as e on a.use_dept_id = e.id
<where> <where>
a.deleted = 0
<if test="vo.useUserId != null"> <if test="vo.useUserId != null">
and a.use_user_id = #{vo.useUserId} and a.use_user_id = #{vo.useUserId}
</if> </if>
@ -65,7 +67,7 @@
and a.create_time &lt;= #{vo.createTime[1]} and a.create_time &lt;= #{vo.createTime[1]}
</if> </if>
</if> </if>
order by a.create_time desc
</where> </where>
order by a.create_time desc
</select> </select>
</mapper> </mapper>