28169 1 månad sedan
förälder
incheckning
4d783b0fd6

+ 6 - 2
controllers/doctors_api_controller.go Visa fil

@@ -183,11 +183,15 @@ func (c *DoctorsApiController) ScheduleAdvices() {
183 183
 func (c *DoctorsApiController) GetAllDoctorAndNurse() {
184 184
 
185 185
 	adminUserInfo := c.GetAdminUserInfo()
186
+
186 187
 	doctors, nursers, _ := service.GetAllDoctorAndNurseSeven(adminUserInfo.CurrentOrgId)
187 188
 
189
+	signature, _ := service.GetAdminUserEsTwo(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId)
190
+
188 191
 	c.ServeSuccessJSON(map[string]interface{}{
189
-		"doctors": doctors,
190
-		"nursers": nursers,
192
+		"doctors":   doctors,
193
+		"nursers":   nursers,
194
+		"signature": signature,
191 195
 	})
192 196
 	return
193 197
 }

+ 6 - 2
controllers/patient_api_controller.go Visa fil

@@ -4490,6 +4490,10 @@ func (c *PatientApiController) DeleteGroupAdvice() {
4490 4490
 
4491 4491
 	groupNo, _ := c.GetInt64("groupno", 0)
4492 4492
 
4493
+	patient_id, _ := c.GetInt64("patient_id")
4494
+
4495
+	advice_date, _ := c.GetInt64("advice_date")
4496
+
4493 4497
 	if groupNo <= 0 {
4494 4498
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4495 4499
 		return
@@ -4497,7 +4501,7 @@ func (c *PatientApiController) DeleteGroupAdvice() {
4497 4501
 
4498 4502
 	adminUserInfo := c.GetAdminUserInfo()
4499 4503
 
4500
-	advice, _ := service.FindDoctorAdviceByGroupNo(adminUserInfo.CurrentOrgId, groupNo)
4504
+	advice, _ := service.FindDoctorAdviceByGroupNoOne(adminUserInfo.CurrentOrgId, groupNo, patient_id, advice_date)
4501 4505
 	if advice.ID == 0 {
4502 4506
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDoctorAdviceNotExist)
4503 4507
 		return
@@ -4554,7 +4558,7 @@ func (c *PatientApiController) DeleteGroupAdvice() {
4554 4558
 		}
4555 4559
 	}
4556 4560
 
4557
-	err := service.DeleteGroupAdvice(adminUserInfo.CurrentOrgId, groupNo, adminUserInfo.AdminUser.Id)
4561
+	err := service.DeleteGroupAdvice(adminUserInfo.CurrentOrgId, groupNo, adminUserInfo.AdminUser.Id, patient_id, advice_date)
4558 4562
 
4559 4563
 	byterequest, _ := json.Marshal(advice)
4560 4564
 	doctorAdviceLog := models.XtDoctorAdviceLog{

+ 1 - 0
controllers/stock_in_api_controller.go Visa fil

@@ -1544,6 +1544,7 @@ func (c *StockManagerApiController) GetWarehouseOutList() {
1544 1544
 		}
1545 1545
 
1546 1546
 	}
1547
+	fmt.Println("ids======================", ids)
1547 1548
 	warehouseOutList, total, err := service.FindAllWarehouseOutListOne(adminUserInfo.CurrentOrgId, page, limit, startTime, endTime, types, keywords, ids, storehouse_id, way_type, check_type)
1548 1549
 	houselist, _ := service.GetAllStoreHouseList(adminUserInfo.CurrentOrgId)
1549 1550
 	patients, _ := service.GetAllpatient(adminUserInfo.CurrentOrgId)

+ 7 - 2
service/patient_service.go Visa fil

@@ -1283,8 +1283,8 @@ func DeleteDoctorAdvice(m *models.DoctorAdvice) (err error) {
1283 1283
 
1284 1284
 	return
1285 1285
 }
1286
-func DeleteGroupAdvice(orgId int64, groupNo int64, admin_user_id int64) (err error) {
1287
-	err = writeDb.Model(&models.DoctorAdvice{}).Where("user_org_id = ? and groupno = ?", orgId, groupNo).Update(map[string]interface{}{"UpdatedTime": time.Now().Unix(), "Status": 0, "Modifier": admin_user_id}).Error
1286
+func DeleteGroupAdvice(orgId int64, groupNo int64, admin_user_id int64, patient_id int64, advice_date int64) (err error) {
1287
+	err = writeDb.Model(&models.DoctorAdvice{}).Where("user_org_id = ? and groupno = ? and patient_id = ? and advice_date = ? and status=1", orgId, groupNo, patient_id, advice_date).Update(map[string]interface{}{"UpdatedTime": time.Now().Unix(), "Status": 0, "Modifier": admin_user_id}).Error
1288 1288
 	if err != nil {
1289 1289
 		return
1290 1290
 	}
@@ -1329,6 +1329,11 @@ func FindHisDoctorAdviceOne(orgID, patient_id int64) (advice models.HisDoctorAdv
1329 1329
 	return
1330 1330
 }
1331 1331
 
1332
+func FindDoctorAdviceByGroupNoOne(orgID, groupNo int64, patient_id int64, advice_date int64) (advice models.DoctorAdvice, err error) {
1333
+	err = readDb.Model(&models.DoctorAdvice{}).Where("groupno = ? and user_org_id=? and status = 1 and patient_id = ? and advice_date = ?", groupNo, orgID, patient_id, advice_date).First(&advice).Error
1334
+	return
1335
+}
1336
+
1332 1337
 func FindDoctorAdviceByGroupNo(orgID, groupNo int64) (advice models.DoctorAdvice, err error) {
1333 1338
 	err = readDb.Model(&models.DoctorAdvice{}).Where("groupno = ? and user_org_id=? and status = 1", groupNo, orgID).First(&advice).Error
1334 1339
 	return

+ 1 - 1
service/stock_service.go Visa fil

@@ -2095,7 +2095,7 @@ func FindAllWarehouseOutList(orgId int64, page int64, limit int64, startTime int
2095 2095
 
2096 2096
 func FindAllWarehouseOutListOne(orgId int64, page int64, limit int64, startTime int64, endTime int64, types int64, keywords string, ids []int64, storehouse_id int64, way_type int64, check_type int64) (list []*models.WarehouseOut, total int64, err error) {
2097 2097
 	db := readDb.Model(&models.WarehouseOut{})
2098
-	db = db.Where("xt_warehouse_out.org_id = ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.type = ?", orgId, types)
2098
+	db = db.Where("xt_warehouse_out.org_id = ? AND xt_warehouse_out.status = 1", orgId)
2099 2099
 
2100 2100
 	if len(keywords) > 0 {
2101 2101
 		likeKey := "%" + keywords + "%"