...
|
...
|
@@ -35,6 +35,10 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs |
|
|
err = protocol.NewErrWithMessage("10064")
|
|
|
return
|
|
|
}
|
|
|
if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil {
|
|
|
err = protocol.NewErrWithMessage("10271")
|
|
|
return
|
|
|
}
|
|
|
orm := orm2.NewOrm()
|
|
|
//模板
|
|
|
{
|
...
|
...
|
@@ -156,6 +160,10 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques |
|
|
log.Error("template_id:%v 不存在 ,err:%v", request.Template.Id, err.Error())
|
|
|
return
|
|
|
}
|
|
|
if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil {
|
|
|
err = protocol.NewErrWithMessage("10271")
|
|
|
return
|
|
|
}
|
|
|
orm := orm2.NewOrm()
|
|
|
//模板
|
|
|
{
|
...
|
...
|
@@ -549,6 +557,10 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe |
|
|
log.Error("template_id:%v companyId:%v want:%v not equal.", request.Id, companyId, chanceType.CompanyId)
|
|
|
return
|
|
|
}
|
|
|
if _, err = models.GetChanceTypeByName(companyId, chanceType.Name); err == nil {
|
|
|
err = protocol.NewErrWithMessage("10271")
|
|
|
return
|
|
|
}
|
|
|
if err = utils.UpdateTableByMap(chanceType, map[string]interface{}{"Name": request.Name, "Icon": request.Icon, "SortNum": chanceType.SortNum, "UpdateAt": time.Now()}); err != nil {
|
|
|
log.Error(err.Error())
|
|
|
return
|
...
|
...
|
@@ -572,6 +584,10 @@ func TemplateOperateCategory(uid, companyId int64, request *protocol.TemplateOpe |
|
|
err = protocol.NewErrWithMessage("10064")
|
|
|
return
|
|
|
}
|
|
|
if _, err = models.GetChanceTypeByName(companyId, chanceType.Name); err == nil {
|
|
|
err = protocol.NewErrWithMessage("10271")
|
|
|
return
|
|
|
}
|
|
|
if _, err = models.AddChanceType(chanceType); err != nil {
|
|
|
log.Error(err.Error())
|
|
|
}
|
...
|
...
|
|