Browse Source

11月8日库存管理

XMLWAN 3 years ago
parent
commit
16914269b1

+ 1 - 1
conf/app.conf View File

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3 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,6 +191,7 @@ func (this *DialysisAPIController) Scheduals() {
191 191
 			//获取今日所有的处方开的耗材
192 192
 			project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
193 193
 
194
+			fmt.Println("orgID00000000000000000000000000000000", date.Unix())
194 195
 			//获取今日透析准备的数据
195 196
 			goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
196 197
 
@@ -204,7 +205,6 @@ func (this *DialysisAPIController) Scheduals() {
204 205
 					}
205 206
 				}
206 207
 			}
207
-
208 208
 			fmt.Println("goodlist888888888888888888888", goodList, err)
209 209
 			this.ServeSuccessJSON(map[string]interface{}{
210 210
 				"scheduals": scheduals,

+ 4 - 2
controllers/patient_api_controller.go View File

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

+ 3 - 0
service/dialysis_service.go View File

@@ -1656,6 +1656,9 @@ func GetAdminUserRoleInformation(orgid int64) (models.SgjOrgFollow, error) {
1656 1656
 	if orgid > 0 {
1657 1657
 		db = db.Where("org_id = ?", orgid)
1658 1658
 	}
1659
+	if orgid == 0 {
1660
+		db = db.Where("org_id = ?", 0)
1661
+	}
1659 1662
 
1660 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 1664
 	return follow, err

+ 2 - 2
service/mobile_dialysis_service.go View File

@@ -3599,7 +3599,7 @@ func MobileGetDialysisGoodsSeven(orgID int64, scheduleDate int64) (prepare []*mo
3599 3599
 		db = db.Where("p.user_org_id = ?", orgID)
3600 3600
 	}
3601 3601
 	if scheduleDate > 0 {
3602
-		db = db.Where("p.record_date< ?", scheduleDate)
3602
+		db = db.Where("p.record_date<= ?", scheduleDate)
3603 3603
 	}
3604 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 3605
 	return prepare, err
@@ -3607,7 +3607,7 @@ func MobileGetDialysisGoodsSeven(orgID int64, scheduleDate int64) (prepare []*mo
3607 3607
 
3608 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 3611
 	return prepare, err
3612 3612
 }
3613 3613