Commit 3897d658 authored by Shen's avatar Shen

1. 更新用户时更新机构

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