请假
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
e811d20348
commit
82a64323c3
@ -14,8 +14,10 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode PJ_NOT_EXISTS = new ErrorCode(1_009_002_000, "主要用于首页的项目数据不存在");
|
ErrorCode PJ_NOT_EXISTS = new ErrorCode(1_009_002_000, "主要用于首页的项目数据不存在");
|
||||||
// ========== 公告内容 1_009_003_000 ==========
|
// ========== 公告内容 1_009_003_000 ==========
|
||||||
ErrorCode IMG_NOT_EXISTS = new ErrorCode(1_009_003_000, "公告内容不存在");
|
ErrorCode IMG_NOT_EXISTS = new ErrorCode(1_009_003_000, "公告内容不存在");
|
||||||
// ========== 公司新闻 1-011-003-000 ==========
|
// ========== 公司新闻 1_009_004_000 ==========
|
||||||
ErrorCode NEWS_NOT_EXISTS = new ErrorCode(1_011_003_000, "公司新闻不存在");
|
ErrorCode NEWS_NOT_EXISTS = new ErrorCode(1_009_004_000, "公司新闻不存在");
|
||||||
|
// ========== 请假管理 1_009_005_000 ==========
|
||||||
|
ErrorCode QJGL_NOT_EXISTS = new ErrorCode(1_009_005_000, "请假管理不存在");
|
||||||
// ========== 车辆管理 1_011_004_000 ==========
|
// ========== 车辆管理 1_011_004_000 ==========
|
||||||
ErrorCode CLGL_NOT_EXISTS = new ErrorCode(1_011_004_000, "车辆管理不存在");
|
ErrorCode CLGL_NOT_EXISTS = new ErrorCode(1_011_004_000, "车辆管理不存在");
|
||||||
}
|
}
|
||||||
|
@ -65,5 +65,11 @@
|
|||||||
<version>2.1.0-jdk8-snapshot</version>
|
<version>2.1.0-jdk8-snapshot</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
<artifactId>yudao-module-system-biz</artifactId>
|
||||||
|
<version>2.1.0-jdk8-snapshot</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.home.controller.admin.qjgl;
|
package cn.iocoder.yudao.module.home.controller.admin.qjgl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
@ -9,6 +10,9 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|||||||
import cn.iocoder.yudao.module.home.controller.admin.qjgl.vo.*;
|
import cn.iocoder.yudao.module.home.controller.admin.qjgl.vo.*;
|
||||||
import cn.iocoder.yudao.module.home.dal.dataobject.qjgl.QjglDO;
|
import cn.iocoder.yudao.module.home.dal.dataobject.qjgl.QjglDO;
|
||||||
import cn.iocoder.yudao.module.home.service.qjgl.QjglService;
|
import cn.iocoder.yudao.module.home.service.qjgl.QjglService;
|
||||||
|
import cn.iocoder.yudao.module.home.convert.qjgl.QjglConvert;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -21,9 +25,11 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 请假管理")
|
@Tag(name = "管理后台 - 请假管理")
|
||||||
@ -34,17 +40,18 @@ public class QjglController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private QjglService qjglService;
|
private QjglService qjglService;
|
||||||
|
@Resource
|
||||||
|
private DeptService deptService;
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建请假管理")
|
@Operation(summary = "创建请假管理")
|
||||||
@PreAuthorize("@ss.hasPermission('base:qjgl:create')")
|
@PreAuthorize("@ss.hasPermission('home:qjgl:create')")
|
||||||
public CommonResult<Long> createQjgl(@Valid @RequestBody QjglSaveReqVO createReqVO) {
|
public CommonResult<Long> createQjgl(@Valid @RequestBody QjglSaveReqVO createReqVO) {
|
||||||
return success(qjglService.createQjgl(getLoginUserId(),createReqVO));
|
return success(qjglService.createQjgl(getLoginUserId(),createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新请假管理")
|
@Operation(summary = "更新请假管理")
|
||||||
@PreAuthorize("@ss.hasPermission('base:qjgl:update')")
|
@PreAuthorize("@ss.hasPermission('home:qjgl:update')")
|
||||||
public CommonResult<Boolean> updateQjgl(@Valid @RequestBody QjglSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateQjgl(@Valid @RequestBody QjglSaveReqVO updateReqVO) {
|
||||||
qjglService.updateQjgl(updateReqVO);
|
qjglService.updateQjgl(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -53,7 +60,7 @@ public class QjglController {
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除请假管理")
|
@Operation(summary = "删除请假管理")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('base:qjgl:delete')")
|
@PreAuthorize("@ss.hasPermission('home:qjgl:delete')")
|
||||||
public CommonResult<Boolean> deleteQjgl(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteQjgl(@RequestParam("id") Long id) {
|
||||||
qjglService.deleteQjgl(id);
|
qjglService.deleteQjgl(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -62,7 +69,7 @@ public class QjglController {
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得请假管理")
|
@Operation(summary = "获得请假管理")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('base:qjgl:query')")
|
@PreAuthorize("@ss.hasPermission('home:qjgl:query')")
|
||||||
public CommonResult<QjglRespVO> getQjgl(@RequestParam("id") Long id) {
|
public CommonResult<QjglRespVO> getQjgl(@RequestParam("id") Long id) {
|
||||||
QjglDO qjgl = qjglService.getQjgl(id);
|
QjglDO qjgl = qjglService.getQjgl(id);
|
||||||
return success(BeanUtils.toBean(qjgl, QjglRespVO.class));
|
return success(BeanUtils.toBean(qjgl, QjglRespVO.class));
|
||||||
@ -70,15 +77,24 @@ public class QjglController {
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得请假管理分页")
|
@Operation(summary = "获得请假管理分页")
|
||||||
@PreAuthorize("@ss.hasPermission('base:qjgl:query')")
|
@PreAuthorize("@ss.hasPermission('home:qjgl:query')")
|
||||||
public CommonResult<PageResult<QjglRespVO>> getQjglPage(@Valid QjglPageReqVO pageReqVO) {
|
public CommonResult<PageResult<QjglRespVO>> getQjglPage(@Valid QjglPageReqVO pageReqVO) {
|
||||||
PageResult<QjglDO> pageResult = qjglService.getQjglPage(pageReqVO);
|
PageResult<QjglDO> pageResult = qjglService.getQjglPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, QjglRespVO.class));
|
// return success(BeanUtils.toBean(pageResult, QjglRespVO.class));
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
||||||
|
return success(new PageResult<>(pageResult.getTotal()));
|
||||||
|
}
|
||||||
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
||||||
|
convertList(pageResult.getList(), QjglDO::getDeptId));
|
||||||
|
|
||||||
|
// 转换并返回结果
|
||||||
|
return success(new PageResult<>(QjglConvert.INSTANCE.convertList(pageResult.getList(), deptMap), pageResult.getTotal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出请假管理 Excel")
|
@Operation(summary = "导出请假管理 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('base:qjgl:export')")
|
@PreAuthorize("@ss.hasPermission('home:qjgl:export')")
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportQjglExcel(@Valid QjglPageReqVO pageReqVO,
|
public void exportQjglExcel(@Valid QjglPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
|
@ -52,6 +52,10 @@ public class QjglRespVO {
|
|||||||
@ExcelProperty("部门id")
|
@ExcelProperty("部门id")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "部门名称", example = "IT 部")
|
||||||
|
@ExcelProperty("部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.convert;
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.convert.qjgl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.home.controller.admin.qjgl.vo.QjglRespVO;
|
||||||
|
import cn.iocoder.yudao.module.home.dal.dataobject.qjgl.QjglDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface QjglConvert {
|
||||||
|
QjglConvert INSTANCE = Mappers.getMapper(QjglConvert.class);
|
||||||
|
|
||||||
|
default List<QjglRespVO> convertList(List<QjglDO> list, Map<Long, DeptDO> deptMap) {
|
||||||
|
return list.stream().map(QjglDO -> {
|
||||||
|
DeptDO deptDO = deptMap.get(QjglDO.getDeptId());
|
||||||
|
return convert(QjglDO, deptDO);
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
default QjglRespVO convert(QjglDO qjgl, DeptDO dept) {
|
||||||
|
QjglRespVO QjglVO = BeanUtils.toBean(qjgl, QjglRespVO.class);
|
||||||
|
if (dept != null) {
|
||||||
|
QjglVO.setDeptName(dept.getName());
|
||||||
|
}
|
||||||
|
return QjglVO;
|
||||||
|
}
|
||||||
|
}
|
@ -46,7 +46,7 @@ spring:
|
|||||||
primary: master
|
primary: master
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://140.143.164.40:3306/yudao-oa?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
url: jdbc:mysql://192.168.1.28:3306/yudao-vue?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
# url: jdbc:mysql://192.168.1.28:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
# url: jdbc:mysql://192.168.1.28:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例
|
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例
|
||||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
||||||
@ -71,7 +71,7 @@ spring:
|
|||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
redis:
|
redis:
|
||||||
host: 140.143.164.40 # 地址140.143.164.40
|
host: 192.168.1.28 # 地址140.143.164.40
|
||||||
port: 6379 # 端口
|
port: 6379 # 端口
|
||||||
database: 0 # 数据库索引
|
database: 0 # 数据库索引
|
||||||
password: 123456
|
password: 123456
|
||||||
|
Loading…
Reference in New Issue
Block a user