Browse Source

历史排班

28169 1 year ago
parent
commit
f6c0f5b617

+ 4 - 5
controllers/base_api_controller.go View File

73
 		var userAdmin models.AdminUser
73
 		var userAdmin models.AdminUser
74
 		userAdmin.Id = 1448
74
 		userAdmin.Id = 1448
75
 		userAdmin.Mobile = "15717313968"
75
 		userAdmin.Mobile = "15717313968"
76
-
77
 		userAdmin.Id = 1 //4,809
76
 		userAdmin.Id = 1 //4,809
78
 		userAdmin.Mobile = "12222222222"
77
 		userAdmin.Mobile = "12222222222"
79
 		userAdmin.IsSuperAdmin = true
78
 		userAdmin.IsSuperAdmin = true
82
 		userAdmin.ModifyTime = 1530786071
81
 		userAdmin.ModifyTime = 1530786071
83
 		var subscibe models.ServeSubscibe
82
 		var subscibe models.ServeSubscibe
84
 		subscibe.ID = 11
83
 		subscibe.ID = 11
85
-		subscibe.OrgId = 9671 //机构id
84
+		subscibe.OrgId = 3877 //机构id
86
 		subscibe.PeriodStart = 1547447814
85
 		subscibe.PeriodStart = 1547447814
87
 		subscibe.PeriodEnd = 1550039814
86
 		subscibe.PeriodEnd = 1550039814
88
 		subscibe.State = 1
87
 		subscibe.State = 1
92
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
 		subscibes[4] = &subscibe
92
 		subscibes[4] = &subscibe
94
 		var adminUserInfo service.AdminUserInfo
93
 		var adminUserInfo service.AdminUserInfo
95
-		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
94
+		adminUserInfo.CurrentOrgId = 3877 //机构id小英9675或4
96
 		adminUserInfo.CurrentAppId = 3244 //4
95
 		adminUserInfo.CurrentAppId = 3244 //4
97
 		adminUserInfo.AdminUser = &userAdmin
96
 		adminUserInfo.AdminUser = &userAdmin
98
 		adminUserInfo.Subscibes = subscibes
97
 		adminUserInfo.Subscibes = subscibes
328
 		userAdmin.ModifyTime = 1530786071
327
 		userAdmin.ModifyTime = 1530786071
329
 		var subscibe models.ServeSubscibe
328
 		var subscibe models.ServeSubscibe
330
 		subscibe.ID = 11
329
 		subscibe.ID = 11
331
-		subscibe.OrgId = 9671 //机构id小英9675或4
330
+		subscibe.OrgId = 3877 //机构id小英9675或4
332
 		subscibe.PeriodStart = 1538035409
331
 		subscibe.PeriodStart = 1538035409
333
 		subscibe.PeriodEnd = 1569571409
332
 		subscibe.PeriodEnd = 1569571409
334
 		subscibe.State = 1
333
 		subscibe.State = 1
338
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
337
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
 		subscibes[4] = &subscibe
338
 		subscibes[4] = &subscibe
340
 		var adminUserInfo service.AdminUserInfo
339
 		var adminUserInfo service.AdminUserInfo
341
-		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
340
+		adminUserInfo.CurrentOrgId = 3877 //机构id小英9675或4
342
 		adminUserInfo.CurrentAppId = 3244 //4
341
 		adminUserInfo.CurrentAppId = 3244 //4
343
 		adminUserInfo.AdminUser = &userAdmin
342
 		adminUserInfo.AdminUser = &userAdmin
344
 		adminUserInfo.Subscibes = subscibes
343
 		adminUserInfo.Subscibes = subscibes

+ 14 - 14
controllers/his_api_controller.go View File

3076
 
3076
 
3077
 							}
3077
 							}
3078
 
3078
 
3079
-							if adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10265 {
3080
-
3081
-								if p.Type == 3 {
3082
-									//查询该耗材是否停用
3083
-									goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
3084
-									//表示该耗材已经停用,不能保存
3085
-									if goodInfoSeven.ID == 0 {
3086
-										goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3087
-										c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
3088
-										return
3089
-									}
3090
-								}
3091
-
3092
-							}
3079
+							//if adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10265 {
3080
+							//
3081
+							//	if p.Type == 3 {
3082
+							//		//查询该耗材是否停用
3083
+							//		goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
3084
+							//		//表示该耗材已经停用,不能保存
3085
+							//		if goodInfoSeven.ID == 0 {
3086
+							//			goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3087
+							//			c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
3088
+							//			return
3089
+							//		}
3090
+							//	}
3091
+							//
3092
+							//}
3093
 
3093
 
3094
 							service.CreateHisProjectTwo(&p)
3094
 							service.CreateHisProjectTwo(&p)
