浏览代码

历史排班

28169 1年前
父节点
当前提交
f6c0f5b617

+ 4 - 5
controllers/base_api_controller.go 查看文件

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

+ 14 - 14
controllers/his_api_controller.go 查看文件

@@ -3076,20 +3076,20 @@ func (c *HisApiController) CreateHisPrescription() {
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 3094
 							service.CreateHisProjectTwo(&p)
3095 3095
 							//记录日志

+ 3 - 0
controllers/patient_dataconfig_api_controller.go 查看文件

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

+ 1 - 0
controllers/sign_api_controller.go 查看文件

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

+ 1 - 1
controllers/verify_login_controller.go 查看文件

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

+ 1 - 0
models/patient_models.go 查看文件

@@ -2161,6 +2161,7 @@ type XtDeviceValsualMap struct {
2161 2161
 	XuanzhuanV                   float64                         `gorm:"column:xuanzhuan_v" json:"xuanzhuan_v" form:"xuanzhuan_v"`
2162 2162
 	ALeft                        float64                         `gorm:"column:a_left" json:"a_left" form:"a_left"`
2163 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 2165
 	XtDeviceValsualALeft         []*XtDeviceValsualALeft         `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualALeft"`
2165 2166
 	XtDeviceValsualMapFangxiangA []*XtDeviceValsualMapFangxiangA `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangA"`
2166 2167
 	XtDeviceValsualMapFangxiangV []*XtDeviceValsualMapFangxiangV `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"DeviceValsualMapFangxiangV"`

+ 93 - 53
service/new_warehouse_service.go 查看文件

@@ -1520,65 +1520,67 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1520 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 1586
 		var out_count int64
@@ -1602,6 +1604,44 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1602 1604
 		fmt.Println("查收嗖嗖嗖哦", deliver_number_one-(out_count-cancel_count))
1603 1605
 		if deliver_number_one-(out_count-cancel_count) >= 0 {
1604 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 1645
 				drugflow := models.DrugFlow{
1606 1646
 					WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1607 1647
 					WarehouseOutId:          warehouseout.ID,

+ 9 - 0
service/sign_service.go 查看文件

@@ -1372,3 +1372,12 @@ func CreateNewUploadPact(name string) string {
1372 1372
 	fmt.Println("strwwoowowow", str)
1373 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
+}