Browse Source

2024/6/17

28169 1 month ago
parent
commit
585294d531

+ 6 - 6
controllers/base_api_controller.go View File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10697 //机构id
86
+		subscibe.OrgId = 10587 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,8 +93,8 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10697 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 17260 //4
96
+		adminUserInfo.CurrentOrgId = 10587 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 10697 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
100 100
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10697 //机构id小英9675或4
332
+		subscibe.OrgId = 10587 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,8 +339,8 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10697 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 17260 //4
342
+		adminUserInfo.CurrentOrgId = 10587 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 16787 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes
346 346
 		this.SetSession("admin_user_info", &adminUserInfo)

File diff suppressed because it is too large
+ 1353 - 966
controllers/mobile_api_controllers/dialysis_api_controller.go


+ 2 - 2
controllers/print_data_api_controller.go View File

@@ -38,7 +38,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
38 38
 	idStrs := strings.Split(schIDStr, ",")
39 39
 	adminUserInfo := this.GetAdminUserInfo()
40 40
 
41
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 || this.GetAdminUserInfo().CurrentOrgId == 10013 || this.GetAdminUserInfo().CurrentOrgId == 10014 {
41
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 || this.GetAdminUserInfo().CurrentOrgId == 10013 || this.GetAdminUserInfo().CurrentOrgId == 10014 || this.GetAdminUserInfo().CurrentOrgId == 10307 {
42 42
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
43 43
 		for _, item := range schedules {
44 44
 
@@ -144,7 +144,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
144 144
 		})
145 145
 	}
146 146
 
