Explorar el Código

Merge branch 'master_20240722' of http://git.dgtis.com/15896567520/oneportal_saas into master_20240722

zhaopeiqing hace 6 meses
padre
commit
cdbb3a7d54
Se han modificado 14 ficheros con 238 adiciones y 20 borrados
  1. 8 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java
  2. 26 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TenantDataTypeEnum.java
  3. 6 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/vo/OaEntryRespVO.java
  4. 6 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveRespVO.java
  5. 5 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/turnover/vo/OaTurnoverRespVO.java
  6. 26 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/entry/OaEntryServiceImpl.java
  7. 26 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/leave/OaLeaveServiceImpl.java
  8. 26 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/turnover/OaTurnoverServiceImpl.java
  9. 1 1
      yudao-module-finance/yudao-module-cash-biz/src/main/java/cn/iocoder/yudao/module/cash/controller/admin/refundinfo/vo/RefundInfoPageReqVO.java
  10. 30 6
      yudao-module-personnel/yudao-module-attendance-biz/src/main/java/cn/iocoder/yudao/module/attendance/service/leave/AttendanceLeaveServiceImpl.java
  11. 2 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java
  12. 33 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dictTenant/DictDataTenantController.java
  13. 16 5
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dictTenant/vo/data/DictDataTenantRespVO.java
  14. 27 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dictTenant/DictDataTenantServiceImpl.java

+ 8 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java

