Commit 5f887bd8 authored by ZWT's avatar ZWT

feat(能源管理系统): 组织机构管理

1.修改组织机构管理分页列表功能,优化sql查询逻辑及代码业务处理逻辑,解决组织部分信息获取错误问题,完成接口冒烟测试并添加线上接口文档;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 4dca7250
......@@ -398,11 +398,10 @@ public class SysOrganizationService {
SysOrganizationViewMapper mapper = context.getBean(SysOrganizationViewMapper.class);
SysOrganizationView record = new SysOrganizationView();
XCopyUtils.copyObject(input, record);
record.setEndTime(new Date());
record.setIsDeleted(SysOrganizationCode.NORMAL);
PpsUserSession session = context.getSession(PpsUserSession.class);
Integer isSuperAdmin = session.getIsSuperAdmin();
List<SysOrganizationView> viewList = new ArrayList<>();
List<SysOrganizationView> viewList;
if (XStringUtils.isEmpty(input.getParentOuId())) {
//如果是超级管理员查所以组织机构
if (UserConstant.ISSUPERADMIN_TRUE.equals(isSuperAdmin)) {
......@@ -415,8 +414,6 @@ public class SysOrganizationService {
} else {
viewList = mapper.selectOuSonByParentOuId(record);
}
List<GetSysOrganizationViewOutput> outputs = XCopyUtils.copyNewList(viewList, GetSysOrganizationViewOutput.class);
return XListResult.success(outputs);
}
......
......@@ -168,7 +168,6 @@
from sys_organization so
left join sys_organization_rel sor on sor.ou_id = so.id
where so.is_deleted = #{isDeleted}
and sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime}
<if test="parentOuId != null and parentOuId != ''">
and parent_ou_id =#{parentOuId}
</if>
......@@ -479,13 +478,24 @@
</where>
</select>
<select id="selectOuByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
ou_level,
'ou' as type
select id,
ou_code,
ou_name,
short_name,
ou_level,
description,
post_code,
post_address,
fax_no,
phone,
country,
province,
is_deleted,
ou_level,
'ou' AS type
from sys_organization
where
id=#{id} and is_deleted =1
where id = #{id}
and is_deleted = 1
</select>
<select id="selectOuByOuIdsAndOuName" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment