commit
5b2ab89a06
|
|
@ -5,6 +5,8 @@ import com.engine.organization.entity.company.dto.CompListDTO;
|
|||
import com.engine.organization.entity.company.param.CompSearchParam;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.crm.Maint.SectorInfoComInfo;
|
||||
import weaver.general.StringUtil;
|
||||
|
|
@ -21,47 +23,54 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class CompBO {
|
||||
|
||||
public static List<CompListDTO> buildCompDTOList(Collection<com.engine.organization.entity.company.po.CompPO> list) {
|
||||
public static List<CompListDTO> buildCompDTOList(Collection<CompPO> list) {
|
||||
|
||||
Map<Long, com.engine.organization.entity.company.po.CompPO> poMaps = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item));
|
||||
Map<Long, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
|
||||
|
||||
List<CompListDTO> dtoList = list.stream().map(e -> CompListDTO.builder().id(e.getId()).compNo(e.getCompNo()).compName(e.getCompName()).compNameShort(e.getCompNameShort()).parentCompany(e.getParentCompany()).parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName()).orgCode(e.getOrgCode()).industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + "")).compPrincipal(getUserNameById(e.getCompPrincipal() + "")).forbiddenTag(e.getForbiddenTag()).build()).collect(Collectors.toList());
|
||||
Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany));
|
||||
return dtoList.stream().map(e -> {
|
||||
e.setChildren(collects.get(e.getId()));
|
||||
return e;
|
||||
// 处理被引用数据
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(CompMapper.class).listUsedId();
|
||||
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
|
||||
return dtoList.stream().peek(e -> {
|
||||
List<CompListDTO> childList = collects.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(childList)) {
|
||||
e.setChildren(childList);
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
if (collect.contains(e.getId() + "")) {
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
e.setIsUsed(0);
|
||||
}
|
||||
}
|
||||
}).filter(item -> null == item.getParentCompany() || 0 == item.getParentCompany()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<CompListDTO> buildCompDTOList(Collection<com.engine.organization.entity.company.po.CompPO> list, List<com.engine.organization.entity.company.po.CompPO> filterList) {
|
||||
public static List<CompListDTO> buildCompDTOList(Collection<CompPO> list, List<CompPO> filterList) {
|
||||
// 搜索结果为空,直接返回空
|
||||
if (CollectionUtils.isEmpty(filterList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 递归添加父级数据
|
||||
Map<Long, com.engine.organization.entity.company.po.CompPO> poMaps = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item));
|
||||
List<com.engine.organization.entity.company.po.CompPO> addedList = new ArrayList<>();
|
||||
for (com.engine.organization.entity.company.po.CompPO po : filterList) {
|
||||
Map<Long, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
|
||||
List<CompPO> addedList = new ArrayList<>();
|
||||
for (CompPO po : filterList) {
|
||||
dealParentData(addedList, po, poMaps);
|
||||
}
|
||||
|
||||
List<CompListDTO> dtoList = addedList.stream().map(e -> CompListDTO.builder().id(e.getId()).compNo(e.getCompNo()).compName(e.getCompName()).compNameShort(e.getCompNameShort()).parentCompany(e.getParentCompany()).parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName()).orgCode(e.getOrgCode()).industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + "")).compPrincipal(getUserNameById(e.getCompPrincipal() + "")).forbiddenTag(e.getForbiddenTag()).build()).collect(Collectors.toList());
|
||||
Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany));
|
||||
return dtoList.stream().map(e -> {
|
||||
e.setChildren(collects.get(e.getId()));
|
||||
return e;
|
||||
}).filter(item -> null == item.getParentCompany() || 0 == item.getParentCompany()).collect(Collectors.toList());
|
||||
return buildCompDTOList(addedList);
|
||||
}
|
||||
|
||||
public static com.engine.organization.entity.company.po.CompPO convertParamToPO(CompSearchParam param, Long employeeId) {
|
||||
public static CompPO convertParamToPO(CompSearchParam param, Long employeeId) {
|
||||
if (null == param) {
|
||||
return null;
|
||||
}
|
||||
return com.engine.organization.entity.company.po.CompPO.builder().id(param.getId() == null ? 0 : param.getId()).compNo(param.getCompNo()).compName(param.getCompName()).compNameShort(param.getCompNameShort()).parentCompany(param.getParentCompany()).orgCode(param.getOrgCode()).industry(param.getIndustry()).compPrincipal(param.getCompPrincipal()).description(param.getDescription()).forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1).deleteType(0).createTime(new Date()).updateTime(new Date()).creator(employeeId).build();
|
||||
return CompPO.builder().id(param.getId() == null ? 0 : param.getId()).compNo(param.getCompNo()).compName(param.getCompName()).compNameShort(param.getCompNameShort()).parentCompany(param.getParentCompany()).orgCode(param.getOrgCode()).industry(param.getIndustry()).compPrincipal(param.getCompPrincipal()).description(param.getDescription()).forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1).deleteType(0).createTime(new Date()).updateTime(new Date()).creator(employeeId).build();
|
||||
|
||||
}
|
||||
|
||||
public static List<TreeNode> buildSetToSearchTree(Set<com.engine.organization.entity.company.po.CompPO> comps) {
|
||||
public static List<TreeNode> buildSetToSearchTree(Set<CompPO> comps) {
|
||||
return comps.stream().map(item -> {
|
||||
SearchTree tree = new SearchTree();
|
||||
tree.setCanClick(true);
|
||||
|
|
@ -85,7 +94,7 @@ public class CompBO {
|
|||
* @param po
|
||||
* @param poMaps
|
||||
*/
|
||||
private static void dealParentData(List<com.engine.organization.entity.company.po.CompPO> addedList, com.engine.organization.entity.company.po.CompPO po, Map<Long, com.engine.organization.entity.company.po.CompPO> poMaps) {
|
||||
private static void dealParentData(List<CompPO> addedList, CompPO po, Map<Long, CompPO> poMaps) {
|
||||
if (!addedList.contains(po)) {
|
||||
addedList.add(po);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.organization.entity.company.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.engine.organization.annotation.TableTitle;
|
||||
|
|
@ -22,9 +21,8 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508",
|
||||
tableType = WeaTableType.NONE,
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "查看部门")
|
||||
})
|
||||
|
|
@ -33,7 +31,10 @@ public class CompListDTO {
|
|||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public class DepartmentBO {
|
|||
|
||||
// 递归添加父级数据
|
||||
Map<Long, DepartmentPO> poMaps = list.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
|
||||
|
||||
List<DepartmentListDTO> dtoList = list.stream().map(e ->
|
||||
DepartmentListDTO
|
||||
.builder()
|
||||
|
|
@ -41,7 +40,22 @@ public class DepartmentBO {
|
|||
.forbiddenTag(e.getForbiddenTag())
|
||||
.build()).collect(Collectors.toList());
|
||||
Map<Long, List<DepartmentListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentDept() && 0 != item.getParentDept()).collect(Collectors.groupingBy(DepartmentListDTO::getParentDept));
|
||||
return dtoList.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> null == item.getParentDept() || 0 == item.getParentDept()).collect(Collectors.toList());
|
||||
// 处理被引用数据
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(DepartmentMapper.class).listUsedId();
|
||||
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
|
||||
return dtoList.stream().peek(e -> {
|
||||
List<DepartmentListDTO> childList = collects.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(childList)) {
|
||||
e.setChildren(childList);
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
if (collect.contains(e.getId() + "")) {
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
e.setIsUsed(0);
|
||||
}
|
||||
}
|
||||
}).filter(item -> null == item.getParentDept() || 0 == item.getParentDept()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list, List<DepartmentPO> filterList) {
|
||||
|
|
@ -90,10 +104,7 @@ public class DepartmentBO {
|
|||
//获取非一级部门
|
||||
Map<Long, List<SingleDeptTreeVO>> collects = singleDeptTreeVOS.stream().filter(item -> !parentComp.equals(item.getParentComp()) && null != item.getParentDept()).collect(Collectors.groupingBy(SingleDeptTreeVO::getParentDept));
|
||||
|
||||
return singleDeptTreeVOS.stream().map(e -> {
|
||||
e.setChildren(collects.get(e.getId()));
|
||||
return e;
|
||||
}).filter(item -> parentComp.equals(item.getParentComp())).collect(Collectors.toList());
|
||||
return singleDeptTreeVOS.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> parentComp.equals(item.getParentComp())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||
@OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508",
|
||||
tableType = WeaTableType.NONE,
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "合并"),
|
||||
@OrganizationTableOperate(index = "3", text = "转移"),
|
||||
|
|
@ -34,7 +34,10 @@ import java.util.List;
|
|||
public class DepartmentListDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ package com.engine.organization.entity.job.bo;
|
|||
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||
import com.engine.organization.entity.job.param.JobSearchParam;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.transmethod.JobTransMethod;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -64,7 +66,22 @@ public class JobBO {
|
|||
.forbiddenTag(e.getForbiddenTag())
|
||||
.build()).collect(Collectors.toList());
|
||||
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
|
||||
return dtoList.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList());
|
||||
// 处理被引用数据
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId();
|
||||
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
|
||||
return dtoList.stream().peek(e -> {
|
||||
List<JobListDTO> childList = collects.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(childList)) {
|
||||
e.setChildren(childList);
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
if (collect.contains(e.getId() + "")) {
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
e.setIsUsed(0);
|
||||
}
|
||||
}
|
||||
}).filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||
@OrganizationTable(pageId = "0efea835-dfc5-11ec-a09e-00e04c680716",
|
||||
tableType = WeaTableType.NONE,
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "合并"),
|
||||
@OrganizationTableOperate(index = "3", text = "转移"),
|
||||
|
|
@ -36,7 +36,10 @@ public class JobListDTO {
|
|||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.engine.organization.entity.scheme.vo;
|
||||
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -25,14 +24,19 @@ import lombok.NoArgsConstructor;
|
|||
" t.description ," +
|
||||
" a.scheme_name ," +
|
||||
" t.level_id ," +
|
||||
" t.forbidden_tag",
|
||||
" t.forbidden_tag," +
|
||||
"t.is_used",
|
||||
fromSql = "from jcl_org_grade t inner join jcl_org_scheme a on t.scheme_id = a.id ",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除")
|
||||
}
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatSourceOperates", otherpara = "column:is_used"),
|
||||
checkboxPopedom = @CheckboxPopedom(showmethod = "com.engine.organization.util.ConfigTrans.getCheckBoxPopedom", popedompara = "column:is_used")
|
||||
|
||||
)
|
||||
public class GradeTableVO {
|
||||
/**
|
||||
|
|
@ -40,6 +44,11 @@ public class GradeTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
@OrganizationTableColumn(column = "isUsed", display = false)
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
@ -67,7 +76,7 @@ public class GradeTableVO {
|
|||
/**
|
||||
* 职等
|
||||
*/
|
||||
@OrganizationTableColumn(text = "职等", width = "20%", column = "level_id",transmethod = "com.engine.organization.transmethod.LevelTransMethod.getLevelId")
|
||||
@OrganizationTableColumn(text = "职等", width = "20%", column = "level_id", transmethod = "com.engine.organization.transmethod.LevelTransMethod.getLevelId")
|
||||
private String levelId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.engine.organization.entity.scheme.vo;
|
||||
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,6 +20,7 @@ import lombok.NoArgsConstructor;
|
|||
"s.scheme_name," +
|
||||
"t.scheme_id," +
|
||||
"t.forbidden_tag," +
|
||||
"t.is_used," +
|
||||
"t.creator," +
|
||||
"t.delete_type," +
|
||||
"t.create_time," +
|
||||
|
|
@ -29,9 +29,11 @@ import lombok.NoArgsConstructor;
|
|||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除")
|
||||
}
|
||||
}, tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatSourceOperates", otherpara = "column:is_used"),
|
||||
checkboxPopedom = @CheckboxPopedom(showmethod = "com.engine.organization.util.ConfigTrans.getCheckBoxPopedom", popedompara = "column:is_used")
|
||||
)
|
||||
public class LevelTableVO {
|
||||
/**
|
||||
|
|
@ -39,6 +41,11 @@ public class LevelTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
@OrganizationTableColumn(column = "isUsed", display = false)
|
||||
private Integer isUsed;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
|
|
@ -56,11 +63,6 @@ public class LevelTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(text = "描述说明", width = "20%", column = "description")
|
||||
private String description;
|
||||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
// @OrganizationTableColumn(text = "等级方案", width = "20%", column = "level_scheme")
|
||||
private String schemeId;
|
||||
|
||||
/**
|
||||
* 等级方案
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.engine.organization.entity.sequence.vo;
|
||||
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -25,6 +24,7 @@ import lombok.NoArgsConstructor;
|
|||
"t.description," +
|
||||
"s.scheme_name," +
|
||||
"t.forbidden_tag," +
|
||||
"t.is_used," +
|
||||
"t.creator," +
|
||||
"t.delete_type," +
|
||||
"t.create_time," +
|
||||
|
|
@ -33,9 +33,13 @@ import lombok.NoArgsConstructor;
|
|||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除")
|
||||
}
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatSourceOperates", otherpara = "column:is_used"),
|
||||
checkboxPopedom = @CheckboxPopedom(showmethod = "com.engine.organization.util.ConfigTrans.getCheckBoxPopedom", popedompara = "column:is_used")
|
||||
|
||||
)
|
||||
public class SequenceTableVO {
|
||||
|
||||
|
|
@ -44,7 +48,11 @@ public class SequenceTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
@OrganizationTableColumn(column = "isUsed", display = false)
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.engine.organization.entity.staff.vo;
|
||||
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,15 +20,18 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508",
|
||||
fields = "t.id, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag",
|
||||
fields = "t.id,t.is_used, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag",
|
||||
fromSql = "FROM jcl_org_staffplan t ",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "发起编制流程")
|
||||
}
|
||||
}, tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatStaffOperates", otherpara = "column:is_used"),
|
||||
checkboxPopedom = @CheckboxPopedom(showmethod = "com.engine.organization.util.ConfigTrans.getCheckBoxPopedom", popedompara = "column:is_used")
|
||||
|
||||
)
|
||||
public class StaffPlanTableVO {
|
||||
|
||||
|
|
@ -38,6 +40,11 @@ public class StaffPlanTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
@OrganizationTableColumn(column = "isUsed", display = false)
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.engine.organization.entity.staff.vo;
|
||||
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -19,15 +18,18 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@OrganizationTable(pageId = "0cdfd5bb-dc09-11ec-b69e-00ffcbed7508",
|
||||
fields = "id,plan_id,comp_id,dept_id,job_id,staff_num,permanent_num,freeze_num,lack_status,staff_desc",
|
||||
fields = "id,is_used,plan_id,comp_id,dept_id,job_id,staff_num,permanent_num,freeze_num,lack_status,staff_desc",
|
||||
fromSql = "FROM jcl_org_staff t ",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "变更")
|
||||
}
|
||||
}, tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatStaffOperates", otherpara = "column:is_used"),
|
||||
checkboxPopedom = @CheckboxPopedom(showmethod = "com.engine.organization.util.ConfigTrans.getCheckBoxPopedom", popedompara = "column:is_used")
|
||||
|
||||
)
|
||||
public class StaffTableVO {
|
||||
/**
|
||||
|
|
@ -35,6 +37,11 @@ public class StaffTableVO {
|
|||
*/
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
/**
|
||||
* 是否被引用
|
||||
*/
|
||||
@OrganizationTableColumn(column = "isUsed", display = false)
|
||||
private Integer isUsed;
|
||||
/**
|
||||
* 方案id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.engine.organization.mapper.common;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface RefreshUseMapper {
|
||||
int updateIsUsedByIds(@Param("tableName") String tableName, @Param("ids") Collection<String> ids, @Param("isUsed") int isUsed);
|
||||
|
||||
int initIsUseStatus(@Param("tableName") String tableName);
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.common.RefreshUseMapper">
|
||||
|
||||
<update id="updateIsUsedByIds">
|
||||
update ${tableName} set is_used = #{isUsed} where delete_type = 0 and id
|
||||
<if test=" isUsed == 0 ">
|
||||
not
|
||||
</if>
|
||||
in
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="initIsUseStatus">
|
||||
update ${tableName}
|
||||
set is_used = 0
|
||||
where delete_type = 0
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -21,6 +21,13 @@ public interface CompMapper {
|
|||
*/
|
||||
List<CompPO> list();
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
|
||||
/**
|
||||
* 根据搜索条件查询数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -176,7 +176,8 @@
|
|||
<include refid="baseColumns"/>
|
||||
from jcl_org_comp t where comp_no = #{compNo} AND delete_type = 0
|
||||
</select>
|
||||
<select id="listByFilter" parameterType="com.engine.organization.entity.company.po.CompPO" resultMap="BaseResultMap">
|
||||
<select id="listByFilter" parameterType="com.engine.organization.entity.company.po.CompPO"
|
||||
resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
|
|
@ -233,6 +234,23 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select parent_comp
|
||||
from JCL_ORG_DEPT
|
||||
where delete_type = 0
|
||||
union
|
||||
select parent_comp
|
||||
from JCL_ORG_JOB
|
||||
where delete_type = 0
|
||||
union
|
||||
select company_id
|
||||
from JCL_ORG_STAFFPLAN
|
||||
where delete_type = 0
|
||||
union
|
||||
select comp_id
|
||||
from JCL_ORG_STAFF
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
|
||||
update jcl_org_comp
|
||||
|
|
|
|||
|
|
@ -98,4 +98,11 @@ public interface DepartmentMapper {
|
|||
* @param ids
|
||||
*/
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,15 @@
|
|||
where delete_type = 0
|
||||
and parent_dept = #{pid}
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select parent_dept
|
||||
from JCL_ORG_JOB
|
||||
where delete_type = 0
|
||||
union
|
||||
select dept_id
|
||||
from JCL_ORG_STAFF
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.department.po.DepartmentPO"
|
||||
keyProperty="id"
|
||||
|
|
|
|||
|
|
@ -95,4 +95,10 @@ public interface JobMapper {
|
|||
*/
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,6 +276,11 @@
|
|||
where delete_type = 0
|
||||
and parent_job = #{pid}
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select job_id
|
||||
from JCL_ORG_STAFF
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
|
||||
<sql id="likeSQL">
|
||||
|
|
|
|||
|
|
@ -77,4 +77,6 @@ public interface GradeMapper {
|
|||
* @return
|
||||
*/
|
||||
int getCountByTag(@Param("tag") int tag);
|
||||
|
||||
List<String> listUsedId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,14 +38,14 @@
|
|||
from jcl_org_grade t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.GradePO" resultMap="BaseResultMap">
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.GradePO" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_grade t where grade_no = #{gradeNo} AND delete_type = 0
|
||||
</select>
|
||||
<select id="getCountByTag" resultType="java.lang.Integer">
|
||||
select count(1) from jcl_org_grade where 1=1 AND delete_type = 0
|
||||
<if test=" tag != -1 " >
|
||||
<if test=" tag != -1 ">
|
||||
and forbidden_tag = #{tag}
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -54,6 +54,11 @@
|
|||
<include refid="baseColumns"/>
|
||||
from jcl_org_grade t where delete_type = 0 and scheme_id = #{schemeId}
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select grade_id
|
||||
from JCL_ORG_JOBDT
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updateGrade" parameterType="com.engine.organization.entity.scheme.po.GradePO">
|
||||
update jcl_org_grade
|
||||
|
|
@ -96,7 +101,8 @@
|
|||
</if>
|
||||
<if test="schemeId != null ">
|
||||
scheme_id,
|
||||
</if><if test="levelId != null ">
|
||||
</if>
|
||||
<if test="levelId != null ">
|
||||
level_id,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
|
|
@ -125,7 +131,8 @@
|
|||
</if>
|
||||
<if test="schemeId != null ">
|
||||
#{schemeId},
|
||||
</if><if test="levelId != null ">
|
||||
</if>
|
||||
<if test="levelId != null ">
|
||||
#{levelId},
|
||||
</if>
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,13 @@ public interface LevelMapper {
|
|||
*/
|
||||
List<LevelPO> listByNo(@Param("levelNo") String levelNo);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
|
||||
/**
|
||||
* 获取职等根据ID
|
||||
* @param id
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@
|
|||
from jcl_org_level t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.LevelPO" resultMap="BaseResultMap">
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.LevelPO" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_level t where level_no = #{levelNo} AND delete_type = 0
|
||||
</select>
|
||||
<select id="getCountByTag" resultType="java.lang.Integer">
|
||||
select count(1) from jcl_org_level where delete_type = 0
|
||||
<if test=" tag != -1 " >
|
||||
select count(1) from jcl_org_level where delete_type = 0
|
||||
<if test=" tag != -1 ">
|
||||
and forbidden_tag = #{tag}
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -59,6 +59,15 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select level_id
|
||||
from JCL_ORG_GRADE
|
||||
where delete_type = 0
|
||||
union
|
||||
select level_id
|
||||
from JCL_ORG_JOBDT
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
|
||||
update jcl_org_level
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ public interface SchemeMapper {
|
|||
*/
|
||||
List<SchemePO> listByNo(@Param("schemeNo") String schemeNo);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
/**
|
||||
* 根据ID查询登记方案
|
||||
*
|
||||
|
|
@ -41,7 +47,7 @@ public interface SchemeMapper {
|
|||
* @return
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String,Object>> listSchemesByIds(@Param("ids") Collection<Long> ids);
|
||||
List<Map<String, Object>> listSchemesByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
|
|
|
|||
|
|
@ -51,6 +51,23 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select scheme_id
|
||||
from jcl_org_level
|
||||
where delete_type = 0
|
||||
union
|
||||
select scheme_id
|
||||
from jcl_org_grade
|
||||
where delete_type = 0
|
||||
union
|
||||
select scheme_id
|
||||
from JCL_ORG_SEQUENCE
|
||||
where delete_type = 0
|
||||
union
|
||||
select scheme_id
|
||||
from JCL_ORG_JOB
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.SchemePO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
|
|
|
|||
|
|
@ -25,6 +25,13 @@ public interface SequenceMapper {
|
|||
*/
|
||||
List<SequencePO> listByNo(@Param("sequenceNo") String sequenceNo);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
|
||||
/**
|
||||
* 获取岗位根据ID
|
||||
* @param id
|
||||
|
|
@ -77,4 +84,5 @@ public interface SequenceMapper {
|
|||
* @return
|
||||
*/
|
||||
int getCountByTag(@Param("tag") int tag);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,14 +36,15 @@
|
|||
from jcl_org_sequence t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.sequence.po.SequencePO" resultMap="BaseResultMap">
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.sequence.po.SequencePO"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_sequence t where sequence_no = #{sequenceNo} AND delete_type = 0
|
||||
</select>
|
||||
<select id="getCountByTag" resultType="java.lang.Integer">
|
||||
select count(1) from jcl_org_sequence where 1=1 AND delete_type = 0
|
||||
<if test=" tag != -1 " >
|
||||
<if test=" tag != -1 ">
|
||||
and forbidden_tag = #{tag}
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -59,6 +60,10 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select sequence_id
|
||||
from JCL_ORG_JOB
|
||||
</select>
|
||||
|
||||
<update id="updateSequence" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
|
||||
update jcl_org_sequence
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.organization.entity.staff.po.StaffPO;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
|
|
@ -16,6 +17,7 @@ public interface StaffMapper {
|
|||
|
||||
/**
|
||||
* 根据ID查询编制方案
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -23,6 +25,7 @@ public interface StaffMapper {
|
|||
|
||||
/**
|
||||
* 插入编制方案
|
||||
*
|
||||
* @param staffPO
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -44,4 +47,10 @@ public interface StaffMapper {
|
|||
*/
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@
|
|||
<include refid="baseColumns"/>
|
||||
from jcl_org_staff t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select staff_id
|
||||
from jcl_org_staffs
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updateStaff" parameterType="com.engine.organization.entity.staff.po.StaffPO">
|
||||
update jcl_org_staff
|
||||
|
|
|
|||
|
|
@ -25,10 +25,11 @@ public interface StaffPlanMapper {
|
|||
List<StaffPlanPO> listByNo(@Param("planNo") String planNo);
|
||||
|
||||
|
||||
List<Map<String,Object>> listPlansByIds(@Param("ids") Collection<Long> ids);
|
||||
List<Map<String, Object>> listPlansByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据ID查询编制方案
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -36,6 +37,7 @@ public interface StaffPlanMapper {
|
|||
|
||||
/**
|
||||
* 插入编制方案
|
||||
*
|
||||
* @param staffPlanPO
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -64,4 +66,10 @@ public interface StaffPlanMapper {
|
|||
*/
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select plan_id
|
||||
from JCL_ORG_STAFF
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updateStaffPlan" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
|
||||
update jcl_org_staffplan
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import com.engine.organization.service.GradeService;
|
|||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.RefreshIsUsedUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -51,6 +52,8 @@ public class GradeServiceImpl extends Service implements GradeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshGrade("jcl_org_grade");
|
||||
OrganizationWeaTable<GradeTableVO> table = new OrganizationWeaTable<>(user, GradeTableVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.engine.organization.service.LevelService;
|
|||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.RefreshIsUsedUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -46,6 +47,8 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshLevel("jcl_org_level");
|
||||
OrganizationWeaTable<LevelTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ package com.engine.organization.service.impl;
|
|||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
||||
import com.cloudstore.eccom.pc.table.WeaTablePopedom;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
|
|
@ -18,13 +14,13 @@ import com.engine.organization.service.SchemeService;
|
|||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.RefreshIsUsedUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -42,8 +38,9 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshScheme("jcl_org_scheme");
|
||||
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, SchemeTableVO.class);
|
||||
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
|
|
@ -54,7 +51,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> save(SchemeSearchParam param) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
List<SchemePO> list = getSchemeMapper().listByNo(Util.null2String(param.getSchemeNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
|
||||
|
|
@ -64,7 +61,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> updateScheme(SchemeSearchParam param) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
|
||||
getSchemeMapper().updateScheme(schemePO);
|
||||
return apidatas;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.engine.organization.service.SequenceService;
|
|||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.RefreshIsUsedUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -46,6 +47,8 @@ public class SequenceServiceImpl extends Service implements SequenceService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshSequence("jcl_org_sequence");
|
||||
OrganizationWeaTable<SequenceTableVO> table = new OrganizationWeaTable<>(user, SequenceTableVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.engine.organization.service.StaffPlanService;
|
|||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.RefreshIsUsedUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -45,6 +46,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(StaffPlanSearchParam params) {
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshStaffPlan("jcl_org_staffplan");
|
||||
OrganizationWeaTable<StaffPlanTableVO> table = new OrganizationWeaTable<>(user, StaffPlanTableVO.class);
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(params, (long) user.getUID());
|
||||
String sqlWhere = buildSqlWhere(staffPlanPO);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.engine.organization.service.StaffService;
|
|||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.RefreshIsUsedUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -60,6 +61,8 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(StaffSearchParam params) {
|
||||
// 刷新引用状态
|
||||
RefreshIsUsedUtil.RefreshStaff("jcl_org_staff");
|
||||
OrganizationWeaTable<StaffTableVO> table = new OrganizationWeaTable<>(user, StaffTableVO.class);
|
||||
StaffPO staffPO = StaffBO.convertParamToPO(params, (long) user.getUID());
|
||||
String sqlWhere = buildSqlWhere(staffPO);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class ConfigTrans {
|
|||
return "false";
|
||||
}
|
||||
|
||||
public static List<Object> formatSourceOperates(String id,String isDefault) {
|
||||
public static List<Object> formatSourceOperates(String id, String isDefault) {
|
||||
List list = Lists.newArrayList();
|
||||
list.add(true);
|
||||
if ("0".equals(isDefault)) {
|
||||
|
|
@ -30,4 +30,16 @@ public class ConfigTrans {
|
|||
return list;
|
||||
}
|
||||
|
||||
public static List<Object> formatStaffOperates(String id, String isDefault) {
|
||||
List list = Lists.newArrayList();
|
||||
list.add(true);
|
||||
if ("0".equals(isDefault)) {
|
||||
list.add(true);
|
||||
} else {
|
||||
list.add(false);
|
||||
}
|
||||
list.add(true);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
package com.engine.organization.util;
|
||||
|
||||
import com.engine.organization.mapper.common.RefreshUseMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.mapper.scheme.LevelMapper;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import com.engine.organization.mapper.sequence.SequenceMapper;
|
||||
import com.engine.organization.mapper.staff.StaffMapper;
|
||||
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RefreshIsUsedUtil {
|
||||
|
||||
private static RefreshUseMapper getRefreshUseMapper() {
|
||||
return MapperProxyFactory.getProxy(RefreshUseMapper.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新等级方案表 引用状态
|
||||
* <p>
|
||||
* JCL_ORG_LEVEL,JCL_ORG_GRADE,JCL_ORG_SEQUENCE,JCL_ORG_JOB
|
||||
*/
|
||||
public static void RefreshScheme(String tableName) {
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(SchemeMapper.class).listUsedId();
|
||||
usedIds.removeIf(Objects::isNull);
|
||||
RefreshIsUsedStatus(tableName, usedIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新职等表 引用状态
|
||||
* <p>
|
||||
* JCL_ORG_GRADE,JCL_ORG_JOBDT
|
||||
*/
|
||||
public static void RefreshLevel(String tableName) {
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(LevelMapper.class).listUsedId();
|
||||
usedIds.removeIf(Objects::isNull);
|
||||
RefreshIsUsedStatus(tableName, usedIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新职级表 引用状态
|
||||
* <p>
|
||||
* JCL_ORG_JOBDT
|
||||
*/
|
||||
public static void RefreshGrade(String tableName) {
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(GradeMapper.class).listUsedId();
|
||||
usedIds.removeIf(Objects::isNull);
|
||||
RefreshIsUsedStatus(tableName, usedIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新岗位序列表 引用状态
|
||||
* <p>
|
||||
* JCL_ORG_JOB
|
||||
*/
|
||||
public static void RefreshSequence(String tableName) {
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(SequenceMapper.class).listUsedId();
|
||||
usedIds.removeIf(Objects::isNull);
|
||||
RefreshIsUsedStatus(tableName, usedIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新编制方案列表 引用状态
|
||||
* <p>
|
||||
* JCL_ORG_JOB
|
||||
*/
|
||||
public static void RefreshStaffPlan(String tableName) {
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(StaffPlanMapper.class).listUsedId();
|
||||
usedIds.removeIf(Objects::isNull);
|
||||
RefreshIsUsedStatus(tableName, usedIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新编制表列表 引用状态
|
||||
* <p>
|
||||
* JCL_ORG_JOB
|
||||
*/
|
||||
public static void RefreshStaff(String tableName) {
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(StaffMapper.class).listUsedId();
|
||||
usedIds.removeIf(Objects::isNull);
|
||||
RefreshIsUsedStatus(tableName, usedIds);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新指定表的引用状态
|
||||
*
|
||||
* @param tableName
|
||||
* @param usedIds
|
||||
*/
|
||||
private static void RefreshIsUsedStatus(String tableName, List<String> usedIds) {
|
||||
if (CollectionUtils.isNotEmpty(usedIds)) {
|
||||
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
|
||||
getRefreshUseMapper().updateIsUsedByIds(tableName, collect, 0);
|
||||
getRefreshUseMapper().updateIsUsedByIds(tableName, collect, 1);
|
||||
}else{
|
||||
getRefreshUseMapper().initIsUseStatus(tableName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue