|
@ -172,7 +172,11 @@ public class ProfessorService {
|
172
|
172
|
}
|
173
|
173
|
professor.setAuthentication(true);
|
174
|
174
|
if (professor.getOrgId() == null) {
|
175
|
|
professor.setOrgId(this.orgService.createOrganization(con, orgName));
|
|
175
|
if(null != this.orgDao.queryByName(con, orgName)){
|
|
176
|
professor.setOrgId(this.orgDao.queryByName(con, orgName));
|
|
177
|
} else {
|
|
178
|
professor.setOrgId(this.orgService.createOrganization(con, orgName));
|
|
179
|
}
|
176
|
180
|
}
|
177
|
181
|
this.professorDao.insert(con, professor);
|
178
|
182
|
this.imageService.saveDefaultHeadImage(professor.getId());
|
|
@ -183,7 +187,11 @@ public class ProfessorService {
|
183
|
187
|
@Path
|
184
|
188
|
public void update(@JdbcConn(true) Connection con, @RequestBody EditProfessor professor) throws SQLException, IOException {
|
185
|
189
|
if(professor.getOrgName()!=null)
|
186
|
|
professor.setOrgId(this.orgService.createOrganization(con, professor.getOrgName()));
|
|
190
|
if(null != this.orgDao.queryByName(con, professor.getOrgName())){
|
|
191
|
professor.setOrgId(this.orgDao.queryByName(con, professor.getOrgName()));
|
|
192
|
} else {
|
|
193
|
professor.setOrgId(this.orgService.createOrganization(con, professor.getOrgName()));
|
|
194
|
}
|
187
|
195
|
this.professorDao.update(con, professor);
|
188
|
196
|
}
|
189
|
197
|
|