分部列表BUG修复

pull/137/MERGE^2
dxfeng 3 years ago
parent 1a1646e818
commit 5291c3b855

@ -44,6 +44,8 @@ public class CompBO {
Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany)); Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany));
// 处理被引用数据 // 处理被引用数据
List<String> usedIds = MapperProxyFactory.getProxy(CompMapper.class).listUsedId(); List<String> usedIds = MapperProxyFactory.getProxy(CompMapper.class).listUsedId();
// 兼容MySQL
usedIds.addAll(MapperProxyFactory.getProxy(CompMapper.class).listUsedIds());
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList()); List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
return dtoList.stream().peek(e -> { return dtoList.stream().peek(e -> {
List<CompListDTO> childList = collects.get(e.getId()); List<CompListDTO> childList = collects.get(e.getId());

@ -28,6 +28,8 @@ public interface CompMapper {
*/ */
List<String> listUsedId(); List<String> listUsedId();
List<String> listUsedIds();
/** /**
* *
* *

@ -266,10 +266,6 @@
from JCL_ORG_JOB from JCL_ORG_JOB
where delete_type = 0 where delete_type = 0
union union
select company_id
from JCL_ORG_STAFFPLAN
where delete_type = 0
union
select comp_id select comp_id
from JCL_ORG_STAFF from JCL_ORG_STAFF
where delete_type = 0 where delete_type = 0
@ -288,6 +284,11 @@
select COUNT(id) from jcl_org_comp where 1=1 select COUNT(id) from jcl_org_comp where 1=1
<include refid="nullParentCompany"/> <include refid="nullParentCompany"/>
</select> </select>
<select id="listUsedIds" resultType="java.lang.String">
select company_id
from JCL_ORG_STAFFPLAN
where delete_type = 0
</select>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO"> <update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
update jcl_org_comp update jcl_org_comp

@ -8,6 +8,7 @@ import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.util.response.ReturnResult; import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.CompWrapper; import com.engine.organization.wrapper.CompWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.general.BaseBean;
import weaver.hrm.HrmUserVarify; import weaver.hrm.HrmUserVarify;
import weaver.hrm.User; import weaver.hrm.User;
@ -48,6 +49,7 @@ public class CompController {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).listPage(params)); return ReturnResult.successed(getCompWrapper(user).listPage(params));
} catch (Exception e) { } catch (Exception e) {
new BaseBean().writeLog(e);
return ReturnResult.exceptionHandle(e.getMessage()); return ReturnResult.exceptionHandle(e.getMessage());
} }
} }

Loading…
Cancel
Save