| | |
| | | package cn.lihu.jh.module.ecg.controller.admin.jobrecord; |
| | | |
| | | import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | |
| | | import jakarta.validation.constraints.*; |
| | | import jakarta.validation.*; |
| | | import jakarta.servlet.http.*; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | |
| | |
| | | import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.*; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO; |
| | | import cn.lihu.jh.module.ecg.service.jobrecord.JobRecordService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | @Tag(name = "管理后台 - 工作记录") |
| | | @RestController |
| | |
| | | return success(BeanUtils.toBean(pageResult, JobRecordRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/doctor-page") |
| | | @Operation(summary = "获得用户自己的工作记录分页") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<PageResult<JobRecordRespVO>> getJobRecordDoctorPage(@Valid JobRecordPageReqVO pageReqVO) { |
| | | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| | | String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); |
| | | |
| | | pageReqVO.setDocId( userId ); |
| | | PageResult<JobRecordDO> pageResult = jobRecordService.getJobRecordPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, JobRecordRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导出工作记录 Excel") |
| | | @PreAuthorize("@ss.hasPermission('ecg:job-record:export')") |
| | |
| | | BeanUtils.toBean(list, JobRecordRespVO.class)); |
| | | } |
| | | |
| | | } |
| | | @GetMapping("/job-statistic") |
| | | @Operation(summary = "工作量统计") |
| | | @PreAuthorize("@ss.hasPermission('ecg:job-record:statistic')") |
| | | public CommonResult<List<JobRecordStatisticVO>> getJobStatistic(@Valid JobRecordPageReqVO pageReqVO) { |
| | | List<JobRecordStatisticDO> statisticDOList = jobRecordService.getJobStatistic(pageReqVO.getJobTime()[0], pageReqVO.getJobTime()[1]); |
| | | return success(BeanUtils.toBean(statisticDOList, JobRecordStatisticVO.class)); |
| | | } |
| | | } |
| | | |