...
|
...
|
@@ -79,7 +79,7 @@ func FastPgWorkstation(transactionContext application.TransactionContext, worksh |
|
|
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"workshopId": workshopId}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该工作位置不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -113,7 +113,7 @@ func FastPgProductJob(transactionContext application.TransactionContext, id int, |
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该工位不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -142,7 +142,7 @@ func FastPgProductGroup(transactionContext application.TransactionContext, id in |
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该生产班组不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -171,7 +171,7 @@ func FastPgProduct(transactionContext application.TransactionContext, id int, op |
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该产品不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -197,7 +197,7 @@ func FastPgDevice(transactionContext application.TransactionContext, id int, opt |
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该设备档案不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -223,7 +223,7 @@ func FastPgProductCalendar(transactionContext application.TransactionContext, id |
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间日历不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -249,7 +249,7 @@ func FastPgUnitConversion(transactionContext application.TransactionContext, id |
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该单位换算不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -273,9 +273,9 @@ func FastPgProductPlan(transactionContext application.TransactionContext, id int |
|
|
rep = value
|
|
|
}
|
|
|
if id > 0 {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productJobId": id}); err != nil {
|
|
|
if mod, err = rep.FindOne(map[string]interface{}{"productPlanId": id}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该车间不存在")
|
|
|
return nil, nil, application.ThrowError(application.RES_NO_FIND_ERROR, "该生产计划不存在")
|
|
|
}
|
|
|
return nil, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|