Kaynağa Gözat

新增创建不存在医生

刘韬 5 yıl önce
ebeveyn
işleme
df6e390abd
1 değiştirilmiş dosya ile 10 ekleme ve 1 silme
  1. 10 1
      DataFusion/src/com/zskk/task/DataTask.java

+ 10 - 1
DataFusion/src/com/zskk/task/DataTask.java

@@ -84,7 +84,16 @@ public class DataTask implements ITask {
 		}
 		Doctors doctors = Doctors.dao.use("zskk").findFirst("SELECT * FROM doctors where instr(?,realname) and institution_id=81069902 and realname<>''", name);
 		if (doctors == null) {
-			return null;
+			Doctors newDoctors = new Doctors().use("zskk");
+			newDoctors.setId(creatId());
+			newDoctors.setUsername("none");
+			newDoctors.setRealname(name);
+			newDoctors.setPassword("123456");
+			newDoctors.setInstitutionId("81069902");
+			newDoctors.setCreatedAt(new Date());
+			newDoctors.setUpdatedAt(new Date());
+			newDoctors.save();
+			return newDoctors.getId();
 		}
 		return doctors.getId();
 	}