1. 流程枚举状态补充方法返回对应枚举
2. 新增获得指定用户的公司部门信息携带 Code
This commit is contained in:
@@ -24,4 +24,9 @@ public class CompanyDeptInfo {
|
|||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
private String companyCode;
|
||||||
|
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ import com.zt.plat.framework.common.core.ArrayValuable;
|
|||||||
import com.zt.plat.framework.common.util.object.ObjectUtils;
|
import com.zt.plat.framework.common.util.object.ObjectUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@@ -47,4 +48,33 @@ public enum BpmProcessInstanceStatusEnum implements ArrayValuable<Integer> {
|
|||||||
APPROVE.getStatus(), REJECT.getStatus(), CANCEL.getStatus());
|
APPROVE.getStatus(), REJECT.getStatus(), CANCEL.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过流程的状态返回对应的枚举
|
||||||
|
* @param status 流程状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static BpmProcessInstanceStatusEnum getEnumByStatus(Integer status){
|
||||||
|
for (BpmProcessInstanceStatusEnum e : BpmProcessInstanceStatusEnum.values()) {
|
||||||
|
if (e.getStatus().equals(status)) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NOT_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过枚举描述返回对应的枚举
|
||||||
|
* @param desc 描述
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static BpmProcessInstanceStatusEnum getEnumByDesc(String desc){
|
||||||
|
if (StringUtils.isEmpty(desc)) return NOT_START;
|
||||||
|
for (BpmProcessInstanceStatusEnum e : BpmProcessInstanceStatusEnum.values()) {
|
||||||
|
if (desc.equals(e.getDesc())) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NOT_START;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjUtil;
|
|||||||
import com.zt.plat.framework.common.util.object.ObjectUtils;
|
import com.zt.plat.framework.common.util.object.ObjectUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程任务 Task 的状态枚举
|
* 流程任务 Task 的状态枚举
|
||||||
@@ -67,4 +68,33 @@ public enum BpmTaskStatusEnum {
|
|||||||
return ObjUtil.equal(status, CANCEL.getStatus());
|
return ObjUtil.equal(status, CANCEL.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过流程的状态返回对应的枚举
|
||||||
|
* @param status 流程状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static BpmTaskStatusEnum getEnumByStatus(Integer status){
|
||||||
|
for (BpmTaskStatusEnum e : BpmTaskStatusEnum.values()) {
|
||||||
|
if (e.getStatus().equals(status)) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NOT_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过枚举描述返回对应的枚举
|
||||||
|
* @param name 描述
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static BpmTaskStatusEnum getEnumByName(String name){
|
||||||
|
if (StringUtils.isEmpty(name)) return NOT_START;
|
||||||
|
for (BpmTaskStatusEnum e : BpmTaskStatusEnum.values()) {
|
||||||
|
if (name.equals(e.getName())) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NOT_START;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,16 @@ public class CompanyDeptInfoRespDTO {
|
|||||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
|
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
|
||||||
private String companyName;
|
private String companyName;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxxx")
|
||||||
|
private String companyCode;
|
||||||
|
|
||||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(description = "部门编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxxxx")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -383,8 +383,10 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
CompanyDeptInfo info = new CompanyDeptInfo();
|
CompanyDeptInfo info = new CompanyDeptInfo();
|
||||||
info.setCompanyId(company.getId());
|
info.setCompanyId(company.getId());
|
||||||
info.setCompanyName(company.getName());
|
info.setCompanyName(company.getName());
|
||||||
|
info.setCompanyCode(company.getCode());
|
||||||
info.setDeptId(dept.getId());
|
info.setDeptId(dept.getId());
|
||||||
info.setDeptName(dept.getName());
|
info.setDeptName(dept.getName());
|
||||||
|
info.setDeptCode(dept.getCode());
|
||||||
result.add(info);
|
result.add(info);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user