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 { ...@@ -398,11 +398,10 @@ public class SysOrganizationService {
SysOrganizationViewMapper mapper = context.getBean(SysOrganizationViewMapper.class); SysOrganizationViewMapper mapper = context.getBean(SysOrganizationViewMapper.class);
SysOrganizationView record = new SysOrganizationView(); SysOrganizationView record = new SysOrganizationView();
XCopyUtils.copyObject(input, record); XCopyUtils.copyObject(input, record);
record.setEndTime(new Date());
record.setIsDeleted(SysOrganizationCode.NORMAL); record.setIsDeleted(SysOrganizationCode.NORMAL);
PpsUserSession session = context.getSession(PpsUserSession.class); PpsUserSession session = context.getSession(PpsUserSession.class);
Integer isSuperAdmin = session.getIsSuperAdmin(); Integer isSuperAdmin = session.getIsSuperAdmin();
List<SysOrganizationView> viewList = new ArrayList<>(); List<SysOrganizationView> viewList;
if (XStringUtils.isEmpty(input.getParentOuId())) { if (XStringUtils.isEmpty(input.getParentOuId())) {
//如果是超级管理员查所以组织机构 //如果是超级管理员查所以组织机构
if (UserConstant.ISSUPERADMIN_TRUE.equals(isSuperAdmin)) { if (UserConstant.ISSUPERADMIN_TRUE.equals(isSuperAdmin)) {
...@@ -415,8 +414,6 @@ public class SysOrganizationService { ...@@ -415,8 +414,6 @@ public class SysOrganizationService {
} else { } else {
viewList = mapper.selectOuSonByParentOuId(record); viewList = mapper.selectOuSonByParentOuId(record);
} }
List<GetSysOrganizationViewOutput> outputs = XCopyUtils.copyNewList(viewList, GetSysOrganizationViewOutput.class); List<GetSysOrganizationViewOutput> outputs = XCopyUtils.copyNewList(viewList, GetSysOrganizationViewOutput.class);
return XListResult.success(outputs); return XListResult.success(outputs);
} }
......
...@@ -168,7 +168,6 @@ ...@@ -168,7 +168,6 @@
from sys_organization so from sys_organization so
left join sys_organization_rel sor on sor.ou_id = so.id left join sys_organization_rel sor on sor.ou_id = so.id
where so.is_deleted = #{isDeleted} where so.is_deleted = #{isDeleted}
and sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime}
<if test="parentOuId != null and parentOuId != ''"> <if test="parentOuId != null and parentOuId != ''">
and parent_ou_id =#{parentOuId} and parent_ou_id =#{parentOuId}
</if> </if>
...@@ -479,13 +478,24 @@ ...@@ -479,13 +478,24 @@
</where> </where>
</select> </select>
<select id="selectOuByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap"> <select id="selectOuByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
select select id,
<include refid="Base_Column_List"/>, ou_code,
ou_name,
short_name,
ou_level, ou_level,
'ou' as type description,
post_code,
post_address,
fax_no,
phone,
country,
province,
is_deleted,
ou_level,
'ou' AS type
from sys_organization from sys_organization
where where id = #{id}
id=#{id} and is_deleted =1 and is_deleted = 1
</select> </select>
<select id="selectOuByOuIdsAndOuName" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOuByOuIdsAndOuName" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> 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