147
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 && this.GetAdminUserInfo().CurrentOrgId != 10013 && this.GetAdminUserInfo().CurrentOrgId != 10014 {
147
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 && this.GetAdminUserInfo().CurrentOrgId != 10013 && this.GetAdminUserInfo().CurrentOrgId != 10014 && this.GetAdminUserInfo().CurrentOrgId != 10307 {
148 148
 
149 149
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
150 150
 		for _, item := range schedules {

+ 4 - 0
controllers/self_drug_api_congtroller.go View File

@@ -6433,6 +6433,9 @@ func (c *SelfDrugApiController) GetDrugInventoryModePrintList() {
6433 6433
 	//查询本月出库
6434 6434
 	outList, _ := service.GetDrugWarhouseHouseOutInfo(orgId, startTime, endTime)
6435 6435
 
6436
+	//查询本月退库
6437
+	cancelOutInfo, _ := service.GetDrugWarehouseCancelOutInfo(orgId, startTime, endTime)
6438
+
6436 6439
 	drugList, _ := service.GetAllDrugList(orgId)
6437 6440
 
6438 6441
 	warehouseInfoFlow, _ := service.GetDrugMonthWarehouseInfo(orgId, startTime)
@@ -6450,5 +6453,6 @@ func (c *SelfDrugApiController) GetDrugInventoryModePrintList() {
6450 6453
 		"warehouseInfoFlow": warehouseInfoFlow,
6451 6454
 		"warehouseOutFlow":  warehouseOutFlow,
6452 6455
 		"cancelFlow":        cancelFlow,
6456
+		"cancelOutInfo":     cancelOutInfo,
6453 6457
 	})
6454 6458
 }

+ 4 - 0
controllers/stock_in_api_controller.go View File

@@ -8420,6 +8420,9 @@ func (this *StockManagerApiController) GetStockInventoryModePrintList() {
8420 8420
 	//获取盘亏的数据
8421 8421
 	flowNoProList, _ := service.GetGoodStockFlowNoProList(startTime, endTime, orgId)
8422 8422
 
8423
+	//获取盘点退库
8424
+	CancelFlowList, _ := service.GetCancelStockFlowList(startTime, endTime, orgId)
8425
+
8423 8426
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
8424 8427
 
8425 8428
 	//获取期初结余数量
@@ -8441,6 +8444,7 @@ func (this *StockManagerApiController) GetStockInventoryModePrintList() {
8441 8444
 		"warehouseinfo":    warehouseinfo,
8442 8445
 		"warehouseOutInfo": warehouseOutInfo,
8443 8446
 		"cancelInfo":       cancelInfo,
8447
+		"CancelFlowList":   CancelFlowList,
8444 8448
 	})
8445 8449
 
8446 8450
 }

+ 17 - 16
models/self_drug_models.go View File

@@ -986,22 +986,23 @@ func (SgjDrugWarehouseOutInfo) TableName() string {
986 986
 }
987 987
 
988 988
 type PatientDrugWarehouseInfo struct {
989
-	DrugId         int64  `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
990
-	Number         string `gorm:"column:number" json:"number" form:"number"`
991
-	ProductDate    int64  `gorm:"column:product_date" json:"product_date" form:"product_date"`
992
-	ExpiryDate     int64  `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
993
-	StockMaxNumber int64  `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
994
-	StockMinNumber int64  `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
995
-	BatchNumber    string `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
996
-	DrugName       string `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
997
-	MaxUnit        string `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
998
-	MinUnit        string `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
999
-	MinNumber      int64  `gorm:"column:min_number" json:"min_number" form:"min_number"`
1000
-	Dose           string `gorm:"column:dose" json:"dose" form:"dose"`
1001
-	DoseUnit       string `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
1002
-	Manufacturer   int64  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
1003
-	Dealer         int64  `gorm:"column:dealer" json:"dealer" form:"dealer"`
1004
-	SumCount       int64  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
989
+	DrugId           int64  `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
990
+	Number           string `gorm:"column:number" json:"number" form:"number"`
991
+	ProductDate      int64  `gorm:"column:product_date" json:"product_date" form:"product_date"`
992
+	ExpiryDate       int64  `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
993
+	StockMaxNumber   int64  `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
994
+	StockMinNumber   int64  `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
995
+	BatchNumber      string `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
996
+	DrugName         string `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
997
+	MaxUnit          string `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
998
+	MinUnit          string `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
999
+	MinNumber        int64  `gorm:"column:min_number" json:"min_number" form:"min_number"`
1000
+	Dose             string `gorm:"column:dose" json:"dose" form:"dose"`
1001
+	DoseUnit         string `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
1002
+	Manufacturer     int64  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
1003
+	Dealer           int64  `gorm:"column:dealer" json:"dealer" form:"dealer"`
1004
+	SumCount         int64  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
1005
+	WarehousingCount int64  `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
1005 1006
 }
1006 1007
 
1007 1008
 type NewGoodInformation struct {

+ 1 - 0
models/stock_models.go View File

@@ -1344,6 +1344,7 @@ type PatientWarehouseInfo struct {
1344 1344
 	Remark            string `gorm:"column:remark" json:"remark" form:"remark"`
1345 1345
 	OrgId             int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
1346 1346
 	StockCount        int64  `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1347
+	WarehousingCount  int64  `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
1347 1348
 }
1348 1349
 
1349 1350
 func (PatientWarehouseInfo) TableName() string {

+ 2 - 0
service/pharmacy_service.go View File

@@ -563,6 +563,8 @@ func GetManyDrugs(orgid int64, keyword string) (map[int64]models.PharmacyBaseDru
563 563
 // 查询(
564 564
 func GetTodayMedicine(stime, etime, orgid, is_medicine int64, keyword string) (finlly []*models.ListOfDrugs, err error) {
565 565
 	InitDrugidIsNil(orgid, stime, etime)
566
+
567
+	fmt.Println("startime==========================", stime)
566 568
 	var tmp []*models.TmpLLL
567 569
 	if is_medicine == 0 {
568 570
 		if keyword != "" {

+ 22 - 1
service/self_drug_service.go View File

@@ -1244,7 +1244,7 @@ func GetDamageByDrugId(drugid int64, warhousingorder string, drugtype int64) (dr
1244 1244
 
1245 1245
 func GetInventoryModeList(orgid int64) (info []*models.PatientDrugWarehouseInfo, err error) {
1246 1246
 
1247
-	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1 and (x.stock_max_number>0 or x.stock_min_number>0)")
1247
+	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1 and (x.warehousing_count>0)")
1248 1248
 	table := XTReadDB().Table("xt_base_drug as t").Where("t.status = 1")
1249 1249
 	fmt.Println(table)
1250 1250
 	if orgid > 0 {
@@ -5293,6 +5293,27 @@ func GetDrugWarhouseHouseOutInfo(org_id int64, start_time int64, end_time int64)
5293 5293
 
5294 5294
 }
5295 5295
 
5296
+func GetDrugWarehouseCancelOutInfo(org_id int64, start_time int64, end_time int64) (flow []*models.XtDrugFlowList, err error) {
5297
+
5298
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type= 7)")
5299
+
5300
+	if org_id > 0 {
5301
+		db = db.Where("user_org_id = ?", org_id)
5302
+	}
5303
+
5304
+	if start_time > 0 {
5305
+		db = db.Where("ctime >= ?", start_time)
5306
+	}
5307
+
5308
+	if end_time > 0 {
5309
+		db = db.Where("ctime<=?", end_time)
5310
+	}
5311
+
5312
+	err = db.Find(&flow).Error
5313
+
5314
+	return flow, err
5315
+}
5316
+
5296 5317
 func GetDrugMonthWarehouseInfo(org_id int64, start_time int64) (flow []*models.XtDrugFlowList, err error) {
5297 5318
 
5298 5319
 	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type=1 or consumable_type=10)")

+ 19 - 1
service/stock_service.go View File

@@ -6932,7 +6932,7 @@ func UpdatedGoodInfo(info models.GoodInfo, goodid int64) error {
6932 6932
 
6933 6933
 func GetInventoryExportList(orgid int64) (info []*models.PatientWarehouseInfo, err error) {
6934 6934
 
6935
-	db := XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1 and x.stock_count>0")
6935
+	db := XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1 and x.warehousing_count>0")
6936 6936
 	table := XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
6937 6937
 	fmt.Println(table)
6938 6938
 	if orgid > 0 {
@@ -9673,6 +9673,24 @@ func GetGoodStockFlowNoProList(startTime int64, endTime int64, orgId int64) (flo
9673 9673
 	return flow, err
9674 9674
 }
9675 9675
 
9676
+func GetCancelStockFlowList(startTime int64, endTime int64, orgId int64) (flow []*models.VmStockFlow, err error) {
9677
+
9678
+	db := XTReadDB().Model(&flow).Where("status=1 and consumable_type = 7")
9679
+
9680
+	if startTime > 0 {
9681
+		db = db.Where("ctime>=?", startTime)
9682
+	}
9683
+	if endTime > 0 {
9684
+		db = db.Where("ctime<=?", endTime)
9685
+	}
9686
+	if orgId > 0 {
9687
+		db = db.Where("user_org_id = ?", orgId)
9688
+	}
9689
+	err = db.Find(&flow).Error
9690
+
9691
+	return flow, err
9692
+}
9693
+
9676 9694
 func GetLastMonthCount(startTime int64, orgId int64) (flow []*models.VmStockFlow, err error) {
9677 9695
 
9678 9696
 	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type = 1 or consumable_type = 10)")