Browse Source

Merge remote-tracking branch 'origin/master_20240722' into master_20240722

dongpo 6 months ago
parent
commit
89bc29b219

+ 11 - 24
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoRespVO.java

@@ -16,44 +16,36 @@ import com.alibaba.excel.annotation.*;
 public class CustomerInfoRespVO {
 
     @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8654")
-    @ExcelProperty("自增主键")
     private Long id;
 
     @Schema(description = "客户uuid", example = "178")
-    @ExcelProperty("客户uuid")
     private String customerId;
 
-    @Schema(description = "客户编")
-    @ExcelProperty("客户编")
+    @Schema(description = "客户编")
+    @ExcelProperty("客户编")
     private String customerCode;
 
     @Schema(description = "客户名称", example = "张三")
     @ExcelProperty("客户名称")
     private String customerName;
 
+    @Schema(description = "客户成立日期")
+    @ExcelProperty("客户成立日期")
+    private String registDate;
+
     @Schema(description = "客户状态", example = "1")
-    @ExcelProperty("客户状态")
     private String customerStatus;
 
     @Schema(description = "创建人员工id", example = "28498")
-    @ExcelProperty("创建人员工id")
     private Long creatorEmployeeId;
 
-    @Schema(description = "创建人员工姓名", example = "张三")
-    @ExcelProperty("创建人员工姓名")
-    private String creatorEmployeeName;
-
     @Schema(description = "部门id", example = "8267")
-    @ExcelProperty("部门id")
     private Long deptId;
 
     @Schema(description = "部门名称", example = "人事部")
-    @ExcelProperty("部门名称")
     private String deptName;
 
-    @Schema(description = "客户成立时间")
-    @ExcelProperty("客户成立时间")
-    private String registDate;
+
 
     @Schema(description = "注册资本金(万元)")
     @ExcelProperty("注册资本金(万元)")
@@ -68,15 +60,12 @@ public class CustomerInfoRespVO {
     private Integer workforce;
 
     @Schema(description = "行业")
-    @ExcelProperty("行业")
     private String trade;
 
     @Schema(description = "企业性质")
-    @ExcelProperty("企业性质")
     private String customerNature;
 
     @Schema(description = "客户地址")
-    @ExcelProperty("客户地址")
     private String companyAddress;
 
     @Schema(description = "客户联系人")
@@ -87,24 +76,23 @@ public class CustomerInfoRespVO {
     @ExcelProperty("客户联系手机号")
     private String customerPersonPhone;
 
+    @Schema(description = "创建人", example = "张三")
+    @ExcelProperty("创建人")
+    private String creatorEmployeeName;
+
     @Schema(description = "客户联系人办公地址")
-    @ExcelProperty("客户联系人办公地址")
     private String companyPersonAddress;
 
     @Schema(description = "客户来源")
-    @ExcelProperty("客户来源")
     private String customerFrom;
 
     @Schema(description = "是否开启 0开启1关闭", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("是否开启 0开启1关闭")
     private Integer isOpen;
 
     @Schema(description = "备注")
-    @ExcelProperty("备注")
     private String remarks;
 
     @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @ExcelProperty("状态")
     private Integer status;
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -112,7 +100,6 @@ public class CustomerInfoRespVO {
     private LocalDateTime createTime;
 
     @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4014")
-    @ExcelProperty("租户编号")
     private Long tenantId;
 
     @Schema(description = "附件列表")

+ 2 - 2
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/info/CustomerInfoServiceImpl.java

@@ -51,9 +51,9 @@ public class CustomerInfoServiceImpl implements CustomerInfoService {
     public Long createInfo(CustomerInfoSaveReqVO createReqVO) {
         // 获取用户信息和租户ID
         LoginUser user = SecurityFrameworkUtils.getLoginUser();
-        Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
+//        Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
         Long userId = user != null && user.getId() != null ? user.getId() : 0L;
-        createReqVO.setTenantId(tenantId);
+//        createReqVO.setTenantId(tenantId);
         // 通过用户ID获取登录员工信息
         EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(userId);
         // 创建人信息

+ 9 - 19
yudao-module-personnel/yudao-module-attendance-biz/src/main/java/cn/iocoder/yudao/module/attendance/controller/admin/info/vo/AttendanceInfoRespVO.java

@@ -21,83 +21,73 @@ import javax.validation.constraints.NotEmpty;
 public class AttendanceInfoRespVO {
 
     @Schema(description = "考勤ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14247")
-    @ExcelProperty("考勤ID")
     private Long id;
 
     @Schema(description = "员工ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6960")
-    @ExcelProperty("员工ID")
     private Long employeeId;
 
     @Schema(description = "员工姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
     @ExcelProperty("员工姓名")
     private String employeeName;
 
-    @Schema(description = "员工手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13812345678")
-    @NotEmpty(message = "员工手机号不能为空")
-    private String employeeMobile;
-
     @Schema(description = "部门名称", example = "13463")
+    @ExcelProperty("部门")
     private String deptName;
 
     @Schema(description = "职位名称", example = "13463")
+    @ExcelProperty("职位")
     private String position;
 
+    @Schema(description = "员工手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13812345678")
+    @ExcelProperty("手机号")
+    private String employeeMobile;
+
     @Schema(description = "考勤日期", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("考勤日期")
+    @ExcelProperty("日期")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private LocalDate attendanceDate;
 
     @Schema(description = "上班时间")
-    @ExcelProperty("上班时间")
+    @ExcelProperty("上班打卡")
     @JsonFormat(pattern = "HH:mm")
     private LocalTime workStartTime;
 
     @Schema(description = "下班时间")
-    @ExcelProperty("下班时间")
+    @ExcelProperty("下班打卡")
     @JsonFormat(pattern = "HH:mm")
     private LocalTime workEndTime;
 
     @Schema(description = "迟到时间(如有)")
-    @ExcelProperty("迟到时间(如有)")
     @JsonFormat(pattern = "HH:mm")
     private LocalTime lateTime;
 
     @Schema(description = "早退时间(如有)")
-    @ExcelProperty("早退时间(如有)")
     @JsonFormat(pattern = "HH:mm")
     private LocalTime leaveEarlyTime;
 
     @Schema(description = "加班时长(小时)")
-    @ExcelProperty("加班时长(小时)")
     private BigDecimal overtimeDuration;
 
     @Schema(description = "请假类型", example = "2")
-    @ExcelProperty("请假类型")
     private String leaveType;
 
     @Schema(description = "请假时长(小时或天数)")
-    @ExcelProperty("请假时长(小时或天数)")
     private BigDecimal leaveDuration;
 
     @Schema(description = "考勤状态", example = "1")
-    @ExcelProperty("考勤状态")
     private String attendanceStatus;
 
     @Schema(description = "备注")
-    @ExcelProperty("备注")
     private String remarks;
 
     @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
-    @ExcelProperty("状态")
     private Integer status;
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime createTime;
 
     @Schema(description = "租户编号", example = "1")
-    @ExcelProperty("租户编号")
     private Long tenantId;
 
 }

+ 8 - 23
yudao-module-personnel/yudao-module-attendance-biz/src/main/java/cn/iocoder/yudao/module/attendance/controller/admin/leave/vo/AttendanceLeaveRespVO.java

@@ -16,53 +16,45 @@ import com.alibaba.excel.annotation.*;
 public class AttendanceLeaveRespVO {
 
     @Schema(description = "请假表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11893")
-    @ExcelProperty("请假表单主键")
     private Long id;
 
     @Schema(description = "uuid", example = "9396")
-    @ExcelProperty("uuid")
     private String leaveId;
 
     @Schema(description = "请假人id", example = "25553")
-    @ExcelProperty("请假人id")
     private Long employeeId;
 
     @Schema(description = "请假人uuid", example = "9213")
-    @ExcelProperty("请假人uuid")
     private String employeeUuid;
 
     @Schema(description = "请假员工姓名", example = "王五")
-    @ExcelProperty("请假员工姓名")
+    @ExcelProperty("请假")
     private String employeeName;
 
-    @Schema(description = "请假员工手机号")
-    @ExcelProperty("请假员工手机号")
-    private String employeePhone;
-
     @Schema(description = "用户账号id", example = "20160")
-    @ExcelProperty("用户账号id")
     private Long userId;
 
     @Schema(description = "用户账号uuid", example = "27340")
-    @ExcelProperty("用户账号uuid")
     private String userUuid;
 
     @Schema(description = "部门id", example = "5849")
-    @ExcelProperty("部门id")
     private Long deptId;
 
     @Schema(description = "部门uuid", example = "864")
-    @ExcelProperty("部门uuid")
     private String deptUuid;
 
     @Schema(description = "部门名称", example = "财务部")
-    @ExcelProperty("部门名称")
+    @ExcelProperty("部门")
     private String deptName;
 
     @Schema(description = "员工职位")
-    @ExcelProperty("员工职位")
+    @ExcelProperty("职位")
     private String position;
 
+    @Schema(description = "请假员工手机号")
+    @ExcelProperty("手机号")
+    private String employeePhone;
+
     @Schema(description = "请假类型", example = "1")
     @ExcelProperty("请假类型")
     private String leaveType;
@@ -72,7 +64,6 @@ public class AttendanceLeaveRespVO {
     private String startDate;
 
     @Schema(description = "具体时间,精确到上下午,am上午 pm下午")
-    @ExcelProperty("具体时间,精确到上下午,am上午 pm下午")
     private String startTime;
 
     @Schema(description = "结束日期")
@@ -80,7 +71,6 @@ public class AttendanceLeaveRespVO {
     private String endDate;
 
     @Schema(description = "具体时间,精确到上下午,am上午 pm下午")
-    @ExcelProperty("具体时间,精确到上下午,am上午 pm下午")
     private String endTime;
 
     @Schema(description = "请假天数")
@@ -88,11 +78,9 @@ public class AttendanceLeaveRespVO {
     private String day;
 
     @Schema(description = "请假原因", example = "不香")
-    @ExcelProperty("请假原因")
     private String reason;
 
     @Schema(description = "备注")
-    @ExcelProperty("备注")
     private String remarks;
 
     @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@@ -100,15 +88,13 @@ public class AttendanceLeaveRespVO {
     private Integer status;
 
     @Schema(description = "数据来源,0流程添加、1手动添加")
-    @ExcelProperty("数据来源,0流程添加、1手动添加")
     private String infoSource;
 
     @Schema(description = "创建人员工id", example = "22995")
-    @ExcelProperty("创建人员工id")
     private Long creatorEmployeeId;
 
     @Schema(description = "创建人员工姓名", example = "张三")
-    @ExcelProperty("创建人员工姓名")
+    @ExcelProperty("创建人")
     private String creatorEmployeeName;
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -117,7 +103,6 @@ public class AttendanceLeaveRespVO {
     private LocalDateTime createTime;
 
     @Schema(description = "租户编号", example = "1")
-    @ExcelProperty("租户编号")
     private Long tenantId;
 
     @Schema(description = "附件列表")

+ 12 - 0
yudao-module-personnel/yudao-module-employee-api/src/main/java/cn/iocoder/yudao/module/employee/api/dto/EmployeePageReqDTO.java

@@ -44,5 +44,17 @@ public class EmployeePageReqDTO extends PageParam {
      * 手机号
      */
     private String phone;
+    /**
+     * 部门ID
+     */
+    private Long deptId;
+    /**
+     * 职位ID
+     */
+    private Long postId;
+    /**
+     * 职位
+     */
+    private String position;
 
 }

+ 5 - 0
yudao-module-personnel/yudao-module-employee-api/src/main/java/cn/iocoder/yudao/module/employee/api/dto/EmployeeRespDTO.java

@@ -63,6 +63,11 @@ public class EmployeeRespDTO {
      */
     private String phone;
 
+    /**
+     * 员工ID
+     */
+    private Long employeeId;
+
     /**
      * 员工编号
      */

+ 20 - 6
yudao-module-personnel/yudao-module-employee-biz/src/main/java/cn/iocoder/yudao/module/employee/service/info/EmployeeInfoServiceImpl.java

@@ -21,6 +21,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
 import cn.iocoder.yudao.module.system.service.dept.DeptService;
 import cn.iocoder.yudao.module.system.service.dept.PostService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -148,6 +149,13 @@ public class EmployeeInfoServiceImpl implements EmployeeInfoService {
             }
             createReqVO.setPosition(post.getName());
         }
+        // 部门
+        if (createReqVO.getDeptId() != null) {
+            DeptDO dept = deptService.getDept(createReqVO.getDeptId());
+            if (dept != null && StringUtils.isNotBlank(dept.getName())) {
+                createReqVO.setDeptName(dept.getName());
+            }
+        }
         // 检查电话号码是否为空
         if (createReqVO.getPhone() == null || createReqVO.getPhone().isEmpty()) {
             throw exception(EMPLOYEE_INFO_PHONE_NOT_NULL);
@@ -161,11 +169,11 @@ public class EmployeeInfoServiceImpl implements EmployeeInfoService {
             throw exception(EMPLOYEE_INFO_PHONE_EXISTS);
         }
         // 获取用户信息和租户ID
-        LoginUser user = SecurityFrameworkUtils.getLoginUser();
-        if (createReqVO.getTenantId() == null) {
-            Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
-            createReqVO.setTenantId(tenantId);
-        }
+//        LoginUser user = SecurityFrameworkUtils.getLoginUser();
+//        if (createReqVO.getTenantId() == null) {
+//            Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
+//            createReqVO.setTenantId(tenantId);
+//        }
         createReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
         // 生成id
         createReqVO.setInfoId(IdUtil.fastSimpleUUID());
@@ -190,7 +198,13 @@ public class EmployeeInfoServiceImpl implements EmployeeInfoService {
         // 假设 employeeInfoDO 和 updateReqVO 已经被正确定义和初始化
         String newPhone = updateReqVO.getPhone();
         String currentPhone = employeeInfoDO.getPhone();
-
+        // 部门
+        if (updateReqVO.getDeptId() != null) {
+            DeptDO dept = deptService.getDept(updateReqVO.getDeptId());
+            if (dept != null && StringUtils.isNotBlank(dept.getName())) {
+                updateReqVO.setDeptName(dept.getName());
+            }
+        }
         // 检查新电话号码是否为空
         if (newPhone == null || newPhone.isEmpty()) {
             throw exception(EMPLOYEE_INFO_PHONE_NOT_NULL);

+ 3 - 14
yudao-module-personnel/yudao-module-relations-biz/src/main/java/cn/iocoder/yudao/module/relations/controller/admin/contract/vo/RelationsContractRespVO.java

@@ -17,11 +17,9 @@ import com.alibaba.excel.annotation.*;
 public class RelationsContractRespVO {
 
     @Schema(description = "自增ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28961")
-    @ExcelProperty("自增ID")
     private Long id;
 
     @Schema(description = "业务UUID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17794")
-    @ExcelProperty("业务UUID")
     private String contractId;
 
     @Schema(description = "员工姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@@ -29,23 +27,20 @@ public class RelationsContractRespVO {
     private String employeeName;
 
     @Schema(description = "部门ID", example = "20570")
-    @ExcelProperty("部门ID")
     private Long deptId;
 
     @Schema(description = "部门名称", example = "张三")
-    @ExcelProperty("部门名称")
+    @ExcelProperty("部门")
     private String deptName;
 
     @Schema(description = "职位编号", example = "13164")
-    @ExcelProperty("职位编号")
     private Long postId;
 
     @Schema(description = "职位名称")
-    @ExcelProperty("职位名称")
+    @ExcelProperty("职位")
     private String position;
 
     @Schema(description = "员工编号")
-    @ExcelProperty("员工编号")
     private String employeeNumber;
 
     @Schema(description = "员工手机号")
@@ -63,23 +58,19 @@ public class RelationsContractRespVO {
     private LocalDate contractEndDate;
 
     @Schema(description = "合同期限")
-    @ExcelProperty("合同期限")
     private String contractDeadline;
 
     @Schema(description = "备注信息")
-    @ExcelProperty("备注信息")
     private String remarks;
 
     @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
-    @ExcelProperty("状态")
     private Integer status;
 
     @Schema(description = "创建人员工id", example = "11670")
-    @ExcelProperty("创建人员工id")
     private Long creatorEmployeeId;
 
     @Schema(description = "创建人员工姓名", example = "赵六")
-    @ExcelProperty("创建人员工姓名")
+    @ExcelProperty("创建人")
     private String creatorEmployeeName;
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -88,11 +79,9 @@ public class RelationsContractRespVO {
     private LocalDateTime createTime;
 
     @Schema(description = "员工ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31256")
-    @ExcelProperty("员工ID")
     private Long employeeId;
 
     @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4014")
-    @ExcelProperty("租户编号")
     private Long tenantId;
 
     @Schema(description = "附件列表")

+ 16 - 0
yudao-module-personnel/yudao-module-relations-biz/src/main/java/cn/iocoder/yudao/module/relations/service/contract/RelationsContractServiceImpl.java

@@ -83,6 +83,14 @@ public class RelationsContractServiceImpl implements RelationsContractService {
             contractInfo.setCreatorEmployeeId(loginEmployee.getId());
             contractInfo.setCreatorEmployeeName(loginEmployee.getName());
         }
+        // 选择员工信息
+        EmployeeRespDTO choseEmployee = employeeApi.getEmployeeById(createReqVO.getEmployeeId());
+        if (choseEmployee != null) {
+            contractInfo.setDeptId(choseEmployee.getDeptId());
+            contractInfo.setDeptName(choseEmployee.getDeptName());
+            contractInfo.setPostId(choseEmployee.getPostId());
+            contractInfo.setPosition(choseEmployee.getPosition());
+        }
         contractMapper.insert(contractInfo);
         // 保存业务uuid到附件中
         fileApi.updateFileBiz(createReqVO.getFileIdList(), infoId);
@@ -96,6 +104,14 @@ public class RelationsContractServiceImpl implements RelationsContractService {
         validateContractInfoExists(updateReqVO.getId());
         // 保存业务uuid到附件中
         fileApi.updateFileBiz(updateReqVO.getFileIdList(), updateReqVO.getContractId());
+        // 选择员工信息
+        EmployeeRespDTO choseEmployee = employeeApi.getEmployeeById(updateReqVO.getEmployeeId());
+        if (choseEmployee != null) {
+            updateReqVO.setDeptId(choseEmployee.getDeptId());
+            updateReqVO.setDeptName(choseEmployee.getDeptName());
+            updateReqVO.setPostId(choseEmployee.getPostId());
+            updateReqVO.setPosition(choseEmployee.getPosition());
+        }
         // 更新
         RelationsContractDO updateObj = BeanUtils.toBean(updateReqVO, RelationsContractDO.class);
         contractMapper.updateById(updateObj);