...
|
...
|
@@ -28,7 +28,7 @@ func PositionAdd(param protocol.RequestPositionAdd) (*protocol.ResponsePositionI |
|
|
DeleteAt: time.Unix(0, 0),
|
|
|
ParentId: param.ParentID,
|
|
|
}
|
|
|
ok := models.ExistPositiontName(param.ParentID, param.Name)
|
|
|
ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name)
|
|
|
if ok {
|
|
|
return nil, protocol.NewErrWithMessage("10013")
|
|
|
}
|
...
|
...
|
@@ -106,7 +106,13 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio |
|
|
log.Error(e.Error())
|
|
|
return nil, protocol.NewErrWithMessage("1", e)
|
|
|
}
|
|
|
positionUpdate.Name = param.Name
|
|
|
if positionUpdate.Name != param.Name {
|
|
|
ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name)
|
|
|
if ok {
|
|
|
return nil, protocol.NewErrWithMessage("10013")
|
|
|
}
|
|
|
positionUpdate.Name = param.Name
|
|
|
}
|
|
|
positionUpdate.UpdateAt = nowTime
|
|
|
err = models.UpdatePositionById(positionUpdate, []string{"Name", "UpdateAt"})
|
|
|
if err != nil {
|
...
|
...
|
|