28169 il y a 1 an
Parent
révision
8e84e72dff

+ 8 - 4
controllers/his_api_controller.go Voir le fichier

1648
 				if info.RetailPrice > 0 {
1648
 				if info.RetailPrice > 0 {
1649
 					subItem.Drug.MinPrice = info.RetailPrice
1649
 					subItem.Drug.MinPrice = info.RetailPrice
1650
 
1650
 
1651
-					service.UpdatePrescriptionAdvice(subItem.DrugId, admin.CurrentOrgId, info.RetailPrice, subItem.PatientId)
1651
+					if admin.CurrentOrgId != 10598 {
1652
 
1652
 
1653
-					service.UpdateBaseMinPrice(subItem.DrugId, admin.CurrentOrgId, info.RetailPrice)
1653
+						service.UpdatePrescriptionAdvice(subItem.DrugId, admin.CurrentOrgId, info.RetailPrice, subItem.PatientId)
1654
+						service.UpdateBaseMinPrice(subItem.DrugId, admin.CurrentOrgId, info.RetailPrice)
1655
+					}
1654
 
1656
 
1655
 				}
1657
 				}
1656
 			}
1658
 			}
1665
 					if info.Price > 0 {
1667
 					if info.Price > 0 {
1666
 						subItem.GoodInfo.PackingPrice = info.Price
1668
 						subItem.GoodInfo.PackingPrice = info.Price
1667
 
1669
 
1668
-						service.UpdatePrescriptionProject(subItem.ProjectId, admin.CurrentOrgId, info.Price, subItem.PatientId)
1670
+						if admin.CurrentOrgId != 10598 {
1669
 
1671
 
1670
-						service.UpdateGood(subItem.ProjectId, admin.CurrentOrgId, info.Price)
1672
+							service.UpdatePrescriptionProject(subItem.ProjectId, admin.CurrentOrgId, info.Price, subItem.PatientId)
1673
+							service.UpdateGood(subItem.ProjectId, admin.CurrentOrgId, info.Price)
1674
+						}
1671
 
1675
 
1672
 					}
1676
 					}
1673
 				}
1677
 				}

+ 16 - 16
controllers/mobile_api_controllers/patient_api_controller.go Voir le fichier

1696
 				//fmt.Println("config+++++++++++", config.IsOpen)
1696
 				//fmt.Println("config+++++++++++", config.IsOpen)
1697
 				//fmt.Println("config+++++++++++", item.UserOrgId)
1697
 				//fmt.Println("config+++++++++++", item.UserOrgId)
1698
 				//
1698
 				//
1699
-				//if config.IsOpen == 1 && item.UserOrgId == 10210 {
1700
-				//
1701
-				//	service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1702
-				//	//更新字典里面的库存
1703
-				//	stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1704
-				//	var sum_count int64
1705
-				//	for _, its := range stockInfo {
1706
-				//		if its.MaxUnit == medical.MaxUnit {
1707
-				//			its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1708
-				//		}
1709
-				//		sum_count += its.StockMaxNumber + its.StockMinNumber
1710
-				//	}
1711
-				//	service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1712
-				//	//剩余库存
1713
-				//	service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1714
-				//}
1699
+				if config.IsOpen == 1 && item.UserOrgId == 10402 {
1700
+
1701
+					service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1702
+					//更新字典里面的库存
1703
+					stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1704
+					var sum_count int64
1705
+					for _, its := range stockInfo {
1706
+						if its.MaxUnit == medical.MaxUnit {
1707
+							its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1708
+						}
1709
+						sum_count += its.StockMaxNumber + its.StockMinNumber
1710
+					}
1711
+					service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1712
+					//剩余库存
1713
+					service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1714
+				}
1715
 
1715
 
1716
 			}
1716
 			}
1717
 		}
1717
 		}

+ 7 - 7
controllers/sign_api_controller.go Voir le fichier

1232
 	//	service.ModifyPatient(item.PatientId, item.Count)
1232
 	//	service.ModifyPatient(item.PatientId, item.Count)
1233
 	//}
1233
 	//}
1234
 
1234
 