3095
 							//记录日志
3095
 							//记录日志

+ 3 - 0
controllers/patient_dataconfig_api_controller.go View File

1535
 		xuanzhuan_a := dataBody["xuanzhuan_a"].(float64)
1535
 		xuanzhuan_a := dataBody["xuanzhuan_a"].(float64)
1536
 		xuanzhuan_v := dataBody["xuanzhuan_v"].(float64)
1536
 		xuanzhuan_v := dataBody["xuanzhuan_v"].(float64)
1537
 
1537
 
1538
+		img_url := dataBody["img_url"].(string)
1539
+
1538
 		deviceValsualMap := models.XtDeviceValsualMap{
1540
 		deviceValsualMap := models.XtDeviceValsualMap{
1539
 			ID:             id,
1541
 			ID:             id,
1540
 			PatientId:      patient_id,
1542
 			PatientId:      patient_id,
1569
 			XuanzhuanV:     xuanzhuan_v,
1571
 			XuanzhuanV:     xuanzhuan_v,
1570
 			ALeft:          left_a,
1572
 			ALeft:          left_a,
1571
 			VLeft:          left_v,
1573
 			VLeft:          left_v,
1574
+			ImgUrl:         img_url,
1572
 		}
1575
 		}
1573
 
1576
 
1574
 		err = service.CreateDeviceValsualMap(deviceValsualMap)
1577
 		err = service.CreateDeviceValsualMap(deviceValsualMap)

+ 1 - 0
controllers/sign_api_controller.go View File

72
 	beego.Router("/api/device/getenterprisedetail", &SignApiController{}, "Get:GetEnterPriseDetail")
72
 	beego.Router("/api/device/getenterprisedetail", &SignApiController{}, "Get:GetEnterPriseDetail")
73
 
73
 
74
 	beego.Router("/api/device/uploadprintorder", &SignApiController{}, "Post:UploadPrintOrder")
74
 	beego.Router("/api/device/uploadprintorder", &SignApiController{}, "Post:UploadPrintOrder")
75
+
75
 }
76
 }
76
 
77
 
77
 // 短信服务接口
78
 // 短信服务接口

+ 1 - 1
controllers/verify_login_controller.go View File

188
 
188
 
189
 			//查询该机构是否存在医护排班
189
 			//查询该机构是否存在医护排班
190
 			_, errcode := service.GetDoctorScheduleByOrgId(curOrg.Id)
190
 			_, errcode := service.GetDoctorScheduleByOrgId(curOrg.Id)
191
-			fmt.Println("errcode2------------------", errcode)
191
+
192
 			//如果没有就插入
192
 			//如果没有就插入
193
 			if errcode == gorm.ErrRecordNotFound {
193
 			if errcode == gorm.ErrRecordNotFound {
194
 				err = service.BatchInsertDoctorSchedule(curOrg.Id)
194
 				err = service.BatchInsertDoctorSchedule(curOrg.Id)

+ 1 - 0
models/patient_models.go View File

2161
 	XuanzhuanV                   float64                         `gorm:"column:xuanzhuan_v" json:"xuanzhuan_v" form:"xuanzhuan_v"`
2161
 	XuanzhuanV                   float64                         `gorm:"column:xuanzhuan_v" json:"xuanzhuan_v" form:"xuanzhuan_v"`
2162
 	ALeft                        float64                         `gorm:"column:a_left" json:"a_left" form:"a_left"`
2162
 	ALeft                        float64                         `gorm:"column:a_left" json:"a_left" form:"a_left"`
2163
 	VLeft                        float64                         `gorm:"column:v_left" json:"v_left" form:"v_left"`
2163
 	VLeft                        float64                         `gorm:"column:v_left" json:"v_left" form:"v_left"`
2164
+	ImgUrl                       string                          `gorm:"column:img_url" json:"img_url" form:"img_url"`
2164
 	XtDeviceValsualALeft         []*XtDeviceValsualALeft         `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualALeft"`
2165
 	XtDeviceValsualALeft         []*XtDeviceValsualALeft         `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualALeft"`
2165
 	XtDeviceValsualMapFangxiangA []*XtDeviceValsualMapFangxiangA `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangA"`
2166
 	XtDeviceValsualMapFangxiangA []*XtDeviceValsualMapFangxiangA `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangA"`
2166
 	XtDeviceValsualMapFangxiangV []*XtDeviceValsualMapFangxiangV `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangV"`
2167
 	XtDeviceValsualMapFangxiangV []*XtDeviceValsualMapFangxiangV `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangV"`

+ 93 - 53
service/new_warehouse_service.go View File

1520
 			sum_count += its.StockMaxNumber + its.StockMinNumber
1520
 			sum_count += its.StockMaxNumber + its.StockMinNumber
1521
 		}
1521
 		}
