Browse Source

11月8日库存管理

XMLWAN 3 years ago
parent
commit
16914269b1

+ 1 - 1
conf/app.conf View File

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

File diff suppressed because it is too large
+ 552 - 524
controllers/his_api_controller.go


+ 1 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go View File

191
 			//获取今日所有的处方开的耗材
191
 			//获取今日所有的处方开的耗材
192
 			project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
192
 			project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
193
 
193
 
194
+			fmt.Println("orgID00000000000000000000000000000000", date.Unix())
194
 			//获取今日透析准备的数据
195
 			//获取今日透析准备的数据
195
 			goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
196
 			goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
196
 
197
 
204
 					}
205
 					}
205
 				}
206
 				}
206
 			}
207
 			}
207
-
208
 			fmt.Println("goodlist888888888888888888888", goodList, err)
208
 			fmt.Println("goodlist888888888888888888888", goodList, err)
209
 			this.ServeSuccessJSON(map[string]interface{}{
209
 			this.ServeSuccessJSON(map[string]interface{}{
210
 				"scheduals": scheduals,
210
 				"scheduals": scheduals,

+ 4 - 2
controllers/patient_api_controller.go View File

4092
 	limit, _ := c.GetInt64("limit", 10)
4092
 	limit, _ := c.GetInt64("limit", 10)
4093
 	adminUserInfo := c.GetAdminUserInfo()
4093
 	adminUserInfo := c.GetAdminUserInfo()
4094
 	total, patients, _ := service.GetAllWaitRemindPatient(adminUserInfo.CurrentOrgId, page, limit)
4094
 	total, patients, _ := service.GetAllWaitRemindPatient(adminUserInfo.CurrentOrgId, page, limit)
4095
+	fmt.Println("机构ID2222222222222", c.GetAdminUserInfo().CurrentOrgId)
4095
 
4096
 
4096
 	_, errcode := service.GetOrgFollowIsExist(c.GetAdminUserInfo().CurrentOrgId)
4097
 	_, errcode := service.GetOrgFollowIsExist(c.GetAdminUserInfo().CurrentOrgId)
4098
+	fmt.Println("机构ID2222222222222", errcode)
4097
 	if errcode == gorm.ErrRecordNotFound {
4099
 	if errcode == gorm.ErrRecordNotFound {
4098
 		information, err := service.GetAdminUserRoleInformation(0)
4100
 		information, err := service.GetAdminUserRoleInformation(0)
4099
 		if err != nil {
4101
 		if err != nil {
4107
 			"information": information,
4109
 			"information": information,
4108
 		})
4110
 		})
4109
 	} else if errcode == nil {
4111
 	} else if errcode == nil {
4110
-		information, err := service.GetAdminUserRoleInformation(0)
4112
+		information, err := service.GetAdminUserRoleInformation(c.GetAdminUserInfo().CurrentOrgId)
4111
 		if err != nil {
4113
 		if err != nil {
4112
 			utils.ErrorLog(err.Error())
4114
 			utils.ErrorLog(err.Error())
4113
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4115
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4768
 			"information": information,
4770
 			"information": information,
4769
 		})
4771
 		})
4770
 	} else if errcodes == nil {
4772
 	} else if errcodes == nil {
4771
-		information, err := service.GetAdminUserRoleInformation(0)
4773
+		information, err := service.GetAdminUserRoleInformation(orgId)
4772
 		if err != nil {
4774
 		if err != nil {
4773
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4775
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4774
 			return
4776
 			return

+ 3 - 0
service/dialysis_service.go View File

1656
 	if orgid > 0 {
1656
 	if orgid > 0 {
1657
 		db = db.Where("org_id = ?", orgid)
1657
 		db = db.Where("org_id = ?", orgid)
1658
 	}
1658
 	}
1659
+	if orgid == 0 {
1660
+		db = db.Where("org_id = ?", 0)
1661
+	}
1659
 
1662
 
1660
 	err := db.Select("f.org_id,f.admin_user_id,a.name,a.phone,a.camera,a.wechat,a.qqchat,a.email,a.wechat_link").Joins("left join sgj_admin as a on a.id = f.admin_user_id").Scan(&follow).Error
1663
 	err := db.Select("f.org_id,f.admin_user_id,a.name,a.phone,a.camera,a.wechat,a.qqchat,a.email,a.wechat_link").Joins("left join sgj_admin as a on a.id = f.admin_user_id").Scan(&follow).Error
1661
 	return follow, err
1664
 	return follow, err

+ 2 - 2
service/mobile_dialysis_service.go View File

3599
 		db = db.Where("p.user_org_id = ?", orgID)
3599
 		db = db.Where("p.user_org_id = ?", orgID)
3600
 	}
3600
 	}
3601
 	if scheduleDate > 0 {
3601
 	if scheduleDate > 0 {
3602
-		db = db.Where("p.record_date< ?", scheduleDate)
3602
+		db = db.Where("p.record_date<= ?", scheduleDate)
3603
 	}
3603
 	}
3604
 	err = db.Select("p.patient_id,p.good_id,Max(p.record_date) as record_date").Group("patient_id").Order("id desc").Find(&prepare).Error
3604
 	err = db.Select("p.patient_id,p.good_id,Max(p.record_date) as record_date").Group("patient_id").Order("id desc").Find(&prepare).Error
3605
 	return prepare, err
3605
 	return prepare, err
3607
 
3607
 
3608
 func MobileGetDialysisGoodsSix(orgID int64, scheduleDate int64) (prepare []*models.DialysisBeforePrepare, err error) {
3608
 func MobileGetDialysisGoodsSix(orgID int64, scheduleDate int64) (prepare []*models.DialysisBeforePrepare, err error) {
3609
 
3609
 
3610
-	err = readDb.Where("user_org_id = ? AND status=1 AND record_date < ? AND count > 0", orgID, scheduleDate).Select("patient_id,good_id,record_date").Find(&prepare).Error
3610
+	err = readDb.Where("user_org_id = ? AND status=1 AND record_date <= ? AND count > 0", orgID, scheduleDate).Select("patient_id,good_id,record_date").Find(&prepare).Error
3611
 	return prepare, err
3611
 	return prepare, err
3612
 }
3612
 }
3613
 
3613