Browse Source

提交代码

陈少旭 1 year ago
parent
commit
65d593bebf
1 changed files with 13 additions and 13 deletions
  1. 13 13
      service/pharmacy_service.go

+ 13 - 13
service/pharmacy_service.go View File

1438
 	for _, v := range lib {
1438
 	for _, v := range lib {
1439
 		v := v
1439
 		v := v
1440
 		g.Go(func() error {
1440
 		g.Go(func() error {
1441
-			//var tmp models.Manufacturer
1442
-			//err := readDb.Model(&models.Manufacturer{}).Where("id = ?", v.Manufacturer).Find(&tmp).Error
1443
-			//if err != nil {
1444
-			//	return err
1445
-			//}
1441
+			var tmp models.Manufacturer
1442
+			err := readDb.Model(&models.Manufacturer{}).Where("id = ?", v.Manufacturer).Find(&tmp).Error
1443
+			if err != nil {
1444
+				return err
1445
+			}
1446
 
1446
 
1447
 			lock.Lock()
1447
 			lock.Lock()
1448
 
1448
 
1457
 			} else {
1457
 			} else {
1458
 				list = append(list, &models.ReplacementDrugs{
1458
 				list = append(list, &models.ReplacementDrugs{
1459
 					Id:   v.ID,
1459
 					Id:   v.ID,
1460
-					Name: v.DrugName + " " + v.Dose + v.DoseUnit + "*" + config.ToString(v.MinNumber) + v.MinUnit + "/" + v.MaxUnit + " " + v.Number,
1460
+					Name: v.DrugName + " " + v.Dose + v.DoseUnit + "*" + config.ToString(v.MinNumber) + v.MinUnit + "/" + v.MaxUnit + " " + tmp.ManufacturerName,
1461
 				})
1461
 				})
1462
 				lock.Unlock()
1462
 				lock.Unlock()
1463
 			}
1463
 			}
1479
 		return
1479
 		return
1480
 	}
1480
 	}
1481
 	for _, v := range lib {
1481
 	for _, v := range lib {
1482
-		//var tmp models.Manufacturer
1483
-		//err = readDb.Model(&models.Manufacturer{}).Where("id = ?", v.Manufacturer).Find(&tmp).Error
1484
-		//if err != nil {
1485
-		//	return
1486
-		//}
1482
+		var tmp models.Manufacturer
1483
+		err = readDb.Model(&models.Manufacturer{}).Where("id = ?", v.Manufacturer).Find(&tmp).Error
1484
+		if err != nil {
1485
+			return
1486
+		}
1487
 
1487
 
1488
 		if orgid == 10206 {
1488
 		if orgid == 10206 {
1489
 			list = append(list, &models.ReplacementDrugs{
1489
 			list = append(list, &models.ReplacementDrugs{
1494
 		} else {
1494
 		} else {
1495
 			list = append(list, &models.ReplacementDrugs{
1495
 			list = append(list, &models.ReplacementDrugs{
1496
 				Id:   v.ID,
1496
 				Id:   v.ID,
1497
-				Name: v.DrugName + " " + v.Dose + v.DoseUnit + "*" + config.ToString(v.MinNumber) + v.MinUnit + "/" + v.PrescribingNumberUnit + " " + v.Number,
1497
+				Name: v.DrugName + " " + v.Dose + v.DoseUnit + "*" + config.ToString(v.MinNumber) + v.MinUnit + "/" + v.PrescribingNumberUnit + " " + tmp.ManufacturerName,
1498
 			})
1498
 			})
1499
 		}
1499
 		}
1500
 	}
1500
 	}
1581
 	for _, v := range good {
1581
 	for _, v := range good {
1582
 		list = append(list, &models.DropDownList{
1582
 		list = append(list, &models.DropDownList{
1583
 			Id:   "i" + config.ToString(v.ID),
1583
 			Id:   "i" + config.ToString(v.ID),
1584
-			Name: v.GoodName + " " + v.SpecificationName,
1584
+			Name: v.GoodName + " " + v.SpecificationName + " " + v.GoodNumber,
1585
 		})
1585
 		})
1586
 	}
1586
 	}
1587
 
1587