用户常用应用配置 操作权限
This commit is contained in:
parent
5d91b50418
commit
633f2a64b1
@ -38,14 +38,12 @@ public class CommonlyUsedController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户常用应用配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:create')")
|
||||
public CommonResult<Long> createCommonlyUsed(@Valid @RequestBody CommonlyUsedSaveReqVO createReqVO) {
|
||||
return success(commonlyUsedService.createCommonlyUsed(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/batchCreateOrEditOrDel")
|
||||
@Operation(summary = "批量创建编辑删除用户常用应用配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:create')")
|
||||
public CommonResult<?> batchCreateOrEditOrDel(@Valid @RequestBody List<CommonlyUsedSaveReqVO> list) {
|
||||
commonlyUsedService.batchCreateOrEditOrDel(list);
|
||||
return success(true);
|
||||
@ -53,7 +51,6 @@ public class CommonlyUsedController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户常用应用配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:update')")
|
||||
public CommonResult<Boolean> updateCommonlyUsed(@Valid @RequestBody CommonlyUsedSaveReqVO updateReqVO) {
|
||||
commonlyUsedService.updateCommonlyUsed(updateReqVO);
|
||||
return success(true);
|
||||
@ -61,7 +58,6 @@ public class CommonlyUsedController {
|
||||
|
||||
@PutMapping("/batchUpdate")
|
||||
@Operation(summary = "批量更新用户常用应用配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:update')")
|
||||
public CommonResult<Boolean> batchUpdate(@Valid @RequestBody List<CommonlyUsedSaveReqVO> list) {
|
||||
commonlyUsedService.batchUpdate(list);
|
||||
return success(true);
|
||||
@ -70,7 +66,6 @@ public class CommonlyUsedController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户常用应用配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:delete')")
|
||||
public CommonResult<Boolean> deleteCommonlyUsed(@RequestParam("id") Long id) {
|
||||
commonlyUsedService.deleteCommonlyUsed(id);
|
||||
return success(true);
|
||||
@ -78,7 +73,6 @@ public class CommonlyUsedController {
|
||||
|
||||
@DeleteMapping("/batchDelete")
|
||||
@Operation(summary = "批量删除用户常用应用配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:delete')")
|
||||
public CommonResult<Boolean> batchDelete(@RequestBody List<Long> ids) {
|
||||
commonlyUsedService.batchDelete(ids);
|
||||
return success(true);
|
||||
@ -87,7 +81,6 @@ public class CommonlyUsedController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户常用应用配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:query')")
|
||||
public CommonResult<CommonlyUsedRespVO> getCommonlyUsed(@RequestParam("id") Long id) {
|
||||
CommonlyUsedDO commonlyUsed = commonlyUsedService.getCommonlyUsed(id);
|
||||
return success(BeanUtils.toBean(commonlyUsed, CommonlyUsedRespVO.class));
|
||||
@ -95,7 +88,6 @@ public class CommonlyUsedController {
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得用户常用应用配置列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:query')")
|
||||
public CommonResult<CommonlyUsedVO> getCommonlyUsedList() {
|
||||
CommonlyUsedVO vo = commonlyUsedService.getCommonlyUsedList();
|
||||
return success(vo);
|
||||
@ -103,7 +95,6 @@ public class CommonlyUsedController {
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户常用应用配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportCommonlyUsedExcel(@Valid CommonlyUsedPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
@ -1025,14 +1025,23 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
//先减去补卡次数
|
||||
this.useReplacementCardNum(userId);
|
||||
try {
|
||||
int update = attendancePunchRecordMapper.update(new AttendancePunchRecordDO().setStatus(AttendanceOnTheDayDTO.REPLACEMENT_CARD),
|
||||
new LambdaQueryWrapper<AttendancePunchRecordDO>()
|
||||
// -- 找到这条缺卡记录
|
||||
LambdaQueryWrapper<AttendancePunchRecordDO> lambdaQueryWrapper = new LambdaQueryWrapper<AttendancePunchRecordDO>()
|
||||
.eq(AttendancePunchRecordDO::getUserId, userId)
|
||||
.eq(AttendancePunchRecordDO::getAttendanceGroupShiftItemId, dto.getAttendanceGroupShiftItemId())
|
||||
.eq(AttendancePunchRecordDO::getWorkType, dto.getWorkType())
|
||||
.eq(AttendancePunchRecordDO::getActualDayTime, dto.getActualDayTime())
|
||||
.eq(AttendancePunchRecordDO::getStatus, AttendanceOnTheDayDTO.PUNCH_STATUS_MISS));
|
||||
if (update <= 0) {
|
||||
.eq(AttendancePunchRecordDO::getStatus, AttendanceOnTheDayDTO.PUNCH_STATUS_MISS);
|
||||
|
||||
List<AttendancePunchRecordDO> list = attendancePunchRecordMapper.selectList(lambdaQueryWrapper);
|
||||
int update = 0;
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
AttendancePunchRecordDO attendancePunchRecordDO = list.get(0);
|
||||
attendancePunchRecordDO.setStatus(AttendanceOnTheDayDTO.REPLACEMENT_CARD);
|
||||
attendancePunchRecordDO.setPunchTime(attendancePunchRecordDO.getShouldPunchTime());
|
||||
update = attendancePunchRecordMapper.updateById(attendancePunchRecordDO);
|
||||
}
|
||||
if (CollectionUtil.isEmpty(list) || update <= 0) {
|
||||
throw exception(CANNOT_FIND_THE_RECORD_THAT_NEEDS_TO_BE_REPLACED);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user