Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
f96e2c88f7

+ 1 - 1
conf/app.conf View File

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9529
2
+httpport = 9531
3 3
 runmode = dev
4 4
 #dev/prod
5 5
 

+ 6 - 0
controllers/dialysis_api_controller.go View File

@@ -1158,6 +1158,9 @@ func (c *DialysisApiController) PostReceiveTreatmentAsses() {
1158 1158
 	psychological_other := c.GetString("psychological_other")
1159 1159
 	admission_number := c.GetString("admission_number")
1160 1160
 	tumble, _ := c.GetInt64("tumble")
1161
+	his_department := c.GetString("his_department")
1162
+	his_bed := c.GetString("his_bed")
1163
+	diacrisis := c.GetString("diacrisis")
1161 1164
 	if id <= 0 {
1162 1165
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1163 1166
 		return
@@ -1206,6 +1209,9 @@ func (c *DialysisApiController) PostReceiveTreatmentAsses() {
1206 1209
 		PsychologicalOther:           psychological_other,
1207 1210
 		AdmissionNumber:              admission_number,
1208 1211
 		Tumble:                       tumble,
1212
+		HisDepartment:                his_department,
1213
+		HisBed:                       his_bed,
1214
+		Diacrisis:                    diacrisis,
1209 1215
 	}
1210 1216
 
1211 1217
 	if receiveTreatment.ID == 0 { //新增

+ 5 - 7
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -866,8 +866,10 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
866 866
 	psychological_other := c.GetString("psychological_other")
867 867
 
868 868
 	admission_number := c.GetString("admission_number")
869
-	tumble, _ := c.GetInt64("diacrisis")
869
+	tumble, _ := c.GetInt64("tumble")
870 870
 	diacrisis := c.GetString("diacrisis")
871
+	his_department := c.GetString("his_department")
872
+	his_bed := c.GetString("his_bed")
871 873
 	if id <= 0 {
872 874
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
873 875
 		return
@@ -922,6 +924,8 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
922 924
 		AdmissionNumber:              admission_number,
923 925
 		Tumble:                       tumble,
924 926
 		Diacrisis:                    diacrisis,
927
+		HisBed:                       his_bed,
928
+		HisDepartment:                his_department,
925 929
 	}
926 930
 
927 931
 	if receiveTreatment.ID == 0 { //新增
@@ -4097,12 +4101,6 @@ func (c *DialysisAPIController) GetSchedule() {
4097 4101
 	schedual_type, _ := c.GetInt64("schedual_type")
4098 4102
 	adminUserInfo := c.GetMobileAdminUserInfo()
4099 4103
 
4100
-	//timeLayout := "2006-01-02 15:04:05"
4101
-	//
4102
-	//date := time.Now().Format("2006-01-02") + " 00:00:00"
4103
-	//loc, _ := time.LoadLocation("Local")
4104
-	//theStartTime, _ := time.ParseInLocation(timeLayout, date, loc)
4105
-	//scheduleTime := theStartTime.Unix()
4106 4104
 	scheduleTime, _ := c.GetInt64("record_date")
4107 4105
 	deviceNumber, _ := service.GetAllDeviceNumbers(adminUserInfo.Org.Id, scheduleTime, schedual_type)
4108 4106
 	list, _ := service.GetAllBedNumberSeven(adminUserInfo.Org.Id)

+ 24 - 0
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go View File

@@ -720,3 +720,27 @@ func (c *StaffScheduleApiController) GetSolutionSchedule() {
720 720
 		"schedule": schedule,
721 721
 	})
722 722
 }
723
+
724
+func (c *StaffScheduleApiController) GetAllBedList() {
725
+
726
+	orgId := c.GetMobileAdminUserInfo().Org.Id
727
+	list, _ := service.GetAllBedNumberSix(orgId)
728
+	c.ServeSuccessJSON(map[string]interface{}{
729
+		"list": list,
730
+	})
731
+}
732
+
733
+func (c *StaffScheduleApiController) ChangeScheduleById() {
734
+
735
+	id, _ := c.GetInt64("id")
736
+	mode_id, _ := c.GetInt64("mode_id")
737
+	schedule_date, _ := c.GetInt64("schedule_date")
738
+	patient_id, _ := c.GetInt64("patient_id")
739
+	org_id := c.GetMobileAdminUserInfo().Org.Id
740
+	err := service.ChangeScheduleById(id, mode_id)
741
+	fmt.Println("9999999999999999", err)
742
+	err = service.ChangeDialysisSolution(patient_id, schedule_date, org_id, mode_id)
743
+	c.ServeSuccessJSON(map[string]interface{}{
744
+		"msg": "ok",
745
+	})
746
+}

+ 4 - 0
controllers/new_mobile_api_controllers/staff_schedule_api_router.go View File

@@ -26,4 +26,8 @@ func StaffScheduleApiControllersRegisterRouters() {
26 26
 	beego.Router("m/api/schedule/patients", &StaffScheduleApiController{}, "Get:GetSchedulePatient")
27 27
 	beego.Router("/m/api/schedule/create", &StaffScheduleApiController{}, "Post:CreateMobileSchedulePatient")
28 28
 	beego.Router("m/api/schedule/getsolutionschedule", &StaffScheduleApiController{}, "Get:GetSolutionSchedule")
29
+
30
+	beego.Router("m/api/schedule/getallbedlist", &StaffScheduleApiController{}, "Get:GetAllBedList")
31
+
32
+	beego.Router("m/api/schedule/changeschedulebyid", &StaffScheduleApiController{}, "Get:ChangeScheduleById")
29 33
 }

+ 0 - 1
controllers/patient_api_controller.go View File

@@ -2339,7 +2339,6 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2339 2339
 
2340 2340
 						if medical.IsUse == 2 {
2341 2341
 							if config.IsOpen != 1 {
2342
-								fmt.Println("pharmacyConfig23232332322323", pharmacyConfig.IsOpen, medical.IsPharmacy)
2343 2342
 								if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
2344 2343
 									service.HisDrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2345 2344
 

+ 2 - 0
models/dialysis.go View File

@@ -967,6 +967,8 @@ type ReceiveTreatmentAsses struct {
967 967
 	AdmissionNumber              string `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
968 968
 	Diacrisis                    string `gorm:"column:diacrisis" json:"diacrisis" form:"diacrisis"`
969 969
 	Tumble                       int64  `gorm:"column:tumble" json:"tumble" form:"tumble"`
970
+	HisDepartment                string `gorm:"column:his_department" json:"his_department" form:"his_department"`
971
+	HisBed                       string `gorm:"column:his_bed" json:"his_bed" form:"his_bed"`
970 972
 }
971 973
 
972 974
 func (ReceiveTreatmentAsses) TableName() string {

+ 14 - 0
service/device_service.go View File

@@ -782,3 +782,17 @@ func GetAllBedNumberSeven(orgId int64) (devicenumber []*models.SgjDeviceNumber,
782 782
 	err = XTReadDB().Where("org_id = ? and status= 1", orgId).Preload("Zone", "status = 1").Find(&devicenumber).Error
783 783
 	return devicenumber, err
784 784
 }
785
+
786
+func ChangeScheduleById(id int64, mode_id int64) error {
787
+
788
+	err := XTWriteDB().Model(&models.XtSchedule{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"mode_id": mode_id}).Error
789
+	fmt.Println("err233322323232232323", err)
790
+	return err
791
+}
792
+
793
+func ChangeDialysisSolution(patient_id int64, schedule_date int64, org_id int64, mode_id int64) error {
794
+
795
+	err := XTWriteDB().Model(&models.DialysisPrescription{}).Where("patient_id = ? and record_date =? and user_org_id = ? and status = 1", patient_id, schedule_date, org_id).Update(map[string]interface{}{"mode_id": mode_id}).Error
796
+	return err
797
+
798
+}

+ 0 - 1
service/new_warehouse_service.go View File

@@ -14,7 +14,6 @@ import (
14 14
 //耗材出库
15 15
 func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, goods *models.DialysisBeforePrepare, warehouseOut *models.WarehouseOut, count int64) (err error) {
16 16
 
17
-	//fmt.Println("出库数量2333333333333333333333333333333333hhha", goods.Count)
18 17
 	//开事务
19 18
 	var deliver_number int64 = 0
20 19
 	var stock_number int64 = 0