From 79d3136706d36f35a5d8bcacc43f8c6c70780f50 Mon Sep 17 00:00:00 2001 From: zk <2762560464@qq.com> Date: Fri, 22 Sep 2023 14:13:57 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=90=88=E5=90=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElectronicContractsController.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java index c98f83f6..3a1b032e 100644 --- a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java @@ -1,36 +1,36 @@ package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts; -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.PageResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; - import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; - import cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo.*; -import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; import cn.iocoder.yudao.module.ea.convert.electroniccontracts.ElectronicContractsConvert; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; import cn.iocoder.yudao.module.ea.service.electroniccontracts.ElectronicContractsService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; +/** + * @author HP + */ @Tag(name = "管理后台 - 合同档案") @RestController -@RequestMapping("/ea/electronic-contracts") +@RequestMapping("/ea/electronicContracts") @Validated public class ElectronicContractsController { From bdfb1ab58c9d2e0ef872755375cd68c15dfe48cb Mon Sep 17 00:00:00 2001 From: zk <2762560464@qq.com> Date: Fri, 22 Sep 2023 18:38:44 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=91=98=E5=B7=A5=E6=A1=A3=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElectronicEmployeeController.java | 102 ++++++++ .../vo/ElectronicEmployeeBaseVO.java | 65 +++++ .../vo/ElectronicEmployeeCreateReqVO.java | 100 ++++++++ .../vo/ElectronicEmployeeExcelVO.java | 69 ++++++ .../vo/ElectronicEmployeeExportReqVO.java | 66 +++++ .../vo/ElectronicEmployeePageReqVO.java | 68 ++++++ .../vo/ElectronicEmployeeRespVO.java | 16 ++ .../vo/ElectronicEmployeeUpdateReqVO.java | 97 ++++++++ .../ElectronicEmployeeConvert.java | 34 +++ .../ElectronicEmployeeDO.java | 225 ++++++++++++++++++ .../ElectronicEmployeeMapper.java | 62 +++++ .../ElectronicEmployeeService.java | 70 ++++++ .../ElectronicEmployeeServiceImpl.java | 82 +++++++ .../ea/utils/enums/BorrowStatusEnum.java | 35 +++ .../ElectronicEmployeeMapper.xml | 12 + 15 files changed, 1103 insertions(+) create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/ElectronicEmployeeController.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeBaseVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeCreateReqVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExcelVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExportReqVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeePageReqVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeRespVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeUpdateReqVO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicemployee/ElectronicEmployeeConvert.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicemployee/ElectronicEmployeeDO.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicemployee/ElectronicEmployeeMapper.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeService.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeServiceImpl.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java create mode 100644 yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicemployee/ElectronicEmployeeMapper.xml diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/ElectronicEmployeeController.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/ElectronicEmployeeController.java new file mode 100644 index 00000000..3b86c99c --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/ElectronicEmployeeController.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee; + +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.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; +import cn.iocoder.yudao.module.ea.convert.electronicemployee.ElectronicEmployeeConvert; +import cn.iocoder.yudao.module.ea.service.electronicemployee.ElectronicEmployeeService; + +@Tag(name = "管理后台 - 员工档案") +@RestController +@RequestMapping("/ea/electronic-employee") +@Validated +public class ElectronicEmployeeController { + + @Resource + private ElectronicEmployeeService electronicEmployeeService; + + @PostMapping("/create") + @Operation(summary = "创建员工档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:create')") + public CommonResult createElectronicEmployee(@Valid @RequestBody ElectronicEmployeeCreateReqVO createReqVO) { + return success(electronicEmployeeService.createElectronicEmployee(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新员工档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:update')") + public CommonResult updateElectronicEmployee(@Valid @RequestBody ElectronicEmployeeUpdateReqVO updateReqVO) { + electronicEmployeeService.updateElectronicEmployee(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除员工档案") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:delete')") + public CommonResult deleteElectronicEmployee(@RequestParam("id") Long id) { + electronicEmployeeService.deleteElectronicEmployee(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得员工档案") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:query')") + public CommonResult getElectronicEmployee(@RequestParam("id") Long id) { + ElectronicEmployeeDO electronicEmployee = electronicEmployeeService.getElectronicEmployee(id); + return success(ElectronicEmployeeConvert.INSTANCE.convert(electronicEmployee)); + } + + @GetMapping("/list") + @Operation(summary = "获得员工档案列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:query')") + public CommonResult> getElectronicEmployeeList(@RequestParam("ids") Collection ids) { + List list = electronicEmployeeService.getElectronicEmployeeList(ids); + return success(ElectronicEmployeeConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得员工档案分页") + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:query')") + public CommonResult> getElectronicEmployeePage(@Valid ElectronicEmployeePageReqVO pageVO) { + PageResult pageResult = electronicEmployeeService.getElectronicEmployeePage(pageVO); + return success(ElectronicEmployeeConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出员工档案 Excel") + @PreAuthorize("@ss.hasPermission('ea:electronic-employee:export')") + @OperateLog(type = EXPORT) + public void exportElectronicEmployeeExcel(@Valid ElectronicEmployeeExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = electronicEmployeeService.getElectronicEmployeeList(exportReqVO); + // 导出 Excel + List datas = ElectronicEmployeeConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "员工档案.xls", "数据", ElectronicEmployeeExcelVO.class, datas); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeBaseVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeBaseVO.java new file mode 100644 index 00000000..d3cd5c48 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeBaseVO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; + +/** + * 员工档案 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class ElectronicEmployeeBaseVO { + + @Schema(description = "id" ) + private Long id; + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门", example = "王五") + private String deptName; + + @Schema(description = "员工姓名", example = "张三") + private String name; + + @Schema(description = "性别") + private String gender; + + @Schema(description = "国籍") + private String nationality; + + @Schema(description = "联系方式") + private String contactNumber; + + @Schema(description = "身份证号") + private String idCardNumber; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "2") + private String borrowStatus; + + @Schema(description = "归档时间") + private String recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeCreateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeCreateReqVO.java new file mode 100644 index 00000000..a1ee752b --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeCreateReqVO.java @@ -0,0 +1,100 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo; + +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import javax.validation.constraints.*; + +/** + * @author HP + */ +@Schema(description = "管理后台 - 员工档案创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicEmployeeCreateReqVO extends ElectronicEmployeeBaseVO { + + @Schema(description = "出生日期") + private LocalDate birthdate; + + @Schema(description = "地址") + private String address; + + @Schema(description = "护照号码") + private String passportNumber; + + @Schema(description = "毕业学校") + private String graduationSchool; + + @Schema(description = "专业") + private String major; + + @Schema(description = "学历") + private String education; + + @Schema(description = "教育经历") + private String educationExperience; + + @Schema(description = "工作经历") + private String workExperience; + + @Schema(description = "职位") + private String jobTitle; + + @Schema(description = "职位级别") + private String jobLevel; + + @Schema(description = "职位描述", example = "你说的对") + private String jobDescription; + + @Schema(description = "薪酬") + private Long salary; + + @Schema(description = "身体状况") + private String healthCondition; + + @Schema(description = "体检记录") + private String medicalRecords; + + @Schema(description = "疾病史") + private String diseaseHistory; + + @Schema(description = "养老保险") + private String socialInsurance; + + @Schema(description = "医疗保险") + private Long pensionInsurance; + + @Schema(description = "失业保险") + private Long medicalInsurance; + + @Schema(description = "失业保险") + private Long unemploymentInsurance; + + @Schema(description = "工伤保险") + private Long workInjuryInsurance; + + @Schema(description = "考核评价") + private String leaveRecords; + + @Schema(description = "奖惩记录") + private String overtimeRecords; + + @Schema(description = "培训计划") + private String welfareBenefits; + + @Schema(description = "培训成果") + private String performanceEvaluation; + + @Schema(description = "个人标签") + private String rewardsPunishments; + + @Schema(description = "兴趣爱好") + private String trainingRecords; + + @Schema(description = "特长", example = "你说的对") + private String personalDescription; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExcelVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExcelVO.java new file mode 100644 index 00000000..79e68b32 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExcelVO.java @@ -0,0 +1,69 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo; + +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + + +/** + * 员工档案 Excel VO + * + * @author 芋道源码 + */ +@Data +public class ElectronicEmployeeExcelVO { + + @ExcelProperty("制单人") + private String createBy; + + @ExcelProperty("创建日期") + private LocalDateTime createTime; + + @ExcelProperty("业务实体") + private String company; + + @ExcelProperty("所属部门") + private String deptName; + + @ExcelProperty("员工姓名") + private String name; + + @ExcelProperty(value = "性别", converter = DictConvert.class) + @DictFormat("system_user_sex") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private String gender; + + @ExcelProperty("国籍") + private String nationality; + + @ExcelProperty("联系方式") + private String contactNumber; + + @ExcelProperty("身份证号") + private String idCardNumber; + + @ExcelProperty("年度") + private String year; + + @ExcelProperty("月份") + private String period; + + @ExcelProperty(value = "借阅状态", converter = DictConvert.class) + @DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private String borrowStatus; + + @ExcelProperty("归档时间") + private String recordTime; + + @ExcelProperty("纸档位置") + private String position; + + @ExcelProperty("完整性") + private Integer cherks; + + @ExcelProperty("归档状态") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExportReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExportReqVO.java new file mode 100644 index 00000000..326652e7 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeExportReqVO.java @@ -0,0 +1,66 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 员工档案 Excel 导出 Request VO,参数和 ElectronicEmployeePageReqVO 是一致的") +@Data +public class ElectronicEmployeeExportReqVO { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门", example = "王五") + private String deptName; + + @Schema(description = "员工姓名", example = "张三") + private String name; + + @Schema(description = "性别") + private String gender; + + @Schema(description = "国籍") + private String nationality; + + @Schema(description = "联系方式") + private String contactNumber; + + @Schema(description = "身份证号") + private String idCardNumber; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "2") + private String borrowStatus; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeePageReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeePageReqVO.java new file mode 100644 index 00000000..78d44f95 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeePageReqVO.java @@ -0,0 +1,68 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.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 ElectronicEmployeePageReqVO extends PageParam { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门", example = "王五") + private String deptName; + + @Schema(description = "员工姓名", example = "张三") + private String name; + + @Schema(description = "性别") + private String gender; + + @Schema(description = "国籍") + private String nationality; + + @Schema(description = "联系方式") + private String contactNumber; + + @Schema(description = "身份证号") + private String idCardNumber; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "2") + private String borrowStatus; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeRespVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeRespVO.java new file mode 100644 index 00000000..631b6b96 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeRespVO.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 员工档案 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicEmployeeRespVO extends ElectronicEmployeeBaseVO { + + @Schema(description = "创建日期") + private LocalDateTime createTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeUpdateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeUpdateReqVO.java new file mode 100644 index 00000000..339012fb --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicemployee/vo/ElectronicEmployeeUpdateReqVO.java @@ -0,0 +1,97 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 员工档案更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicEmployeeUpdateReqVO extends ElectronicEmployeeBaseVO { + + @Schema(description = "出生日期") + private LocalDate birthdate; + + @Schema(description = "地址") + private String address; + + @Schema(description = "护照号码") + private String passportNumber; + + @Schema(description = "毕业学校") + private String graduationSchool; + + @Schema(description = "专业") + private String major; + + @Schema(description = "学历") + private String education; + + @Schema(description = "教育经历") + private String educationExperience; + + @Schema(description = "工作经历") + private String workExperience; + + @Schema(description = "职位") + private String jobTitle; + + @Schema(description = "职位级别") + private String jobLevel; + + @Schema(description = "职位描述", example = "你说的对") + private String jobDescription; + + @Schema(description = "薪酬") + private Long salary; + + @Schema(description = "身体状况") + private String healthCondition; + + @Schema(description = "体检记录") + private String medicalRecords; + + @Schema(description = "疾病史") + private String diseaseHistory; + + @Schema(description = "养老保险") + private String socialInsurance; + + @Schema(description = "医疗保险") + private Long pensionInsurance; + + @Schema(description = "失业保险") + private Long medicalInsurance; + + @Schema(description = "失业保险") + private Long unemploymentInsurance; + + @Schema(description = "工伤保险") + private Long workInjuryInsurance; + + @Schema(description = "考核评价") + private String leaveRecords; + + @Schema(description = "奖惩记录") + private String overtimeRecords; + + @Schema(description = "培训计划") + private String welfareBenefits; + + @Schema(description = "培训成果") + private String performanceEvaluation; + + @Schema(description = "个人标签") + private String rewardsPunishments; + + @Schema(description = "兴趣爱好") + private String trainingRecords; + + @Schema(description = "特长", example = "你说的对") + private String personalDescription; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicemployee/ElectronicEmployeeConvert.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicemployee/ElectronicEmployeeConvert.java new file mode 100644 index 00000000..5ba0205e --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicemployee/ElectronicEmployeeConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.ea.convert.electronicemployee; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; + +/** + * 员工档案 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicEmployeeConvert { + + ElectronicEmployeeConvert INSTANCE = Mappers.getMapper(ElectronicEmployeeConvert.class); + + ElectronicEmployeeDO convert(ElectronicEmployeeCreateReqVO bean); + + ElectronicEmployeeDO convert(ElectronicEmployeeUpdateReqVO bean); + + ElectronicEmployeeRespVO convert(ElectronicEmployeeDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicemployee/ElectronicEmployeeDO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicemployee/ElectronicEmployeeDO.java new file mode 100644 index 00000000..c42d1b57 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicemployee/ElectronicEmployeeDO.java @@ -0,0 +1,225 @@ +package cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee; + +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +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("ea_electronic_employee") +@KeySequence("ea_electronic_employee_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ElectronicEmployeeDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 制单人 + */ + private String createBy; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体 + */ + private String company; + /** + * 所属部门id + */ + private Long deptId; + /** + * 所属部门 + */ + private String deptName; + /** + * 员工姓名 + */ + private String name; + /** + * 性别 + * + * 枚举 + */ + private String gender; + /** + * 出生日期 + */ + private LocalDate birthdate; + /** + * 国籍 + */ + private String nationality; + /** + * 地址 + */ + private String address; + /** + * 联系方式 + */ + private String contactNumber; + /** + * 身份证号 + */ + private String idCardNumber; + /** + * 护照号码 + */ + private String passportNumber; + /** + * 毕业学校 + */ + private String graduationSchool; + /** + * 专业 + */ + private String major; + /** + * 学历 + */ + private String education; + /** + * 教育经历 + */ + private String educationExperience; + /** + * 工作经历 + */ + private String workExperience; + /** + * 职位 + */ + private String jobTitle; + /** + * 职位级别 + */ + private String jobLevel; + /** + * 职位描述 + */ + private String jobDescription; + /** + * 薪酬 + */ + private Long salary; + /** + * 身体状况 + */ + private String healthCondition; + /** + * 体检记录 + */ + private String medicalRecords; + /** + * 疾病史 + * + * 枚举 + */ + private String diseaseHistory; + /** + * 养老保险 + * + * 枚举 + */ + private String socialInsurance; + /** + * 医疗保险 + */ + private Long pensionInsurance; + /** + * 失业保险 + */ + private Long medicalInsurance; + /** + * 失业保险 + */ + private Long unemploymentInsurance; + /** + * 工伤保险 + */ + private Long workInjuryInsurance; + /** + * 考核评价 + */ + private String leaveRecords; + /** + * 奖惩记录 + */ + private String overtimeRecords; + /** + * 培训计划 + */ + private String welfareBenefits; + /** + * 培训成果 + */ + private String performanceEvaluation; + /** + * 个人标签 + */ + private String rewardsPunishments; + /** + * 兴趣爱好 + */ + private String trainingRecords; + /** + * 特长 + */ + private String personalDescription; + /** + * 年度 + */ + private String year; + /** + * 月份 + */ + private String period; + /** + * 借阅状态 + * + * 枚举 + */ + private String borrowStatus; + /** + * 归档时间 + */ + private String recordTime; + /** + * 纸档位置 + */ + private String position; + /** + * 完整性 + */ + private Integer cherks; + /** + * 归档id + */ + private Long recordId; + /** + * 用户id + */ + private Long userId; + /** + * 归档状态 + */ + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicemployee/ElectronicEmployeeMapper.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicemployee/ElectronicEmployeeMapper.java new file mode 100644 index 00000000..4ec833be --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicemployee/ElectronicEmployeeMapper.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee; + +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.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*; + +/** + * 员工档案 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicEmployeeMapper extends BaseMapperX { + + default PageResult selectPage(ElectronicEmployeePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ElectronicEmployeeDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicEmployeeDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicEmployeeDO::getCompany, reqVO.getCompany()) + .likeIfPresent(ElectronicEmployeeDO::getDeptName, reqVO.getDeptName()) + .likeIfPresent(ElectronicEmployeeDO::getName, reqVO.getName()) + .eqIfPresent(ElectronicEmployeeDO::getGender, reqVO.getGender()) + .eqIfPresent(ElectronicEmployeeDO::getNationality, reqVO.getNationality()) + .eqIfPresent(ElectronicEmployeeDO::getContactNumber, reqVO.getContactNumber()) + .eqIfPresent(ElectronicEmployeeDO::getIdCardNumber, reqVO.getIdCardNumber()) + .eqIfPresent(ElectronicEmployeeDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicEmployeeDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicEmployeeDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicEmployeeDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicEmployeeDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicEmployeeDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicEmployeeDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicEmployeeDO::getId)); + } + + default List selectList(ElectronicEmployeeExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ElectronicEmployeeDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicEmployeeDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicEmployeeDO::getCompany, reqVO.getCompany()) + .likeIfPresent(ElectronicEmployeeDO::getDeptName, reqVO.getDeptName()) + .likeIfPresent(ElectronicEmployeeDO::getName, reqVO.getName()) + .eqIfPresent(ElectronicEmployeeDO::getGender, reqVO.getGender()) + .eqIfPresent(ElectronicEmployeeDO::getNationality, reqVO.getNationality()) + .eqIfPresent(ElectronicEmployeeDO::getContactNumber, reqVO.getContactNumber()) + .eqIfPresent(ElectronicEmployeeDO::getIdCardNumber, reqVO.getIdCardNumber()) + .eqIfPresent(ElectronicEmployeeDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicEmployeeDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicEmployeeDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicEmployeeDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicEmployeeDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicEmployeeDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicEmployeeDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicEmployeeDO::getId)); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeService.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeService.java new file mode 100644 index 00000000..35fabf96 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.ea.service.electronicemployee; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 员工档案 Service 接口 + * + * @author 芋道源码 + */ +public interface ElectronicEmployeeService { + + /** + * 创建员工档案 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createElectronicEmployee(@Valid ElectronicEmployeeCreateReqVO createReqVO); + + /** + * 更新员工档案 + * + * @param updateReqVO 更新信息 + */ + void updateElectronicEmployee(@Valid ElectronicEmployeeUpdateReqVO updateReqVO); + + /** + * 删除员工档案 + * + * @param id 编号 + */ + void deleteElectronicEmployee(Long id); + + /** + * 获得员工档案 + * + * @param id 编号 + * @return 员工档案 + */ + ElectronicEmployeeDO getElectronicEmployee(Long id); + + /** + * 获得员工档案列表 + * + * @param ids 编号 + * @return 员工档案列表 + */ + List getElectronicEmployeeList(Collection ids); + + /** + * 获得员工档案分页 + * + * @param pageReqVO 分页查询 + * @return 员工档案分页 + */ + PageResult getElectronicEmployeePage(ElectronicEmployeePageReqVO pageReqVO); + + /** + * 获得员工档案列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 员工档案列表 + */ + List getElectronicEmployeeList(ElectronicEmployeeExportReqVO exportReqVO); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeServiceImpl.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeServiceImpl.java new file mode 100644 index 00000000..cb7ce91b --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicemployee/ElectronicEmployeeServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.service.electronicemployee; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.ea.convert.electronicemployee.ElectronicEmployeeConvert; +import cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee.ElectronicEmployeeMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.*; + +/** + * 员工档案 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ElectronicEmployeeServiceImpl implements ElectronicEmployeeService { + + @Resource + private ElectronicEmployeeMapper electronicEmployeeMapper; + + @Override + public Long createElectronicEmployee(ElectronicEmployeeCreateReqVO createReqVO) { + // 插入 + ElectronicEmployeeDO electronicEmployee = ElectronicEmployeeConvert.INSTANCE.convert(createReqVO); + electronicEmployeeMapper.insert(electronicEmployee); + // 返回 + return electronicEmployee.getId(); + } + + @Override + public void updateElectronicEmployee(ElectronicEmployeeUpdateReqVO updateReqVO) { + // 校验存在 + validateElectronicEmployeeExists(updateReqVO.getId()); + // 更新 + ElectronicEmployeeDO updateObj = ElectronicEmployeeConvert.INSTANCE.convert(updateReqVO); + electronicEmployeeMapper.updateById(updateObj); + } + + @Override + public void deleteElectronicEmployee(Long id) { + // 校验存在 + validateElectronicEmployeeExists(id); + // 删除 + electronicEmployeeMapper.deleteById(id); + } + + private void validateElectronicEmployeeExists(Long id) { + if (electronicEmployeeMapper.selectById(id) == null) { + throw exception(ELECTRONIC_EMPLOYEE_NOT_EXISTS); + } + } + + @Override + public ElectronicEmployeeDO getElectronicEmployee(Long id) { + return electronicEmployeeMapper.selectById(id); + } + + @Override + public List getElectronicEmployeeList(Collection ids) { + return electronicEmployeeMapper.selectBatchIds(ids); + } + + @Override + public PageResult getElectronicEmployeePage(ElectronicEmployeePageReqVO pageReqVO) { + return electronicEmployeeMapper.selectPage(pageReqVO); + } + + @Override + public List getElectronicEmployeeList(ElectronicEmployeeExportReqVO exportReqVO) { + return electronicEmployeeMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java new file mode 100644 index 00000000..1fcfaf3a --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.module.ea.utils.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.Getter; + +/** + * author: zk + * date: 2023/9/22 + * description: 借阅状态枚举 + * @author HP + */ +@Getter +public enum BorrowStatusEnum { + /** + * 借阅状态枚举 + */ + BORROWSTATUS_TRUE("true", "1"), + BORROWSTATUS_FALSE("false", "0") + ; + + @JsonValue + private final String status; + + /** + * 获取转换后的状态 + */ + @EnumValue + private final String isStatus; + + BorrowStatusEnum(String status, String isStatus) { + this.status = status; + this.isStatus = isStatus; + } +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicemployee/ElectronicEmployeeMapper.xml b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicemployee/ElectronicEmployeeMapper.xml new file mode 100644 index 00000000..b00652db --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicemployee/ElectronicEmployeeMapper.xml @@ -0,0 +1,12 @@ + + + + + + + From 5aeb7ba3d814dcd9389d2ab4508f1a79b229514d Mon Sep 17 00:00:00 2001 From: zk <2762560464@qq.com> Date: Fri, 22 Sep 2023 19:05:37 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=90=88=E5=90=8C=E3=80=81=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E6=A1=A3=E6=A1=88sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/contracts20230922zK.sql | 119 ++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sql/contracts20230922zK.sql diff --git a/sql/contracts20230922zK.sql b/sql/contracts20230922zK.sql new file mode 100644 index 00000000..6dfd1719 --- /dev/null +++ b/sql/contracts20230922zK.sql @@ -0,0 +1,119 @@ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- 合同档案 for ea_electronic_contracts +-- ---------------------------- +DROP TABLE IF EXISTS `ea_electronic_contracts`; +CREATE TABLE `ea_electronic_contracts` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `create_by` varchar(20) DEFAULT NULL COMMENT '制单人', + `creator` varchar(20) DEFAULT NULL COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建日期', + `company_id` bigint unsigned DEFAULT NULL COMMENT '业务实体id', + `company` varchar(30) DEFAULT NULL COMMENT '业务实体', + `update_time` datetime DEFAULT NULL COMMENT '更新日期', + `dept_id` bigint DEFAULT NULL COMMENT '所属部门id', + `dept_name` varchar(30) DEFAULT NULL COMMENT '所属部门', + `contract_code` varchar(64) DEFAULT NULL COMMENT '合同编号', + `contract_title` varchar(100) DEFAULT NULL COMMENT '合同名称', + `contract_type` varchar(50) DEFAULT NULL COMMENT '合同类型', + `signatory` varchar(50) DEFAULT NULL COMMENT '签署方', + `sign_date` date DEFAULT NULL COMMENT '签署日期', + `effective_date` date DEFAULT NULL COMMENT '生效日期', + `expiry_date` date DEFAULT NULL COMMENT '截止日期', + `contract_status` varchar(50) DEFAULT NULL COMMENT '状态', + `contract_amount` decimal(10,0) DEFAULT NULL COMMENT '金额', + `contract_attachment` varchar(200) DEFAULT NULL COMMENT '附件', + `handle_result` varchar(500) DEFAULT NULL COMMENT '处理结果', + `year` varchar(20) DEFAULT NULL COMMENT '年度', + `period` varchar(20) DEFAULT NULL COMMENT '月份', + `borrow_status` varchar(2) DEFAULT NULL COMMENT '借阅状态', + `record_time` varchar(20) DEFAULT NULL COMMENT '归档时间', + `position` varchar(255) DEFAULT NULL COMMENT '纸档位置', + `cherks` int DEFAULT NULL COMMENT '完整性', + `record_id` bigint DEFAULT NULL COMMENT '归档id,一个归档id对应多个合同档案', + `user_id` bigint DEFAULT NULL COMMENT '用户id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `updater` varchar(20) DEFAULT NULL COMMENT '更新者', + `file_status` varchar(64) DEFAULT NULL COMMENT '归档状态', + `tenant_id` bigint NOT NULL COMMENT '租户编号,一个集团/总公司对应一个租户', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='合同档案'; + +-- ---------------------------- +-- 员工档案 for ea_electronic_employee +-- ---------------------------- +DROP TABLE IF EXISTS `ea_electronic_employee`; +CREATE TABLE `ea_electronic_employee` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `create_by` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '制单人', + `creator` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建日期', + `company_id` bigint DEFAULT NULL COMMENT '业务实体id', + `company` varchar(30) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '业务实体', + `update_time` datetime DEFAULT NULL COMMENT '更新日期', + `dept_id` bigint DEFAULT NULL COMMENT '所属部门id', + `dept_name` varchar(30) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '所属部门', + `name` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '员工姓名', + `gender` varchar(10) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '性别', + `birthdate` date DEFAULT NULL COMMENT '出生日期', + `nationality` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '国籍', + `address` varchar(200) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '地址', + `contact_number` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系方式', + `id_card_number` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '身份证号', + `passport_number` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '护照号码', + `graduation_school` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '毕业学校', + `major` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '专业', + `education` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '学历', + `education_experience` text COLLATE utf8mb4_general_ci COMMENT '教育经历', + `work_experience` text COLLATE utf8mb4_general_ci COMMENT '工作经历', + `job_title` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '职位', + `job_level` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '职位级别', + `job_description` text COLLATE utf8mb4_general_ci COMMENT '职位描述', + `salary` decimal(10,0) DEFAULT NULL COMMENT '薪酬', + `health_condition` text COLLATE utf8mb4_general_ci COMMENT '身体状况', + `medical_records` text COLLATE utf8mb4_general_ci COMMENT '体检记录', + `disease_history` text COLLATE utf8mb4_general_ci COMMENT '疾病史', + `social_insurance` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '养老保险', + `pension_insurance` decimal(10,0) DEFAULT NULL COMMENT '医疗保险', + `medical_insurance` decimal(10,0) DEFAULT NULL COMMENT '失业保险', + `unemployment_insurance` decimal(10,0) DEFAULT NULL COMMENT '失业保险', + `work_injury_insurance` decimal(10,0) DEFAULT NULL COMMENT '工伤保险', + `leave_records` text COLLATE utf8mb4_general_ci COMMENT '考核评价', + `overtime_records` text COLLATE utf8mb4_general_ci COMMENT '奖惩记录', + `welfare_benefits` text COLLATE utf8mb4_general_ci COMMENT '培训计划', + `performance_evaluation` text COLLATE utf8mb4_general_ci COMMENT '培训成果', + `rewards_punishments` text COLLATE utf8mb4_general_ci COMMENT '个人标签', + `training_records` text COLLATE utf8mb4_general_ci COMMENT '兴趣爱好', + `personal_description` text COLLATE utf8mb4_general_ci COMMENT '特长', + `year` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '年度', + `period` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '月份', + `borrow_status` varchar(2) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '借阅状态', + `record_time` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '归档时间', + `position` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '纸档位置', + `cherks` int DEFAULT NULL COMMENT '完整性', + `record_id` bigint DEFAULT NULL COMMENT '归档id', + `user_id` bigint DEFAULT NULL COMMENT '用户id', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `updater` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新者', + `file_status` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '归档状态', + `tenant_id` bigint NOT NULL COMMENT '租户编号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工档案'; + +-- 合同档案菜单权限 +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2415', '合同档案', '', '2', '0', '2383', 'electronic-contracts', 'clipboard', 'ea/electronicContracts/index', 'ElectronicContracts', '0', b'1', b'1', b'1', '', '2023-09-20 11:29:50', '', '2023-09-20 15:45:07', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2416', '合同档案查询', 'ea:electronic-contracts:query', '3', '1', '2415', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-20 11:29:50', '', '2023-09-20 11:29:50', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2417', '合同档案创建', 'ea:electronic-contracts:create', '3', '2', '2415', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-20 11:29:50', '', '2023-09-20 11:29:50', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2418', '合同档案更新', 'ea:electronic-contracts:update', '3', '3', '2415', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-20 11:29:50', '', '2023-09-20 11:29:50', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2419', '合同档案删除', 'ea:electronic-contracts:delete', '3', '4', '2415', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-20 11:29:50', '', '2023-09-20 11:29:50', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2420', '合同档案导出', 'ea:electronic-contracts:export', '3', '5', '2415', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-20 11:29:50', '', '2023-09-20 11:29:50', b'0'); + +-- 员工档案菜单权限 +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2439', '员工档案', '', '2', '0', '2383', 'electronic-employee', 'clipboard', 'ea/electronicEmployee/index', 'ElectronicEmployee', '0', b'1', b'1', b'1', '', '2023-09-22 14:53:59', '', '2023-09-22 14:53:59', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2440', '员工档案查询', 'ea:electronic-employee:query', '3', '1', '2439', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-22 14:53:59', '', '2023-09-22 14:53:59', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2441', '员工档案创建', 'ea:electronic-employee:create', '3', '2', '2439', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-22 14:53:59', '', '2023-09-22 14:53:59', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2442', '员工档案更新', 'ea:electronic-employee:update', '3', '3', '2439', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-22 14:53:59', '', '2023-09-22 14:53:59', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2443', '员工档案删除', 'ea:electronic-employee:delete', '3', '4', '2439', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-22 14:53:59', '', '2023-09-22 14:53:59', b'0'); +INSERT INTO `lyr-one`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('2444', '员工档案导出', 'ea:electronic-employee:export', '3', '5', '2439', '', '', '', NULL, '0', b'1', b'1', b'1', '', '2023-09-22 14:53:59', '', '2023-09-22 14:53:59', b'0'); From c74cd4fb2f79ba452976466777785457b0eb39ac Mon Sep 17 00:00:00 2001 From: zk <2762560464@qq.com> Date: Sun, 24 Sep 2023 09:45:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=91=98=E5=B7=A5=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java b/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java index fa709ecc..2f31367c 100644 --- a/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java +++ b/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java @@ -2,7 +2,11 @@ package cn.iocoder.yudao.module.ea.enums; import cn.iocoder.yudao.framework.common.exception.ErrorCode; +/** + * @author HP + */ public interface ErrorCodeConstants { ErrorCode ELECTRONIC_ASSETS_NOT_EXISTS = new ErrorCode(300010, "资产档案不存在"); ErrorCode ELECTRONIC_CONTRACTS_NOT_EXISTS = new ErrorCode(300011, "合同档案不存在"); + ErrorCode ELECTRONIC_EMPLOYEE_NOT_EXISTS = new ErrorCode(300012, "员工档案不存在"); } From ace0d97dd16193dcc0804bfd7bfc9355c6e1713f Mon Sep 17 00:00:00 2001 From: "LAPTOP-0SF788NU\\admin" <3306174053@qq.com> Date: Mon, 25 Sep 2023 09:16:55 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E8=B4=A6=E7=B0=BFsql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/book20230922Js.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/book20230922Js.sql b/sql/book20230922Js.sql index 58680f24..769a47e7 100644 --- a/sql/book20230922Js.sql +++ b/sql/book20230922Js.sql @@ -1,5 +1,5 @@ -- 创建会计账簿表 -CREATE TABLE `lyr-one`.`Untitled` ( +CREATE TABLE `lyr-one`.`archives_accounting_book` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '账簿id', `uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账簿文件uri', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账簿文件名称', From 53dbc16020ef34ce169e6a078af0abf8c8bd002e Mon Sep 17 00:00:00 2001 From: "LAPTOP-0SF788NU\\admin" <3306174053@qq.com> Date: Mon, 25 Sep 2023 09:46:05 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archives/enums/ErrorCodeConstants.java | 2 + .../controller/admin/flow/FlowController.java | 102 ++++++++++++++++++ .../controller/admin/flow/vo/FlowBaseVO.java | 69 ++++++++++++ .../admin/flow/vo/FlowCreateReqVO.java | 14 +++ .../controller/admin/flow/vo/FlowExcelVO.java | 77 +++++++++++++ .../admin/flow/vo/FlowExportReqVO.java | 71 ++++++++++++ .../admin/flow/vo/FlowPageReqVO.java | 73 +++++++++++++ .../controller/admin/flow/vo/FlowRespVO.java | 19 ++++ .../admin/flow/vo/FlowUpdateReqVO.java | 18 ++++ .../archives/convert/flow/FlowConvert.java | 34 ++++++ .../archives/dal/dataobject/flow/FlowDO.java | 100 +++++++++++++++++ .../archives/dal/mysql/flow/FlowMapper.java | 66 ++++++++++++ .../archives/service/flow/FlowService.java | 70 ++++++++++++ .../service/flow/FlowServiceImpl.java | 82 ++++++++++++++ .../main/resources/mapper/flow/FlowMapper.xml | 12 +++ 15 files changed, 809 insertions(+) create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/FlowController.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowBaseVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowCreateReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExcelVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExportReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowPageReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowRespVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowUpdateReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/flow/FlowConvert.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/flow/FlowDO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/flow/FlowMapper.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowService.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowServiceImpl.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/flow/FlowMapper.xml diff --git a/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java b/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java index 252721ba..e308d46b 100644 --- a/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java +++ b/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java @@ -10,4 +10,6 @@ public interface ErrorCodeConstants { ErrorCode BORROW_APPLY_NOT_EXISTS = new ErrorCode(300200,"借阅申请不存在"); ErrorCode AUTHENTICATE_NOT_EXISTS = new ErrorCode(300300,"档案鉴定历史不存在"); + + ErrorCode FLOW_NOT_EXISTS = new ErrorCode(300400, "审批流程不存在"); } \ No newline at end of file diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/FlowController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/FlowController.java new file mode 100644 index 00000000..99de09bd --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/FlowController.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow; + +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.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.archives.controller.admin.flow.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.flow.FlowDO; +import cn.iocoder.yudao.module.archives.convert.flow.FlowConvert; +import cn.iocoder.yudao.module.archives.service.flow.FlowService; + +@Tag(name = "管理后台 - 审批流程") +@RestController +@RequestMapping("/archives/flow") +@Validated +public class FlowController { + + @Resource + private FlowService flowService; + + @PostMapping("/create") + @Operation(summary = "创建审批流程") + @PreAuthorize("@ss.hasPermission('archives:flow:create')") + public CommonResult createFlow(@Valid @RequestBody FlowCreateReqVO createReqVO) { + return success(flowService.createFlow(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新审批流程") + @PreAuthorize("@ss.hasPermission('archives:flow:update')") + public CommonResult updateFlow(@Valid @RequestBody FlowUpdateReqVO updateReqVO) { + flowService.updateFlow(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除审批流程") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('archives:flow:delete')") + public CommonResult deleteFlow(@RequestParam("id") Long id) { + flowService.deleteFlow(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得审批流程") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('archives:flow:query')") + public CommonResult getFlow(@RequestParam("id") Long id) { + FlowDO flow = flowService.getFlow(id); + return success(FlowConvert.INSTANCE.convert(flow)); + } + + @GetMapping("/list") + @Operation(summary = "获得审批流程列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('archives:flow:query')") + public CommonResult> getFlowList(@RequestParam("ids") Collection ids) { + List list = flowService.getFlowList(ids); + return success(FlowConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得审批流程分页") + @PreAuthorize("@ss.hasPermission('archives:flow:query')") + public CommonResult> getFlowPage(@Valid FlowPageReqVO pageVO) { + PageResult pageResult = flowService.getFlowPage(pageVO); + return success(FlowConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出审批流程 Excel") + @PreAuthorize("@ss.hasPermission('archives:flow:export')") + @OperateLog(type = EXPORT) + public void exportFlowExcel(@Valid FlowExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = flowService.getFlowList(exportReqVO); + // 导出 Excel + List datas = FlowConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "审批流程.xls", "数据", FlowExcelVO.class, datas); + } + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowBaseVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowBaseVO.java new file mode 100644 index 00000000..f75e68f6 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowBaseVO.java @@ -0,0 +1,69 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; + +/** + * 审批流程 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class FlowBaseVO { + + @Schema(description = "OA/ERP流程编号") + private String flowCode; + + @Schema(description = "凭证id", example = "19145") + private Long voucherId; + + @Schema(description = "凭证号") + private String voucherNum; + + @Schema(description = "业务id", example = "21987") + private Long businessId; + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "业务实体id", example = "8805") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "删除状态", example = "2") + private String delStatus; + + @Schema(description = "文件后缀") + private String suffix; + + @Schema(description = "文件地址", example = "https://www.iocoder.cn") + private String fileUrl; + + @Schema(description = "绝对路径") + private String fileAp; + + @Schema(description = "流程号", example = "13373") + private String flowId; + + @Schema(description = "摘要") + private String note; + + @Schema(description = "部门id", example = "31515") + private Long deptId; + + @Schema(description = "部门名称", example = "张三") + private String deptName; + + @Schema(description = "归档id", example = "3820") + private Long archiveId; + + @Schema(description = "归档状态") + private String archiveState; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowCreateReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowCreateReqVO.java new file mode 100644 index 00000000..59dbcc3e --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 审批流程创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class FlowCreateReqVO extends FlowBaseVO { + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExcelVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExcelVO.java new file mode 100644 index 00000000..b29b2e12 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExcelVO.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 审批流程 Excel VO + * + * @author 芋道源码 + */ +@Data +public class FlowExcelVO { + + @ExcelProperty("主键Id") + private Long id; + + @ExcelProperty("OA/ERP流程编号") + private String flowCode; + + @ExcelProperty("凭证id") + private Long voucherId; + + @ExcelProperty("凭证号") + private String voucherNum; + + @ExcelProperty("业务id") + private Long businessId; + + @ExcelProperty("业务类型") + private String businessType; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("业务实体id") + private Long companyId; + + @ExcelProperty("业务实体") + private String company; + + @ExcelProperty("删除状态") + private String delStatus; + + @ExcelProperty("文件后缀") + private String suffix; + + @ExcelProperty("文件地址") + private String fileUrl; + + @ExcelProperty("绝对路径") + private String fileAp; + + @ExcelProperty("流程号") + private String flowId; + + @ExcelProperty("摘要") + private String note; + + @ExcelProperty("部门id") + private Long deptId; + + @ExcelProperty("部门名称") + private String deptName; + + @ExcelProperty("归档id") + private Long archiveId; + + @ExcelProperty("归档状态") + private String archiveState; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExportReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExportReqVO.java new file mode 100644 index 00000000..0db12a6c --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowExportReqVO.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 审批流程 Excel 导出 Request VO,参数和 FlowPageReqVO 是一致的") +@Data +public class FlowExportReqVO { + + @Schema(description = "OA/ERP流程编号") + private String flowCode; + + @Schema(description = "凭证id", example = "19145") + private Long voucherId; + + @Schema(description = "凭证号") + private String voucherNum; + + @Schema(description = "业务id", example = "21987") + private Long businessId; + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体id", example = "8805") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "删除状态", example = "2") + private String delStatus; + + @Schema(description = "文件后缀") + private String suffix; + + @Schema(description = "文件地址", example = "https://www.iocoder.cn") + private String fileUrl; + + @Schema(description = "绝对路径") + private String fileAp; + + @Schema(description = "流程号", example = "13373") + private String flowId; + + @Schema(description = "摘要") + private String note; + + @Schema(description = "部门id", example = "31515") + private Long deptId; + + @Schema(description = "部门名称", example = "张三") + private String deptName; + + @Schema(description = "归档id", example = "3820") + private Long archiveId; + + @Schema(description = "归档状态") + private String archiveState; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowPageReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowPageReqVO.java new file mode 100644 index 00000000..db349231 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowPageReqVO.java @@ -0,0 +1,73 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.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 FlowPageReqVO extends PageParam { + + @Schema(description = "OA/ERP流程编号") + private String flowCode; + + @Schema(description = "凭证id", example = "19145") + private Long voucherId; + + @Schema(description = "凭证号") + private String voucherNum; + + @Schema(description = "业务id", example = "21987") + private Long businessId; + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体id", example = "8805") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "删除状态", example = "2") + private String delStatus; + + @Schema(description = "文件后缀") + private String suffix; + + @Schema(description = "文件地址", example = "https://www.iocoder.cn") + private String fileUrl; + + @Schema(description = "绝对路径") + private String fileAp; + + @Schema(description = "流程号", example = "13373") + private String flowId; + + @Schema(description = "摘要") + private String note; + + @Schema(description = "部门id", example = "31515") + private Long deptId; + + @Schema(description = "部门名称", example = "张三") + private String deptName; + + @Schema(description = "归档id", example = "3820") + private Long archiveId; + + @Schema(description = "归档状态") + private String archiveState; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowRespVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowRespVO.java new file mode 100644 index 00000000..c31f57d2 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 审批流程 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class FlowRespVO extends FlowBaseVO { + + @Schema(description = "主键Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3083") + private Long id; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowUpdateReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowUpdateReqVO.java new file mode 100644 index 00000000..248b9c48 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/flow/vo/FlowUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.archives.controller.admin.flow.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 审批流程更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class FlowUpdateReqVO extends FlowBaseVO { + + @Schema(description = "主键Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3083") + @NotNull(message = "主键Id不能为空") + private Long id; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/flow/FlowConvert.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/flow/FlowConvert.java new file mode 100644 index 00000000..13cb27ad --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/flow/FlowConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.archives.convert.flow; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.archives.controller.admin.flow.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.flow.FlowDO; + +/** + * 审批流程 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface FlowConvert { + + FlowConvert INSTANCE = Mappers.getMapper(FlowConvert.class); + + FlowDO convert(FlowCreateReqVO bean); + + FlowDO convert(FlowUpdateReqVO bean); + + FlowRespVO convert(FlowDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/flow/FlowDO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/flow/FlowDO.java new file mode 100644 index 00000000..15e3b711 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/flow/FlowDO.java @@ -0,0 +1,100 @@ +package cn.iocoder.yudao.module.archives.dal.dataobject.flow; + +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("archives_flow") +@KeySequence("archives_flow_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowDO extends BaseDO { + + /** + * 主键Id + */ + @TableId + private Long id; + /** + * OA/ERP流程编号 + */ + private String flowCode; + /** + * 凭证id + */ + private Long voucherId; + /** + * 凭证号 + */ + private String voucherNum; + /** + * 业务id + */ + private Long businessId; + /** + * 业务类型 + */ + private String businessType; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体 + */ + private String company; + /** + * 删除状态 + */ + private String delStatus; + /** + * 文件后缀 + */ + private String suffix; + /** + * 文件地址 + */ + private String fileUrl; + /** + * 绝对路径 + */ + private String fileAp; + /** + * 流程号 + */ + private String flowId; + /** + * 摘要 + */ + private String note; + /** + * 部门id + */ + private Long deptId; + /** + * 部门名称 + */ + private String deptName; + /** + * 归档id + */ + private Long archiveId; + /** + * 归档状态 + */ + private String archiveState; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/flow/FlowMapper.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/flow/FlowMapper.java new file mode 100644 index 00000000..58e2a614 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/flow/FlowMapper.java @@ -0,0 +1,66 @@ +package cn.iocoder.yudao.module.archives.dal.mysql.flow; + +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.archives.dal.dataobject.flow.FlowDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.archives.controller.admin.flow.vo.*; + +/** + * 审批流程 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface FlowMapper extends BaseMapperX { + + default PageResult selectPage(FlowPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(FlowDO::getFlowCode, reqVO.getFlowCode()) + .eqIfPresent(FlowDO::getVoucherId, reqVO.getVoucherId()) + .eqIfPresent(FlowDO::getVoucherNum, reqVO.getVoucherNum()) + .eqIfPresent(FlowDO::getBusinessId, reqVO.getBusinessId()) + .eqIfPresent(FlowDO::getBusinessType, reqVO.getBusinessType()) + .betweenIfPresent(FlowDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(FlowDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(FlowDO::getCompany, reqVO.getCompany()) + .eqIfPresent(FlowDO::getDelStatus, reqVO.getDelStatus()) + .eqIfPresent(FlowDO::getSuffix, reqVO.getSuffix()) + .eqIfPresent(FlowDO::getFileUrl, reqVO.getFileUrl()) + .eqIfPresent(FlowDO::getFileAp, reqVO.getFileAp()) + .eqIfPresent(FlowDO::getFlowId, reqVO.getFlowId()) + .eqIfPresent(FlowDO::getNote, reqVO.getNote()) + .eqIfPresent(FlowDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(FlowDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(FlowDO::getArchiveId, reqVO.getArchiveId()) + .eqIfPresent(FlowDO::getArchiveState, reqVO.getArchiveState()) + .orderByDesc(FlowDO::getId)); + } + + default List selectList(FlowExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(FlowDO::getFlowCode, reqVO.getFlowCode()) + .eqIfPresent(FlowDO::getVoucherId, reqVO.getVoucherId()) + .eqIfPresent(FlowDO::getVoucherNum, reqVO.getVoucherNum()) + .eqIfPresent(FlowDO::getBusinessId, reqVO.getBusinessId()) + .eqIfPresent(FlowDO::getBusinessType, reqVO.getBusinessType()) + .betweenIfPresent(FlowDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(FlowDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(FlowDO::getCompany, reqVO.getCompany()) + .eqIfPresent(FlowDO::getDelStatus, reqVO.getDelStatus()) + .eqIfPresent(FlowDO::getSuffix, reqVO.getSuffix()) + .eqIfPresent(FlowDO::getFileUrl, reqVO.getFileUrl()) + .eqIfPresent(FlowDO::getFileAp, reqVO.getFileAp()) + .eqIfPresent(FlowDO::getFlowId, reqVO.getFlowId()) + .eqIfPresent(FlowDO::getNote, reqVO.getNote()) + .eqIfPresent(FlowDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(FlowDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(FlowDO::getArchiveId, reqVO.getArchiveId()) + .eqIfPresent(FlowDO::getArchiveState, reqVO.getArchiveState()) + .orderByDesc(FlowDO::getId)); + } + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowService.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowService.java new file mode 100644 index 00000000..a3711136 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.archives.service.flow; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.archives.controller.admin.flow.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.flow.FlowDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 审批流程 Service 接口 + * + * @author 芋道源码 + */ +public interface FlowService { + + /** + * 创建审批流程 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createFlow(@Valid FlowCreateReqVO createReqVO); + + /** + * 更新审批流程 + * + * @param updateReqVO 更新信息 + */ + void updateFlow(@Valid FlowUpdateReqVO updateReqVO); + + /** + * 删除审批流程 + * + * @param id 编号 + */ + void deleteFlow(Long id); + + /** + * 获得审批流程 + * + * @param id 编号 + * @return 审批流程 + */ + FlowDO getFlow(Long id); + + /** + * 获得审批流程列表 + * + * @param ids 编号 + * @return 审批流程列表 + */ + List getFlowList(Collection ids); + + /** + * 获得审批流程分页 + * + * @param pageReqVO 分页查询 + * @return 审批流程分页 + */ + PageResult getFlowPage(FlowPageReqVO pageReqVO); + + /** + * 获得审批流程列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 审批流程列表 + */ + List getFlowList(FlowExportReqVO exportReqVO); + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowServiceImpl.java new file mode 100644 index 00000000..789dcc9c --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/flow/FlowServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.archives.service.flow; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.archives.controller.admin.flow.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.flow.FlowDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.archives.convert.flow.FlowConvert; +import cn.iocoder.yudao.module.archives.dal.mysql.flow.FlowMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.archives.enums.ErrorCodeConstants.*; + +/** + * 审批流程 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class FlowServiceImpl implements FlowService { + + @Resource + private FlowMapper flowMapper; + + @Override + public Long createFlow(FlowCreateReqVO createReqVO) { + // 插入 + FlowDO flow = FlowConvert.INSTANCE.convert(createReqVO); + flowMapper.insert(flow); + // 返回 + return flow.getId(); + } + + @Override + public void updateFlow(FlowUpdateReqVO updateReqVO) { + // 校验存在 + validateFlowExists(updateReqVO.getId()); + // 更新 + FlowDO updateObj = FlowConvert.INSTANCE.convert(updateReqVO); + flowMapper.updateById(updateObj); + } + + @Override + public void deleteFlow(Long id) { + // 校验存在 + validateFlowExists(id); + // 删除 + flowMapper.deleteById(id); + } + + private void validateFlowExists(Long id) { + if (flowMapper.selectById(id) == null) { + throw exception(FLOW_NOT_EXISTS); + } + } + + @Override + public FlowDO getFlow(Long id) { + return flowMapper.selectById(id); + } + + @Override + public List getFlowList(Collection ids) { + return flowMapper.selectBatchIds(ids); + } + + @Override + public PageResult getFlowPage(FlowPageReqVO pageReqVO) { + return flowMapper.selectPage(pageReqVO); + } + + @Override + public List getFlowList(FlowExportReqVO exportReqVO) { + return flowMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/flow/FlowMapper.xml b/yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/flow/FlowMapper.xml new file mode 100644 index 00000000..2d31ff62 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/flow/FlowMapper.xml @@ -0,0 +1,12 @@ + + + + + + +