...
|
...
|
@@ -89,6 +89,18 @@ func (srv ProductTroubleService) SaveProductTrouble(operateInfo *domain.OperateI |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
if param.SaveAndApprove {
|
|
|
var approveUser *domain.User
|
|
|
userService := domainService.NewUserService()
|
|
|
approveUser, err = userService.User(operateInfo.UserId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "获取审核人信息失败,"+err.Error())
|
|
|
}
|
|
|
err = troubleData.Approve(approveUser)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
_, err = productTroubleRepo.Save(troubleData)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -174,6 +186,10 @@ func (srv ProductTroubleService) DeleteProductTrouble(id int64) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// func (srv ProductTroubleService) approveProductTrouble(operateInfo *domain.OperateInfo, param *domain.ProductTrouble) error {
|
|
|
// return nil
|
|
|
// }
|
|
|
|
|
|
func (srv ProductTroubleService) ApproveProductTrouble(operateInfo *domain.OperateInfo, id int64) error {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
|