28169 hace 1 año
padre
commit
4b94836e6f

BIN
XT_New.exe Ver fichero


+ 4 - 4
controllers/base_api_controller.go Ver fichero

@@ -82,7 +82,7 @@ func (this *BaseAuthAPIController) Prepare() {
82 82
 		userAdmin.ModifyTime = 1530786071
83 83
 		var subscibe models.ServeSubscibe
84 84
 		subscibe.ID = 11
85
-		subscibe.OrgId = 10164 //机构id 10344
85
+		subscibe.OrgId = 10537 //机构id 10344
86 86
 		subscibe.PeriodStart = 1547447814
87 87
 		subscibe.PeriodEnd = 1550039814
88 88
 		subscibe.State = 1
@@ -92,7 +92,7 @@ func (this *BaseAuthAPIController) Prepare() {
92 92
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93 93
 		subscibes[4] = &subscibe
94 94
 		var adminUserInfo service.AdminUserInfo
95
-		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
95
+		adminUserInfo.CurrentOrgId = 10537 //机构id小英9675或4
96 96
 		adminUserInfo.CurrentAppId = 12123 //4
97 97
 		adminUserInfo.AdminUser = &userAdmin
98 98
 		adminUserInfo.Subscibes = subscibes
@@ -327,7 +327,7 @@ func (this *BaseServeAPIController) Prepare() {
327 327
 		userAdmin.ModifyTime = 1530786071
328 328
 		var subscibe models.ServeSubscibe
329 329
 		subscibe.ID = 11
330
-		subscibe.OrgId = 10164 //机构id小英10344或4
330
+		subscibe.OrgId = 10537 //机构id小英10344或4
331 331
 		subscibe.PeriodStart = 1538035409
332 332
 		subscibe.PeriodEnd = 1569571409
333 333
 		subscibe.State = 1
@@ -337,7 +337,7 @@ func (this *BaseServeAPIController) Prepare() {
337 337
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338 338
 		subscibes[4] = &subscibe
339 339
 		var adminUserInfo service.AdminUserInfo
340
-		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
340
+		adminUserInfo.CurrentOrgId = 10537 //机构id小英9675或4
341 341
 		adminUserInfo.CurrentAppId = 12123 //4
342 342
 		adminUserInfo.AdminUser = &userAdmin
343 343
 		adminUserInfo.Subscibes = subscibes

+ 1 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go Ver fichero

@@ -9161,7 +9161,7 @@ func ConsumablesDeliveryDeleteNew(orgID int64, record_time int64, good_yc *model
9161 9161
 		Total:           0,
9162 9162
 		ProductDate:     stockInInfo.ProductDate,
9163 9163
 		ExpiryDate:      stockInInfo.ExpiryDate,
9164
-		Ctime:           time.Now().Unix(),
9164
+		Ctime:           record_time,
9165 9165
 		Status:          1,
9166 9166
 		OrgId:           orgID,
9167 9167
 		OrderNumber:     cancel.OrderNumber,

+ 8 - 0
controllers/patient_api_controller.go Ver fichero

@@ -1078,6 +1078,10 @@ func (c *PatientApiController) CreateDialysisSolution() {
1078 1078
 		if len(solution.DialysisIrrigation) > 0 {
1079 1079
 			DialysisMachineName = DialysisMachineName + "," + solution.DialysisIrrigation
1080 1080
 		}
1081
+
1082
+		if len(solution.DialysisStrainer) > 0 {
1083
+			DialysisMachineName = DialysisMachineName + "," + solution.DialysisStrainer
1084
+		}
1081 1085
 		sch.DialysisMachineName = DialysisMachineName
1082 1086
 		service.UpdateSch(sch)
1083 1087
 	}
@@ -1180,6 +1184,10 @@ func (c *PatientApiController) UpdateDialysisSolution() {
1180 1184
 		if len(solution.DialysisIrrigation) > 0 {
1181 1185
 			DialysisMachineName = DialysisMachineName + "," + solution.DialysisIrrigation
1182 1186
 		}
1187
+
1188
+		if len(solution.DialysisStrainer) > 0 {
1189
+			DialysisMachineName = DialysisMachineName + "," + solution.DialysisStrainer
1190
+		}
1183 1191
 		sch.DialysisMachineName = DialysisMachineName
1184 1192
 		service.UpdateSch(sch)
1185 1193
 	}

+ 121 - 0
controllers/stock_in_api_controller.go Ver fichero

@@ -163,6 +163,10 @@ func StockManagerApiRegistRouters() {
163 163
 
164 164
 	beego.Router("/api/stock/getgoodpatientname", &StockManagerApiController{}, "Get:GetGoodPatientName")
165 165
 
166
+	beego.Router("/api/drug/updatebasedruglisbyuserorgid", &StockManagerApiController{}, "Get:UpdateBaseDrugListByUserOrgID")
167
+
168
+	beego.Router("/api/good/updategoodinfobyuserorgid", &StockManagerApiController{}, "Get:UpdateGoodInfoByUserOrgId")
169
+
166 170
 }
167 171
 func (c *StockManagerApiController) HandleRefundStock() {
168 172
 	order_id, _ := c.GetInt64("order_id", 0)
@@ -8193,3 +8197,120 @@ func (this *StockManagerApiController) GetGoodPatientName() {
8193 8197
 		"outList":     outList,
8194 8198
 	})
8195 8199
 }
8200
+
8201
+func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8202
+
8203
+	orgId := this.GetAdminUserInfo().CurrentOrgId
8204
+
8205
+	list, _ := service.GetAllBaseDrugList(orgId)
8206
+	//
8207
+
8208
+	for _, item := range list {
8209
+		var sum_in_count int64
8210
+		var sum_out_count int64
8211
+		var flush_out_count int64
8212
+		//var str = ""
8213
+		//str = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit
8214
+		//service.UpdateBaseDrugById(item.ID, drug_dosage_form_str)
8215
+
8216
+		//drug_dosage_form_str := service.GetDosageFormListById(item.DrugDosageForm, orgId)
8217
+		//service.UpdateDosageFormListById(drug_dosage_form_str, item.ID)
8218
+
8219
+		warehouseinfo, _ := service.GetDrugWarehouseInfoByItemId(item.ID)
8220
+		if len(warehouseinfo) > 0 {
8221
+			for _, it := range warehouseinfo {
8222
+				if item.MaxUnit == it.MaxUnit && item.MaxUnit != item.MinUnit {
8223
+					it.WarehousingCount = it.WarehousingCount * item.MinNumber
8224
+				}
8225
+
8226
+				if item.MaxUnit == it.MinUnit && item.MaxUnit != item.MinUnit {
8227
+					it.WarehousingCount = it.WarehousingCount
8228
+				}
8229
+
8230
+				if item.MaxUnit == it.MinUnit && item.MaxUnit == item.MinUnit {
8231
+					it.WarehousingCount = it.WarehousingCount
8232
+				}
8233
+
8234
+				sum_in_count += it.WarehousingCount
8235
+			}
8236
+
8237
+		}
8238
+
8239
+		outList, _ := service.GetDrugWarehosueOutInfoByItemId(item.ID)
8240
+		if len(outList) > 0 {
8241
+			for _, it := range outList {
8242
+				if item.MaxUnit == it.CountUnit && item.MaxUnit != item.MinUnit {
8243
+					it.Count = it.Count * item.MinNumber
8244
+				}
8245
+
8246
+				if item.MaxUnit == it.CountUnit && item.MaxUnit != item.MinUnit {
8247
+					it.Count = it.Count
8248
+				}
8249
+
8250
+				if item.MaxUnit == it.CountUnit && item.MaxUnit == item.MinUnit {
8251
+					it.Count = it.Count
8252
+				}
8253
+
8254
+				sum_out_count += it.Count
8255
+			}
8256
+		}
8257
+
8258
+		flush_out_count = sum_in_count - sum_out_count
8259
+
8260
+		service.UpdateBaseDrugByIdCount(item.ID, flush_out_count)
8261
+	}
8262
+
8263
+	//info, _ := service.GetDrugAllInfo(orgId)
8264
+	//
8265
+	//for _, item := range info {
8266
+	//
8267
+	//	dealer, _ := service.GetDealerById(item.Dealer)
8268
+	//
8269
+	//	manufacturer, _ := service.GetManufactureById(item.Manufacturer)
8270
+	//
8271
+	//	service.UpdateDealerManufacturer(item.ID, dealer.DealerName, manufacturer.ManufacturerName)
8272
+	//}
8273
+
8274
+}
8275
+
8276
+func (this *StockManagerApiController) UpdateGoodInfoByUserOrgId() {
8277
+
8278
+	orgId := this.GetAdminUserInfo().CurrentOrgId
8279
+
8280
+	//info, _ := service.GetAllWareHouseInforByUserOrg(orgId)
8281
+	//
8282
+	//if len(info) > 0 {
8283
+	//	for _, item := range info {
8284
+	//		dealer, _ := service.GetDealerById(item.Dealer)
8285
+	//
8286
+	//		manufacturer, _ := service.GetManufactureById(item.Manufacturer)
8287
+	//
8288
+	//		service.UpdateGoodInfoByUserOrgId(item.ID, dealer.DealerName, manufacturer.ManufacturerName)
8289
+	//	}
8290
+	//}
8291
+
8292
+	goodList, _ := service.GetAllGoodList(orgId)
8293
+
8294
+	for _, item := range goodList {
8295
+
8296
+		var sum_in_count int64
8297
+		var sum_out_count int64
8298
+		var flush_out_count int64
8299
+		infor, _ := service.GetAllWarehouseSumInCount(item.ID)
8300
+
8301
+		for _, item := range infor {
8302
+			sum_in_count += item.WarehousingCount
8303
+		}
8304
+
8305
+		outInfo, _ := service.GetAllWarehouseSumOutCount(item.ID)
8306
+
8307
+		for _, item := range outInfo {
8308
+			sum_out_count += item.Count
8309
+		}
8310
+
8311
+		flush_out_count = sum_in_count - sum_out_count
8312
+
8313
+		service.UpdateGoodInfoById(item.ID, flush_out_count)
8314
+	}
8315
+
8316
+}

+ 3 - 2
models/drug.go Ver fichero

@@ -85,8 +85,9 @@ type BaseDrugLib struct {
85 85
 	Bby01     string `gorm:"column:bby01" json:"bby01" form:"bby01"`
86 86
 	Bbx01     string `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
87 87
 
88
-	FirstLetter string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
89
-	IsProject   int64  `gorm:"column:is_project" json:"is_project" form:"is_project"`
88
+	FirstLetter        string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
89
+	IsProject          int64  `gorm:"column:is_project" json:"is_project" form:"is_project"`
90
+	DrugDosageFormName string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
90 91
 }
91 92
 
92 93
 func (BaseDrugLib) TableName() string {

+ 2 - 0
models/drug_stock.go Ver fichero

@@ -89,6 +89,8 @@ type DrugWarehouseInfo struct {
89 89
 	StorehouseId              int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
90 90
 	SecondWarehouseInfoId     int64   `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
91 91
 	IsCheck                   int64   `gorm:"column:is_check" json:"is_check" form:"is_check"`
92
+	ManafacturerName          string  `gorm:"column:manafacturer_name" json:"manafacturer_name" form:"manafacturer_name"`
93
+	DealerName                string  `gorm:"column:dealer_name" json:"dealer_name" form:"dealer_name"`
92 94
 }
93 95
 
94 96
 func (DrugWarehouseInfo) TableName() string {

+ 1 - 0
models/good_models.go Ver fichero

@@ -225,6 +225,7 @@ type GoodInfoSevenThirty struct {
225 225
 	SumOutCount                 int64                `gorm:"column:sum_out_count" json:"sum_out_count" form:"sum_out_count"`
226 226
 	SumCancelCount              int64                `gorm:"column:sum_cancel_count" json:"sum_cancel_count" form:"sum_cancel_count"`
227 227
 	TotalCount                  int64                `gorm:"column:total_count" json:"total_count" form:"total_count"`
228
+	TotalCountOne               int64                `gorm:"column:total_count_one" json:"total_count_one" form:"total_count_one"`
228 229
 }
229 230
 
230 231
 func (GoodInfoSevenThirty) TableName() string {

+ 4 - 0
models/self_drug_models.go Ver fichero

@@ -76,6 +76,8 @@ type XtBaseDrug struct {
76 76
 	MinPrice               float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
77 77
 	IsUse                  int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
78 78
 	IsPharmacy             int64   `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
79
+	DrugDosageFormName     string  `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
80
+	TotalCountOne          int64   `gorm:"column:total_count_one" json:"total_count" form:"total_count_one"`
79 81
 }
80 82
 
81 83
 func (XtBaseDrug) TableName() string {
@@ -419,6 +421,8 @@ type XtDrugWarehouseInfo struct {
419 421
 	SupplyWarehouseDetailInfo int64      `gorm:"column:supply_warehouse_detail_info" json:"supply_warehouse_detail_info" form:"supply_warehouse_detail_info"`
420 422
 	StorehouseId              int64      `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
421 423
 	IsCheck                   int64      `gorm:"column:is_check" json:"is_check" form:"is_check"`
424
+	ManafacturerName          string     `gorm:"column:manafacturer_name" json:"manafacturer_name" form:"manafacturer_name"`
425
+	DealerName                string     `gorm:"column:dealer_name" json:"dealer_name" form:"dealer_name"`
422 426
 }
423 427
 
424 428
 func (XtDrugWarehouseInfo) TableName() string {

+ 2 - 0
models/stock_models.go Ver fichero

@@ -174,6 +174,8 @@ type WarehousingInfo struct {
174 174
 	SecondWarehouseInfoId     int64       `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
175 175
 	IsCheck                   int64       `gorm:"column:is_check" json:"is_check" form:"is_check"`
176 176
 	RegisterNumber            string      `gorm:"column:register_number" json:"register_number" form:"register_number"`
177
+	ManafacturerName          string      `gorm:"column:manafacturer_name" json:"manafacturer_name" form:"manafacturer_name"`
178
+	DealerName                string      `gorm:"column:dealer_name" json:"dealer_name" form:"dealer_name"`
177 179
 }
178 180
 
179 181
 func (WarehousingInfo) TableName() string {

+ 11 - 9
service/new_warehouse_service.go Ver fichero

@@ -71,7 +71,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
71 71
 			WarehouseOutId:          warehouseOut.ID,
72 72
 			WarehouseInfotId:        warehouse.ID,
73 73
 			Status:                  1,
74
-			Ctime:                   time.Now().Unix(),
74
+			Ctime:                   record_time,
75 75
 			Remark:                  warehouse.Remark,
76 76
 			OrgId:                   orgID,
77 77
 			Type:                    1,
@@ -142,7 +142,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
142 142
 				Count:                   count - out_count + out_count_one,
143 143
 				Price:                   warehouse.PackingPrice,
144 144
 				Status:                  1,
145
-				Ctime:                   time.Now().Unix(),
145
+				Ctime:                   record_time,
146 146
 				UserOrgId:               orgID,
147 147
 				Manufacturer:            warehouse.Manufacturer,
148 148
 				Dealer:                  warehouse.Dealer,
@@ -217,7 +217,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
217 217
 				Total:           0,
218 218
 				ProductDate:     warehouse.ProductDate,
219 219
 				ExpiryDate:      warehouse.ExpiryDate,
220
-				Ctime:           time.Now().Unix(),
220
+				Ctime:           record_time,
221 221
 				Status:          1,
222 222
 				OrgId:           orgID,
223 223
 				OrderNumber:     cancel.OrderNumber,
@@ -263,7 +263,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
263 263
 				Creator:                 warehouseOut.Creater,
264 264
 				UpdateCreator:           0,
265 265
 				Status:                  1,
266
-				Ctime:                   time.Now().Unix(),
266
+				Ctime:                   record_time,
267 267
 				Mtime:                   0,
268 268
 				Price:                   warehouse.PackingPrice,
269 269
 				WarehousingDetailId:     warehouse.ID,
@@ -333,7 +333,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
333 333
 			WarehouseOutId:          warehouseOut.ID,
334 334
 			WarehouseInfotId:        warehouse.ID,
335 335
 			Status:                  1,
336
-			Ctime:                   time.Now().Unix(),
336
+			Ctime:                   record_time,
337 337
 			Remark:                  warehouse.Remark,
338 338
 			OrgId:                   orgID,
339 339
 			Type:                    1,
@@ -402,7 +402,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
402 402
 				Count:                   stock_number,
403 403
 				Price:                   warehouse.PackingPrice,
404 404
 				Status:                  1,
405
-				Ctime:                   time.Now().Unix(),
405
+				Ctime:                   record_time,
406 406
 				UserOrgId:               orgID,
407 407
 				Manufacturer:            warehouse.Manufacturer,
408 408
 				Dealer:                  warehouse.Dealer,
@@ -473,7 +473,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
473 473
 				Total:           0,
474 474
 				ProductDate:     warehouse.ProductDate,
475 475
 				ExpiryDate:      warehouse.ExpiryDate,
476
-				Ctime:           time.Now().Unix(),
476
+				Ctime:           record_time,
477 477
 				Status:          1,
478 478
 				OrgId:           orgID,
479 479
 				OrderNumber:     cancel.OrderNumber,
@@ -519,7 +519,7 @@ func ConsumablesGoodDelivery(orgID int64, patient_id int64, record_time int64, g
519 519
 				Creator:                 warehouseOut.Creater,
520 520
 				UpdateCreator:           0,
521 521
 				Status:                  1,
522
-				Ctime:                   time.Now().Unix(),
522
+				Ctime:                   record_time,
523 523
 				Mtime:                   0,
524 524
 				Price:                   warehouse.PackingPrice,
525 525
 				WarehousingDetailId:     warehouse.ID,
@@ -1606,8 +1606,10 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1606 1606
 
1607 1607
 		//更改字典里面的价格
1608 1608
 		if advice.UserOrgId == 10265 || advice.UserOrgId == 10215 {
1609
+			if lastWarehouse.RetailPrice > 0 {
1610
+				UpdateBasePrice(lastWarehouse.DrugId, lastWarehouse.RetailPrice)
1611
+			}
1609 1612
 
1610
-			UpdateBasePrice(lastWarehouse.DrugId, lastWarehouse.RetailPrice)
1611 1613
 		}
1612 1614
 
1613 1615
 		//查询剩余库存

+ 1 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go Ver fichero

@@ -393,6 +393,7 @@ type AssessmentAfterDislysisVM struct {
393 393
 	Consciousness                   int64   `gorm:"column:consciousness" json:"consciousness" form:"consciousness"`
394 394
 	Fallrisk                        int64   `gorm:"column:fallrisk" json:"fallrisk" form:"fallrisk"`
395 395
 	UserOrgId                       int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
396
+	DisplaceLiquiValue              string  `gorm:"column:displace_liqui_value" json:"displace_liqui_value" form:"displace_liqui_value"`
396 397
 }
397 398
 
398 399
 func (AssessmentAfterDislysisVM) TableName() string {

+ 104 - 1
service/self_drug_service.go Ver fichero

@@ -1868,7 +1868,7 @@ func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, ke
1868 1868
 	likeKey := "%" + keyword + "%"
1869 1869
 	db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1 AND find_in_set('停用',x.drug_status) = 0")
1870 1870
 	if good_type == 2 {
1871
-		db = db.Where("x.total_count<=x.drug_stock_limit")
1871
+		db = db.Where("x.sum_count<=x.drug_stock_limit")
1872 1872
 	}
1873 1873
 	if good_type == 3 {
1874 1874
 		db = db.Where("x.sum_count = 0")
@@ -3299,3 +3299,106 @@ func GetWarehouseOutListBySysrecordTime(good_id int64, sys_record_time int64, us
3299 3299
 	err = XTReadDB().Where("good_id = ? and sys_record_time =? and org_id = ? and status=1 and is_sys=1", good_id, sys_record_time, user_org_id).Find(&out).Error
3300 3300
 	return out, err
3301 3301
 }
3302
+
3303
+func UpdateBaseDrugById(id int64, drug_str string) (models.XtBaseDrug, error) {
3304
+
3305
+	baseDrug := models.XtBaseDrug{}
3306
+
3307
+	err := XTWriteDB().Model(&baseDrug).Where("id = ? and status =1", id).Updates(map[string]interface{}{"drug_spec": drug_str}).Error
3308
+
3309
+	return baseDrug, err
3310
+}
3311
+
3312
+func UpdateDosageFormListById(drug_dosage_form_name string, drug_id int64) (models.XtBaseDrug, error) {
3313
+
3314
+	drug := models.XtBaseDrug{}
3315
+
3316
+	err := XTWriteDB().Model(&drug).Where("id = ? and status =1", drug_id).Updates(map[string]interface{}{"drug_dosage_form_name": drug_dosage_form_name}).Error
3317
+
3318
+	return drug, err
3319
+}
3320
+
3321
+func GetDosageFormListById(id int64, orgId int64) (str string) {
3322
+
3323
+	var drugDosageForm = "药品剂型"
3324
+	drugDosageFormParent, _ := GetDrugDataConfig(0, drugDosageForm)
3325
+	drugDosageFormList, _ := GetParentDataConfig(drugDosageFormParent.ID, orgId)
3326
+
3327
+	for _, item := range drugDosageFormList {
3328
+		if id == int64(item.Value) {
3329
+			str = item.Name
3330
+		}
3331
+	}
3332
+	return str
3333
+}
3334
+
3335
+func GetDrugAllInfo(org_id int64) (warehouseInfo []*models.DrugWarehouseInfo, err error) {
3336
+
3337
+	err = XTReadDB().Where("org_id = ? and status= 1 and ctime>=1640966400 and ctime<=1703952000", org_id).Find(&warehouseInfo).Error
3338
+
3339
+	return warehouseInfo, err
3340
+}
3341
+
3342
+func UpdateDealerManufacturer(id int64, dealer_name string, manufactruer string) (err error) {
3343
+
3344
+	warehouseInfo := models.DrugWarehouseInfo{}
3345
+	err = XTWriteDB().Model(&warehouseInfo).Where("id = ? and status =1", id).Updates(map[string]interface{}{"manafacturer_name": manufactruer, "dealer_name": dealer_name}).Error
3346
+
3347
+	return err
3348
+}
3349
+
3350
+func GetDrugWarehouseInfoByItemId(drug_id int64) (list []*models.XtDrugWarehouseInfo, err error) {
3351
+
3352
+	err = XTReadDB().Where("drug_id = ? and status=1 and is_check=1 and ctime<1640966400", drug_id).Find(&list).Error
3353
+
3354
+	return list, err
3355
+}
3356
+
3357
+func GetDrugWarehosueOutInfoByItemId(drug_id int64) (list []*models.XtDrugWarehouseOutInfo, err error) {
3358
+
3359
+	err = XTReadDB().Where("drug_id = ? and status=1 and is_check=1 and ctime<1640966400", drug_id).Find(&list).Error
3360
+
3361
+	return list, err
3362
+}
3363
+
3364
+func UpdateBaseDrugByIdCount(drug_id int64, flush_count int64) (models.XtBaseDrug, error) {
3365
+
3366
+	drug := models.XtBaseDrug{}
3367
+	err := XTWriteDB().Model(&drug).Model(&drug).Where("id = ? and status=1", drug_id).Updates(map[string]interface{}{"total_count_one": flush_count}).Error
3368
+	return drug, err
3369
+}
3370
+
3371
+func GetAllWareHouseInforByUserOrg(org_id int64) (info []*models.WarehousingInfo, err error) {
3372
+
3373
+	err = XTReadDB().Where("org_id =? and status =1 and is_check=1 and ctime>=1640966400 and ctime<=1703952000", org_id).Find(&info).Error
3374
+
3375
+	return info, err
3376
+}
3377
+
3378
+func UpdateGoodInfoByUserOrgId(id int64, dealer_name string, manufactruer string) (err error) {
3379
+
3380
+	warehousingInfo := models.WarehousingInfo{}
3381
+	err = XTWriteDB().Model(&warehousingInfo).Where("id = ? and status =1", id).Updates(map[string]interface{}{"dealer_name": dealer_name, "manafacturer_name": manufactruer}).Error
3382
+	return err
3383
+}
3384
+
3385
+func GetAllWarehouseSumInCount(org_id int64) (infor []*models.WarehousingInfo, err error) {
3386
+
3387
+	err = XTReadDB().Where("id = ? and status =1 and is_check =1 and ctime<1640966400", org_id).Find(&infor).Error
3388
+
3389
+	return infor, err
3390
+}
3391
+
3392
+func GetAllWarehouseSumOutCount(org_id int64) (infor []*models.WarehouseOutInfo, err error) {
3393
+
3394
+	err = XTReadDB().Where("id = ? and status =1 and is_check =1 and ctime<1640966400", org_id).Find(&infor).Error
3395
+
3396
+	return infor, err
3397
+}
3398
+
3399
+func UpdateGoodInfoById(id int64, total_count_one int64) error {
3400
+
3401
+	err := XTWriteDB().Model(&models.GoodInfoSevenThirty{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"total_count_one": total_count_one}).Error
3402
+
3403
+	return err
3404
+}