|
|
@@ -46,6 +46,8 @@ type UserModel struct {
|
|
|
Sign string `json:"sign"`
|
|
|
IsCompanyUser int `json:"Iscompanyuser"`
|
|
|
Superior string `json:"superior"`
|
|
|
+ UnitId int `json:"unitId"`
|
|
|
+ Unit string `json:"unit"`
|
|
|
}
|
|
|
|
|
|
type ChangePwdModel struct {
|
|
|
@@ -432,8 +434,18 @@ func (this *UserController) EditUser() {
|
|
|
userentity.Modifiedby = this.User.Realname
|
|
|
userentity.Departmentid = model.DepartmentId
|
|
|
userentity.Departmentname = model.DepartmentName
|
|
|
-
|
|
|
- var cols []string = []string{"Realname", "CompanyId", "DepartmentId", "DepartmentName", "Telephone", "Mobile", "Description", "Photo", "Modifieduserid", "Modifiedby", "Superior"}
|
|
|
+ if model.Superior != "" {
|
|
|
+ //改所属单位
|
|
|
+ str := strings.Split(model.Superior, ",")
|
|
|
+ if str[2] != "" {
|
|
|
+ var entity organize.Base_Organize
|
|
|
+ svc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ svc.GetEntityById (str[2], &entity)
|
|
|
+ userentity.UnitId,_ = strconv.Atoi(str[2])
|
|
|
+ userentity.Unit = entity.Fullname
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var cols []string = []string{"Realname", "CompanyId", "DepartmentId", "DepartmentName", "Telephone", "Mobile", "Description", "Photo", "Modifieduserid", "Modifiedby", "Superior", "Unit", "UnitId"}
|
|
|
|
|
|
err := svc.UpdateEntityAndBackupByCols(id, &userentity, &userentityempty, cols, utils.ToStr(this.User.Id), this.User.Realname)
|
|
|
|