...
|
...
|
@@ -570,10 +570,10 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate |
|
|
Weigh: weigh,
|
|
|
WeighBefore: weigh,
|
|
|
WeighAfter: weigh,
|
|
|
ApproveStatus: domain.ProductRecordAutoApproved,
|
|
|
ApproveStatus: domain.ProductRecordNotApprove,
|
|
|
ApproveAt: nowTime.Unix(),
|
|
|
ApproveUser: operateUser,
|
|
|
UnitConversionId: 0,
|
|
|
UnitConversionId: productPlanData.Ext.ProductPlanExt.ProductId,
|
|
|
ProductPlanId: productPlanData.ProductPlanId,
|
|
|
PlanProductName: productPlanData.PlanProductName,
|
|
|
BatchNumber: productPlanData.BatchNumber,
|
...
|
...
|
@@ -588,9 +588,22 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate |
|
|
}
|
|
|
productRecordList = append(productRecordList, tempItem)
|
|
|
}
|
|
|
|
|
|
if len(failRows) > 0 {
|
|
|
return failRows, nil
|
|
|
}
|
|
|
productRecordRepo, _ := factory.CreateProductRecordRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
for i := range productRecordList {
|
|
|
_, err := productRecordRepo.Save(productRecordList[i])
|
|
|
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())
|
|
|
}
|
|
|
//自动审核
|
|
|
//
|
|
|
return nil, nil
|
|
|
} |
...
|
...
|
|