作者 yangfu

Merge branch 'feature_material' of http://gitlab.fjmaimaimai.com/allied-creation…

…/allied-creation-manufacture into feature_material
... ... @@ -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
... ...