作者 tangxvhui

日常保存

@@ -2,6 +2,9 @@ @@ -2,6 +2,9 @@
2 2
3 - 开发环境服务器地址:http://allied-creation-manufacture-dev.fjmaimaimai.com 3 - 开发环境服务器地址:http://allied-creation-manufacture-dev.fjmaimaimai.com
4 - 测试环境服务器地址: http://allied-creation-manufacture-test.fjmaimaimai.com 4 - 测试环境服务器地址: http://allied-creation-manufacture-test.fjmaimaimai.com
  5 +
  6 +- 前端调用的地址 http://allied-creation-gateway-dev.fjmaimaimai.com/v1/manufacture
  7 +- 前端调用的地址 http://allied-creation-gateway-test.fjmaimaimai.com/v1/manufacture
5 ## 1.数据导入导出模块 8 ## 1.数据导入导出模块
6 9
7 ### 1.1.Excel导入流程 10 ### 1.1.Excel导入流程
@@ -570,10 +570,10 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate @@ -570,10 +570,10 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate
570 Weigh: weigh, 570 Weigh: weigh,
571 WeighBefore: weigh, 571 WeighBefore: weigh,
572 WeighAfter: weigh, 572 WeighAfter: weigh,
573 - ApproveStatus: domain.ProductRecordAutoApproved, 573 + ApproveStatus: domain.ProductRecordNotApprove,
574 ApproveAt: nowTime.Unix(), 574 ApproveAt: nowTime.Unix(),
575 ApproveUser: operateUser, 575 ApproveUser: operateUser,
576 - UnitConversionId: 0, 576 + UnitConversionId: productPlanData.Ext.ProductPlanExt.ProductId,
577 ProductPlanId: productPlanData.ProductPlanId, 577 ProductPlanId: productPlanData.ProductPlanId,
578 PlanProductName: productPlanData.PlanProductName, 578 PlanProductName: productPlanData.PlanProductName,
579 BatchNumber: productPlanData.BatchNumber, 579 BatchNumber: productPlanData.BatchNumber,
@@ -588,9 +588,22 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate @@ -588,9 +588,22 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate
588 } 588 }
589 productRecordList = append(productRecordList, tempItem) 589 productRecordList = append(productRecordList, tempItem)
590 } 590 }
591 - 591 + if len(failRows) > 0 {
  592 + return failRows, nil
  593 + }
  594 + productRecordRepo, _ := factory.CreateProductRecordRepository(map[string]interface{}{
  595 + "transactionContext": transactionContext,
  596 + })
  597 + for i := range productRecordList {
  598 + _, err := productRecordRepo.Save(productRecordList[i])
  599 + if err != nil {
  600 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  601 + }
  602 + }
592 if err := transactionContext.CommitTransaction(); err != nil { 603 if err := transactionContext.CommitTransaction(); err != nil {
593 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 604 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
594 } 605 }
  606 + //自动审核
  607 + //
595 return nil, nil 608 return nil, nil
596 } 609 }