28169 2 years ago
parent
commit
c9a8e0614c

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

@@ -163,7 +163,7 @@ func MobileAPIControllersRegisterRouters() {
163 163
 
164 164
 	beego.Router("/m/api/updatestockgoods", &DialysisAPIController{}, "Get:UpdateStockGoods")
165 165
 
166
-	beego.Router("/m/api/getmobileschedulelist", &DialysisAPIController{}, "Get:GetMobileScheduleList")
166
+	//beego.Router("/m/api/getmobileschedulelist", &DialysisAPIController{}, "Get:GetMobileScheduleList")
167 167
 
168 168
 	beego.Router("/m/api/getrolelist", &DialysisAPIController{}, "Get:GetRoleList")
169 169
 

+ 11 - 82
controllers/self_drug_api_congtroller.go View File

@@ -2722,9 +2722,9 @@ func (this *SelfDrugApiController) GetStorehouseList() {
2722 2722
 	orgId := this.GetAdminUserInfo().CurrentOrgId
2723 2723
 
2724 2724
 	list, err := service.GetAllStoreHouseList(orgId)
2725
-	manufacturerList, _ := service.GetAllManufacturerList(orgId)
2726
-	goodType, _ := service.GetAllGoodType(orgId)
2727
-	patientList, _ := service.GetAllpatient(orgId)
2725
+	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
2726
+	goodType, _ := service.GetAllNewGoodType(orgId)
2727
+	patientList, _ := service.GetAllpatientThirty(orgId)
2728 2728
 	if err != nil {
2729 2729
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取仓库失败")
2730 2730
 		return
@@ -2761,16 +2761,16 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
2761 2761
 	}
2762 2762
 
2763 2763
 	var ids []int64
2764
-	var goodIds []int64
2764
+	//var goodIds []int64
2765 2765
 	manufacturerList, _ := service.GetManufacturerListByKeyword(orgId, keyword)
2766 2766
 	for _, it := range manufacturerList {
2767 2767
 		ids = append(ids, it.ID)
2768 2768
 	}
2769 2769
 
2770
-	infoList, _ := service.GetGoodWarehouseInfoByOrgId(orgId, storehouse_id)
2771
-	for _, it := range infoList {
2772
-		goodIds = append(goodIds, it.GoodId)
2773
-	}
2770
+	//infoList, _ := service.GetGoodWarehouseInfoByOrgId(orgId, storehouse_id)
2771
+	//for _, it := range infoList {
2772
+	//	goodIds = append(goodIds, it.GoodId)
2773
+	//}
2774 2774
 
2775 2775
 	stockList, total, err := service.GetGoodStockList(orgId, storehouse_id, good_type, keyword, page, limit, ids)
2776 2776
 
@@ -3262,7 +3262,7 @@ func (this *SelfDrugApiController) GetPurchaseDrugQuery() {
3262 3262
 	for _, it := range infoList {
3263 3263
 		infoIds = append(infoIds, it.DrugId)
3264 3264
 	}
3265
-	manufacturerList, _ := service.GetAllManufacturerList(orgId)
3265
+	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
3266 3266
 	list, total, err := service.GetDrugPurchaseStockQuery(good_type, keyword, page, limit, orgId, startTime, endTime, ids, infoIds)
3267 3267
 
3268 3268
 	for _, item := range list {
@@ -3428,7 +3428,6 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
3428 3428
 	for _, it := range infoList {
3429 3429
 		goodIds = append(goodIds, it.DrugId)
3430 3430
 	}
3431
-	//list, total, err := service.GetDrugNewQuery(orgId, storehouse_id, good_type, keyword, page, limit, ids, goodIds, startTime, endTime)
3432 3431
 
3433 3432
 	countList, total, err := service.GetDrugStockCountList(orgId, storehouse_id, good_type, keyword, page, limit, ids, goodIds, startTime, endTime)
3434 3433
 
@@ -3441,8 +3440,7 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
3441 3440
 	drugTypeList, _ := service.GetParentDataConfig(drugTypeParent.ID, orgId)
3442 3441
 
3443 3442
 	this.ServeSuccessJSON(map[string]interface{}{
3444
-		"total": total,
3445
-		//"list":  list,
3443
+		"total":        total,
3446 3444
 		"drugTypeList": drugTypeList,
3447 3445
 		"countList":    countList,
3448 3446
 	})
@@ -3665,7 +3663,7 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3665 3663
 	for _, it := range manufacturers {
3666 3664
 		ids = append(ids, it.ID)
3667 3665
 	}
3668
-	manufacturerList, _ := service.GetAllManufacturerList(orgId)
3666
+	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
3669 3667
 	list, total, err := service.GetGoodNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds)
3670 3668
 
3671 3669
 	for _, item := range list {
@@ -3680,18 +3678,6 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3680 3678
 
3681 3679
 		item.GoodEndFlowInfo = flow
3682 3680
 
3683
-		//获取期初结余数量
3684
-		//infoList, _ := service.GetStartGoodWarehouseInfoList(item.ID, orgId, startTime)
3685
-		//for _, it := range infoList {
3686
-		//  item.WarehousingInfoStart = append(item.WarehousingInfoStart, it)
3687
-		//}
3688
-		//
3689
-		////获取期末结余数量
3690
-		//warehouseInfoList, _ := service.GetEndGoodWarehouseInfoList(item.ID, orgId, endTime)
3691
-		//for _, it := range warehouseInfoList {
3692
-		//  item.WarehousingInfoEnd = append(item.WarehousingInfoEnd, it)
3693
-		//}
3694
-
3695 3681
 		//获取期间增加
3696 3682
 		goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime)
3697 3683
 		for _, it := range goodWarehouseInfoList {
@@ -3720,63 +3706,6 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3720 3706
 			item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
3721 3707
 		}
3722 3708
 
3723
-		////获取期初结余
3724
-		//info, _ := service.FindeStartFlowInfo(item.ID, orgId, startTime)
3725
-		//for _, it := range info {
3726
-		//  item.StartFlowInfo = append(item.StartFlowInfo, it)
3727
-		//}
3728
-		////获取期初结余
3729
-		//flowOutInfo, _ := service.FindeStartFlowOutInfo(item.ID, orgId, startTime)
3730
-		//for _, it := range flowOutInfo {
3731
-		//  item.StartOutFlowInfo = append(item.StartOutFlowInfo, it)
3732
-		//}
3733
-		//
3734
-		////获取期初退库
3735
-		//cancelInfo, _ := service.FindeStartCancelInfo(item.ID, orgId, startTime)
3736
-		//for _, it := range cancelInfo {
3737
-		//  item.StartCancelFlowInfo = append(item.StartCancelFlowInfo, it)
3738
-		//}
3739
-
3740
-		////获取期末结余
3741
-		//flowInfo, _ := service.FindEndStartFlowInfo(item.ID, orgId, endTime)
3742
-		//for _, it := range flowInfo {
3743
-		//  item.EndFlowInfo = append(item.EndFlowInfo, it)
3744
-		//}
3745
-		//
3746
-		////获取期末出库
3747
-		//lowOutInfo, _ := service.FindeEndFLowOutInfo(item.ID, orgId, endTime)
3748
-		//for _, it := range lowOutInfo {
3749
-		//  item.EndFlowOutInfo = append(item.EndFlowOutInfo, it)
3750
-		//}
3751
-		//
3752
-		////获取期末退库
3753
-		//endCancelInfo, _ := service.FindEndCancelInfo(item.ID, orgId, endTime)
3754
-		//for _, it := range endCancelInfo {
3755
-		//  item.EndCancelFLowInfo = append(item.EndCancelFLowInfo, it)
3756
-		//}
3757
-
3758
-		////期初盘赢
3759
-		//inventory, _ := service.FindeStartStockInventoryProfit(item.ID, orgId, startTime)
3760
-		//for _, it := range inventory {
3761
-		//  item.WareStartStockInventoryProfit = append(item.WareStartStockInventoryProfit, it)
3762
-		//}
3763
-		////期初盘亏
3764
-		//stockInventory, _ := service.FindStartStockInventoryLosses(item.ID, orgId, startTime)
3765
-		//for _, it := range stockInventory {
3766
-		//  item.WareStartStockInventoryLosses = append(item.WareStartStockInventoryLosses, it)
3767
-		//}
3768
-
3769
-		////期末盘盈
3770
-		//inventoryProfit, _ := service.FindeStartStockInventoryProfit(item.ID, orgId, endTime)
3771
-		//for _, it := range inventoryProfit {
3772
-		//  item.WareEndStockInventoryProfit = append(item.WareEndStockInventoryProfit, it)
3773
-		//}
3774
-		////期末盘亏
3775
-		//inventoryLosses, _ := service.FindStartStockInventoryLosses(item.ID, orgId, endTime)
3776
-		//for _, it := range inventoryLosses {
3777
-		//  item.WareEndStockInventoryLosses = append(item.WareEndStockInventoryLosses, it)
3778
-		//}
3779
-
3780 3709
 		//期中盘盈
3781 3710
 		profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime)
3782 3711
 		for _, it := range profit {

+ 12 - 0
models/drug.go View File

@@ -100,6 +100,18 @@ func (BaseDrugLibSeven) TableName() string {
100 100
 	return "xt_base_drug"
101 101
 }
102 102
 
103
+type BaseDrugLibTen struct {
104
+	ID                  int64 `gorm:"column:id" json:"id" form:"id"`
105
+	OrgId               int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
106
+	TotalCount          int64 `gorm:"column:total_count" json:"total_count" form:"total_count"`
107
+	DrugStockLimitCount int64 `gorm:"column:drug_stock_limit_count" json:"drug_stock_limit_count" form:"drug_stock_limit_count"`
108
+	Status              int64 `gorm:"column:status" json:"status" form:"status"`
109
+}
110
+
111
+func (BaseDrugLibTen) TableName() string {
112
+	return "xt_base_drug"
113
+}
114
+
103 115
 type DrugUnitSafeguard struct {
104 116
 	ID               int64  `gorm:"column:id" json:"id" form:"id"`
105 117
 	Unit             string `gorm:"column:unit" json:"unit" form:"unit"`

+ 13 - 0
models/drug_stock.go View File

@@ -94,6 +94,19 @@ func (DrugWarehouseInfo) TableName() string {
94 94
 	return "xt_drug_warehouse_info"
95 95
 }
96 96
 
97
+type DrugWarehouseInfoTen struct {
98
+	StockMaxNumber int64 `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
99
+	StockMinNumber int64 `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
100
+	StorehouseId   int64 `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
101
+	IsCheck        int64 `gorm:"column:is_check" json:"is_check" form:"is_check"`
102
+	Status         int64 `gorm:"column:status" json:"status" form:"status"`
103
+	OrgId          int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
104
+}
105
+
106
+func (DrugWarehouseInfoTen) TableName() string {
107
+	return "xt_drug_warehouse_info"
108
+}
109
+
97 110
 type DrugWarehouseInfoSeven struct {
98 111
 	StockMaxNumber int64 `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
99 112
 	StockMinNumber int64 `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`

+ 23 - 0
models/good_models.go View File

@@ -22,6 +22,18 @@ func (GoodsType) TableName() string {
22 22
 	return "xt_goods_type"
23 23
 }
24 24
 
25
+type NewGoodsType struct {
26
+	ID       int64  `gorm:"column:id" json:"id"`
27
+	TypeName string `gorm:"column:type_name" json:"type_name"`
28
+	Remark   string `gorm:"column:remark" json:"remark"`
29
+	OrgId    int64  `gorm:"column:org_id" json:"org_id"`
30
+	Status   int64  `gorm:"column:status" json:"status"`
31
+}
32
+
33
+func (NewGoodsType) TableName() string {
34
+	return "xt_goods_type"
35
+}
36
+
25 37
 type GoodInfo struct {
26 38
 	ID                     int64   `gorm:"column:id" json:"id" form:"id"`
27 39
 	GoodCode               string  `gorm:"column:good_code" json:"good_code" form:"good_code"`
@@ -146,6 +158,17 @@ func (GoodInfoSeven) TableName() string {
146 158
 	return "xt_good_information"
147 159
 }
148 160
 
161
+type GoodInfoTen struct {
162
+	ID         int64 `gorm:"column:id" json:"id" form:"id"`
163
+	OrgId      int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
164
+	Status     int64 `gorm:"column:status" json:"status" form:"status"`
165
+	TotalCount int64 `gorm:"column:total_count" json:"total_count" form:"total_count"`
166
+}
167
+
168
+func (GoodInfoTen) TableName() string {
169
+	return "xt_good_information"
170
+}
171
+
149 172
 type GoodsTypeOne struct {
150 173
 	ID             int64                    `gorm:"column:id" json:"id"`
151 174
 	TypeCode       string                   `gorm:"column:type_code" json:"type_code"`

+ 69 - 17
models/new_stock_models.go View File

@@ -144,6 +144,37 @@ func (NewBaseDrug) TableName() string {
144 144
 	return "xt_base_drug"
145 145
 }
146 146
 
147
+type NewBaseDrugOne struct {
148
+	ID                  int64                  `gorm:"column:id" json:"id" form:"id"`
149
+	DrugName            string                 `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
150
+	DrugSpec            string                 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
151
+	DrugStockLimit      string                 `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
152
+	MaxUnit             string                 `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
153
+	MinNumber           int64                  `gorm:"column:min_number" json:"min_number" form:"min_number"`
154
+	MinUnit             string                 `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
155
+	Dose                string                 `gorm:"column:dose" json:"dose" form:"dose"`
156
+	DoseUnit            string                 `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
157
+	RetailPrice         float64                `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
158
+	MinPrice            float64                `gorm:"column:min_price" json:"min_price" form:"min_price"`
159
+	LastPrice           float64                `gorm:"column:last_price" json:"last_price" form:"last_price"`
160
+	Number              string                 `gorm:"column:number" json:"number" form:"number"`
161
+	OrgId               int64                  `gorm:"column:org_id" json:"org_id" form:"org_id"`
162
+	DrugWarehouseInfo   []*VsDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
163
+	XtDrugStockCount    []*XtDrugStockCount    `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_stock_count"`
164
+	DrugStockCount      []*XtDrugStockCount    `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_stock_info"`
165
+	TotalCount          int64                  `gorm:"column:total_count" json:"total_count" form:"total_count"`
166
+	IsUser              int64                  `gorm:"column:is_user" json:"is_user" form:"is_user"`
167
+	BatchRetaiPrice     float64                `gorm:"column:batch_retai_price" json:"batch_retai_price" form:"batch_retai_price"`
168
+	DrugStockLimitCount int64                  `gorm:"column:drug_stock_limit_count" json:"drug_stock_limit_count" form:"drug_stock_limit_count"`
169
+	SumCount            int64                  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
170
+	SumInCount          int64                  `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
171
+	IsPharmacy          int64                  `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
172
+}
173
+
174
+func (NewBaseDrugOne) TableName() string {
175
+	return "xt_base_drug"
176
+}
177
+
147 178
 type XtDialysisSetting struct {
148 179
 	ID                         int64 `gorm:"column:id" json:"id" form:"id"`
149 180
 	UserOrgId                  int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
@@ -184,28 +215,50 @@ func (XtDialysisSetting) TableName() string {
184 215
 }
185 216
 
186 217
 type VmStockFlowTwenty struct {
187
-	ID                  int64           `gorm:"column:id" json:"id" form:"id"`
188
-	WarehousingId       int64           `gorm:"column:warehousing_id" json:"warehousing_id" form:"warehousing_id"`
189
-	GoodId              int64           `gorm:"column:good_id" json:"good_id" form:"good_id"`
190
-	Count               int64           `gorm:"column:count" json:"count" form:"count"`
191
-	UserOrgId           int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
192
-	PatientId           int64           `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
193
-	SystemTime          int64           `gorm:"column:system_time" json:"system_time" form:"system_time"`
194
-	ConsumableType      int64           `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
195
-	IsSys               int64           `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
196
-	Price               float64         `gorm:"column:price" json:"price" form:"price"`
197
-	WarehousingDetailId int64           `gorm:"column:warehousing_detail_id" json:"warehousing_detail_id" form:"warehousing_detail_id"`
198
-	BuyPrice            float64         `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
199
-	IsRead              int64           `gorm:"column:is_read" json:"is_read" form:"is_read"`
200
-	OverCount           int64           `gorm:"column:over_count" json:"over_count" form:"over_count"`
201
-	Ctime               int64           `gorm:"column:ctime" json:"ctime" form:"ctime"`
202
-	WarehousingInfo     WarehousingInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehousingId" json:"xt_warehouse_info"`
218
+	ID                  int64              `gorm:"column:id" json:"id" form:"id"`
219
+	WarehousingId       int64              `gorm:"column:warehousing_id" json:"warehousing_id" form:"warehousing_id"`
220
+	GoodId              int64              `gorm:"column:good_id" json:"good_id" form:"good_id"`
221
+	Count               int64              `gorm:"column:count" json:"count" form:"count"`
222
+	UserOrgId           int64              `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
223
+	PatientId           int64              `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
224
+	SystemTime          int64              `gorm:"column:system_time" json:"system_time" form:"system_time"`
225
+	ConsumableType      int64              `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
226
+	IsSys               int64              `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
227
+	Price               float64            `gorm:"column:price" json:"price" form:"price"`
228
+	WarehousingDetailId int64              `gorm:"column:warehousing_detail_id" json:"warehousing_detail_id" form:"warehousing_detail_id"`
229
+	BuyPrice            float64            `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
230
+	IsRead              int64              `gorm:"column:is_read" json:"is_read" form:"is_read"`
231
+	OverCount           int64              `gorm:"column:over_count" json:"over_count" form:"over_count"`
232
+	Ctime               int64              `gorm:"column:ctime" json:"ctime" form:"ctime"`
233
+	WarehousingInfo     NewWarehousingInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehousingId" json:"xt_warehouse_info"`
203 234
 }
204 235
 
205 236
 func (VmStockFlowTwenty) TableName() string {
206 237
 	return "xt_stock_flow"
207 238
 }
208 239
 
240
+type VmNewStockFlowTwenty struct {
241
+	ID                  int64   `gorm:"column:id" json:"id" form:"id"`
242
+	WarehousingId       int64   `gorm:"column:warehousing_id" json:"warehousing_id" form:"warehousing_id"`
243
+	GoodId              int64   `gorm:"column:good_id" json:"good_id" form:"good_id"`
244
+	Count               int64   `gorm:"column:count" json:"count" form:"count"`
245
+	UserOrgId           int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
246
+	PatientId           int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
247
+	SystemTime          int64   `gorm:"column:system_time" json:"system_time" form:"system_time"`
248
+	ConsumableType      int64   `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
249
+	IsSys               int64   `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
250
+	Price               float64 `gorm:"column:price" json:"price" form:"price"`
251
+	WarehousingDetailId int64   `gorm:"column:warehousing_detail_id" json:"warehousing_detail_id" form:"warehousing_detail_id"`
252
+	BuyPrice            float64 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
253
+	IsRead              int64   `gorm:"column:is_read" json:"is_read" form:"is_read"`
254
+	OverCount           int64   `gorm:"column:over_count" json:"over_count" form:"over_count"`
255
+	Ctime               int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
256
+}
257
+
258
+func (VmNewStockFlowTwenty) TableName() string {
259
+	return "xt_stock_flow"
260
+}
261
+
209 262
 type GoodInfoTwenty struct {
210 263
 	ID                     int64                   `gorm:"column:id" json:"id" form:"id"`
211 264
 	SpecificationName      string                  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
@@ -216,7 +269,6 @@ type GoodInfoTwenty struct {
216 269
 	OrgId                  int64                   `gorm:"column:org_id" json:"org_id" form:"org_id"`
217 270
 	GoodName               string                  `gorm:"column:good_name" json:"good_name" form:"good_name"`
218 271
 	RetailPrice            float64                 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
219
-	Ctime                  int64                   `gorm:"column:ctime" json:"ctime" form:"ctime"`
220 272
 	PackingUnit            string                  `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
221 273
 	PackingPrice           float64                 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
222 274
 	StWarehousingInfo      []*StWarehousingInfo    `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`

+ 41 - 0
models/stock_models.go View File

@@ -1614,3 +1614,44 @@ type GoodWarehousingInfo struct {
1614 1614
 func (GoodWarehousingInfo) TableName() string {
1615 1615
 	return "xt_warehouse_info"
1616 1616
 }
1617
+
1618
+type BloodManufacturer struct {
1619
+	ID               int64  `gorm:"column:id" json:"id"`
1620
+	ManufacturerName string `gorm:"column:manufacturer_name" json:"manufacturer_name"`
1621
+	OrgId            int64  `gorm:"column:org_id" json:"org_id"`
1622
+	Status           int64  `gorm:"column:status" json:"status"`
1623
+}
1624
+
1625
+func (BloodManufacturer) TableName() string {
1626
+	return "xt_manufacturer"
1627
+}
1628
+
1629
+type GoodQueryNewWarehousingInfo struct {
1630
+	ID      int64 `gorm:"column:id" json:"id"`
1631
+	GoodId  int64 `gorm:"column:good_id" json:"good_id"`
1632
+	Status  int64 `gorm:"column:status" json:"status"`
1633
+	OrgId   int64 `gorm:"column:org_id" json:"org_id"`
1634
+	IsCheck int64 `gorm:"column:is_check" json:"is_check" form:"is_check"`
1635
+}
1636
+
1637
+func (GoodQueryNewWarehousingInfo) TableName() string {
1638
+	return "xt_warehouse_info"
1639
+}
1640
+
1641
+type NewWarehousingInfo struct {
1642
+	ID               int64   `gorm:"column:id" json:"id"`
1643
+	WarehousingId    int64   `gorm:"column:warehousing_id" json:"warehousing_id"`
1644
+	GoodId           int64   `gorm:"column:good_id" json:"good_id"`
1645
+	Price            float64 `gorm:"column:price" json:"price"`
1646
+	Status           int64   `gorm:"column:status" json:"status"`
1647
+	OrgId            int64   `gorm:"column:org_id" json:"org_id"`
1648
+	WarehouseInfoId  int64   `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1649
+	PackingPrice     float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1650
+	IsCheck          int64   `gorm:"column:is_check" json:"is_check" form:"is_check"`
1651
+	WarehousingCount int64   `gorm:"column:warehousing_count" json:"warehousing_count"`
1652
+	StockCount       int64   `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1653
+}
1654
+
1655
+func (NewWarehousingInfo) TableName() string {
1656
+	return "xt_warehouse_info"
1657
+}

+ 1 - 1
service/dialysis_service.go View File

@@ -1480,7 +1480,7 @@ func GetDialysisBeforePrepare(goodTypeId int64, goodId int64, orgid int64, patie
1480 1480
 
1481 1481
 func CreateDialysisBeforePrepareOne(prepare *models.DialysisBeforePrepare) error {
1482 1482
 
1483
-	err := XTReadDB().Create(&prepare).Error
1483
+	err := XTWriteDB().Create(&prepare).Error
1484 1484
 	return err
1485 1485
 }
1486 1486
 

+ 4 - 4
service/doctor_schedule_service.go View File

@@ -58,7 +58,7 @@ func GetClassNameIsExsit(classname string, orgid int64, id int64) (schedule mode
58 58
 
59 59
 func UpdateScheduleList(id int64, schedules *models.DoctorSchedules) error {
60 60
 
61
-	err := XTReadDB().Model(&schedules).Where("id=?", id).Updates(map[string]interface{}{"class_name": schedules.ClassName, "class_attributes": schedules.ClassAttributes, "timeone_start": schedules.TimeoneStart, "timeone_type": schedules.TimeoneType, "timeone_end": schedules.TimeoneEnd, "timetwo_start": schedules.TimetwoStart, "timetwo_type": schedules.TimetwoType, "timetwo_end": schedules.TimetwoEnd, "work_time": schedules.WorkTime, "remarks": schedules.Remarks, "minute": schedules.Minute, "mtime": time.Now().Unix()}).Error
61
+	err := XTWriteDB().Model(&schedules).Where("id=?", id).Updates(map[string]interface{}{"class_name": schedules.ClassName, "class_attributes": schedules.ClassAttributes, "timeone_start": schedules.TimeoneStart, "timeone_type": schedules.TimeoneType, "timeone_end": schedules.TimeoneEnd, "timetwo_start": schedules.TimetwoStart, "timetwo_type": schedules.TimetwoType, "timetwo_end": schedules.TimetwoEnd, "work_time": schedules.WorkTime, "remarks": schedules.Remarks, "minute": schedules.Minute, "mtime": time.Now().Unix()}).Error
62 62
 	return err
63 63
 }
64 64
 
@@ -129,7 +129,7 @@ func AddSchedule(schedule *models.StaffSchedule) error {
129 129
 }
130 130
 
131 131
 func UpdateStaffList(schedule *models.StaffSchedule, id int64) error {
132
-	err := XTReadDB().Model(&schedule).Where("id=?", id).Updates(map[string]interface{}{"doctor_id": schedule.DoctorId, "doctor_type": schedule.DoctorType, "schedule_type": schedule.ScheduleType, "schedule_week": schedule.ScheduleWeek, "schedule_date": schedule.ScheduleDate, "mtime": time.Now().Unix()}).Error
132
+	err := XTWriteDB().Model(&schedule).Where("id=?", id).Updates(map[string]interface{}{"doctor_id": schedule.DoctorId, "doctor_type": schedule.DoctorType, "schedule_type": schedule.ScheduleType, "schedule_week": schedule.ScheduleWeek, "schedule_date": schedule.ScheduleDate, "mtime": time.Now().Unix()}).Error
133 133
 	return err
134 134
 }
135 135
 
@@ -768,14 +768,14 @@ func GetPatientScheduleIsExist(startime int64, schedule_type int64, bed_id int64
768 768
 
769 769
 func CreateDialysisPrescription(prescription *models.DialysisPrescription) error {
770 770
 
771
-	err := XTReadDB().Create(&prescription).Error
771
+	err := XTWriteDB().Create(&prescription).Error
772 772
 
773 773
 	return err
774 774
 }
775 775
 
776 776
 func CreateDialysisSolution(solution models.DialysisSolution) error {
777 777
 
778
-	err := XTReadDB().Create(&solution).Error
778
+	err := XTWriteDB().Create(&solution).Error
779 779
 	return err
780 780
 }
781 781
 

+ 1 - 1
service/his_project_service.go View File

@@ -149,7 +149,7 @@ func UpdatedDepartment(id int64, department *models.XtHisDepartment) error {
149 149
 
150 150
 func DeleteDepartment(id int64) error {
151 151
 	department := models.XtHisDepartment{}
152
-	err := XTReadDB().Model(&department).Where("id=? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
152
+	err := XTWriteDB().Model(&department).Where("id=? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
153 153
 	return err
154 154
 }
155 155
 

+ 1 - 1
service/patientmanage_service.go View File

@@ -1839,7 +1839,7 @@ func DeleteSummary(ids []string) error {
1839 1839
 
1840 1840
 func CreateHisSummary(summary *models.XtHospitalSummary) error {
1841 1841
 
1842
-	err := XTReadDB().Create(&summary).Error
1842
+	err := XTWriteDB().Create(&summary).Error
1843 1843
 	return err
1844 1844
 }
1845 1845
 

+ 25 - 20
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go View File

@@ -85,26 +85,31 @@ func (PatientVM) TableName() string {
85 85
 }
86 86
 
87 87
 type DialysisOrderVM struct {
88
-	ID             int64           `gorm:"column:id" json:"id"`
89
-	DialysisDate   int64           `gorm:"column:dialysis_date" json:"dialysis_date"`
90
-	PatientID      int64           `gorm:"column:patient_id" json:"patient_id"`
91
-	Stage          int64           `gorm:"column:stage" json:"stage"`
92
-	BedID          int64           `gorm:"column:bed_id" json:"bed_id"`
93
-	StartNurse     int64           `gorm:"column:start_nurse" json:"start_nurse"`
94
-	FinishNurse    int64           `gorm:"column:finish_nurse" json:"finish_nurse"`
95
-	StartTime      int64           `gorm:"column:start_time" json:"start_time"`
96
-	EndTime        int64           `gorm:"column:end_time" json:"end_time"`
97
-	PunctureNurse  int64           `gorm:"column:puncture_nurse" json:"puncture_nurse"`
98
-	DeviceNumber   *DeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
99
-	Creator        int64           `gorm:"column:creator" json:"creator"`
100
-	Modifier       int64           `gorm:"column:modifier" json:"modifier"`
101
-	FinishCreator  int64           `gorm:"column:finish_creator" json:"finish_creator"`
102
-	FinishModifier int64           `gorm:"column:finish_modifier" json:"finish_modifier"`
103
-	SchedualType   int64           `gorm:"column:schedual_type" json:"schedual_type"`
104
-	WashpipeNurse  int64           `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
105
-	UserOrgId      int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
106
-	QualityNurseId int64           `gorm:"column:quality_nurse_id" json:"quality_nurse_id" form:"quality_nurse_id"`
107
-	Url            string          `gorm:"column:url" json:"url" form:"url"`
88
+	ID                 int64           `gorm:"column:id" json:"id"`
89
+	DialysisDate       int64           `gorm:"column:dialysis_date" json:"dialysis_date"`
90
+	PatientID          int64           `gorm:"column:patient_id" json:"patient_id"`
91
+	Stage              int64           `gorm:"column:stage" json:"stage"`
92
+	BedID              int64           `gorm:"column:bed_id" json:"bed_id"`
93
+	StartNurse         int64           `gorm:"column:start_nurse" json:"start_nurse"`
94
+	FinishNurse        int64           `gorm:"column:finish_nurse" json:"finish_nurse"`
95
+	StartTime          int64           `gorm:"column:start_time" json:"start_time"`
96
+	EndTime            int64           `gorm:"column:end_time" json:"end_time"`
97
+	PunctureNurse      int64           `gorm:"column:puncture_nurse" json:"puncture_nurse"`
98
+	DeviceNumber       *DeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
99
+	Creator            int64           `gorm:"column:creator" json:"creator"`
100
+	Modifier           int64           `gorm:"column:modifier" json:"modifier"`
101
+	FinishCreator      int64           `gorm:"column:finish_creator" json:"finish_creator"`
102
+	FinishModifier     int64           `gorm:"column:finish_modifier" json:"finish_modifier"`
103
+	SchedualType       int64           `gorm:"column:schedual_type" json:"schedual_type"`
104
+	WashpipeNurse      int64           `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
105
+	UserOrgId          int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
106
+	QualityNurseId     int64           `gorm:"column:quality_nurse_id" json:"quality_nurse_id" form:"quality_nurse_id"`
107
+	Url                string          `gorm:"column:url" json:"url" form:"url"`
108
+	BloodAccessId      int64           `gorm:"column:blood_access_id" json:"blood_access_id" form:"blood_access_id"`
109
+	DialysisIrrigation string          `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
110
+	DialysisDialyszers string          `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
111
+	PunctureWay        string          `gorm:"column:puncture_way" json:"puncture_way" form:"puncture_way"`
112
+	PunctureNeedle     string          `gorm:"column:puncture_needle" json:"puncture_needle" form:"puncture_needle"`
108 113
 }
109 114
 
110 115
 func (DialysisOrderVM) TableName() string {

+ 1 - 1
service/schedule_service.go View File

@@ -1186,7 +1186,7 @@ func GetSettingById(id int64) (*models.XtRemindPrintSetting, error) {
1186 1186
 
1187 1187
 func CreateSetting(setting *models.XtRemindPrintSetting) error {
1188 1188
 
1189
-	err := XTReadDB().Create(&setting).Error
1189
+	err := XTWriteDB().Create(&setting).Error
1190 1190
 	return err
1191 1191
 }
1192 1192
 

+ 6 - 6
service/self_drug_service.go View File

@@ -1196,7 +1196,7 @@ func GetInventoryModeList(orgid int64) (info []*models.PatientDrugWarehouseInfo,
1196 1196
 	return info, err
1197 1197
 }
1198 1198
 
1199
-func GetManufacturerListByKeyword(orgid int64, keyword string) (list []*models.Manufacturer, err error) {
1199
+func GetManufacturerListByKeyword(orgid int64, keyword string) (list []*models.BloodManufacturer, err error) {
1200 1200
 
1201 1201
 	likeKey := "%" + keyword + "%"
1202 1202
 	db := XTReadDB().Model(&list).Where("status = 1")
@@ -1249,7 +1249,7 @@ func GetGoodWarehouseInfoByOrgId(orgid int64, storehouse_id int64) (info []*mode
1249 1249
 	return info, err
1250 1250
 }
1251 1251
 
1252
-func GetGoodWarehouseInfoByOrgIdTwo(orgid int64) (info []*models.WarehousingInfo, err error) {
1252
+func GetGoodWarehouseInfoByOrgIdTwo(orgid int64) (info []*models.GoodQueryNewWarehousingInfo, err error) {
1253 1253
 	db := XTReadDB().Model(&info).Where("is_check =1 and status =1")
1254 1254
 	if orgid > 0 {
1255 1255
 		db = db.Where("org_id = ?", orgid)
@@ -1805,7 +1805,7 @@ func GetDrugNewQuery(orgId int64, storehouse_id int64, good_type int64, keyword
1805 1805
 	return drug, total, err
1806 1806
 }
1807 1807
 
1808
-func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, keyword string, page int64, limit int64, ids []int64, goodIds []int64, startime int64, endtime int64) (drug []*models.NewBaseDrug, total int64, err error) {
1808
+func GetDrugStockCountList(orgId int64, storehouse_id int64, good_type int64, keyword string, page int64, limit int64, ids []int64, goodIds []int64, startime int64, endtime int64) (drug []*models.NewBaseDrugOne, total int64, err error) {
1809 1809
 
1810 1810
 	offset := (page - 1) * limit
1811 1811
 	likeKey := "%" + keyword + "%"
@@ -1894,7 +1894,7 @@ func GetGoodInformationWarehouseInfo(good_id int64, orgid int64) (info []*models
1894 1894
 
1895 1895
 func UpdateGoodInformation(id int64, orgid int64, total_count int64) error {
1896 1896
 
1897
-	err := XTWriteDB().Model(&models.GoodInfo{}).Where("id = ? and org_id = ? and status = 1", id, orgid).Update(map[string]interface{}{"total_count": total_count}).Error
1897
+	err := XTWriteDB().Model(&models.GoodInfoTen{}).Where("id = ? and org_id = ? and status = 1", id, orgid).Update(map[string]interface{}{"total_count": total_count}).Error
1898 1898
 	return err
1899 1899
 }
1900 1900
 
@@ -1904,7 +1904,7 @@ func GetBaseDrugName(orgid int64) (drug []*models.BaseDrugLibTwenty, err error)
1904 1904
 	return drug, err
1905 1905
 }
1906 1906
 
1907
-func GetDrugWarehouseInfoName(drugid int64, orgid int64) (info []*models.DrugWarehouseInfo, err error) {
1907
+func GetDrugWarehouseInfoName(drugid int64, orgid int64) (info []*models.DrugWarehouseInfoTen, err error) {
1908 1908
 
1909 1909
 	err = XTReadDB().Where("drug_id = ? and org_id = ? and is_check = 1 and (stock_max_number >0 or stock_min_number > 0) and status = 1", drugid, orgid).Find(&info).Error
1910 1910
 	return info, err
@@ -1912,7 +1912,7 @@ func GetDrugWarehouseInfoName(drugid int64, orgid int64) (info []*models.DrugWar
1912 1912
 
1913 1913
 func UpdateDrugById(id int64, orgid int64, limit_count int64, total_count int64) error {
1914 1914
 
1915
-	err := XTWriteDB().Model(&models.BaseDrugLib{}).Where("id = ? and org_id = ? and status = 1", id, orgid).Update(map[string]interface{}{"drug_stock_limit_count": limit_count, "total_count": total_count}).Error
1915
+	err := XTWriteDB().Model(&models.BaseDrugLibTen{}).Where("id = ? and org_id = ? and status = 1", id, orgid).Update(map[string]interface{}{"drug_stock_limit_count": limit_count, "total_count": total_count}).Error
1916 1916
 	return err
1917 1917
 }
1918 1918
 

+ 12 - 7
service/stock_service.go View File

@@ -3594,11 +3594,10 @@ func GetAllManufacturerList(orgid int64) (list []*models.Manufacturer, err error
3594 3594
 	return list, err
3595 3595
 }
3596 3596
 
3597
-//func GetAllManufacturerListTX(orgid int64,tx *gorm.DB) (list []*models.Manufacturer, err error) {
3598
-//
3599
-//	err = tx.Where("org_id = ? and status = 1", orgid).Find(&list).Error
3600
-//	return list, err
3601
-//}
3597
+func GetNewAllManufacturerList(orgid int64) (list []*models.BloodManufacturer, err error) {
3598
+	err = XTReadDB().Where("org_id = ? and status = 1", orgid).Find(&list).Error
3599
+	return list, err
3600
+}
3602 3601
 
3603 3602
 func GetAllDealerList(orgid int64) (list []*models.Dealer, err error) {
3604 3603
 
@@ -3706,6 +3705,12 @@ func GetAllGoodType(orgid int64) (goodsType []*models.GoodsType, err error) {
3706 3705
 	return goodsType, err
3707 3706
 }
3708 3707
 
3708
+func GetAllNewGoodType(orgid int64) (goodsType []*models.NewGoodsType, err error) {
3709
+
3710
+	err = XTReadDB().Model(&goodsType).Where("org_id = ? and status = 1", orgid).Find(&goodsType).Error
3711
+	return goodsType, err
3712
+}
3713
+
3709 3714
 func GetDepartMentByName(name string, orgid int64) (*models.XtHisDepartment, error) {
3710 3715
 
3711 3716
 	var department models.XtHisDepartment
@@ -5642,7 +5647,7 @@ func GetLastGoodWarehouseOut(orgid int64) (models.WarehouseOut, error) {
5642 5647
 
5643 5648
 func CreateWarehouseInfo(info models.WarehousingInfo) error {
5644 5649
 
5645
-	err := XTReadDB().Create(&info).Error
5650
+	err := XTWriteDB().Create(&info).Error
5646 5651
 	return err
5647 5652
 }
5648 5653
 
@@ -8225,7 +8230,7 @@ func GetSettleOpenConfig(user_org_id int64) (*models.HisSettleStockConfig, error
8225 8230
 
8226 8231
 func CreateSettleOpenConfig(config models.HisSettleStockConfig) error {
8227 8232
 
8228
-	err := XTReadDB().Create(&config).Error
8233
+	err := XTWriteDB().Create(&config).Error
8229 8234
 	return err
8230 8235
 }
8231 8236