Commit 1620ed5b7879a43742c79f4ab9989d5bd9d8c98b
1 parent
36856fcf97
Exists in
master
and in
8 other branches
add data import :机构、部门、用户(医生)
Showing 2 changed files with 16 additions and 12 deletions
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java
View file @
1620ed5
... | ... | @@ -85,7 +85,11 @@ |
85 | 85 | try { |
86 | 86 | // organization |
87 | 87 | if (StringUtils.isBlank(organization.getForeignId()) || !organization.getForeignId().equals(map.get("H_ID"))) { |
88 | - organization.setForeignId(map.get("H_ID").toString()); | |
88 | + if (!organizationMap.containsKey(map.get("H_ID").toString())) { | |
89 | + organization = new Organization(); | |
90 | + organization.setForeignId(map.get("H_ID").toString()); | |
91 | + organizationMap.put(organization.getForeignId(),organization); | |
92 | + } | |
89 | 93 | organization.setYn(YnEnums.YES.getId()); |
90 | 94 | organization.setName(map.get("H_NAME").toString()); |
91 | 95 | organization.setAreaId(map.get("H_COUNTYNO") == null ? null : map.get("H_COUNTYNO").toString()); |
92 | 96 | |
... | ... | @@ -98,13 +102,15 @@ |
98 | 102 | organization.setPublishId(0); |
99 | 103 | organization.setPublishName("system"); |
100 | 104 | organization.setModified(new Date()); |
101 | - if (!organizationMap.containsKey(organization.getForeignId())) { | |
102 | - organizationMap.put(organization.getForeignId(),organization); | |
103 | - } | |
104 | 105 | } |
105 | 106 | |
106 | 107 | // Departments |
107 | 108 | if (StringUtils.isBlank(departments.getForeignId()) || !departments.getForeignId().equals(map.get("D_ID"))) { |
109 | + if (!organization.getDepartmentsMap().containsKey(map.get("D_ID").toString())) { | |
110 | + departments = new Departments(); | |
111 | + departments.setForeignId(map.get("D_ID").toString()); | |
112 | + organization.getDepartmentsMap().put(departments.getForeignId(), departments); | |
113 | + } | |
108 | 114 | departments.setPublishName("system"); |
109 | 115 | departments.setType(2); |
110 | 116 | departments.setPublishId(0); |
111 | 117 | |
112 | 118 | |
... | ... | @@ -113,19 +119,20 @@ |
113 | 119 | departments.setForeignId(map.get("D_ID").toString()); |
114 | 120 | departments.setModified(new Date()); |
115 | 121 | departments.setName(map.get("D_NAME") == null ? null : map.get("D_NAME").toString()); |
116 | - if (!organization.getDepartmentsMap().containsKey(departments.getForeignId())) { | |
117 | - organization.getDepartmentsMap().put(departments.getForeignId(), departments); | |
118 | - } | |
119 | 122 | } |
120 | 123 | |
121 | 124 | // users |
122 | 125 | if (StringUtils.isBlank(users.getForeignId()) || !users.getForeignId().equals(map.get("U_ID"))) { |
126 | + if (!departments.getUsersMap().containsKey(map.get("U_ID").toString())) { | |
127 | + users = new Users(); | |
128 | + users.setForeignId(map.get("U_ID").toString()); | |
129 | + departments.getUsersMap().put(users.getForeignId(), users); | |
130 | + } | |
123 | 131 | users.setPublishId(0); |
124 | 132 | users.setPublishName("system"); |
125 | 133 | users.setOrgId(organization.getId()); |
126 | 134 | users.setName(map.get("E_NAME") == null ? null : map.get("E_NAME").toString()); |
127 | 135 | users.setAccount(map.get("U_USERNAME") == null ? null : map.get("U_USERNAME").toString()); |
128 | - users.setForeignId(map.get("U_ID").toString()); | |
129 | 136 | users.setYn(YnEnums.YES.getId()); |
130 | 137 | users.setModified(new Date()); |
131 | 138 | users.setDeptId(departments.getId()); |
... | ... | @@ -136,9 +143,6 @@ |
136 | 143 | users.setEnable(2); |
137 | 144 | } |
138 | 145 | users.setKsId(departments.getId()); |
139 | - if (!departments.getUsersMap().containsKey(users.getForeignId())) { | |
140 | - departments.getUsersMap().put(users.getForeignId(), users); | |
141 | - } | |
142 | 146 | |
143 | 147 | //TODO 手机号,权限 对应中间表 |
144 | 148 | // users.setPhone(""); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java
View file @
1620ed5
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | |
35 | 35 | @TokenRequired |
36 | 36 | @RequestMapping(value = "/regions",method = RequestMethod.GET) |
37 | - public void getRegions(@RequestParam(value = "parentId") String parentId, | |
37 | + public void getRegions(@RequestParam(value = "parentId", required = false) String parentId, | |
38 | 38 | HttpServletResponse httpServletResponse){ |
39 | 39 | if ("0".equals(parentId) || StringUtils.isBlank(parentId)) { |
40 | 40 | parentId = SystemConfig.CHINA_BASIC_ID; |