|
@@ -927,13 +927,19 @@ func SelfSupportForSchoolImportTeacher(c *gin.Context) { |
|
|
xlsx, err := excelize.OpenFile(dst) |
|
|
xlsx, err := excelize.OpenFile(dst) |
|
|
rows := xlsx.GetRows("Sheet" + "1") |
|
|
rows := xlsx.GetRows("Sheet" + "1") |
|
|
for key, row := range rows { |
|
|
for key, row := range rows { |
|
|
if key > 0 && (row[0] != "" && row[1] != "") { |
|
|
|
|
|
|
|
|
if key > 0 && ((row[0] != "" || row[1] != "") && row[2] != "") { |
|
|
idNo := row[0] |
|
|
idNo := row[0] |
|
|
name := row[1] |
|
|
|
|
|
|
|
|
certType := enum.UserIdentityCertTypeForIdCard |
|
|
|
|
|
if idNo == "" { |
|
|
|
|
|
idNo = row[1] |
|
|
|
|
|
certType = enum.UserIdentityCertTypeForStudentId |
|
|
|
|
|
} |
|
|
|
|
|
name := row[2] |
|
|
|
|
|
|
|
|
//1、查找当前身份是否已存在 |
|
|
//1、查找当前身份是否已存在 |
|
|
userIdentityDb := db.UserIdentityDb{} |
|
|
userIdentityDb := db.UserIdentityDb{} |
|
|
userIdentityDb.Set(0) |
|
|
userIdentityDb.Set(0) |
|
|
isHasUserIdentity, err := userIdentityDb.UserIdentityExist(enterpriseId, idNo, enum.UserIdentityCertTypeForIdCard) |
|
|
|
|
|
|
|
|
isHasUserIdentity, err := userIdentityDb.UserIdentityExist(enterpriseId, idNo, certType) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
return |
|
|
return |
|
@@ -948,7 +954,7 @@ func SelfSupportForSchoolImportTeacher(c *gin.Context) { |
|
|
Uid: 0, |
|
|
Uid: 0, |
|
|
Name: name, |
|
|
Name: name, |
|
|
IdNo: idNo, |
|
|
IdNo: idNo, |
|
|
CertType: enum.UserIdentityCertTypeForIdCard, |
|
|
|
|
|
|
|
|
CertType: certType, |
|
|
Kind: enum.UserIdentityKindForCommon, |
|
|
Kind: enum.UserIdentityKindForCommon, |
|
|
Identity: enum.UserIdentityForSelfSupportForTeacher, |
|
|
Identity: enum.UserIdentityForSelfSupportForTeacher, |
|
|
EnterpriseId: enterpriseId, |
|
|
EnterpriseId: enterpriseId, |
|
|