1235
-	//list, _ := service.GetNewAllpatient(orgId)
1236
-	//
1237
-	//for _, item := range list {
1238
-	//	service.UpdateAllPatient(item.BloodId, item.Diagnose, item.UserOrgId)
1239
-	//}
1235
+	list, _ := service.GetNewAllpatient(orgId)
1240
 
1236
 
1241
-	list, _ := service.GetAllDialysisOrder(6963)
1242
 	for _, item := range list {
1237
 	for _, item := range list {
1243
-		service.UpdateScheduleByOrder(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType)
1238
+		service.UpdateAllPatient(item.BloodId, item.Diagnose, item.UserOrgId)
1244
 	}
1239
 	}
1245
 
1240
 
1241
+	//list, _ := service.GetAllDialysisOrder(6963)
1242
+	//for _, item := range list {
1243
+	//	service.UpdateScheduleByOrder(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType)
1244
+	//}
1245
+
1246
 	//drugList, _ := service.GetAllBaseDrugList(10571)
1246
 	//drugList, _ := service.GetAllBaseDrugList(10571)
1247
 	//for _, item := range drugList {
1247
 	//for _, item := range drugList {
1248
 	//	//service.UpdateDrugWarehouseInfoByDrug(item.ID, item.MinPrice, item.OrgId)
1248
 	//	//service.UpdateDrugWarehouseInfoByDrug(item.ID, item.MinPrice, item.OrgId)

+ 13 - 10
models/pharmacy_models.go Voir le fichier

46
 
46
 
47
 // 药品信息
47
 // 药品信息
48
 type PharmacyContent struct {
48
 type PharmacyContent struct {
49
-	Name         string //名称
50
-	SingleDosage string //单次用量
51
-	Usage        string //用法
52
-	Frequency    string //频率
53
-	Days         string //天数
54
-	Total        string //总量
55
-	Doctor       string //开立医生
56
-	DataSources  string //数据来源
57
-	Remarks      string //备注
58
-	DrugId       int64
49
+	Name           string //名称
50
+	SingleDosage   string //单次用量
51
+	Usage          string //用法
52
+	Frequency      string //频率
53
+	Days           string //天数
54
+	Total          string //总量
55
+	Doctor         string //开立医生
56
+	DataSources    string //数据来源
57
+	Remarks        string //备注
58
+	DrugId         int64
59
+	ExecutionTime  int64
60
+	ExecutionStaff int64
61
+	ExecutionState int64
59
 }
62
 }
60
 
63
 
61
 // 发药明细列表
64
 // 发药明细列表

+ 0 - 1
service/dialysis_service.go Voir le fichier

