具体用户设置是否可以外勤打卡
This commit is contained in:
parent
56a4ef5629
commit
fb56f2093a
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.equipment.vo.userExt;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -31,6 +32,10 @@ public class UsersExtRespVO {
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "是否允许外勤打卡 0否 1是", example = "0")
|
||||
@ExcelProperty("是否允许外勤打卡")
|
||||
private Integer fieldworkFlag;
|
||||
|
||||
@Schema(description = "人脸图片地址")
|
||||
@ExcelProperty("人脸图片")
|
||||
private String faceImg;
|
||||
@ -47,4 +52,4 @@ public class UsersExtRespVO {
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,14 @@ public class UserController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/update-fieldwork")
|
||||
@Operation(summary = "修改用户外勤打卡状态")
|
||||
public CommonResult<Boolean> updateFieldwork(@Valid @RequestBody UserUpdateFieldworkReqVO reqVO) {
|
||||
userService.updateFieldwork(reqVO.getId(), reqVO.getFieldworkFlag());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:list')")
|
||||
|
@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.user.vo.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 用户更新状态 Request VO")
|
||||
@Data
|
||||
public class UserUpdateFieldworkReqVO {
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "角色编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "是否允许外勤打卡 0否 1是", example = "0")
|
||||
private Integer fieldworkFlag;
|
||||
}
|
@ -4,7 +4,10 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
@ -92,6 +95,14 @@ public class AdminUserDO extends TenantBaseDO {
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否允许外勤打卡 0否 1是
|
||||
* <p>
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer fieldworkFlag;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
* 1:公司用户 2:工厂用户
|
||||
|
@ -258,7 +258,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
LocalDateTime localDateTime = dto.getLocalDateTime();
|
||||
LocalDateTime nextDayDateTime = LocalDateTimeUtil.offset(localDateTime, 1, ChronoUnit.DAYS);
|
||||
AttendanceGroupDO activationGroup = dto.getActivationGroup();
|
||||
vo.setFieldworkFlag(activationGroup.getFieldworkFlag());
|
||||
vo.setFieldworkFlag(dto.getUser().getFieldworkFlag() == null ? activationGroup.getFieldworkFlag() : dto.getUser().getFieldworkFlag());
|
||||
// - 根据经纬度判断是否在对应班组的打卡点上 - 如果是考勤机的话默认就是在打卡点
|
||||
vo.setPunchPoint(AttendanceGroupDO.PUNCH_TYPE_ATTENDANCE_MACHINE.equals(dto.getPunchType()) ? Constants.TRUE :
|
||||
GeoUtil.distance(Double.parseDouble(dto.getLatitude()), Double.parseDouble(dto.getLongitude())
|
||||
|
@ -94,6 +94,14 @@ public interface AdminUserService {
|
||||
*/
|
||||
void updateUserStatus(Long id, Integer status);
|
||||
|
||||
/**
|
||||
* 修改外勤打卡状态
|
||||
*
|
||||
* @param id 用户编号
|
||||
* @param fieldworkFlag 状态
|
||||
*/
|
||||
void updateFieldwork(Long id, Integer fieldworkFlag);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*
|
||||
@ -308,4 +316,5 @@ public interface AdminUserService {
|
||||
* @return
|
||||
*/
|
||||
IPage<UserSimpleRespVO> getAllUserListByGroupIds(UserPageDTO dto);
|
||||
|
||||
}
|
||||
|
@ -230,6 +230,15 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
userMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFieldwork(Long id, Integer fieldworkFlag) {
|
||||
// 更新状态
|
||||
AdminUserDO updateObj = new AdminUserDO();
|
||||
updateObj.setId(id);
|
||||
updateObj.setFieldworkFlag(fieldworkFlag);
|
||||
userMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteUser(Long id) {
|
||||
|
@ -14,6 +14,7 @@
|
||||
b.id,
|
||||
a.id AS userId,
|
||||
a.nickname AS userName,
|
||||
a.fieldwork_flag as fieldworkFlag,
|
||||
a.dept_id AS dept_id,
|
||||
b.face_img AS faceImg,
|
||||
b.attendance_machine_nos AS attendanceMachineNos,
|
||||
@ -56,4 +57,4 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user