1522
 
1522
 
1523
-		warehouseOutInfo := &models.DrugWarehouseOutInfo{
1524
-			WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1525
-			WarehouseOutId:          warehouseout.ID,
1526
-			Status:                  1,
1527
-			Ctime:                   advice.RecordDate,
1528
-			Mtime:                   time.Now().Unix(),
1529
-			Remark:                  warehouse.Remark,
1530
-			OrgId:                   orgID,
1531
-			Type:                    1,
1532
-			Manufacturer:            warehouse.Manufacturer,
1533
-			Dealer:                  warehouse.Dealer,
1534
-			IsSys:                   1,
1535
-			SysRecordTime:           advice.RecordDate,
1536
-			DrugId:                  advice.DrugId,
1537
-			Number:                  warehouse.Number,
1538
-			BatchNumber:             warehouse.BatchNumber,
1539
-			Price:                   warehouse.RetailPrice,
1540
-			CountUnit:               drup.MinUnit,
1541
-			RetailPrice:             warehouse.RetailPrice,
1542
-			ProductDate:             warehouse.ProductDate,
1543
-			ExpiryDate:              warehouse.ExpiryDate,
1544
-			PatientId:               advice.PatientId,
1545
-			Count:                   deliver_number, //出最小单位
1546
-			WarehouseInfoId:         warehouse.ID,
1547
-			SupplyWarehouseId:       warehouse.SupplyWarehouseId,
1548
-			StorehouseId:            storeConfig.DrugStorehouseOut,
1549
-			IsCheck:                 1,
1550
-			OverCount:               sum_count,
1551
-			AdviceId:                advice.ID,
1552
-		}
1523
+		if orgID != 10188 && orgID != 10217 && orgID != 3877 && orgID != 9671 {
1524
+			warehouseOutInfo := &models.DrugWarehouseOutInfo{
1525
+				WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1526
+				WarehouseOutId:          warehouseout.ID,
1527
+				Status:                  1,
1528
+				Ctime:                   advice.RecordDate,
1529
+				Mtime:                   time.Now().Unix(),
1530
+				Remark:                  warehouse.Remark,
1531
+				OrgId:                   orgID,
1532
+				Type:                    1,
1533
+				Manufacturer:            warehouse.Manufacturer,
1534
+				Dealer:                  warehouse.Dealer,
1535
+				IsSys:                   1,
1536
+				SysRecordTime:           advice.RecordDate,
1537
+				DrugId:                  advice.DrugId,
1538
+				Number:                  warehouse.Number,
1539
+				BatchNumber:             warehouse.BatchNumber,
1540
+				Price:                   warehouse.RetailPrice,
1541
+				CountUnit:               drup.MinUnit,
1542
+				RetailPrice:             warehouse.RetailPrice,
1543
+				ProductDate:             warehouse.ProductDate,
1544
+				ExpiryDate:              warehouse.ExpiryDate,
1545
+				PatientId:               advice.PatientId,
1546
+				Count:                   deliver_number, //出最小单位
1547
+				WarehouseInfoId:         warehouse.ID,
1548
+				SupplyWarehouseId:       warehouse.SupplyWarehouseId,
1549
+				StorehouseId:            storeConfig.DrugStorehouseOut,
1550
+				IsCheck:                 1,
1551
+				OverCount:               sum_count,
1552
+				AdviceId:                advice.ID,
1553
+			}
1553
 
1554
 
1554
-		//查询今日该药品该患者是否有出库数据
1555
-		lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1556
-		if lastDrugOutInfo.ID == 0 {
1557
-			errOne := AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1558
-			if errOne != nil {
1559
-				drugError := models.XtDrugError{
1560
-					UserOrgId:             orgID,
1561
-					DrugId:                advice.DrugId,
1562
-					RecordDate:            advice.AdviceDate,
1563
-					PatientId:             advice.PatientId,
1564
-					Remark:                "创建出库单失败",
1565
-					Status:                1,
1566
-					Ctime:                 time.Now().Unix(),
1567
-					Mtime:                 0,
1568
-					SumCount:              0,
1569
-					Prescribingnumber:     advice.PrescribingNumber,
1570
-					PrescribingNumberUnit: advice.PrescribingNumberUnit,
1555
+			//查询今日该药品该患者是否有出库数据
1556
+			lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1557
+			if lastDrugOutInfo.ID == 0 {
1558
+				errOne := AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1559
+				if errOne != nil {
1560
+					drugError := models.XtDrugError{
1561
+						UserOrgId:             orgID,
1562
+						DrugId:                advice.DrugId,
1563
+						RecordDate:            advice.AdviceDate,
1564
+						PatientId:             advice.PatientId,
1565
+						Remark:                "创建出库单失败",
1566
+						Status:                1,
1567
+						Ctime:                 time.Now().Unix(),
1568
+						Mtime:                 0,
1569
+						SumCount:              0,
1570
+						Prescribingnumber:     advice.PrescribingNumber,
1571
+						PrescribingNumberUnit: advice.PrescribingNumberUnit,
1572
+					}
1573
+					CreateDrugError(drugError)
1571
 				}
1574
 				}
1572
-				CreateDrugError(drugError)
1573
 			}
1575
 			}
1574
-		}
1575
-		if lastDrugOutInfo.ID > 0 {
1576
+			if lastDrugOutInfo.ID > 0 {
1576
 
1577
 
1577
-			//删除在新增
1578
-			UpdateDrugWarehouseOutInfoTen(lastDrugOutInfo.PatientId, lastDrugOutInfo.SysRecordTime, advice.ID)
1578
+				//删除在新增
1579
+				UpdateDrugWarehouseOutInfoTen(lastDrugOutInfo.PatientId, lastDrugOutInfo.SysRecordTime, advice.ID)
1579
 
1580
 
1580
-			AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1581
+				AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1581
 
1582
 
1583
+			}
1582
 		}
1584
 		}
