作者 tangxvhui

日常保存

... ... @@ -2,6 +2,9 @@
- 开发环境服务器地址:http://allied-creation-manufacture-dev.fjmaimaimai.com
- 测试环境服务器地址: http://allied-creation-manufacture-test.fjmaimaimai.com
- 前端调用的地址 http://allied-creation-gateway-dev.fjmaimaimai.com/v1/manufacture
- 前端调用的地址 http://allied-creation-gateway-test.fjmaimaimai.com/v1/manufacture
## 1.数据导入导出模块
### 1.1.Excel导入流程
... ...
... ... @@ -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
}
... ...