...
|
...
|
@@ -56,16 +56,17 @@ func (srv ProductTroubleService) SaveProductTrouble(operateInfo *domain.OperateI |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
recordDate, err := time.ParseInLocation("2006-01-02", param.RecordDate, time.Local)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "日期格式错误")
|
|
|
}
|
|
|
var workerUser *domain.User
|
|
|
userService := domainService.NewUserService()
|
|
|
workerUser, err = userService.User(param.WorkerId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "获取员工信息失败,"+err.Error())
|
|
|
}
|
|
|
recordDate, err := time.ParseInLocation("2006-01-02", param.RecordDate, time.Local)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "日期格式错误")
|
|
|
}
|
|
|
var troubleData *domain.ProductTrouble
|
|
|
if param.Id > 0 {
|
|
|
troubleData, err = productTroubleRepo.FindOne(map[string]interface{}{
|
...
|
...
|
@@ -109,6 +110,7 @@ func (srv ProductTroubleService) SaveProductTrouble(operateInfo *domain.OperateI |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|