use of com.ngtesting.platform.vo.RelationOrgGroupUserVo in project ngtesting-platform by aaronchen2k.
the class RelationOrgGroupUserServiceImpl method saveRelations.
@Override
public boolean saveRelations(List<RelationOrgGroupUserVo> orgGroupUserVos) {
if (orgGroupUserVos == null) {
return false;
}
for (Object obj : orgGroupUserVos) {
RelationOrgGroupUserVo vo = JSON.parseObject(JSON.toJSONString(obj), RelationOrgGroupUserVo.class);
if (vo.getSelecting() != vo.getSelected()) {
// 变化了
TestRelationOrgGroupUser relationOrgGroupUser = this.getRelationOrgGroupUser(vo.getOrgGroupId(), vo.getUserId());
if (vo.getSelecting() && relationOrgGroupUser == null) {
// 勾选
relationOrgGroupUser = new TestRelationOrgGroupUser(vo.getOrgId(), vo.getOrgGroupId(), vo.getUserId());
saveOrUpdate(relationOrgGroupUser);
} else if (relationOrgGroupUser != null) {
// 取消
getDao().delete(relationOrgGroupUser);
}
}
}
return true;
}
Aggregations