|
@@ -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
|
} |