Commit 3897d658 authored by Shen's avatar Shen

1. 更新用户时更新机构

2. admin管理用户列表添加机构信息
parent 11d411c4
......@@ -17,4 +17,6 @@ public interface PensionOrganizationUserDao extends BaseDao<PensionOrganizationU
void deleteByUserIds(Long[] ids);
void updateByUserId(Long orgId, Long userId);
}
\ No newline at end of file
......@@ -16,4 +16,6 @@ public interface PensionOrganizationUserService extends CrudService<PensionOrgan
void deleteByUserIds(Long[] ids);
void updateByUserId(Long orgId, Long userId);
}
\ No newline at end of file
......@@ -43,4 +43,9 @@ public class PensionOrganizationUserServiceImpl extends CrudServiceImpl<PensionO
public void deleteByUserIds(Long[] ids) {
pensionOrganizationUserDao.deleteByUserIds(ids);
}
@Override
public void updateByUserId(Long orgId, Long userId) {
pensionOrganizationUserDao.updateByUserId(orgId, userId);
}
}
\ No newline at end of file
......@@ -77,6 +77,15 @@ public class SysUserController {
PageData<SysUserDTO> page = sysUserService.page(params);
for (int i = 0; i < page.getList().size(); i++) {
Long uId = page.getList().get(i).getId();
Long orgId = pensionOrganizationUserService.findUserOrgId(uId);
page.getList().get(i).setOrgId(orgId);
try {
page.getList().get(i).setOrgName(pensionOrganizationService.get(orgId).getName());
}catch(Exception ignore){}
}
return new Result<PageData<SysUserDTO>>().ok(page);
}
......
......@@ -171,6 +171,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
sysUserEntity.setPassword(password);
if (null != dto.getId()) {
updateById(sysUserEntity);
pensionOrganizationUserService.updateByUserId(dto.getOrgId(), dto.getId());
} else {
sysUserEntity.setSuperAdmin(0);
insert(sysUserEntity);
......
......@@ -23,4 +23,7 @@
</foreach>
</delete>
<update id="updateByUserId" parameterType="Long">
UPDATE pension_organization_user SET organization_id = #{orgId} WHERE user_id = #{userId}
</update>
</mapper>
\ No newline at end of file
......@@ -29,7 +29,7 @@
</resultMap>
<select id="getEventForUser" resultType="io.hmit.modules.serviceOrder.dto.PensionEventDTO">
SELECT pe.id, pe.event_title, pe.event_image_url, pe.event_org_name, pe.event_date
SELECT pe.id, pe.event_title, pe.event_image_url, pe.event_org_name, pe.event_date, pe.create_date
FROM pension_event pe WHERE pe.status != 0 AND pe.status != 4
</select>
......
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