...
|
...
|
@@ -347,14 +347,20 @@ func Template(header *protocol.RequestHeader, request *protocol.TemplateRequest) |
|
|
}
|
|
|
for j := range forms {
|
|
|
form := forms[j]
|
|
|
template.FormList[j] = &protocol.Form{
|
|
|
formItem := &protocol.Form{
|
|
|
Id: form.Id,
|
|
|
Label: form.Label,
|
|
|
Value: "",
|
|
|
InputType: form.InputType,
|
|
|
SectionType: form.Section,
|
|
|
Required: form.Required,
|
|
|
Data: make([]*protocol.FormDataItem, 0),
|
|
|
ValueList: make([]*protocol.ValueListItem, 0),
|
|
|
}
|
|
|
if len(form.ValueList) > 0 && form.InputType == protocol.InputRadio {
|
|
|
utils.JsonUnmarshal(form.ValueList, &formItem.ValueList)
|
|
|
}
|
|
|
template.FormList[j] = formItem
|
|
|
}
|
|
|
rsp.Template = template
|
|
|
return
|
...
|
...
|
@@ -432,7 +438,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit |
|
|
err = protocol.NewErrWithMessage(5302)
|
|
|
return
|
|
|
}
|
|
|
auditConfig = &protocol.AuditConfig{NoApprover: template.NoApprover}
|
|
|
auditConfig = &protocol.AuditConfig{NoApprover: template.NoApprover, SelfCheckNeed: template.SelfCheckNeed}
|
|
|
orm := orm.NewOrm()
|
|
|
orm.Begin()
|
|
|
//2.检查模板是否有权限
|
...
|
...
|
@@ -1590,7 +1596,9 @@ func ChancePool(header *protocol.RequestHeader, request *protocol.ChancePoolRequ |
|
|
provider *protocol.BaseUserInfo
|
|
|
flag int
|
|
|
)
|
|
|
if total, err = agg.GetChancePool(header.UserId, header.CompanyId, models.NewChancePoolOption(request.ChanceTypeId, []int{}, request.Type, request.ReserveTypeId), request.DepartmentId, request.IncludeSubDepartment, request.LastId, request.PageSize, &chanceItems); err != nil {
|
|
|
options := models.NewChancePoolOption(request.ChanceTypeId, []int{}, request.Type, request.ReserveTypeId)
|
|
|
options.SetKeyWord(request.KeyWord)
|
|
|
if total, err = agg.GetChancePool(header.UserId, header.CompanyId, options, request.DepartmentId, request.IncludeSubDepartment, request.LastId, request.PageSize, &chanceItems); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
|
|
return
|
...
|
...
|
@@ -2018,9 +2026,8 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail |
|
|
UpdateTime: chance.UpdateAt.Unix() * 1000,
|
|
|
}
|
|
|
jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
//jsonUnmarshal(chance.SelfChecks, &item.SelfChecks)
|
|
|
item.SelfChecks = agg.GetChanceSelfChecks(chance)
|
|
|
item.FormList = clearEmptyForm(item.FormList)
|
|
|
//item.FormList = clearEmptyForm(item.FormList)
|
|
|
item.RelatedDepartmentId = chance.DepartmentId
|
|
|
item.RelatedDepartmentInfo = agg.GetDepartment(int(chance.DepartmentId))
|
|
|
if chanceData, err = models.GetChanceDataByChanceId(chance.Id); err == nil {
|
...
|
...
|
|