1493
 func SaveHisDoctorAdviceOne(advice *models.HisDoctorAdviceInfo, tx *gorm.DB) (err error) {
1493
 func SaveHisDoctorAdviceOne(advice *models.HisDoctorAdviceInfo, tx *gorm.DB) (err error) {
1494
 	err = tx.Save(&advice).Error
1494
 	err = tx.Save(&advice).Error
1495
 	if err != nil {
1495
 	if err != nil {
1496
-
1497
 		tx.Rollback()
1496
 		tx.Rollback()
1498
 		return
1497
 		return
1499
 	}
1498
 	}

+ 26 - 20
service/pharmacy_service.go Voir le fichier

321
 
321
 
322
 		for _, v := range tmp {
322
 		for _, v := range tmp {
323
 			pp = append(pp, &models.PharmacyContent{
323
 			pp = append(pp, &models.PharmacyContent{
324
-				Name:         v.AdviceName,
325
-				SingleDosage: config.ToString(v.SingleDose) + v.SingleDoseUnit,
326
-				Usage:        v.DeliveryWay,
327
-				Frequency:    v.ExecutionFrequency,
328
-				Days:         config.ToString(v.Day) + "天",
329
-				Total:        config.ToString(v.PrescribingNumber) + v.PrescribingNumberUnit,
330
-				Doctor:       GetAdminUserName(v.AdviceDoctor, orgid), //开立医生
331
-				DataSources:  "his处方",
332
-				Remarks:      v.Remark, //备注
333
-				DrugId:       v.DrugId,
324
+				Name:           v.AdviceName,
325
+				SingleDosage:   config.ToString(v.SingleDose) + v.SingleDoseUnit,
326
+				Usage:          v.DeliveryWay,
327
+				Frequency:      v.ExecutionFrequency,
328
+				Days:           config.ToString(v.Day) + "天",
329
+				Total:          config.ToString(v.PrescribingNumber) + v.PrescribingNumberUnit,
330
+				Doctor:         GetAdminUserName(v.AdviceDoctor, orgid), //开立医生
331
+				DataSources:    "his处方",
332
+				Remarks:        v.Remark, //备注
333
+				DrugId:         v.DrugId,
334
+				ExecutionState: v.ExecutionState,
335
+				ExecutionStaff: v.ExecutionStaff,
336
+				ExecutionTime:  v.ExecutionTime,
334
 			})
337
 			})
335
 		}
338
 		}
336
 
339
 
351
 
354
 
352
 		for _, v := range tmp_advice {
355
 		for _, v := range tmp_advice {
353
 			pp = append(pp, &models.PharmacyContent{
356
 			pp = append(pp, &models.PharmacyContent{
354
-				Name:         v.AdviceName,
355
-				SingleDosage: config.ToString(v.SingleDose) + v.SingleDoseUnit,
356
-				Usage:        v.DeliveryWay,
357
-				Frequency:    v.ExecutionFrequency,
358
-				Days:         "-",
359
-				Total:        config.ToString(v.PrescribingNumber) + v.PrescribingNumberUnit,
360
-				Doctor:       GetAdminUserName(v.AdviceDoctor, orgid),
361
-				DataSources:  "临时医嘱",
362
-				Remarks:      v.Remark,
363
-				DrugId:       v.DrugId,
357
+				Name:           v.AdviceName,
358
+				SingleDosage:   config.ToString(v.SingleDose) + v.SingleDoseUnit,
359
+				Usage:          v.DeliveryWay,
360
+				Frequency:      v.ExecutionFrequency,
361
+				Days:           "-",
362
+				Total:          config.ToString(v.PrescribingNumber) + v.PrescribingNumberUnit,
363
+				Doctor:         GetAdminUserName(v.AdviceDoctor, orgid),
364
+				DataSources:    "临时医嘱",
365
+				Remarks:        v.Remark,
366
+				DrugId:         v.DrugId,
367
+				ExecutionState: v.ExecutionState,
368
+				ExecutionStaff: v.ExecutionStaff,
369
+				ExecutionTime:  v.ExecutionTime,
364
 			})
370
 			})
365
 		}
371
 		}
366
 		return
372
 		return

+ 1 - 1
service/schedule_service.go Voir le fichier

1524
 func GetLastDialysisPrescriptionTwo(org_id int64, patient_id int64, mode_id int64, schedule_date int64) (models.NewDialysisPrescription, error) {
1524
 func GetLastDialysisPrescriptionTwo(org_id int64, patient_id int64, mode_id int64, schedule_date int64) (models.NewDialysisPrescription, error) {
1525
 
1525
 
1526
 	dialysisprescription := models.NewDialysisPrescription{}
1526
 	dialysisprescription := models.NewDialysisPrescription{}
1527
-	err := XTReadDB().Where("user_org_id = ? and patient_id = ? and mode_id = ? and status = 1 and record_date>=1704038400 and record_date<?", org_id, patient_id, mode_id, schedule_date).Order("id desc").First(&dialysisprescription).Error
1527
+	err := XTReadDB().Where("user_org_id = ? and patient_id = ? and mode_id = ? and status = 1 and record_date = ?", org_id, patient_id, mode_id, schedule_date).Order("id desc").First(&dialysisprescription).Error
1528
 	return dialysisprescription, err
1528
 	return dialysisprescription, err
1529
 
1529
 
1530
 }
1530
 }

+ 1 - 1
service/sign_service.go Voir le fichier

2099
 
2099
 
2100
 func GetNewAllpatient(org_id int64) (list []*models.XtPatientsNew, err error) {
2100
 func GetNewAllpatient(org_id int64) (list []*models.XtPatientsNew, err error) {
2101
 
2101
 
2102
-	err = XTReadDB().Where("status =1 and user_org_id =10265").Find(&list).Error
2102
+	err = XTReadDB().Where("status =1 and user_org_id =?", org_id).Find(&list).Error
2103
 
2103
 
2104
 	return list, err
2104
 	return list, err
2105
 }
2105
 }