...
|
...
|
@@ -261,11 +261,19 @@ func (productMaterialService *ProductMaterialService) UpdateProductMaterial(oper |
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
productMaterialRepository, productMaterial, err := factory.FastProductMaterial(transactionContext, cmd.ProductMaterialId)
|
|
|
|
|
|
var productMaterialRepository domain.ProductMaterialRepository
|
|
|
if value, err := factory.CreateProductMaterialRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
productMaterialRepository = value
|
|
|
}
|
|
|
productMaterial, err := productMaterialRepository.FindOne(map[string]interface{}{"companyId": operateInfo.CompanyId, "productMaterialId": cmd.ProductMaterialId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
productMaterial.ProductMaterialGroupId = cmd.ProductMaterialGroupId
|
|
|
productMaterial.MaterialName = cmd.MaterialName
|
|
|
productMaterial.MaterialAttribute.Attribute = cmd.MaterialAttribute
|
...
|
...
|
|