@@ -35,6 +35,14 @@ public enum CommonStatusEnum implements IntArrayValuable {
         return ARRAYS;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public String getName() {
+        return name;
+    }
+
     public static boolean isEnable(Integer status) {
         return ObjUtil.equal(ENABLE.status, status);
     }

+ 26 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TenantDataTypeEnum.java

@@ -0,0 +1,26 @@
+package cn.iocoder.yudao.framework.common.enums;
+
+/**
+ * 租户字典数据类型 1内置 2自定义
+ */
+public enum TenantDataTypeEnum {
+    
+    INNER(1, "内置"),
+    CUSTOM(2, "自定义");
+
+    private final Integer type;
+    private final String name;
+
+    TenantDataTypeEnum(Integer type, String name) {
+        this.type = type;
+        this.name = name;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

+ 6 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/vo/OaEntryRespVO.java

@@ -49,10 +49,14 @@ public class OaEntryRespVO {
     @ExcelProperty("职位")
     private String position;
 
-    @Schema(description = "员工类型")
-    @ExcelProperty("员工类型")
+    @Schema(description = "员工类型value")
+    // @ExcelProperty("员工类型")
     private String employeeType;
 
+    @Schema(description = "员工类型label")
+    @ExcelProperty("员工类型")
+    private String employeeTypeDesc;
+
     @Schema(description = "性别")
     @ExcelProperty("性别")
     private String gender;

+ 6 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveRespVO.java

@@ -58,10 +58,14 @@ public class OaLeaveRespVO {
     @ExcelProperty("手机号")
     private String employeePhone;
 
-    @Schema(description = "请假类型")
-    @ExcelProperty("请假类型")
+    @Schema(description = "请假类型value")
+    // @ExcelProperty("请假类型")
     private String leaveType;
 
+    @Schema(description = "请假类型label")
+    @ExcelProperty("请假类型")
+    private String leaveTypeDesc;
+
     @Schema(description = "开始日期")
     @ExcelProperty("请假开始日期")
     private String startDate;

+ 5 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/turnover/vo/OaTurnoverRespVO.java

@@ -78,10 +78,14 @@ public class OaTurnoverRespVO {
     @ExcelProperty("离职日期")
     private String turnoverDate;
 
-    @Schema(description = "离职原因")
+    @Schema(description = "离职原因value")
     // @ExcelProperty("离职原因")
     private String turnoverReason;
 
+    @Schema(description = "离职原因label")
+    // @ExcelProperty("离职原因")
+    private String turnoverReasonDesc;
+
     @Schema(description = "备注")
     // @ExcelProperty("备注")
     private String remarks;

+ 26 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/entry/OaEntryServiceImpl.java

@@ -37,7 +37,10 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
 import cn.iocoder.yudao.module.system.api.dept.PostApi;
 import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
 import cn.iocoder.yudao.module.system.api.dept.dto.PostRespDTO;
+import cn.iocoder.yudao.module.system.api.dicttenant.DictDataTenantApi;
+import cn.iocoder.yudao.module.system.api.dicttenant.dto.DictDataTenantRespDTO;
 import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
+import cn.iocoder.yudao.module.system.enums.dicttenant.DictTypeTenantEnum;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import org.apache.commons.lang3.StringUtils;
@@ -104,6 +107,9 @@ public class OaEntryServiceImpl implements OaEntryService {
     @Resource
     private NotifyMessageSendApi notifyMessageSendApi;
 
+    @Resource
+    private DictDataTenantApi dictDataTenantApi;
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -583,6 +589,16 @@ public class OaEntryServiceImpl implements OaEntryService {
             oaEntryRespVO.setAuditStatusDesc(OaAuditStatusEnum.getByStatus(oaEntryDO.getAuditStatus()));
         }
 
+        // 员工类型
+        if (StrUtil.isNotBlank(oaEntryDO.getEmployeeType())) {
+            List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_EMPLOYEE_TYPE.getType());
+            Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+            String employeeTypeDesc = dictDataMap.get(oaEntryDO.getEmployeeType());
+            if (StrUtil.isNotBlank(employeeTypeDesc)) {
+                oaEntryRespVO.setEmployeeTypeDesc(employeeTypeDesc);
+            }
+        }
+
         String procInstId = oaEntryDO.getProcInstId();
         if (StrUtil.isNotBlank(procInstId)) {
             Task task = taskService.createTaskQuery()
@@ -700,6 +716,9 @@ public class OaEntryServiceImpl implements OaEntryService {
             // 状态
             Map<String, String> statusMap = Arrays.stream(OaAuditStatusEnum.values())
                     .collect(Collectors.toMap(OaAuditStatusEnum::getStatus, OaAuditStatusEnum::getStatusDesc));
+            // 员工类型
+            List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_EMPLOYEE_TYPE.getType());
+            Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
 
             for (OaEntryRespVO respVO : oaEntryRespVOList) {
                 // 当前处理人
@@ -725,6 +744,13 @@ public class OaEntryServiceImpl implements OaEntryService {
                 }
                 // 状态
                 respVO.setAuditStatusDesc(statusMap.get(respVO.getAuditStatus()));
+                // 员工类型
+                if (StrUtil.isNotBlank(respVO.getEmployeeType())) {
+                    String employeeTypeDesc = dictDataMap.get(respVO.getEmployeeType());
+                    if (StrUtil.isNotBlank(employeeTypeDesc)) {
+                        respVO.setEmployeeTypeDesc(employeeTypeDesc);
+                    }
+                }
             }
         }
 

+ 26 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/leave/OaLeaveServiceImpl.java

@@ -37,7 +37,10 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
 import cn.iocoder.yudao.module.system.api.dept.PostApi;
 import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
 import cn.iocoder.yudao.module.system.api.dept.dto.PostRespDTO;
+import cn.iocoder.yudao.module.system.api.dicttenant.DictDataTenantApi;
+import cn.iocoder.yudao.module.system.api.dicttenant.dto.DictDataTenantRespDTO;
 import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
+import cn.iocoder.yudao.module.system.enums.dicttenant.DictTypeTenantEnum;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import org.apache.commons.lang3.StringUtils;
@@ -108,6 +111,8 @@ public class OaLeaveServiceImpl implements OaLeaveService {
     @Resource
     private NotifyMessageSendApi notifyMessageSendApi;
 
+    @Resource
+    private DictDataTenantApi dictDataTenantApi;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -689,6 +694,15 @@ public class OaLeaveServiceImpl implements OaLeaveService {
         if (StrUtil.isNotBlank(oaLeaveDO.getAuditStatus())) {
             oaLeaveRespVO.setAuditStatusDesc(OaAuditStatusEnum.getByStatus(oaLeaveDO.getAuditStatus()));
         }
+        // 请假类型
+        if (StrUtil.isNotBlank(oaLeaveDO.getLeaveType())) {
+            List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_LEAVE_TYPE.getType());
+            Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+            String leaveTypeDesc = dictDataMap.get(oaLeaveDO.getLeaveType());
+            if (StrUtil.isNotBlank(leaveTypeDesc)) {
+                oaLeaveRespVO.setLeaveTypeDesc(leaveTypeDesc);
+            }
+        }
 
         String procInstId = oaLeaveDO.getProcInstId();
         if (StrUtil.isNotBlank(procInstId)) {
@@ -820,6 +834,11 @@ public class OaLeaveServiceImpl implements OaLeaveService {
             Map<String, String> statusMap = Arrays.stream(OaAuditStatusEnum.values())
                     .collect(Collectors.toMap(OaAuditStatusEnum::getStatus, OaAuditStatusEnum::getStatusDesc));
 
+            // 请假类型
+            List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_LEAVE_TYPE.getType());
+            Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+
+
             for (OaLeaveRespVO respVO : oaLeaveRespVOList) {
                 // 当前处理人
                 if (respVO.getCurrentAuditEmployeeId() != null) {
@@ -844,6 +863,13 @@ public class OaLeaveServiceImpl implements OaLeaveService {
                 }
                 // 状态
                 respVO.setAuditStatusDesc(statusMap.get(respVO.getAuditStatus()));
+                // 请假类型
+                if (StrUtil.isNotBlank(respVO.getLeaveType())) {
+                    String leaveTypeDesc = dictDataMap.get(respVO.getLeaveType());
+                    if (StrUtil.isNotBlank(leaveTypeDesc)) {
+                        respVO.setLeaveTypeDesc(leaveTypeDesc);
+                    }
+                }
             }
         }
 

+ 26 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/turnover/OaTurnoverServiceImpl.java

@@ -37,7 +37,10 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
 import cn.iocoder.yudao.module.system.api.dept.PostApi;
 import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
 import cn.iocoder.yudao.module.system.api.dept.dto.PostRespDTO;
+import cn.iocoder.yudao.module.system.api.dicttenant.DictDataTenantApi;
+import cn.iocoder.yudao.module.system.api.dicttenant.dto.DictDataTenantRespDTO;
 import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
+import cn.iocoder.yudao.module.system.enums.dicttenant.DictTypeTenantEnum;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import liquibase.pro.packaged.S;
@@ -109,6 +112,9 @@ public class OaTurnoverServiceImpl implements OaTurnoverService {
     @Resource
     private NotifyMessageSendApi notifyMessageSendApi;
 
+    @Resource
+    private DictDataTenantApi dictDataTenantApi;
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -670,6 +676,15 @@ public class OaTurnoverServiceImpl implements OaTurnoverService {
         }
         // 状态
         oaTurnoverRespVO.setAuditStatusDesc(OaAuditStatusEnum.getByStatus(oaTurnoverDO.getAuditStatus()));
+        // 离职原因
+        if (StrUtil.isNotBlank(oaTurnoverDO.getTurnoverReason())) {
+            List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_TURNOVER_REASON.getType());
+            Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+            String turnoverReasonDesc = dictDataMap.get(oaTurnoverDO.getTurnoverReason());
+            if (StrUtil.isNotBlank(turnoverReasonDesc)) {
+                oaTurnoverRespVO.setTurnoverReasonDesc(turnoverReasonDesc);
+            }
+        }
 
         String procInstId = oaTurnoverDO.getProcInstId();
         if (StrUtil.isNotBlank(procInstId)) {
@@ -789,6 +804,11 @@ public class OaTurnoverServiceImpl implements OaTurnoverService {
             Map<String, String> statusMap = Arrays.stream(OaAuditStatusEnum.values())
                     .collect(Collectors.toMap(OaAuditStatusEnum::getStatus, OaAuditStatusEnum::getStatusDesc));
 
+            // 离职原因
+            List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_TURNOVER_REASON.getType());
+            Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+
+
             for (OaTurnoverRespVO respVO : oaTurnoverRespVOList) {
                 // 当前处理人
                 if (respVO.getCurrentAuditEmployeeId() != null) {
@@ -813,6 +833,12 @@ public class OaTurnoverServiceImpl implements OaTurnoverService {
                 }
                 // 状态
                 respVO.setAuditStatusDesc(statusMap.get(respVO.getAuditStatus()));
+                if (StrUtil.isNotBlank(respVO.getTurnoverReason())) {
+                    String turnoverReasonDesc = dictDataMap.get(respVO.getTurnoverReason());
+                    if (StrUtil.isNotBlank(turnoverReasonDesc)) {
+                        respVO.setTurnoverReasonDesc(turnoverReasonDesc);
+                    }
+                }
             }
         }
 

+ 1 - 1
yudao-module-finance/yudao-module-cash-biz/src/main/java/cn/iocoder/yudao/module/cash/controller/admin/refundinfo/vo/RefundInfoPageReqVO.java

@@ -25,7 +25,7 @@ public class RefundInfoPageReqVO extends PageParam {
     private Long customerId;
 
     @Schema(description = "合同名称")
-    private Long contractName;
+    private String contractName;
 
     @Schema(description = "回款日期", example = "2024-08-07,2024-08-07")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)

+ 30 - 6
yudao-module-personnel/yudao-module-attendance-biz/src/main/java/cn/iocoder/yudao/module/attendance/service/leave/AttendanceLeaveServiceImpl.java

@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.attendance.service.leave;
 
 import cn.hutool.core.util.IdUtil;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.framework.security.core.LoginUser;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
@@ -14,6 +15,9 @@ import cn.iocoder.yudao.module.employee.api.EmployeeApi;
 import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
 import cn.iocoder.yudao.module.employee.api.dto.EmployeeSaveReqDTO;
 import cn.iocoder.yudao.module.infra.api.file.FileApi;
+import cn.iocoder.yudao.module.system.api.dicttenant.DictDataTenantApi;
+import cn.iocoder.yudao.module.system.api.dicttenant.dto.DictDataTenantRespDTO;
+import cn.iocoder.yudao.module.system.enums.dicttenant.DictTypeTenantEnum;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -23,6 +27,7 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.util.List;
+import java.util.Map;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.module.attendance.enums.ErrorCodeConstants.*;
@@ -42,6 +47,8 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
     private EmployeeApi employeeApi;
     @Resource
     private FileApi fileApi;
+    @Resource
+    private DictDataTenantApi dictDataTenantApi;
 
     @Override
     @DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
@@ -71,7 +78,11 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
         leaveMapper.insert(leave);
         // 保存业务uuid到附件中
         fileApi.updateFileBiz(createReqVO.getFileIdList(), infoId);
-        if ("年假".equals(createReqVO.getLeaveType())) {
+        // 请假类型
+        List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_LEAVE_TYPE.getType());
+        Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+        String leaveTypeDesc = dictDataMap.get(createReqVO.getLeaveType());
+        if ("年假".equals(createReqVO.getLeaveType()) || "年假".equals(leaveTypeDesc)) {
             // 获取剩余年假和申请天数
             BigDecimal remainingAnnualLeave = employee.getRemainingAnnualLeave();
             String requestDayStr = createReqVO.getDay(); // 更清晰的变量名
@@ -105,7 +116,11 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
         leaveMapper.insert(attendanceLeaveDO);
         // 请假人信息
         EmployeeRespDTO employee = employeeApi.getEmployeeById(attendanceLeaveDO.getEmployeeId());
-        if ("年假".equals(attendanceLeaveDO.getLeaveType())) {
+        // 请假类型
+        List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_LEAVE_TYPE.getType());
+        Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+        String leaveTypeDesc = dictDataMap.get(attendanceLeaveDO.getLeaveType());
+        if ("年假".equals(attendanceLeaveDO.getLeaveType()) || "年假".equals(leaveTypeDesc)) {
             // 获取剩余年假和申请天数
             BigDecimal remainingAnnualLeave = employee.getRemainingAnnualLeave();
             String requestDayStr = attendanceLeaveDO.getDay(); // 更清晰的变量名
@@ -138,8 +153,13 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
         AttendanceLeaveDO oldLeave = leaveMapper.selectById(updateReqVO.getId());
         // 请假人信息
         EmployeeRespDTO employee = employeeApi.getEmployeeById(updateReqVO.getEmployeeId());
+        // 请假类型
+        List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_LEAVE_TYPE.getType());
+        Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+        String oldLeaveTypeDesc = dictDataMap.get(oldLeave.getLeaveType());
+        String leaveTypeDesc = dictDataMap.get(updateReqVO.getLeaveType());
         if (oldLeave.getEmployeeId().equals(employee.getId())) {// 员工ID不变
-            if ("年假".equals(oldLeave.getLeaveType()) && "年假".equals(updateReqVO.getLeaveType())) {
+            if ("年假".equals(oldLeaveTypeDesc) && "年假".equals(leaveTypeDesc)) {
                 // 新旧都是年假,对比天数进行增减
                 BigDecimal oldDays = new BigDecimal(oldLeave.getDay());
                 BigDecimal newDays = new BigDecimal(updateReqVO.getDay());
@@ -160,7 +180,7 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
                     throw exception(ATTENDANCE_UPDATING_EMPLOYEE_INFO_ERROR);
                 }
             }
-            if (!"年假".equals(oldLeave.getLeaveType()) && "年假".equals(updateReqVO.getLeaveType())) {
+            if (!"年假".equals(oldLeaveTypeDesc) && "年假".equals(leaveTypeDesc)) {
                 // 新的是年假、旧的不是
                 BigDecimal remainingAnnualLeave = employee.getRemainingAnnualLeave();
                 String requestDayStr = updateReqVO.getDay();
@@ -180,7 +200,7 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
                     throw exception(ATTENDANCE_UPDATING_EMPLOYEE_INFO_ERROR);
                 }
             }
-            if ("年假".equals(oldLeave.getLeaveType()) && !"年假".equals(updateReqVO.getLeaveType())) {
+            if ("年假".equals(oldLeaveTypeDesc) && !"年假".equals(leaveTypeDesc)) {
                 // 旧的是年假,新的不是,归还年假天数
                 BigDecimal remainingAnnualLeave = employee.getRemainingAnnualLeave();
                 BigDecimal oldDays = new BigDecimal(oldLeave.getDay());
@@ -229,7 +249,11 @@ public class AttendanceLeaveServiceImpl implements AttendanceLeaveService {
         AttendanceLeaveDO oldLeave = leaveMapper.selectById(id);
         // 请假人信息
         EmployeeRespDTO employee = employeeApi.getEmployeeById(oldLeave.getEmployeeId());
-        if ("年假".equals(oldLeave.getLeaveType())) {
+        // 请假类型
+        List<DictDataTenantRespDTO> dictDataList = dictDataTenantApi.getDictDataList(DictTypeTenantEnum.TENANT_LEAVE_TYPE.getType());
+        Map<String, String> dictDataMap = CollectionUtils.convertMap(dictDataList, DictDataTenantRespDTO::getValue, DictDataTenantRespDTO::getLabel);
+        String leaveTypeDesc = dictDataMap.get(oldLeave.getLeaveType());
+        if ("年假".equals(oldLeave.getLeaveType()) || "事假".equals(leaveTypeDesc)) {
             BigDecimal remainingAnnualLeave = employee.getRemainingAnnualLeave();
             BigDecimal oldDays = new BigDecimal(oldLeave.getDay());
             employee.setRemainingAnnualLeave(remainingAnnualLeave.add(oldDays));

+ 2 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java

@@ -79,6 +79,8 @@ public interface ErrorCodeConstants {
     ErrorCode DICT_DATA_NOT_ENABLE = new ErrorCode(1_002_007_002, "字典数据({})不处于开启状态,不允许选择");
     ErrorCode DICT_DATA_VALUE_DUPLICATE = new ErrorCode(1_002_007_003, "已经存在该值的字典数据");
     ErrorCode DICT_DATA_CAN_NOT_DELETE_SYSTEM_DATA = new ErrorCode(1_002_007_004, "不能删除内置数据");
+    ErrorCode DICT_DATA_LABEL_DUPLICATE = new ErrorCode(1_002_007_005, "已经存在该标签的字典数据");
+    ErrorCode DICT_DATA_CAN_NOT_UPDATE_LABEL_SYSTEM_DATA = new ErrorCode(1_002_007_006, "不能修改内置数据的标签名");
     // ========== 通知公告 1-002-008-000 ==========
     ErrorCode NOTICE_NOT_FOUND = new ErrorCode(1_002_008_001, "当前通知公告不存在");
     // ========== 短信渠道 1-002-011-000 ==========

+ 33 - 2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dictTenant/DictDataTenantController.java

@@ -1,6 +1,8 @@
 package cn.iocoder.yudao.module.system.controller.admin.dictTenant;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.enums.TenantDataTypeEnum;
 import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO;
 import cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data.DictDataTenantPageReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data.DictDataTenantRespVO;
@@ -23,6 +25,7 @@ import javax.validation.*;
 import javax.servlet.http.*;
 import java.util.*;
 import java.io.IOException;
+import java.util.stream.Collectors;
 
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
@@ -89,7 +92,21 @@ public class DictDataTenantController {
     // @PreAuthorize("@ss.hasPermission('tenant:dict-data:query')")
     public CommonResult<PageResult<DictDataTenantRespVO>> getDictDataPage(@Valid @ParameterObject DictDataTenantPageReqVO pageReqVO) {
         PageResult<DictDataTenantDO> pageResult = dictDataTenantService.getDictDataPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, DictDataTenantRespVO.class));
+        PageResult<DictDataTenantRespVO> voPageResult = BeanUtils.toBean(pageResult, DictDataTenantRespVO.class);
+        List<DictDataTenantRespVO> list = voPageResult.getList();
+        if (CollUtil.isNotEmpty(list)) {
+            Map<Integer, String> statusMap = Arrays.stream(CommonStatusEnum.values())
+                    .collect(Collectors.toMap(CommonStatusEnum::getStatus, CommonStatusEnum::getName));
+
+            Map<Integer, String> dataTypeMap = Arrays.stream(TenantDataTypeEnum.values())
+                    .collect(Collectors.toMap(TenantDataTypeEnum::getType, TenantDataTypeEnum::getName));
+
+            for (DictDataTenantRespVO dictData : list) {
+                dictData.setStatusDesc(statusMap.get(dictData.getStatus()));
+                dictData.setDataTypeDesc(dataTypeMap.get(dictData.getDataType()));
+            }
+        }
+        return success(voPageResult);
     }
 
     @GetMapping("/export-excel")
@@ -101,9 +118,23 @@ public class DictDataTenantController {
               HttpServletResponse response) throws IOException {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
         List<DictDataTenantDO> list = dictDataTenantService.getDictDataPage(pageReqVO).getList();
+        List<DictDataTenantRespVO> voList = BeanUtils.toBean(list, DictDataTenantRespVO.class);
+        if (CollUtil.isNotEmpty(voList)) {
+            Map<Integer, String> statusMap = Arrays.stream(CommonStatusEnum.values())
+                    .collect(Collectors.toMap(CommonStatusEnum::getStatus, CommonStatusEnum::getName));
+
+            Map<Integer, String> dataTypeMap = Arrays.stream(TenantDataTypeEnum.values())
+                    .collect(Collectors.toMap(TenantDataTypeEnum::getType, TenantDataTypeEnum::getName));
+
+            for (DictDataTenantRespVO dictData : voList) {
+                dictData.setStatusDesc(statusMap.get(dictData.getStatus()));
+                dictData.setDataTypeDesc(dataTypeMap.get(dictData.getDataType()));
+            }
+        }
+
         // 导出 Excel
         ExcelUtils.write(response, "租户字典数据.xls", "数据", DictDataTenantRespVO.class,
-                        BeanUtils.toBean(list, DictDataTenantRespVO.class));
+                        voList);
     }
 
     @GetMapping(value = {"/list-all-simple"})

+ 16 - 5
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dictTenant/vo/data/DictDataTenantRespVO.java

@@ -1,5 +1,7 @@
 package cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data;
 
+import cn.iocoder.yudao.framework.common.util.date.DateUtils;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 
@@ -24,7 +26,7 @@ public class DictDataTenantRespVO {
     private String label;
 
     @Schema(description = "字典键值")
-    @ExcelProperty("字典键值")
+    // @ExcelProperty("字典键值")
     private String value;
 
     @Schema(description = "字典类型")
@@ -32,19 +34,27 @@ public class DictDataTenantRespVO {
     private String dictType;
 
     @Schema(description = "状态(0正常 1停用)")
-    @ExcelProperty("状态(0正常 1停用)")
+    // @ExcelProperty("状态(0正常 1停用)")
     private Integer status;
 
+    @Schema(description = "状态(0正常 1停用)")
+    @ExcelProperty("状态")
+    private String statusDesc;
+
     @Schema(description = "数据类型(1内置 2自定义)")
-    @ExcelProperty("数据类型(1内置 2自定义)")
+    // @ExcelProperty("数据类型(1内置 2自定义)")
     private Integer dataType;
 
+    @Schema(description = "数据类型(1内置 2自定义)")
+    @ExcelProperty("类型")
+    private String dataTypeDesc;
+
     @Schema(description = "颜色类型")
-    @ExcelProperty("颜色类型")
+    // @ExcelProperty("颜色类型")
     private String colorType;
 
     @Schema(description = "css 样式")
-    @ExcelProperty("css 样式")
+    // @ExcelProperty("css 样式")
     private String cssClass;
 
     @Schema(description = "备注")
@@ -53,6 +63,7 @@ public class DictDataTenantRespVO {
 
     @Schema(description = "创建时间")
     @ExcelProperty("创建时间")
+    @DateTimeFormat(DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime createTime;
 
 }

+ 27 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dictTenant/DictDataTenantServiceImpl.java

@@ -27,6 +27,7 @@ import java.util.Collection;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
@@ -81,6 +82,8 @@ public class DictDataTenantServiceImpl implements DictDataTenantService {
         validateDictTypeExists(createReqVO.getDictType());
         // 校验字典数据的值的唯一性
         // validateDictDataValueUnique(null, createReqVO.getDictType(), createReqVO.getValue());
+        // 校验字典数据的label的唯一性
+        validateDictDataLabelUnique(null, createReqVO.getDictType(), createReqVO.getLabel());
 
         // 插入字典类型
         DictDataTenantDO dictData = BeanUtils.toBean(createReqVO, DictDataTenantDO.class);
@@ -104,11 +107,19 @@ public class DictDataTenantServiceImpl implements DictDataTenantService {
     @Override
     public void updateDictData(DictDataTenantUpdateReqVO updateReqVO) {
         // 校验自己存在
-        validateDictDataExists(updateReqVO.getId());
+        DictDataTenantDO dictDataTenantDO = validateDictDataExists(updateReqVO.getId());
+        // 内置角色label不能修改
+        if (dictDataTenantDO.getDataType() != null && dictDataTenantDO.getDataType() == 1) {
+            if (!Objects.equals(dictDataTenantDO.getLabel(), updateReqVO.getLabel())) {
+                throw exception(DICT_DATA_CAN_NOT_UPDATE_LABEL_SYSTEM_DATA);
+            }
+        }
         // 校验字典类型有效
         // validateDictTypeExists(updateReqVO.getDictType());
         // 校验字典数据的值的唯一性
         // validateDictDataValueUnique(updateReqVO.getId(), updateReqVO.getDictType(), updateReqVO.getValue());
+        // 校验字典数据的label的唯一性
+        validateDictDataLabelUnique(updateReqVO.getId(), dictDataTenantDO.getDictType(), updateReqVO.getLabel());
 
         // 更新字典类型
         DictDataTenantDO updateObj = BeanUtils.toBean(updateReqVO, DictDataTenantDO.class);
@@ -148,6 +159,21 @@ public class DictDataTenantServiceImpl implements DictDataTenantService {
         }
     }
 
+
+    private void validateDictDataLabelUnique(Long id, String dictType, String label) {
+        DictDataTenantDO dictData = dictDataTenantMapper.selectByDictTypeAndLabel(dictType, label);
+        if (dictData == null) {
+            return;
+        }
+        // 如果 id 为空,说明不用比较是否为相同 id 的字典数据
+        if (id == null) {
+            throw exception(DICT_DATA_LABEL_DUPLICATE);
+        }
+        if (!dictData.getId().equals(id)) {
+            throw exception(DICT_DATA_LABEL_DUPLICATE);
+        }
+    }
+
     @VisibleForTesting
     public DictDataTenantDO validateDictDataExists(Long id) {
         DictDataTenantDO dictData = dictDataTenantMapper.selectById(id);