...
|
...
|
@@ -448,7 +448,9 @@ func ChanceUpdate(header *protocol.RequestHeader, request *protocol.ChanceUpdate |
|
|
//}
|
|
|
if _, e := models.GetAuditFlowProcessByReview(request.Id, 0, protocol.ReviewStatusWait); e == nil {
|
|
|
request.IsPublish = true
|
|
|
updateMap["DepartmentId"] = request.RelatedDepartment
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
request.IsPublish = false
|
|
|
}
|
...
|
...
|
@@ -474,7 +476,6 @@ func ChanceUpdate(header *protocol.RequestHeader, request *protocol.ChanceUpdate |
|
|
updateMap["AuditTemplateConfig"] = common.AssertJson(auditConfig)
|
|
|
updateMap["Content"] = request.Content
|
|
|
updateMap["SourceContent"] = common.AssertJson(request.FormList)
|
|
|
updateMap["DepartmentId"] = request.RelatedDepartment
|
|
|
|
|
|
if err = utils.UpdateTableByMapWithOrmer(orm, &models.Chance{Id: chance.Id}, updateMap); err != nil {
|
|
|
log.Error(err)
|
...
|
...
|
@@ -951,12 +952,27 @@ func getDepartmentors(header *protocol.RequestHeader, relatedDeparmentId int64) |
|
|
log.Error(relatedDeparmentId, err)
|
|
|
return
|
|
|
}
|
|
|
if len(departments.Managers) > 0 {
|
|
|
var tmpIds []int64
|
|
|
if err = json.Unmarshal([]byte(departments.Managers), &tmpIds); err == nil {
|
|
|
if len(tmpIds) > 0 {
|
|
|
ids = append(ids, tmpIds...)
|
|
|
for {
|
|
|
if len(departments.Managers) > 0 {
|
|
|
var tmpIds []int64
|
|
|
if e := json.Unmarshal([]byte(departments.Managers), &tmpIds); e == nil {
|
|
|
if len(tmpIds) > 0 {
|
|
|
ids = append(ids, tmpIds...)
|
|
|
}
|
|
|
break
|
|
|
} else {
|
|
|
log.Error(e)
|
|
|
}
|
|
|
//break
|
|
|
}
|
|
|
if departments.ParentId != 0 {
|
|
|
if departments, err = models.GetDepartmentById(int(relatedDeparmentId)); err != nil {
|
|
|
log.Error(relatedDeparmentId, err)
|
|
|
err = nil
|
|
|
break
|
|
|
}
|
|
|
} else {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
//部门长不存在
|
...
|
...
|
|