diff --git a/src/com/engine/organization/entity/company/bo/CompBO.java b/src/com/engine/organization/entity/company/bo/CompBO.java index c43b684e..efbbe194 100644 --- a/src/com/engine/organization/entity/company/bo/CompBO.java +++ b/src/com/engine/organization/entity/company/bo/CompBO.java @@ -44,6 +44,8 @@ public class CompBO { Map> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany)); // 处理被引用数据 List usedIds = MapperProxyFactory.getProxy(CompMapper.class).listUsedId(); + // 兼容MySQL + usedIds.addAll(MapperProxyFactory.getProxy(CompMapper.class).listUsedIds()); List collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList()); return dtoList.stream().peek(e -> { List childList = collects.get(e.getId()); diff --git a/src/com/engine/organization/mapper/comp/CompMapper.java b/src/com/engine/organization/mapper/comp/CompMapper.java index b421e863..ff119d78 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.java +++ b/src/com/engine/organization/mapper/comp/CompMapper.java @@ -28,6 +28,8 @@ public interface CompMapper { */ List listUsedId(); + List listUsedIds(); + /** * 根据搜索条件查询数据 * diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index 2abb7f43..8a119700 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -266,10 +266,6 @@ 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 @@ -288,6 +284,11 @@ select COUNT(id) from jcl_org_comp where 1=1 + update jcl_org_comp diff --git a/src/com/engine/organization/web/CompController.java b/src/com/engine/organization/web/CompController.java index 38888e72..bd7b4e42 100644 --- a/src/com/engine/organization/web/CompController.java +++ b/src/com/engine/organization/web/CompController.java @@ -8,6 +8,7 @@ import com.engine.organization.entity.department.param.DepartmentMoveParam; import com.engine.organization.util.response.ReturnResult; import com.engine.organization.wrapper.CompWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.general.BaseBean; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -48,6 +49,7 @@ public class CompController { User user = HrmUserVarify.getUser(request, response); return ReturnResult.successed(getCompWrapper(user).listPage(params)); } catch (Exception e) { + new BaseBean().writeLog(e); return ReturnResult.exceptionHandle(e.getMessage()); } }