bpm大升级
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled
This commit is contained in:
parent
cde20db807
commit
909d40754a
File diff suppressed because one or more lines are too long
@ -54,4 +54,6 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode NJGL_BACK_DAY = new ErrorCode(1_011_021_000, "销假审批错误");
|
||||
// ========== 收发文编号 1_011_022_000 ==========
|
||||
ErrorCode NUMBERS_NOT_EXISTS = new ErrorCode(1_011_022_000, "收发文编号不存在");
|
||||
// ========== 发文管理 1_011_023_000==========
|
||||
ErrorCode FWGL_NOT_EXISTS = new ErrorCode(1_011_023_000, "发文管理不存在");
|
||||
}
|
||||
|
@ -0,0 +1,113 @@
|
||||
package cn.iocoder.yudao.module.home.controller.admin.fwgl;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.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 javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.home.controller.admin.fwgl.vo.*;
|
||||
import cn.iocoder.yudao.module.home.dal.dataobject.fwgl.FwglDO;
|
||||
import cn.iocoder.yudao.module.home.service.fwgl.FwglService;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 发文管理")
|
||||
@RestController
|
||||
@RequestMapping("/home/fwgl")
|
||||
@Validated
|
||||
public class FwglController {
|
||||
|
||||
@Resource
|
||||
private FwglService fwglService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建发文管理")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:create')")
|
||||
public CommonResult<Long> createFwgl(@Valid @RequestBody FwglSaveReqVO createReqVO) {
|
||||
return success(fwglService.createFwgl(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/saveDraft")
|
||||
@Operation(summary = "创建发文管理为草稿")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:create')")
|
||||
public CommonResult<Long> saveDraftFwgl(@Valid @RequestBody FwglSaveReqVO createReqVO) {
|
||||
return success(fwglService.saveDraft(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新发文管理")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:update')")
|
||||
public CommonResult<Boolean> updateFwgl(@Valid @RequestBody FwglSaveReqVO updateReqVO) {
|
||||
fwglService.updateFwgl(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除发文管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:delete')")
|
||||
public CommonResult<Boolean> deleteFwgl(@RequestParam("id") Long id) {
|
||||
fwglService.deleteFwgl(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得发文管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:query')")
|
||||
public CommonResult<FwglRespVO> getFwgl(@RequestParam("id") Long id) {
|
||||
FwglDO fwgl = fwglService.getFwgl(id);
|
||||
return success(BeanUtils.toBean(fwgl, FwglRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得发文管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:query')")
|
||||
public CommonResult<PageResult<FwglRespVO>> getFwglPage(@Valid FwglPageReqVO pageReqVO) {
|
||||
PageResult<FwglDO> pageResult = fwglService.getFwglPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FwglRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/draft")
|
||||
@Operation(summary = "获得发文管理草稿分页")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:query')")
|
||||
public CommonResult<PageResult<FwglRespVO>> getFwglDraft(@Valid FwglPageReqVO pageReqVO) {
|
||||
PageResult<FwglDO> pageResult = fwglService.getFwglDraft(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FwglRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出发文管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('home:fwgl:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportFwglExcel(@Valid FwglPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FwglDO> list = fwglService.getFwglPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "发文管理.xls", "数据", FwglRespVO.class,
|
||||
BeanUtils.toBean(list, FwglRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.home.controller.admin.fwgl.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 发文管理分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FwglPageReqVO extends PageParam {
|
||||
//1.去掉 userId、processInstanceId、deptId的字段定义
|
||||
//2.检查必要定义字段title、userName、deptName、status,六个字段定义
|
||||
@Schema(description = "发文标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "作者", example = "赵六")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "起草时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] fwglTime;
|
||||
|
||||
@Schema(description = "发文文号")
|
||||
private String fwglBh;
|
||||
|
||||
@Schema(description = "电话号码")
|
||||
private String fwglPhone;
|
||||
|
||||
@Schema(description = "发文密级")
|
||||
private Integer fwglMj;
|
||||
|
||||
@Schema(description = "发文急缓")
|
||||
private Integer fwglJh;
|
||||
|
||||
@Schema(description = "主送部门id", example = "12275")
|
||||
private Long fwglSendDeptid;
|
||||
|
||||
@Schema(description = "主送部门名字", example = "王五")
|
||||
private String fwglSendName;
|
||||
|
||||
@Schema(description = "会签部门id", example = "11155")
|
||||
private Long fwglHqDeptid;
|
||||
|
||||
@Schema(description = "会签部门名字", example = "赵六")
|
||||
private String fwglHqName;
|
||||
|
||||
@Schema(description = "正文路径")
|
||||
private String[] filePath;
|
||||
|
||||
@Schema(description = "附件路径")
|
||||
private String[] attachPath;
|
||||
|
||||
@Schema(description = "部门id", example = "25467")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名字", example = "赵六")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "14391")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "申请人的用户编号", example = "26449")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "审批状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package cn.iocoder.yudao.module.home.controller.admin.fwgl.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 发文管理 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FwglRespVO {
|
||||
//1.去掉 userId的字段定义
|
||||
//2.检查必要定义字段title、userName、deptId、deptName、processInstanceId、status,六个字段定义
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5038")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "发文标题")
|
||||
@ExcelProperty("发文标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("作者")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "起草时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("起草时间")
|
||||
private LocalDateTime fwglTime;
|
||||
|
||||
@Schema(description = "发文文号")
|
||||
@ExcelProperty("发文文号")
|
||||
private String fwglBh;
|
||||
|
||||
@Schema(description = "电话号码")
|
||||
@ExcelProperty("电话号码")
|
||||
private String fwglPhone;
|
||||
|
||||
@Schema(description = "发文密级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "发文密级", converter = DictConvert.class)
|
||||
@DictFormat("fwgl_mj_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer fwglMj;
|
||||
|
||||
@Schema(description = "发文急缓", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "发文急缓", converter = DictConvert.class)
|
||||
@DictFormat("fw_jh_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer fwglJh;
|
||||
|
||||
@Schema(description = "主送部门id", example = "12275")
|
||||
@ExcelProperty("主送部门id")
|
||||
private Long fwglSendDeptid;
|
||||
|
||||
@Schema(description = "主送部门名字", example = "王五")
|
||||
@ExcelProperty("主送部门名字")
|
||||
private String fwglSendName;
|
||||
|
||||
@Schema(description = "会签部门id", example = "11155")
|
||||
@ExcelProperty("会签部门id")
|
||||
private Long fwglHqDeptid;
|
||||
|
||||
@Schema(description = "会签部门名字", example = "赵六")
|
||||
@ExcelProperty("会签部门名字")
|
||||
private String fwglHqName;
|
||||
|
||||
@Schema(description = "正文路径")
|
||||
@ExcelProperty("正文路径")
|
||||
private String[] filePath;
|
||||
|
||||
@Schema(description = "附件路径")
|
||||
@ExcelProperty("附件路径")
|
||||
private String[] attachPath;
|
||||
|
||||
@Schema(description = "部门id", example = "25467")
|
||||
@ExcelProperty("部门id")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名字", example = "赵六")
|
||||
@ExcelProperty("部门名字")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "14391")
|
||||
@ExcelProperty("流程实例的编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "申请人的用户编号", example = "26449")
|
||||
@ExcelProperty("申请人的用户编号")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "审批状态", example = "2")
|
||||
@ExcelProperty("审批状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.home.controller.admin.fwgl.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 发文管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class FwglSaveReqVO {
|
||||
|
||||
//1.去掉 userId的字段定义
|
||||
//2.检查必要定义字段title、userName、deptId、deptName、processInstanceId、status,六个字段定义
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5038")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "发文标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "作者不能为空")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "起草时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "起草时间不能为空")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime fwglTime;
|
||||
|
||||
@Schema(description = "发文文号")
|
||||
private String fwglBh;
|
||||
|
||||
@Schema(description = "电话号码")
|
||||
private String fwglPhone;
|
||||
|
||||
@Schema(description = "发文密级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "发文密级不能为空")
|
||||
private Integer fwglMj;
|
||||
|
||||
@Schema(description = "发文急缓", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "发文急缓不能为空")
|
||||
private Integer fwglJh;
|
||||
|
||||
@Schema(description = "主送部门id", example = "12275")
|
||||
private Long fwglSendDeptid;
|
||||
|
||||
@Schema(description = "主送部门名字", example = "王五")
|
||||
private String fwglSendName;
|
||||
|
||||
@Schema(description = "会签部门id", example = "11155")
|
||||
private Long fwglHqDeptid;
|
||||
|
||||
@Schema(description = "会签部门名字", example = "赵六")
|
||||
private String fwglHqName;
|
||||
|
||||
@Schema(description = "正文路径")
|
||||
private String[] filePath;
|
||||
|
||||
@Schema(description = "附件路径")
|
||||
private String[] attachPath;
|
||||
|
||||
@Schema(description = "部门id", example = "25467")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名字", example = "赵六")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "14391")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "申请人的用户编号", example = "26449")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "审批状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
|
||||
private Map<String, List<Long>> startUserSelectAssignees;
|
||||
|
||||
@Schema(description = "流程定义key")
|
||||
private String processDefinitionKey;
|
||||
|
||||
@Schema(description = "当前创建路径")
|
||||
private String curfullpath;
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package cn.iocoder.yudao.module.home.dal.dataobject.fwgl;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 发文管理 DO
|
||||
*
|
||||
* @author 君风
|
||||
*/
|
||||
@TableName("oa_fwgl")
|
||||
@KeySequence("oa_fwgl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FwglDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 发文标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 起草时间
|
||||
*/
|
||||
private LocalDateTime fwglTime;
|
||||
/**
|
||||
* 发文文号
|
||||
*/
|
||||
private String fwglBh;
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String fwglPhone;
|
||||
/**
|
||||
* 发文密级
|
||||
*
|
||||
* 枚举 {@link TODO fwgl_mj_type 对应的类}
|
||||
*/
|
||||
private Integer fwglMj;
|
||||
/**
|
||||
* 发文急缓
|
||||
*
|
||||
* 枚举 {@link TODO fw_jh_type 对应的类}
|
||||
*/
|
||||
private Integer fwglJh;
|
||||
/**
|
||||
* 主送部门id
|
||||
*/
|
||||
private Long fwglSendDeptid;
|
||||
/**
|
||||
* 主送部门名字
|
||||
*/
|
||||
private String fwglSendName;
|
||||
/**
|
||||
* 会签部门id
|
||||
*/
|
||||
private Long fwglHqDeptid;
|
||||
/**
|
||||
* 会签部门名字
|
||||
*/
|
||||
private String fwglHqName;
|
||||
/**
|
||||
* 正文路径
|
||||
*/
|
||||
private String filePath;
|
||||
/**
|
||||
* 附件路径
|
||||
*/
|
||||
private String attachPath;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门名字
|
||||
*/
|
||||
private String deptName;
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.home.dal.mysql.fwgl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.home.dal.dataobject.fwgl.FwglDO;
|
||||
import cn.iocoder.yudao.module.home.dal.dataobject.qjgl.QjglDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.home.controller.admin.fwgl.vo.*;
|
||||
|
||||
/**
|
||||
* 发文管理 Mapper
|
||||
*
|
||||
* @author 君风
|
||||
*/
|
||||
@Mapper
|
||||
public interface FwglMapper extends BaseMapperX<FwglDO> {
|
||||
|
||||
default PageResult<FwglDO> selectPage(FwglPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FwglDO>()
|
||||
.eqIfPresent(FwglDO::getTitle, reqVO.getTitle())
|
||||
.betweenIfPresent(FwglDO::getFwglTime, reqVO.getFwglTime())
|
||||
.eqIfPresent(FwglDO::getFwglBh, reqVO.getFwglBh())
|
||||
.eqIfPresent(FwglDO::getFwglPhone, reqVO.getFwglPhone())
|
||||
.eqIfPresent(FwglDO::getFwglMj, reqVO.getFwglMj())
|
||||
.eqIfPresent(FwglDO::getFwglJh, reqVO.getFwglJh())
|
||||
.likeIfPresent(FwglDO::getUserName, reqVO.getUserName())
|
||||
.eqIfPresent(FwglDO::getFwglSendDeptid, reqVO.getFwglSendDeptid())
|
||||
.likeIfPresent(FwglDO::getFwglSendName, reqVO.getFwglSendName())
|
||||
.eqIfPresent(FwglDO::getFwglHqDeptid, reqVO.getFwglHqDeptid())
|
||||
.likeIfPresent(FwglDO::getFwglHqName, reqVO.getFwglHqName())
|
||||
.eqIfPresent(FwglDO::getFilePath, reqVO.getFilePath())
|
||||
.eqIfPresent(FwglDO::getAttachPath, reqVO.getAttachPath())
|
||||
.eqIfPresent(FwglDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(FwglDO::getDeptName, reqVO.getDeptName())
|
||||
.betweenIfPresent(FwglDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(FwglDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.eqIfPresent(FwglDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(FwglDO::getStatus, reqVO.getStatus())
|
||||
.ne(FwglDO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.orderByDesc(FwglDO::getId));
|
||||
}
|
||||
default PageResult<FwglDO> selectDraft(FwglPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FwglDO>()
|
||||
.eqIfPresent(FwglDO::getTitle, reqVO.getTitle())
|
||||
.betweenIfPresent(FwglDO::getFwglTime, reqVO.getFwglTime())
|
||||
.eqIfPresent(FwglDO::getFwglBh, reqVO.getFwglBh())
|
||||
.eqIfPresent(FwglDO::getFwglPhone, reqVO.getFwglPhone())
|
||||
.eqIfPresent(FwglDO::getFwglMj, reqVO.getFwglMj())
|
||||
.eqIfPresent(FwglDO::getFwglJh, reqVO.getFwglJh())
|
||||
.likeIfPresent(FwglDO::getUserName, reqVO.getUserName())
|
||||
.eqIfPresent(FwglDO::getFwglSendDeptid, reqVO.getFwglSendDeptid())
|
||||
.likeIfPresent(FwglDO::getFwglSendName, reqVO.getFwglSendName())
|
||||
.eqIfPresent(FwglDO::getFwglHqDeptid, reqVO.getFwglHqDeptid())
|
||||
.likeIfPresent(FwglDO::getFwglHqName, reqVO.getFwglHqName())
|
||||
.eqIfPresent(FwglDO::getFilePath, reqVO.getFilePath())
|
||||
.eqIfPresent(FwglDO::getAttachPath, reqVO.getAttachPath())
|
||||
.eqIfPresent(FwglDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(FwglDO::getDeptName, reqVO.getDeptName())
|
||||
.betweenIfPresent(FwglDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(FwglDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.eqIfPresent(FwglDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(FwglDO::getStatus, reqVO.getStatus())
|
||||
.eq(FwglDO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.orderByDesc(FwglDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.home.service.fwgl;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.home.controller.admin.fwgl.vo.*;
|
||||
import cn.iocoder.yudao.module.home.dal.dataobject.fwgl.FwglDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 发文管理 Service 接口
|
||||
*
|
||||
* @author 君风
|
||||
*/
|
||||
public interface FwglService {
|
||||
|
||||
/**
|
||||
* 创建发文管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFwgl(Long userId,@Valid FwglSaveReqVO createReqVO);
|
||||
|
||||
/* 存为草稿 */
|
||||
Long saveDraft(Long userId,@Valid FwglSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新发文管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFwgl(@Valid FwglSaveReqVO updateReqVO);
|
||||
/**
|
||||
* 更新流程的状态
|
||||
*
|
||||
* @param id FwglS的id,status FwglS的状态
|
||||
*/
|
||||
void updateFwglStatus(Long id, Integer status);
|
||||
/**
|
||||
* 删除发文管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFwgl(Long id);
|
||||
|
||||
/**
|
||||
* 获得发文管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 发文管理
|
||||
*/
|
||||
FwglDO getFwgl(Long id);
|
||||
|
||||
/**
|
||||
* 获得发文管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 发文管理分页
|
||||
*/
|
||||
PageResult<FwglDO> getFwglPage(FwglPageReqVO pageReqVO);
|
||||
|
||||
PageResult<FwglDO> getFwglDraft(FwglPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package cn.iocoder.yudao.module.home.service.fwgl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.home.controller.admin.fwgl.vo.*;
|
||||
import cn.iocoder.yudao.module.home.dal.dataobject.fwgl.FwglDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.home.dal.mysql.fwgl.FwglMapper;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import cn.iocoder.yudao.module.bpm.service.processinstancetodo.ProcessInstanceTodoService;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.home.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 发文管理 Service 实现类
|
||||
*
|
||||
* @author 君风
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FwglServiceImpl implements FwglService {
|
||||
|
||||
public static String PROCESS_KEY = "";
|
||||
public static String processInstanceId ="";
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private ProcessInstanceTodoService processInstanceTodoService;
|
||||
|
||||
@Resource
|
||||
private FwglMapper fwglMapper;
|
||||
|
||||
@Override
|
||||
public Long saveDraft(Long userId,FwglSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FwglDO fwgl = BeanUtils.toBean(createReqVO, FwglDO.class).setUserId(userId).setStatus(100);
|
||||
fwglMapper.insert(fwgl);
|
||||
// 返回
|
||||
return fwgl.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long createFwgl(Long userId,FwglSaveReqVO createReqVO) {
|
||||
PROCESS_KEY = createReqVO.getProcessDefinitionKey();
|
||||
// 插入
|
||||
FwglDO fwgl = BeanUtils.toBean(createReqVO, FwglDO.class)
|
||||
.setUserId(userId).setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
if (createReqVO.getCurfullpath().contains("?") ) {
|
||||
fwglMapper.updateById(fwgl);
|
||||
createReqVO.setCurfullpath( createReqVO.getCurfullpath().replaceAll("\\?id=\\d+", ""));
|
||||
} else {
|
||||
fwglMapper.insert(fwgl);
|
||||
}
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(fwgl.getId()))
|
||||
.setStartUserSelectAssignees(createReqVO.getStartUserSelectAssignees()));
|
||||
|
||||
// 将工作流的编号,更新到 OA 请假单中
|
||||
fwglMapper.updateById(new FwglDO().setId(fwgl.getId()).setProcessInstanceId(processInstanceId));
|
||||
//同步更新流程待办库
|
||||
processInstanceTodoService.oaCreateProcessInstanceTodo(
|
||||
createReqVO.getTitle(),
|
||||
PROCESS_KEY,
|
||||
processInstanceId,
|
||||
createReqVO.getCurfullpath()
|
||||
);
|
||||
// 返回
|
||||
return fwgl.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFwgl(FwglSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateFwglExists(updateReqVO.getId());
|
||||
// 更新
|
||||
FwglDO updateObj = BeanUtils.toBean(updateReqVO, FwglDO.class);
|
||||
fwglMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFwglStatus(Long id, Integer status) {
|
||||
// 校验存在
|
||||
validateFwglExists(id);
|
||||
fwglMapper.updateById( new FwglDO().setId(id).setStatus(status) );
|
||||
}
|
||||
@Override
|
||||
public void deleteFwgl(Long id) {
|
||||
// 校验存在
|
||||
validateFwglExists(id);
|
||||
// 删除
|
||||
fwglMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFwglExists(Long id) {
|
||||
if (fwglMapper.selectById(id) == null) {
|
||||
throw exception(FWGL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FwglDO getFwgl(Long id) {
|
||||
return fwglMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FwglDO> getFwglPage(FwglPageReqVO pageReqVO) {
|
||||
return fwglMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FwglDO> getFwglDraft(FwglPageReqVO pageReqVO) {
|
||||
return fwglMapper.selectDraft(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.home.service.fwgl.listenter;
|
||||
|
||||
import cn.iocoder.yudao.module.home.service.fwgl.FwglService;
|
||||
import cn.iocoder.yudao.module.home.service.fwgl.FwglServiceImpl;
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
|
||||
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 发文管理 结束的监听器实现类
|
||||
*
|
||||
* @author 君风
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class FwglStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||
|
||||
@Resource
|
||||
private FwglService fwglService;
|
||||
|
||||
@Override
|
||||
protected String getProcessDefinitionKey() {
|
||||
return FwglServiceImpl.PROCESS_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getProcessInstanceId() {
|
||||
return FwglServiceImpl.processInstanceId;
|
||||
}
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
fwglService.updateFwglStatus(Long.parseLong(event.getBusinessKey()), event.getStatus());
|
||||
}
|
||||
}
|
@ -104,7 +104,7 @@ public class CodegenEngine {
|
||||
javaModuleImplMainFilePath("dal/dataobject/${table.businessName}/${table.className}DO"))
|
||||
.put(javaTemplatePath("dal/do_sub"), // 特殊:主子表专属逻辑
|
||||
javaModuleImplMainFilePath("dal/dataobject/${table.businessName}/${subTable.className}DO"))
|
||||
.put(javaTemplatePath("dal/Mapper"),
|
||||
.put(javaTemplatePath("dal/flowMapper"),
|
||||
javaModuleImplMainFilePath("dal/mysql/${table.businessName}/${table.className}Mapper"))
|
||||
.put(javaTemplatePath("dal/mapper_sub"), // 特殊:主子表专属逻辑
|
||||
javaModuleImplMainFilePath("dal/mysql/${table.businessName}/${subTable.className}Mapper"))
|
||||
|
@ -54,14 +54,14 @@ public interface ${table.className}Mapper extends BaseMapperX<${table.className}
|
||||
default PageResult<${table.className}DO> selectPage(${sceneEnum.prefixClass}${table.className}PageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<${table.className}DO>()
|
||||
#listCondition()
|
||||
.ne(QjglDO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.ne(${table.className}DO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.orderByDesc(${table.className}DO::getId));## 大多数情况下,id 倒序
|
||||
}
|
||||
|
||||
default PageResult<${table.className}DO> selectDraft(${sceneEnum.prefixClass}${table.className}PageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<${table.className}DO>()
|
||||
#listCondition()
|
||||
.eq(QjglDO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.eq(${table.className}DO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.orderByDesc(${table.className}DO::getId));## 大多数情况下,id 倒序
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ public interface ${table.className}Mapper extends BaseMapperX<${table.className}
|
||||
default PageResult<${table.className}DO> selectPage(long userId,${sceneEnum.prefixClass}${table.className}PageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<${table.className}DO>()
|
||||
#listCondition()
|
||||
.ne(QjglDO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.ne(${table.className}DO::getStatus, 100) // 排除 status = 100 的记录
|
||||
.orderByDesc(${table.className}DO::getId));## 大多数情况下,id 倒序
|
||||
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
||||
${table.className}DO ${classNameVar} = BeanUtils.toBean(createReqVO, ${table.className}DO.class).setUserId(userId).setStatus(100);
|
||||
${classNameVar}Mapper.insert(${classNameVar});
|
||||
// 返回
|
||||
return qjgl.getId();
|
||||
return ${classNameVar}.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,4 +1,8 @@
|
||||
<template>
|
||||
<el-card shadow="never" >
|
||||
<template #header>
|
||||
<span style="font-size: 16px">请假管理流程</span>
|
||||
</template>
|
||||
<el-form
|
||||
class="custom-input"
|
||||
ref="formRef"
|
||||
@ -134,14 +138,13 @@
|
||||
#end
|
||||
</el-tabs>
|
||||
#end
|
||||
## <template #footer>
|
||||
## <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
## <el-button @click="dialogVisible = false">取 消</el-button>
|
||||
## </template>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, getStrDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import * as TaskApi from '@/api/bpm/task'
|
||||
import { ${simpleClassName}Api, ${simpleClassName}VO } from '@/api/${table.moduleName}/${table.businessName}'
|
||||
## 特殊:树表专属逻辑
|
||||
#if ( $table.templateType == 2 )
|
||||
@ -153,9 +156,11 @@ import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import ${subSimpleClassName}Form from './components/${subSimpleClassName}Form.vue'
|
||||
#end
|
||||
#end
|
||||
import * as TaskApi from '@/api/bpm/task'
|
||||
import {useUserStore} from "@/store/modules/user";
|
||||
|
||||
/** ${table.classComment} 表单 */
|
||||
defineOptions({ name: '${simpleClassName}Form' })
|
||||
defineOptions({ name: '${simpleClassName}Detail' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
@ -165,6 +170,7 @@ const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
// const dialogTitle = ref('') // 弹窗的标题
|
||||
// const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const userId = useUserStore().getUser.id // 当前登录的编号
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined)
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-card shadow="never" >
|
||||
<template #header>
|
||||
<span style="font-size: 16px">创建请假管理流程</span>
|
||||
<span style="font-size: 16px">请假管理流程</span>
|
||||
</template>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
@ -212,6 +212,12 @@ const ${subClassNameVar}FormRef = ref()
|
||||
const userInfo = ref('')
|
||||
const deptInfo = ref('')
|
||||
|
||||
const formatDate = (date: Date) => {
|
||||
const yyyy = date.getFullYear()
|
||||
const mm = String(date.getMonth() + 1).padStart(2, '0') // 月份从 0 开始
|
||||
const dd = String(date.getDate()).padStart(2, '0')
|
||||
return `${yyyy}-${mm}-${dd}`
|
||||
}
|
||||
const getUserInfo = async () => {
|
||||
const users = await getUserProfile()
|
||||
if (formData.value.deptId == '' || formData.value.deptId == undefined) {
|
||||
@ -224,6 +230,12 @@ const getUserInfo = async () => {
|
||||
if (formData.value.userName == '' || formData.value.userName == undefined) {
|
||||
formData.value.userName = users.nickname
|
||||
}
|
||||
if (formData.value.fwglTime == '' || formData.value.fwglTime == undefined) {
|
||||
formData.value.fwglTime = formatDate(new Date())
|
||||
}
|
||||
if (formData.value.fwglPhone == '' || formData.value.fwglPhone == undefined) {
|
||||
formData.value.fwglPhone = users.mobile
|
||||
}
|
||||
}
|
||||
// 指定审批人
|
||||
const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表
|
||||
@ -247,7 +259,7 @@ const saveDraft = async () => {
|
||||
message.success(t('common.saveDraft'))
|
||||
// 关闭当前 Tab
|
||||
delView(unref(currentRoute))
|
||||
await push({ name: '${simpleClassName}' })
|
||||
await push({ name: '${simpleClassName}index' })
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
@ -314,7 +326,7 @@ const submitForm = async () => {
|
||||
message.success(t('common.createFlow'))
|
||||
// 关闭当前 Tab
|
||||
delView(unref(currentRoute))
|
||||
await push({ name: '${simpleClassName}' })
|
||||
await push({ name: '${simpleClassName}index' })
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
@ -192,13 +192,21 @@
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
## <el-button
|
||||
## link
|
||||
## type="danger"
|
||||
## @click="handleProcessDetail(scope.row)"
|
||||
## v-hasPermi="['${permissionPrefix}:delete']"
|
||||
## >
|
||||
## 进度
|
||||
## </el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleProcessDetail(scope.row)"
|
||||
v-hasPermi="['${permissionPrefix}:delete']"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['home:qjgl:delete']"
|
||||
>
|
||||
进度
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -291,7 +299,7 @@ const getList = async () => {
|
||||
const data = await ${simpleClassName}Api.get${simpleClassName}List(queryParams)
|
||||
list.value = handleTree(data, 'id', '${treeParentColumn.javaField}')
|
||||
#else
|
||||
const data = await ${simpleClassName}Api.get${simpleClassName}Page(queryParams)
|
||||
const data = await ${simpleClassName}Api.get${simpleClassName}Draft(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
#end
|
||||
@ -339,7 +347,7 @@ const handleCreate = () => {
|
||||
/** 详情操作 */
|
||||
const handleDetail = (row: ${simpleClassName}Api.${simpleClassName}VO) => {
|
||||
router.push({
|
||||
name: '${simpleClassName}Create',
|
||||
name: '${simpleClassName}Form,
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user