From c37638b020e9e984de2f12f845695b0b6cd42240 Mon Sep 17 00:00:00 2001
From: xiao-fajia <1665375861@qq.com>
Date: Wed, 7 Aug 2024 09:59:56 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E5=91=98=E5=B7=A5=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../yudao/module/company/entity/Company.java | 1 -
.../module/company/entity/CompanyQuals.java | 2 -
.../company/mapper/CompanyQualsMapper.java | 6 -
.../company/service/CompanyQualsService.java | 6 -
.../service/impl/CompanyQualsServiceImpl.java | 5 -
.../service/impl/CompanyServiceImpl.java | 7 -
.../module/company/vo/CompanyQualsReqVO.java | 7 -
.../module/company/vo/CompanyQualsRespVO.java | 3 -
.../module/company/vo/CompanyRespVO.java | 5 -
dl-module-company/pom.xml | 86 ++++++++++
.../admin/CompanyStaffController.java | 147 ++++++++++++++++++
.../module/company/entity/CompanyStaff.java | 89 +++++++++++
.../company/mapper/CompanyStaffMapper.java | 24 +++
.../company/service/CompanyStaffService.java | 50 ++++++
.../service/impl/CompanyStaffServiceImpl.java | 53 +++++++
.../module/company/vo/CompanyStaffReqVO.java | 13 ++
.../module/company/vo/CompanyStaffRespVO.java | 20 +++
.../mapper/company/CompanyStaffMapper.xml | 53 +++++++
pom.xml | 1 +
yudao-server/pom.xml | 6 +
20 files changed, 542 insertions(+), 42 deletions(-)
create mode 100644 dl-module-company/pom.xml
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java
create mode 100644 dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java
create mode 100644 dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/Company.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/Company.java
index b15bfc76..33e6f43d 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/Company.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/Company.java
@@ -4,7 +4,6 @@ import cn.iocoder.yudao.converter.DateFormatConverter;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
-import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyQuals.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyQuals.java
index d3a999ad..7851765e 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyQuals.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyQuals.java
@@ -1,9 +1,7 @@
package cn.iocoder.yudao.module.company.entity;
-import cn.iocoder.yudao.converter.DateFormatConverter;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
-import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyQualsMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyQualsMapper.java
index 72f64223..697d13a9 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyQualsMapper.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyQualsMapper.java
@@ -1,14 +1,8 @@
package cn.iocoder.yudao.module.company.mapper;
-import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
-import cn.iocoder.yudao.module.company.vo.CompanyQualsReqVO;
-import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
/**
* 企业资质信息表
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyQualsService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyQualsService.java
index 8efe4efc..53b4688f 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyQualsService.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyQualsService.java
@@ -1,13 +1,7 @@
package cn.iocoder.yudao.module.company.service;
-import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
-import cn.iocoder.yudao.module.company.vo.CompanyQualsReqVO;
import cn.iocoder.yudao.module.company.vo.CompanyQualsRespVO;
-import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
-import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
/**
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyQualsServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyQualsServiceImpl.java
index c9a04212..d9cbd915 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyQualsServiceImpl.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyQualsServiceImpl.java
@@ -1,14 +1,9 @@
package cn.iocoder.yudao.module.company.service.impl;
-import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
-import cn.iocoder.yudao.module.company.mapper.CompanyMapper;
import cn.iocoder.yudao.module.company.mapper.CompanyQualsMapper;
import cn.iocoder.yudao.module.company.service.CompanyQualsService;
-import cn.iocoder.yudao.module.company.vo.CompanyQualsReqVO;
import cn.iocoder.yudao.module.company.vo.CompanyQualsRespVO;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java
index a754af33..3dbb8c57 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java
@@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.company.service.impl;
-import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
@@ -11,12 +10,9 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
-import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
-import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum;
-import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
@@ -27,7 +23,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.iocoder.yudao.module.company.mapper.CompanyMapper;
import cn.iocoder.yudao.module.company.service.CompanyService;
-import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@@ -38,8 +33,6 @@ import java.util.Set;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
-import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
-import static java.util.Collections.singleton;
/**
* 企业信息表(每个租户的下属企业信息);(dl_company)表服务实现类
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsReqVO.java
index 9f5bd5a1..ea32c716 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsReqVO.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsReqVO.java
@@ -1,14 +1,7 @@
package cn.iocoder.yudao.module.company.vo;
-import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
-import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 企业资质信息表查询条件实体
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsRespVO.java
index 59f6ded2..91f2703c 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsRespVO.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyQualsRespVO.java
@@ -1,11 +1,8 @@
package cn.iocoder.yudao.module.company.vo;
-import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
import lombok.Data;
-import java.util.List;
-
/**
* 企业资质返回结果或提交vo
* @author vinjor-M
diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyRespVO.java
index f6eba2c8..a61d3fd0 100644
--- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyRespVO.java
+++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyRespVO.java
@@ -1,15 +1,10 @@
package cn.iocoder.yudao.module.company.vo;
import cn.iocoder.yudao.module.company.entity.Company;
-import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-import java.util.Date;
import java.util.List;
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-
/**
* 企业返回结果或提交vo
* @author vinjor-M
diff --git a/dl-module-company/pom.xml b/dl-module-company/pom.xml
new file mode 100644
index 00000000..213828e7
--- /dev/null
+++ b/dl-module-company/pom.xml
@@ -0,0 +1,86 @@
+
+
+
+ cn.iocoder.boot
+ yudao
+ ${revision}
+
+ 4.0.0
+ dl-module-company
+ jar
+ ${project.artifactId}
+
+ 点亮企业管理库
+
+
+
+ cn.iocoder.boot
+ yudao-module-system-api
+ ${revision}
+
+
+ cn.iocoder.boot
+ yudao-module-infra-api
+ ${revision}
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-biz-tenant
+ 2.1.0-jdk8-snapshot
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-security
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-mybatis
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-redis
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-job
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-mq
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-test
+ test
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-excel
+
+
+
+ org.springframework.boot
+ spring-boot-starter-mail
+
+
+
+
\ No newline at end of file
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java
new file mode 100644
index 00000000..d77d74c3
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java
@@ -0,0 +1,147 @@
+package cn.iocoder.yudao.module.company.controller.admin;
+
+import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import cn.iocoder.yudao.module.company.service.CompanyStaffService;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffRespVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.apache.commons.lang3.StringUtils;
+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 java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * 企业管理-员工信息表 控制层
+ * @author 小李
+ * @date 17:14 2024/8/6
+**/
+@RestController
+@RequestMapping("/company/staff")
+@Tag(name = "管理后台 - 企业管理 - 员工管理")
+@Validated
+public class CompanyStaffController {
+
+ @Resource
+ private CompanyStaffService staffService;
+
+ /**
+ * 分页查询
+ * @author 小李
+ * @date 17:19 2024/8/6
+ * @param pageReqVO 查询条件对象
+ * @param pageNo 页码
+ * @param pageSize 条数
+ **/
+ @GetMapping("/page")
+ @Operation(summary = "获得企业管理-员工信息表信息分页")
+ @PreAuthorize("@ss.hasPermission('company:staff:query')")
+ public CommonResult> getCompanyPage(CompanyStaffReqVO pageReqVO,
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+ Page page = new Page<>(pageNo, pageSize);
+ return success(staffService.queryListPage(pageReqVO, page));
+ }
+
+ /**
+ * 新增员工
+ * @author 小李
+ * @date 17:20 2024/8/6
+ * @param staffRespVO 员工对象
+ **/
+ @PostMapping("/create")
+ @Operation(summary = "创建企业管理-员工信息表信息")
+ @PreAuthorize("@ss.hasPermission('company:staff:create')")
+ public CommonResult createCompany(@RequestBody CompanyStaffRespVO staffRespVO) {
+ staffService.saveStaff(staffRespVO);
+ return CommonResult.ok();
+ }
+
+ /**
+ * 修改员工
+ * @author 小李
+ * @date 17:24 2024/8/6
+ * @param staffRespVO 员工对象
+ **/
+ @PutMapping("/update")
+ @Operation(summary = "更新企业管理-员工信息表信息")
+ @PreAuthorize("@ss.hasPermission('company:staff:update')")
+ public CommonResult updateCompany(@RequestBody CompanyStaffRespVO staffRespVO) {
+ staffService.updateStaff(staffRespVO);
+ return CommonResult.ok();
+ }
+
+ /**
+ * 删除员工
+ * @author 小李
+ * @date 17:28 2024/8/6
+ * @param id 员工id
+ **/
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除企业管理-员工信息表信息")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('company:staff:delete')")
+ public CommonResult deleteCompany(@RequestParam("id") String id) {
+ staffService.deleteStaff(id);
+ return success(true);
+ }
+
+ /**
+ * 查询员工
+ * @author 小李
+ * @date 17:59 2024/8/6
+ * @param id
+ **/
+ @GetMapping("/get")
+ @Operation(summary = "获得企业管理-员工信息表信息")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('company:staff:query')")
+ public CommonResult getCompany(@RequestParam("id") String id) {
+ CompanyStaff staff = staffService.getById(id);
+ CompanyStaffRespVO staffRespVO = BeanUtils.toBean(staff, CompanyStaffRespVO.class);
+ if(StringUtils.isNotEmpty(staffRespVO.getFileIds())){
+ staffRespVO.setFileIdArray(Arrays.asList(staff.getFileIds().split(StrUtil.COMMA)));
+ }
+ return success(staffRespVO);
+ }
+
+ /**
+ * @author 小李
+ * @date 18:01 2024/8/6
+ * @param pageReqVO 查询条件--暂时导出所有
+ * @param response 响应体
+ **/
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出企业管理-员工信息表 Excel")
+ @PreAuthorize("@ss.hasPermission('company:staff:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportCompanyExcel(CompanyStaffReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ List list = staffService.list();
+ // 导出 Excel
+ Map columnWidthMap = new HashMap<>();
+ // 第一列的索引是0,宽度设置为20个字符宽
+ columnWidthMap.put(9, 20);
+ columnWidthMap.put(10, 20);
+ ExcelUtils.write(response, "企业信息表.xls", "数据", CompanyStaff.class, list,columnWidthMap);
+ }
+}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java
new file mode 100644
index 00000000..af0d559f
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java
@@ -0,0 +1,89 @@
+package cn.iocoder.yudao.module.company.entity;
+
+
+import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * 企业管理-员工信息实体
+ * @author 小李
+ * @date 16:25 2024/8/6
+**/
+@TableName("company_staff")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ExcelIgnoreUnannotated
+public class CompanyStaff extends TenantBaseDO {
+ /** 主键标识 */
+ @TableId(type = IdType.INPUT)
+ private String id;
+
+ /** 企业id(base_company表中的id) */
+ private String corpId;
+
+ /** 用户id(system_users表的id) */
+ private Long userId;
+
+ /** 部门id(system_dept表中的id) */
+ private Long deptId;
+
+ /** 工号 */
+ @ExcelProperty("工号")
+ private String workNo;
+
+ /** 姓名 */
+ @ExcelProperty("姓名")
+ private String name;
+
+ /** 手机号 */
+ @ExcelProperty("手机号")
+ private String tel;
+
+ /** 性别 */
+ @ExcelProperty("性别")
+ private String sex;
+
+ /** 家庭住址 */
+ @ExcelProperty("家庭住址")
+ private String address;
+
+ /** 工作日期 */
+ @ExcelProperty("工作日期")
+ private LocalDate workDate;
+
+ /** 工龄 */
+ @ExcelProperty("工龄")
+ private BigDecimal workYear;
+
+ /** 入职日期 */
+ @ExcelProperty("入职日期")
+ private LocalDate joinedDate;
+
+ /** 司龄 */
+ @ExcelProperty("司龄")
+ private BigDecimal joinedYear;
+
+ /** 学历 */
+ @ExcelProperty("学历")
+ private String education;
+
+ /** 个人简介 */
+ @ExcelProperty("个人简介")
+ private String content;
+
+ /** 唯一推广码(须保证全平台唯一,规则:字母+数字;字母全大写) */
+ @ExcelProperty("唯一推广码")
+ private String uniqueCode;
+
+ /** 附件ids(infra_file表中的id,多个英文逗号拼接) */
+ private String fileIds;
+}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java
new file mode 100644
index 00000000..9470f15d
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.company.mapper;
+
+import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 企业管理-员工信息表
+ * @author 小李
+ * @date 16:26 2024/8/6
+ **/
+@Mapper
+public interface CompanyStaffMapper extends BaseMapper {
+
+ IPage selectStaffListPage();
+
+ List selectList();
+}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java
new file mode 100644
index 00000000..330c99a0
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java
@@ -0,0 +1,50 @@
+package cn.iocoder.yudao.module.company.service;
+
+import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffRespVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import javax.validation.Valid;
+
+/**
+ * 企业管理-员工信息表 服务
+ * @author 小李
+ * @date 16:29 2024/8/6
+**/
+public interface CompanyStaffService extends IService {
+
+ /**
+ * 获得企业管理-员工信息表分页
+ * @author 小李
+ * @date 17:11 2024/8/6
+ * @param pageReqVO 分页查询
+ **/
+ IPage queryListPage(CompanyStaffReqVO pageReqVO, Page page);
+
+ /**
+ * 新增员工
+ * @author 小李
+ * @date 16:29 2024/8/6
+ * @param staffRespVO 员工对象
+ **/
+ void saveStaff(@Valid CompanyStaffRespVO staffRespVO);
+
+ /**
+ * 修改员工信息
+ * @author 小李
+ * @date 16:31 2024/8/6
+ * @param staffRespVO 员工对象
+ **/
+ void updateStaff(@Valid CompanyStaffRespVO staffRespVO);
+
+ /**
+ * 删除员工信息
+ * @author 小李
+ * @date 16:32 2024/8/6
+ * @param id 员工ID
+ **/
+ void deleteStaff(String id);
+}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java
new file mode 100644
index 00000000..fa59087e
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java
@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.company.service.impl;
+
+import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import cn.iocoder.yudao.module.company.mapper.CompanyStaffMapper;
+import cn.iocoder.yudao.module.company.service.CompanyStaffService;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.company.vo.CompanyStaffRespVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * 企业管理-员工信息表 服务实现类
+ * @author 小李
+ * @date 16:29 2024/8/6
+ **/
+@Service
+public class CompanyStaffServiceImpl extends ServiceImpl implements CompanyStaffService {
+
+ @Resource
+ private CompanyStaffMapper staffMapper;
+
+ /**
+ * 获得企业管理-员工信息表分页
+ * @author 小李
+ * @date 17:11 2024/8/6
+ * @param pageReqVO 分页查询
+ * @param page 分页对象
+ **/
+ @Override
+ public IPage queryListPage(CompanyStaffReqVO pageReqVO, Page page) {
+ staffMapper.selectList();
+ return staffMapper.selectStaffListPage();
+ }
+
+ @Override
+ public void saveStaff(CompanyStaffRespVO staffRespVO) {
+
+ }
+
+ @Override
+ public void updateStaff(CompanyStaffRespVO staffRespVO) {
+
+ }
+
+ @Override
+ public void deleteStaff(String id) {
+
+ }
+}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java
new file mode 100644
index 00000000..a93c7312
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java
@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.module.company.vo;
+
+import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import lombok.Data;
+
+/**
+ * 员工查询VO
+ * @author 小李
+ * @date 16:49 2024/8/6
+**/
+@Data
+public class CompanyStaffReqVO extends CompanyStaff {
+}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java
new file mode 100644
index 00000000..6a7a45cc
--- /dev/null
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java
@@ -0,0 +1,20 @@
+package cn.iocoder.yudao.module.company.vo;
+
+import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 员工响应或提交VO
+ * @author 小李
+ * @date 16:50 2024/8/6
+**/
+@Data
+public class CompanyStaffRespVO extends CompanyStaff {
+
+ /**
+ * 员工附件IDS
+ */
+ List fileIdArray;
+}
diff --git a/dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml b/dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml
new file mode 100644
index 00000000..4f1b3679
--- /dev/null
+++ b/dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select
+ id,corp_id,user_id,
+ dept_id,work_no,name,
+ tel,sex,address,
+ work_date,work_year,joined_date,
+ joined_year,education,content,
+ unique_code,file_ids,tenant_id,
+ deleted,creator,create_time,
+ updater,update_time
+ from company_staff
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 95fb32b5..186234fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,6 +24,7 @@
dl-module-base
yudao-server
+ dl-module-company
diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml
index beac859e..e2cf2bbc 100644
--- a/yudao-server/pom.xml
+++ b/yudao-server/pom.xml
@@ -37,6 +37,12 @@
dl-module-base
${revision}
+
+
+ cn.iocoder.boot
+ dl-module-company
+ ${revision}
+
From 3f1cb77842bd91dc8ec032f315808ef685eafa75 Mon Sep 17 00:00:00 2001
From: Vinjor
Date: Wed, 7 Aug 2024 11:01:30 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3xml=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E6=89=AB=E6=8F=8F=E4=B8=8D=E5=88=B0=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin/CompanyStaffController.java | 10 ++--
.../entity/CompanyStaff.java | 2 +-
.../mapper/CompanyStaffMapper.java | 10 ++--
.../service/CompanyStaffService.java | 8 +--
.../service/impl/CompanyStaffServiceImpl.java | 15 +++---
.../vo/CompanyStaffReqVO.java | 4 +-
.../vo/CompanyStaffRespVO.java | 4 +-
.../mapper/company/CompanyStaffMapper.xml | 53 -------------------
.../mapper/staff/CompanyStaffMapper.xml | 9 ++++
pom.xml | 5 +-
yudao-dependencies/pom.xml | 2 +-
yudao-server/pom.xml | 10 ++--
.../src/main/resources/application.yaml | 4 +-
13 files changed, 46 insertions(+), 90 deletions(-)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/controller/admin/CompanyStaffController.java (94%)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/entity/CompanyStaff.java (97%)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/mapper/CompanyStaffMapper.java (62%)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/service/CompanyStaffService.java (83%)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/service/impl/CompanyStaffServiceImpl.java (70%)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/vo/CompanyStaffReqVO.java (59%)
rename dl-module-company/src/main/java/cn/iocoder/yudao/module/{company => staff}/vo/CompanyStaffRespVO.java (71%)
delete mode 100644 dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml
create mode 100644 dl-module-company/src/main/resources/mapper/staff/CompanyStaffMapper.xml
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java
similarity index 94%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java
index d77d74c3..3df25b2c 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/controller/admin/CompanyStaffController.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/controller/admin/CompanyStaffController.java
@@ -1,14 +1,14 @@
-package cn.iocoder.yudao.module.company.controller.admin;
+package cn.iocoder.yudao.module.staff.controller.admin;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
-import cn.iocoder.yudao.module.company.entity.CompanyStaff;
-import cn.iocoder.yudao.module.company.service.CompanyStaffService;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffRespVO;
+import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
+import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/entity/CompanyStaff.java
similarity index 97%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/entity/CompanyStaff.java
index af0d559f..a9b64c98 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/entity/CompanyStaff.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/entity/CompanyStaff.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.company.entity;
+package cn.iocoder.yudao.module.staff.entity;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/mapper/CompanyStaffMapper.java
similarity index 62%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/mapper/CompanyStaffMapper.java
index 9470f15d..9c460e39 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/mapper/CompanyStaffMapper.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/mapper/CompanyStaffMapper.java
@@ -1,7 +1,7 @@
-package cn.iocoder.yudao.module.company.mapper;
+package cn.iocoder.yudao.module.staff.mapper;
-import cn.iocoder.yudao.module.company.entity.CompanyStaff;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -18,7 +18,5 @@ import java.util.List;
@Mapper
public interface CompanyStaffMapper extends BaseMapper {
- IPage selectStaffListPage();
-
- List selectList();
+ IPage selectListPage(@Param("map") CompanyStaffReqVO companyStaffReqVO, Page page);
}
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/CompanyStaffService.java
similarity index 83%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/CompanyStaffService.java
index 330c99a0..2112e331 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/CompanyStaffService.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/CompanyStaffService.java
@@ -1,8 +1,8 @@
-package cn.iocoder.yudao.module.company.service;
+package cn.iocoder.yudao.module.staff.service;
-import cn.iocoder.yudao.module.company.entity.CompanyStaff;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffRespVO;
+import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/CompanyStaffServiceImpl.java
similarity index 70%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/CompanyStaffServiceImpl.java
index fa59087e..e81a9372 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyStaffServiceImpl.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/service/impl/CompanyStaffServiceImpl.java
@@ -1,10 +1,10 @@
-package cn.iocoder.yudao.module.company.service.impl;
+package cn.iocoder.yudao.module.staff.service.impl;
-import cn.iocoder.yudao.module.company.entity.CompanyStaff;
-import cn.iocoder.yudao.module.company.mapper.CompanyStaffMapper;
-import cn.iocoder.yudao.module.company.service.CompanyStaffService;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffReqVO;
-import cn.iocoder.yudao.module.company.vo.CompanyStaffRespVO;
+import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
+import cn.iocoder.yudao.module.staff.mapper.CompanyStaffMapper;
+import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
+import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -32,8 +32,7 @@ public class CompanyStaffServiceImpl extends ServiceImpl queryListPage(CompanyStaffReqVO pageReqVO, Page page) {
- staffMapper.selectList();
- return staffMapper.selectStaffListPage();
+ return staffMapper.selectListPage(pageReqVO, page);
}
@Override
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/CompanyStaffReqVO.java
similarity index 59%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/CompanyStaffReqVO.java
index a93c7312..77a0e8c3 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffReqVO.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/CompanyStaffReqVO.java
@@ -1,6 +1,6 @@
-package cn.iocoder.yudao.module.company.vo;
+package cn.iocoder.yudao.module.staff.vo;
-import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
import lombok.Data;
/**
diff --git a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/CompanyStaffRespVO.java
similarity index 71%
rename from dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java
rename to dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/CompanyStaffRespVO.java
index 6a7a45cc..d2cc6852 100644
--- a/dl-module-company/src/main/java/cn/iocoder/yudao/module/company/vo/CompanyStaffRespVO.java
+++ b/dl-module-company/src/main/java/cn/iocoder/yudao/module/staff/vo/CompanyStaffRespVO.java
@@ -1,6 +1,6 @@
-package cn.iocoder.yudao.module.company.vo;
+package cn.iocoder.yudao.module.staff.vo;
-import cn.iocoder.yudao.module.company.entity.CompanyStaff;
+import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
import lombok.Data;
import java.util.List;
diff --git a/dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml b/dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml
deleted file mode 100644
index 4f1b3679..00000000
--- a/dl-module-company/src/main/resources/mapper/company/CompanyStaffMapper.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- select
- id,corp_id,user_id,
- dept_id,work_no,name,
- tel,sex,address,
- work_date,work_year,joined_date,
- joined_year,education,content,
- unique_code,file_ids,tenant_id,
- deleted,creator,create_time,
- updater,update_time
- from company_staff
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dl-module-company/src/main/resources/mapper/staff/CompanyStaffMapper.xml b/dl-module-company/src/main/resources/mapper/staff/CompanyStaffMapper.xml
new file mode 100644
index 00000000..b956f97d
--- /dev/null
+++ b/dl-module-company/src/main/resources/mapper/staff/CompanyStaffMapper.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 186234fa..7676f900 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,16 +15,17 @@
yudao-module-infra
yudao-module-bpm
- yudao-module-report
+
yudao-module-crm
yudao-module-erp
dl-module-base
+ dl-module-company
yudao-server
- dl-module-company
+
diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml
index 19053428..d0233305 100644
--- a/yudao-dependencies/pom.xml
+++ b/yudao-dependencies/pom.xml
@@ -502,7 +502,7 @@
com.google.inject
guice
- ${guice.version}
+
diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml
index e2cf2bbc..33dea56d 100644
--- a/yudao-server/pom.xml
+++ b/yudao-server/pom.xml
@@ -51,11 +51,11 @@
-
- cn.iocoder.boot
- yudao-module-report-biz
- ${revision}
-
+
+
+
+
+
cn.iocoder.boot
diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml
index d23fdee7..efcf0b37 100644
--- a/yudao-server/src/main/resources/application.yaml
+++ b/yudao-server/src/main/resources/application.yaml
@@ -80,7 +80,9 @@ mybatis-plus:
type-aliases-package:
- ${yudao.info.base-package}.module.*.dal.dataobject
- ${yudao.info.base-package}.module.*.entity
- mapper-locations: classpath:/mapper/*/*.xml
+ mapper-locations:
+ - classpath*:mapper/*/*.xml # 扫描子模块下的 mapper.xml文件
+ - classpath:mapper/*/*.xml # 扫描当前模块下的 mapper.xml 文件
encryptor:
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
From f6b29d08e8f7c4db83d5a3c979ddf792e8b60a48 Mon Sep 17 00:00:00 2001
From: Vinjor
Date: Wed, 7 Aug 2024 11:37:48 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=AF=E6=9C=A8=E6=8A=A5=E8=A1=A8?=
=?UTF-8?q?=E6=89=93=E5=8C=85=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 79 +++++++++++--------
.../yudao-module-report-biz/pom.xml | 1 +
.../module/system/enums/common/DeptEnum.java | 27 +++++++
.../service/tenant/TenantServiceImpl.java | 20 ++++-
yudao-server/pom.xml | 10 +--
5 files changed, 96 insertions(+), 41 deletions(-)
create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java
diff --git a/pom.xml b/pom.xml
index 7676f900..0d2f935c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
yudao-module-infra
yudao-module-bpm
-
+ yudao-module-report
@@ -136,36 +136,51 @@
+
+
+ aliyun
+ aliyun Repository
+ http://maven.aliyun.com/nexus/content/groups/public
+
+ false
+
+
+
+
+ jeecg
+ jeecg Repository
+ http://maven.jeecg.org/nexus/content/repositories/jeecg
+
+ false
+
+
+
+
+ huaweicloud
+ huawei
+ https://mirrors.huaweicloud.com/repository/maven/
+
+
+ aliyunmaven
+ aliyun
+ https://maven.aliyun.com/repository/public
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+ false
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ false
+
+
+
diff --git a/yudao-module-report/yudao-module-report-biz/pom.xml b/yudao-module-report/yudao-module-report-biz/pom.xml
index b2c4d181..69c361c0 100644
--- a/yudao-module-report/yudao-module-report-biz/pom.xml
+++ b/yudao-module-report/yudao-module-report-biz/pom.xml
@@ -63,6 +63,7 @@
org.jeecgframework.jimureport
jimureport-spring-boot-starter
+
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java
new file mode 100644
index 00000000..4fa8f26c
--- /dev/null
+++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java
@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.system.enums.common;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 性别的枚举值
+ *
+ * @author 芋道源码
+ */
+@Getter
+@AllArgsConstructor
+public enum DeptEnum {
+
+ /** 私人客户 */
+ PRIVATE_CUS("私人客户"),
+ /** 代办客户 */
+ AGENT_CUS("代办客户"),
+ /** 政企客户 */
+ GOV_CUS("政企客户");
+
+ /**
+ * 名称
+ */
+ private final String name;
+
+}
diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
index 6eb8a01f..3ca1c97f 100644
--- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
+++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
@@ -51,6 +51,7 @@ import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
+import static cn.iocoder.yudao.module.system.enums.common.DeptEnum.*;
import static java.util.Collections.singleton;
/**
@@ -131,7 +132,11 @@ public class TenantServiceImpl implements TenantService {
// 修改租户的管理员
tenantMapper.updateById(new TenantDO().setId(tenant.getId()).setContactUserId(userId));
//创建租户顶级部门
- Long deptId = createDept(userId,createReqVO.getName(),createReqVO.getContactMobile());
+ Long deptId = createDept(userId,createReqVO.getName(),createReqVO.getContactMobile(),null);
+ //创建三个客户部门:私人客户、代办客户、政企客户
+ createDept(null,PRIVATE_CUS.getName(),null,deptId);
+ createDept(null,AGENT_CUS.getName(),null,deptId);
+ createDept(null,GOV_CUS.getName(),null,deptId);
//拉取本租户配置的服务套餐对应的角色和权限,存入本租户对应信息
createServiceRole(createReqVO.getPackageId());
});
@@ -158,13 +163,20 @@ public class TenantServiceImpl implements TenantService {
}
}
- private Long createDept(Long userId,String deptName,String phone){
+ private Long createDept(Long userId,String deptName,String phone,Long parentId){
DeptSaveReqVO deptSaveReqVO = new DeptSaveReqVO();
deptSaveReqVO.setName(deptName);
deptSaveReqVO.setSort(0);
- deptSaveReqVO.setPhone(phone);
deptSaveReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
- deptSaveReqVO.setLeaderUserId(userId);
+ if(null!=phone){
+ deptSaveReqVO.setPhone(phone);
+ }
+ if(null!=userId){
+ deptSaveReqVO.setLeaderUserId(userId);
+ }
+ if(null!=parentId){
+ deptSaveReqVO.setParentId(parentId);
+ }
return deptService.createDept(deptSaveReqVO);
}
diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml
index 33dea56d..e2cf2bbc 100644
--- a/yudao-server/pom.xml
+++ b/yudao-server/pom.xml
@@ -51,11 +51,11 @@
-
-
-
-
-
+
+ cn.iocoder.boot
+ yudao-module-report-biz
+ ${revision}
+
cn.iocoder.boot