|
|
@@ -107,21 +107,27 @@ public class GetSchoolUserController {
|
|
|
JSONArray jsonArray=jsonObject.getJSONArray("organization");
|
|
|
List<OrganDto> users= jsonArray.toJavaList(OrganDto.class);
|
|
|
List<Organization> organizations=new ArrayList();
|
|
|
- for(OrganDto dto:users){
|
|
|
- if ("573084".equals(dto.getParent_id())){
|
|
|
- Organization organization=new Organization();
|
|
|
- organization.setId(dto.getId());
|
|
|
- organization.setName(dto.getName());
|
|
|
- organization.setParentId(dto.getParent_id());
|
|
|
- organization.setUpdatedAt(dto.getUpdated_at());
|
|
|
- organizations.add(organization);
|
|
|
+ try {
|
|
|
+ boolean a = false;
|
|
|
+ boolean b =organizationService.remove(null);
|
|
|
+ if(!b){
|
|
|
+ throw new Exception("删除失败");
|
|
|
}
|
|
|
- }
|
|
|
- boolean a =organizationService.saveOrUpdateBatch(organizations);
|
|
|
+ for(OrganDto dto:users){
|
|
|
+ if ("573084".equals(dto.getParent_id())){
|
|
|
+ Organization organization=new Organization();
|
|
|
+ organization.setId(dto.getId());
|
|
|
+ organization.setName(dto.getName());
|
|
|
+ organization.setParentId(dto.getParent_id());
|
|
|
+ organization.setUpdatedAt(dto.getUpdated_at());
|
|
|
+ organizations.add(organization);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ a = organizationService.saveBatch(organizations);
|
|
|
log.info("更新部门完成:"+a);
|
|
|
-
|
|
|
-
|
|
|
- return ;
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("更新部门失败:"+e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// //获取组织架构成员
|