|
@@ -99,15 +99,15 @@ func SpecialtyToProcure(id int64) error {
|
|
|
var allAmount int64 = 0
|
|
|
for _, v := range newPartPurchase {
|
|
|
contractId, _ := strconv.Atoi(v.ContractId)
|
|
|
- newContract := &model.Contract{}
|
|
|
- if err := tx.Model(new(model.Contract)).Where("id = ?", contractId).First(newContract).Error; err != nil {
|
|
|
- fmt.Println("newContract", err)
|
|
|
- }
|
|
|
-
|
|
|
- bigContract := &model.BigContract{}
|
|
|
- if err := tx.Model(new(model.BigContract)).Where("id = ?", newContract.BigID).First(bigContract).Error; err != nil {
|
|
|
- fmt.Println("CreateSpecialtyPurchase", err)
|
|
|
- }
|
|
|
+ //newContract := &model.Contract{}
|
|
|
+ //if err := tx.Model(new(model.Contract)).Where("id = ?", contractId).First(newContract).Error; err != nil {
|
|
|
+ // fmt.Println("newContract", err)
|
|
|
+ //}
|
|
|
+ //
|
|
|
+ //bigContract := &model.BigContract{}
|
|
|
+ //if err := tx.Model(new(model.BigContract)).Where("id = ?", newContract.BigID).First(bigContract).Error; err != nil {
|
|
|
+ // fmt.Println("CreateSpecialtyPurchase", err)
|
|
|
+ //}
|
|
|
|
|
|
department := &model.Department{}
|
|
|
if err := tx.Model(new(model.Department)).Where("pastureId = ?", newBigPartPurchase.PastureId).
|
|
@@ -117,7 +117,7 @@ func SpecialtyToProcure(id int64) error {
|
|
|
|
|
|
price, _ := strconv.ParseFloat(v.Price, 64)
|
|
|
buyDetailList = append(buyDetailList, model.NewBuyDetail(int64(newBigBuyDetail.ID), int64(newBigBuyDetail.PastureID),
|
|
|
- v.Amount, int64(contractId), v.BrandId, newContract.PartCode, bigContract.ContractCode, v.Purpose, department.Name, price))
|
|
|
+ v.Amount, int64(contractId), v.BrandId, v.PartCode, "", v.Purpose, department.Name, price))
|
|
|
allAmount += v.Amount
|
|
|
}
|
|
|
|