1583
 
1585
 
1584
 		var out_count int64
1586
 		var out_count int64
1602
 		fmt.Println("查收嗖嗖嗖哦", deliver_number_one-(out_count-cancel_count))
1604
 		fmt.Println("查收嗖嗖嗖哦", deliver_number_one-(out_count-cancel_count))
1603
 		if deliver_number_one-(out_count-cancel_count) >= 0 {
1605
 		if deliver_number_one-(out_count-cancel_count) >= 0 {
1604
 			if (deliver_number_one - out_count - cancel_count) != 0 {
1606
 			if (deliver_number_one - out_count - cancel_count) != 0 {
1607
+
1608
+				if orgID == 10217 || orgID == 10188 || orgID == 3877 || orgID == 9671 {
1609
+					warehouseOutInfo := &models.DrugWarehouseOutInfo{
1610
+						WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1611
+						WarehouseOutId:          warehouseout.ID,
1612
+						Status:                  1,
1613
+						Ctime:                   advice.RecordDate,
1614
+						Mtime:                   time.Now().Unix(),
1615
+						Remark:                  warehouse.Remark,
1616
+						OrgId:                   orgID,
1617
+						Type:                    1,
1618
+						Manufacturer:            warehouse.Manufacturer,
1619
+						Dealer:                  warehouse.Dealer,
1620
+						IsSys:                   1,
1621
+						SysRecordTime:           advice.RecordDate,
1622
+						DrugId:                  advice.DrugId,
1623
+						Number:                  warehouse.Number,
1624
+						BatchNumber:             warehouse.BatchNumber,
1625
+						Price:                   warehouse.RetailPrice,
1626
+						CountUnit:               drup.MinUnit,
1627
+						RetailPrice:             warehouse.RetailPrice,
1628
+						ProductDate:             warehouse.ProductDate,
1629
+						ExpiryDate:              warehouse.ExpiryDate,
1630
+						PatientId:               advice.PatientId,
1631
+						Count:                   deliver_number_one - (out_count - cancel_count), //出最小单位
1632
+						WarehouseInfoId:         warehouse.ID,
1633
+						SupplyWarehouseId:       warehouse.SupplyWarehouseId,
1634
+						StorehouseId:            storeConfig.DrugStorehouseOut,
1635
+						IsCheck:                 1,
1636
+						OverCount:               sum_count,
1637
+						AdviceId:                advice.ID,
1638
+					}
1639
+
1640
+					AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1641
+
1642
+				}
1643
+				lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1644
+
1605
 				drugflow := models.DrugFlow{
1645
 				drugflow := models.DrugFlow{
1606
 					WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1646
 					WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1607
 					WarehouseOutId:          warehouseout.ID,
1647
 					WarehouseOutId:          warehouseout.ID,

+ 9 - 0
service/sign_service.go View File

1372
 	fmt.Println("strwwoowowow", str)
1372
 	fmt.Println("strwwoowowow", str)
1373
 	return str
1373
 	return str
1374
 }
1374
 }
1375
+
1376
+func GetDataConfigDisinfectionFluid(org_id int64) (models.Dataconfig, error) {
1377
+
1378
+	dataconfig := models.Dataconfig{}
1379
+
1380
+	err := XTReadDB().Where("org_id = ? and status =1 and id =12536", org_id).Find(&dataconfig).Error
1381
+
1382
+	return dataconfig, err
1383
+}