Commit bba1664149af0a360be5235d14130aecc0377cae

Authored by baohanddd
1 parent e4451e04f4

add data import :机构、部门、用户(医生)

Showing 2 changed files with 13 additions and 14 deletions

platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java View file @ bba1664
... ... @@ -84,7 +84,7 @@
84 84 for (Map map:list) {
85 85 try {
86 86 // organization
87   - if (StringUtils.isBlank(organization.getForeignId()) || !organization.getForeignId().equals(map.get("H_ID"))) {
  87 + if (StringUtils.isBlank(organization.getForeignId()) || !map.get("H_ID").equals(organization.getForeignId())) {
88 88 if (!organizationMap.containsKey(map.get("H_ID").toString())) {
89 89 organization = new Organization();
90 90 organization.setForeignId(map.get("H_ID").toString());
... ... @@ -105,12 +105,10 @@
105 105 }
106 106  
107 107 // Departments
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 + if (StringUtils.isBlank(departments.getForeignId()) || !map.get("D_ID").toString().equals(departments.getForeignId())) {
  109 + departments = new Departments();
  110 + departments.setForeignId(map.get("D_ID").toString());
  111 + organization.getDepartmentsMap().put(departments.getForeignId(), departments);
114 112 departments.setPublishName("system");
115 113 departments.setType(2);
116 114 departments.setPublishId(0);
... ... @@ -122,12 +120,10 @@
122 120 }
123 121  
124 122 // users
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 + if (StringUtils.isBlank(users.getForeignId()) || !map.get("U_ID").toString().equals(users.getForeignId())) {
  124 + users = new Users();
  125 + users.setForeignId(map.get("U_ID").toString());
  126 + departments.getUsersMap().put(users.getForeignId(), users);
131 127 users.setPublishId(0);
132 128 users.setPublishName("system");
133 129 users.setOrgId(organization.getId());
... ... @@ -161,6 +157,9 @@
161 157 UsersQuery usersQuery = new UsersQuery();
162 158 for (Organization o:organizationMap.values()) {
163 159 try {
  160 + if (true) {
  161 + continue;
  162 + }
164 163 organizationQuery.setForeignId(organization.getForeignId());
165 164 List<Organization> organizationList = organizationService.queryOrganization(organizationQuery);
166 165 if (organizationList != null && organizationList.size() > 0) {
platform-mommyData/src/main/resources/earlyOrm/Plat.xml View file @ bba1664
... ... @@ -218,7 +218,7 @@
218 218 <if test="startTime != null">
219 219 and (u.u_opertime >= #{startTime} or e.e_opertime >= #{startTime} or d.d_opertime >= #{startTime} )
220 220 </if>
221   - order by u.u_id
  221 + order by h.h_id,d.d_id,u.u_id
222 222 </select>
223 223  
224 224