Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
0a08e48d86

+ 0 - 10
controllers/dialysis_api_controller.go View File

@@ -1455,12 +1455,6 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1455 1455
 	blood_access_noise, _ := c.GetInt64("blood_access_noise", 0)
1456 1456
 	internal_fistula_other := c.GetString("internal_fistula_other")
1457 1457
 	blood_access_internal_fistula := c.GetString("blood_access_internal_fistula")
1458
-
1459
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
1460
-	breathing_rate := c.GetString("breathing_rate")
1461
-
1462
-	is_infect, _ := c.GetInt64("is_infect", 0)
1463
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
1464 1458
 	breathing_rate := c.GetString("breathing_rate")
1465 1459
 	is_infect, _ := c.GetInt64("is_infect", 0)
1466 1460
 	exposed, _ := c.GetFloat("exposed", 0)
@@ -2439,10 +2433,6 @@ func (c *DialysisApiController) CreateMonitor() {
2439 2433
 	operate_time, _ := c.GetInt64("operate_time", 0)
2440 2434
 	// monitoring_time := c.GetString("monitoring_time")
2441 2435
 	pulse_frequency, _ := c.GetFloat("pulse_frequency", 0)
2442
-	//breathing_rated, _ := c.GetFloat("breathing_rated", 0)
2443
-	breathing_rated := c.GetString("breathing_rated")
2444
-	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
2445
-	//breathing_rated, _ := c.GetFloat("breathing_rated", 0)
2446 2436
 	breathing_rated := c.GetString("breathing_rated")
2447 2437
 	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
2448 2438
 	diastolic_blood_pressure, _ := c.GetFloat("diastolic_blood_pressure", 0)

+ 0 - 2
controllers/his_api_controller.go View File

@@ -6325,8 +6325,6 @@ func (c *HisApiController) GetFaPiaoData() {
6325 6325
 
6326 6326
 	patient, _ := service.GetPatientByID(adminUser.CurrentOrgId, patient_id)
6327 6327
 
6328
-	//prescriptions, _ := service.GetHisPrescriptionThree(adminUser.CurrentOrgId, patient_id, order.Number)
6329
-	patient, _ := service.GetPatientByID(adminUser.CurrentOrgId, patient_id)
6330 6328
 	var bedCostTotal float64 = 0         //床位总费
6331 6329
 	var bedCostSelfTotal float64 = 0     //床位自费
6332 6330
 	var bedCostPartSelfTotal float64 = 0 //床位部分项目自费

+ 1 - 4
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -992,12 +992,9 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
992 992
 	weightReduce, _ := c.GetFloat("weight_loss", 0)
993 993
 	temperature, _ := c.GetFloat("temperature", 0)
994 994
 	pulse_frequency, _ := c.GetFloat("pulse_frequency", 0)
995
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
996
-	breathing_rate := c.GetString("breathing_rate")
997
-	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
998
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
999 995
 	breathing_rate := c.GetString("breathing_rate")
1000 996
 	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
997
+
1001 998
 	diastolic_blood_pressure, _ := c.GetFloat("diastolic_blood_pressure", 0)
1002 999
 	actual_ultrafiltration, _ := c.GetFloat("actual_ultrafiltration", 0)
1003 1000
 	actual_displacement, _ := c.GetFloat("actual_displacement", 0)

+ 0 - 6
controllers/mobile_api_controllers/dialysis_api_controller_extend.go View File

@@ -65,9 +65,6 @@ func (this *DialysisAPIController) AddMonitorRecord() {
65 65
 	//breathingRated, _ := this.GetFloat("breathing_rated")
66 66
 	breathingRated := this.GetString("breathing_rated")
67 67
 	systolicBP, _ := this.GetFloat("systolic_bp")
68
-	//breathingRated, _ := this.GetFloat("breathing_rated")
69
-	breathingRated := this.GetString("breathing_rated")
70
-	systolicBP, _ := this.GetFloat("systolic_bp")
71 68
 	diastolicBP, _ := this.GetFloat("diastolic_bp")
72 69
 	BPType, _ := this.GetInt("bp_type")
73 70
 	bloodFlowVolume, _ := this.GetFloat("blood_flow_volume")
@@ -246,9 +243,6 @@ func (this *DialysisAPIController) EditMonitorRecord() {
246 243
 	//breathingRated, _ := this.GetFloat("breathing_rated")
247 244
 	breathingRated := this.GetString("breathing_rated")
248 245
 	systolicBP, _ := this.GetFloat("systolic_bp")
249
-	//breathingRated, _ := this.GetFloat("breathing_rated")
250
-	breathingRated := this.GetString("breathing_rated")
251
-	systolicBP, _ := this.GetFloat("systolic_bp")
252 246
 	diastolicBP, _ := this.GetFloat("diastolic_bp")
253 247
 	BPType, _ := this.GetInt("bp_type")
254 248
 	bloodFlowVolume, _ := this.GetFloat("blood_flow_volume")

+ 0 - 2
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -2458,8 +2458,6 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2458 2458
 
2459 2459
 	if dataBody["breathing_rate"] != nil && reflect.TypeOf(dataBody["breathing_rate"]).String() == "string" {
2460 2460
 		breathingRate := dataBody["breathing_rate"].(string)
2461
-		//breathingRate, _ := strconv.ParseFloat(dataBody["breathing_rate"].(string), 64)
2462
-		breathingRate, _ := dataBody["breathing_rate"].(string)
2463 2461
 		evaluation.BreathingRate = breathingRate
2464 2462
 	}
2465 2463
 

+ 0 - 10
controllers/sign_weigh_api_controller.go View File

@@ -356,14 +356,9 @@ func (c *SignWeighAPIController) SaveData() {
356 356
 	dry_weight, _ := c.GetFloat("dry_weight", 0)
357 357
 	temperature, _ := c.GetFloat("temperature", 0)
358 358
 	pulse_frequency, _ := c.GetFloat("pulse_frequency", 0)
359
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
360
-	breathing_rate := c.GetString("breathing_rate")
361
-	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
362
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
363 359
 	breathing_rate := c.GetString("breathing_rate")
364 360
 	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
365 361
 	diastolic_blood_pressure, _ := c.GetFloat("diastolic_blood_pressure", 0)
366
-
367 362
 	predialysisevaluation := &models.PredialysisEvaluation{
368 363
 		WeightBefore:           weight_before,
369 364
 		DryWeight:              dry_weight,
@@ -387,14 +382,9 @@ func (c *SignWeighAPIController) EditData() {
387 382
 	dry_weight, _ := c.GetFloat("dry_weight", 0)
388 383
 	temperature, _ := c.GetFloat("temperature", 0)
389 384
 	pulse_frequency, _ := c.GetFloat("pulse_frequency", 0)
390
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
391
-	breathing_rate := c.GetString("breathing_rate")
392
-	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
393
-	//breathing_rate, _ := c.GetFloat("breathing_rate", 0)
394 385
 	breathing_rate := c.GetString("breathing_rate")
395 386
 	systolic_blood_pressure, _ := c.GetFloat("systolic_blood_pressure", 0)
396 387
 	diastolic_blood_pressure, _ := c.GetFloat("diastolic_blood_pressure", 0)
397
-
398 388
 	assessmentafterdislysis := &models.AssessmentAfterDislysis{
399 389
 		WeightAfter:            weight_after,
400 390
 		DryWeight:              dry_weight,

+ 0 - 1
models/dialysis.go View File

@@ -707,7 +707,6 @@ type MonitoringRecord struct {
707 707
 	MonitoringTime              string  `gorm:"column:monitoring_time" json:"monitoring_time"`
708 708
 	PulseFrequency              float64 `gorm:"column:pulse_frequency" json:"pulse_frequency"`
709 709
 	BreathingRate               string  `gorm:"column:breathing_rate" json:"breathing_rate"`
710
-	BreathingRate               string  `gorm:"column:breathing_rate" json:"breathing_rate"`
711 710
 	SystolicBloodPressure       float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure"`
712 711
 	DiastolicBloodPressure      float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure"`
713 712
 	BloodPressureType           int64   `gorm:"column:blood_pressure_type" json:"blood_pressure_type"`

+ 13 - 475
models/pharmacy_models.go View File

@@ -9,19 +9,13 @@ type Pharmary struct {
9 9
 	Mtime      int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
10 10
 	Status     int64 `gorm:"column:status" json:"status" form:"status"`
11 11
 	RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
12
-
13
-
14 12
 }
15 13
 
16 14
 func (Pharmary) TableName() string {
17
-  return "sgj_xt.xt_pharmacy"
15
+	return "sgj_xt.xt_pharmacy"
18 16
 }
19 17
 
20 18
 type XtErrs struct {
21
-  OrgId     int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
22
-  Route     string `gorm:"column:route" json:"route" form:"route"`
23
-  Parameter string `gorm:"column:parameter" json:"parameter" form:"parameter"`
24
-  Text_err  string `gorm:"column:text_err" json:"text_err" form:"text_err"`
25 19
 	OrgId     int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
26 20
 	Route     string `gorm:"column:route" json:"route" form:"route"`
27 21
 	Parameter string `gorm:"column:parameter" json:"parameter" form:"parameter"`
@@ -29,31 +23,18 @@ type XtErrs struct {
29 23
 }
30 24
 
31 25
 func (XtErrs) TableName() string {
32
-  return "sgj_xt.xt_errs"
33
-
34
-
26
+	return "sgj_xt.xt_errs"
27
+}
35 28
 
36 29
 //病人
37 30
 type TmpPatient struct {
38 31
 	PatientID  int64
39 32
 	Name       string
40 33
 	DialysisNo string //透析号
41
-  PatientID  int64
42
-  Name       string
43
-  DialysisNo string //透析号
44 34
 }
45 35
 
46 36
 //药品信息
47 37
 type PharmacyContent struct {
48
-  Name         string //名称
49
-  SingleDosage string //单次用量
50
-  Usage        string //用法
51
-  Frequency    string //频率
52
-  Days         string //天数
53
-  Total        string //总量
54
-  Doctor       string //开立医生
55
-  DataSources  string //数据来源
56
-  Remarks      string //备注
57 38
 	Name         string //名称
58 39
 	SingleDosage string //单次用量
59 40
 	Usage        string //用法
@@ -73,31 +54,15 @@ type DispensingList struct {
73 54
 	DoctorName string //医生姓名
74 55
 	RecordTime int64  //发药时间(转化前)
75 56
 	RecordDate string //发药时间(转化后)
76
-  PatientID  int64  //	患者id
77
-  Name       string //患者姓名
78
-  DoctorId   int64  //医生id
79
-  DoctorName string //医生姓名
80
-  RecordTime int64  //发药时间(转化前)
81
-  RecordDate string //发药时间(转化后)
82 57
 }
83 58
 type PrescripDetailsList struct {
84
-  Name string //处方名
85
-  Id   int64  //处方id
86
-  Pres []*PrescripDetails
87
-
88
-
59
+	Name string //处方名
60
+	Id   int64  //处方id
61
+	Pres []*PrescripDetails
89 62
 }
90 63
 
91 64
 //处方详情
92 65
 type PrescripDetails struct {
93
-  Drugname     string //药品名称
94
-  SingleDosage string //单次用量
95
-  Usage        string //用法
96
-  Frequency    string //频率
97
-  Days         string //天数
98
-  Total        string //总量
99
-  UnitPrice    string //单价
100
-  Remarks      string //备注
101 66
 	Drugname     string //药品名称
102 67
 	SingleDosage string //单次用量
103 68
 	Usage        string //用法
@@ -110,13 +75,6 @@ type PrescripDetails struct {
110 75
 
111 76
 //临时医嘱
112 77
 type StatOrder struct {
113
-  StartTime             string //开始时间
114
-  Name                  string //医嘱名称
115
-  Specifications        string //药品规格
116
-  PreQuantity           string //开药数量
117
-  SingleDosage          string //单次用量
118
-  RouteOfAdministration string //给药途径
119
-  ExecutionFrequency    string //执行频率
120 78
 	StartTime             string //开始时间
121 79
 	Name                  string //医嘱名称
122 80
 	Specifications        string //药品规格
@@ -128,25 +86,6 @@ type StatOrder struct {
128 86
 
129 87
 //退库用的结构体
130 88
 type SpecialForStock struct {
131
-  BatchNumber       string      `json:"batch_number"`
132
-  BatchNumberId     int64       `json:"batch_number_id"`
133
-  Dealer            string      `json:"dealer"`
134
-  DrugId            int64       `json:"drug_id"`
135
-  DrugName          string      `json:"drug_name"`
136
-  DrugType          int64       `json:"drug_type"`
137
-  DrugWarehouseInfo interface{} `json:"drug_warehouse_info"`
138
-  ExpiryDate        string      `json:"expiry_date"`
139
-  LastPrice         float64     `json:"last_price"`
140
-  Manufacturer      string      `json:"manufacturer"`
141
-  MaxUnit           string      `json:"max_unit"`
142
-  MinUnit           string      `json:"min_unit"`
143
-  Name              string      `json:"name"`
144
-  Price             string      `json:"price"`
145
-  ProductDate       string      `json:"product_date"`
146
-  RegisterAccount   string      `json:"register_account"`
147
-  Remark            string      `json:"remark"`
148
-  RetailPrice       string      `json:"retail_price"`
149
-  ReturnCount       string      `json:"return_count"`
150 89
 	BatchNumber       string      `json:"batch_number"`
151 90
 	BatchNumberId     int64       `json:"batch_number_id"`
152 91
 	Dealer            string      `json:"dealer"`
@@ -170,26 +109,14 @@ type SpecialForStock struct {
170 109
 
171 110
 //药品发药药品列表
172 111
 type ListOfDrugs struct {
173
-  ID             int64  `json:"id"`             //药品id
174
-  Name           string `json:"name"`           //药品 名称
175
-  Specifications string `json:"specifications"` //规格
176
-  Stock          string `json:"stock"`          //库存(当前的仓库库存)
112
+	ID             int64  `json:"id"`             //药品id
113
+	Name           string `json:"name"`           //药品 名称
114
+	Specifications string `json:"specifications"` //规格
115
+	Stock          string `json:"stock"`          //库存(当前的仓库库存)
177 116
 }
178 117
 
179 118
 //病人信息
180 119
 type PatientInformation struct {
181
-  Id           string `json:"id"`            //hid表示his_doctor_advice_info的id ,xid表示xt_doctor_advice的id
182
-  PatientId    int64  `json:"patient_id"`    //患者id
183
-  Name         string `json:"name"`          //患者姓名
184
-  SingleDosage string `json:"single_dosage"` //单次用量
185
-  Usage        string `json:"usage"`         //用法
186
-  Frequency    string `json:"frequency"`     //频率
187
-  Days         string `json:"days"`          //天数
188
-  Total        string `json:"total"`         //总量
189
-  DataSources  string `json:"data_sources"`  //数据来源
190
-  People       string `json:"people"`        //领药人
191
-  Quantity     int64  `json:"quantity"`      //总量拆分——数据部分
192
-  Unit         string `json:"unit"`          //总量拆分——单位部分
193 120
 	Id           string `json:"id"`            //hid表示his_doctor_advice_info的id ,xid表示xt_doctor_advice的id
194 121
 	PatientId    int64  `json:"patient_id"`    //患者id
195 122
 	Name         string `json:"name"`          //患者姓名
@@ -261,118 +188,13 @@ type HisDoctorAdviceInfoL struct {
261 188
 	IsMedicine            int64   `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
262 189
 	People                int64   `gorm:"column:people" json:"people" form:"people"`
263 190
 	DispensingTime        int64   `gorm:"column:dispensing_time" json:"dispensing_time" form:"dispensing_time"`
264
-  ID                    int64   `gorm:"column:id" json:"id" form:"id"`
265
-  UserOrgId             int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
266
-  PatientId             int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
267
-  HisPatientId          int64   `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
268
-  AdviceType            int64   `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
269
-  AdviceDate            int64   `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
270
-  StartTime             int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
271
-  AdviceName            string  `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
272
-  AdviceDesc            string  `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
273
-  ReminderDate          int64   `gorm:"column:reminder_date" json:"reminder_date" form:"reminder_date"`
274
-  SingleDose            float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
275
-  SingleDoseUnit        string  `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
276
-  PrescribingNumber     float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
277
-  PrescribingNumberUnit string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
278
-  DeliveryWay           string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
279
-  ExecutionFrequency    string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
280
-  AdviceDoctor          int64   `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
281
-  Status                int64   `gorm:"column:status" json:"status" form:"status"`
282
-  CreatedTime           int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
283
-  UpdatedTime           int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
284
-  AdviceAffirm          string  `gorm:"column:advice_affirm" json:"advice_affirm" form:"advice_affirm"`
285
-  Remark                string  `gorm:"column:remark" json:"remark" form:"remark"`
286
-  StopTime              int64   `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
287
-  StopReason            string  `gorm:"column:stop_reason" json:"stop_reason" form:"stop_reason"`
288
-  StopDoctor            int64   `gorm:"column:stop_doctor" json:"stop_doctor" form:"stop_doctor"`
289
-  StopState             int64   `gorm:"column:stop_state" json:"stop_state" form:"stop_state"`
290
-  ParentId              int64   `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
291
-  ExecutionTime         int64   `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
292
-  ExecutionStaff        int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
293
-  ExecutionState        int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
294
-  Checker               int64   `gorm:"column:checker" json:"checker" form:"checker"`
295
-  RecordDate            int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
296
-  DialysisOrderId       int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
297
-  CheckTime             int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
298
-  CheckState            int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
299
-  DrugSpec              float64 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
300
-  DrugSpecUnit          string  `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
301
-  Groupno               int64   `gorm:"column:groupno" json:"groupno" form:"groupno"`
302
-  RemindType            int64   `gorm:"column:remind_type" json:"remind_type" form:"remind_type"`
303
-  FrequencyType         int64   `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
304
-  DayCount              int64   `gorm:"column:day_count" json:"day_count" form:"day_count"`
305
-  WeekDay               string  `gorm:"column:week_day" json:"week_day" form:"week_day"`
306
-  TemplateId            string  `gorm:"column:template_id" json:"template_id" form:"template_id"`
307
-  Modifier              int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
308
-  DrugId                int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
309
-  Price                 float64 `gorm:"column:price" json:"price" form:"price"`
310
-  PrescriptionId        int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
311
-  MedListCodg           string  `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
312
-  FeedetlSn             string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
313
-  Day                   int64   `gorm:"column:day" json:"day" form:"day"`
314
-  Diagnosis             int64   `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
315
-  Way                   int64   `gorm:"column:way" json:"way" form:"way"`
316
-  HospApprFlag          int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
317
-  LmtUsedFlag           int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
318
-  IsMedicine            int64   `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
319
-  People                int64   `gorm:"column:people" json:"people" form:"people"`
320
-  DispensingTime        int64   `gorm:"column:dispensing_time" json:"dispensing_time" form:"dispensing_time"`
321 191
 }
322 192
 
323 193
 func (HisDoctorAdviceInfoL) TableName() string {
324
-  return "sgj_xt.his_doctor_advice_info"
194
+	return "sgj_xt.his_doctor_advice_info"
325 195
 }
326 196
 
327 197
 type XtDoctorAdviceL struct {
328
-  ID                    int64   `gorm:"column:id" json:"id" form:"id"`
329
-  UserOrgId             int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
330
-  PatientId             int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
331
-  AdviceType            int64   `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
332
-  AdviceDate            int64   `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
333
-  StartTime             int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
334
-  AdviceName            string  `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
335
-  AdviceDesc            string  `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
336
-  ReminderDate          int64   `gorm:"column:reminder_date" json:"reminder_date" form:"reminder_date"`
337
-  SingleDose            float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
338
-  SingleDoseUnit        string  `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
339
-  PrescribingNumber     float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
340
-  PrescribingNumberUnit string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
341
-  DeliveryWay           string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
342
-  ExecutionFrequency    string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
343
-  AdviceDoctor          int64   `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
344
-  Status                int64   `gorm:"column:status" json:"status" form:"status"`
345
-  CreatedTime           int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
346
-  UpdatedTime           int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
347
-  AdviceAffirm          string  `gorm:"column:advice_affirm" json:"advice_affirm" form:"advice_affirm"`
348
-  Remark                string  `gorm:"column:remark" json:"remark" form:"remark"`
349
-  StopTime              int64   `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
350
-  StopReason            string  `gorm:"column:stop_reason" json:"stop_reason" form:"stop_reason"`
351
-  StopDoctor            int64   `gorm:"column:stop_doctor" json:"stop_doctor" form:"stop_doctor"`
352
-  StopState             int64   `gorm:"column:stop_state" json:"stop_state" form:"stop_state"`
353
-  ParentId              int64   `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
354
-  ExecutionTime         int64   `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
355
-  ExecutionStaff        int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
356
-  ExecutionState        int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
357
-  Checker               int64   `gorm:"column:checker" json:"checker" form:"checker"`
358
-  RecordDate            int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
359
-  DialysisOrderId       int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
360
-  CheckTime             int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
361
-  CheckState            int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
362
-  DrugSpec              float64 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
363
-  DrugSpecUnit          string  `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
364
-  Groupno               int64   `gorm:"column:groupno" json:"groupno" form:"groupno"`
365
-  RemindType            int64   `gorm:"column:remind_type" json:"remind_type" form:"remind_type"`
366
-  FrequencyType         int64   `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
367
-  DayCount              int64   `gorm:"column:day_count" json:"day_count" form:"day_count"`
368
-  WeekDay               string  `gorm:"column:week_day" json:"week_day" form:"week_day"`
369
-  TemplateId            string  `gorm:"column:template_id" json:"template_id" form:"template_id"`
370
-  UserName              string  `gorm:"column:user_name" json:"user_name" form:"user_name"`
371
-  CheckerName           string  `gorm:"column:user_name" json:"name" form:"name"`
372
-  Modifier              int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
373
-  IsMedicine            int64   `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
374
-  People                int64   `gorm:"column:people" json:"people" form:"people"`
375
-  DispensingTime        int64   `gorm:"column:dispensing_time" json:"dispensing_time" form:"dispensing_time"`
376 198
 	ID                    int64   `gorm:"column:id" json:"id" form:"id"`
377 199
 	UserOrgId             int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
378 200
 	PatientId             int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
@@ -424,307 +246,23 @@ type XtDoctorAdviceL struct {
424 246
 }
425 247
 
426 248
 func (XtDoctorAdviceL) TableName() string {
427
-  return "sgj_xt.xt_doctor_advice"
249
+	return "sgj_xt.xt_doctor_advice"
428 250
 }
429 251
 
430 252
 type TmpTTT struct {
431
-  PatientID int64
253
+	PatientID int64
432 254
 }
433 255
 type TmpLLL struct {
434
-  DrugId int64
435 256
 	DrugId int64
436 257
 }
437 258
 type TmpID struct {
438
-  Id             int64
439
-  DispensingTime int64
440 259
 	Id             int64
441 260
 	DispensingTime int64
442 261
 }
443
-type TmpAdviceDoctor struct {
444
-  AdviceDoctor int64
445 262
 type TmpAdviceDoctor struct {
446 263
 	AdviceDoctor int64
447 264
 }
448 265
 
449
-//替换药品名称
450
-type ReplacementDrugs struct {
451
-  Id   int64  `json:"id"`
452
-  Name string `json:"name"`
453
-}
454
-
455
-//病人
456
-type DialysisPatient struct {
457
-  ID   int64  `json:"id"`
458
-  Name string `json:"name"`
459
-}
460
-
461
-//项目下拉列表
462
-type DropDownList struct {
463
-  Id   string `json:"id"`
464
-  Name string `json:"name"`
465
-}
466
-type XtHisProjectL struct {
467
-  ID                          int64   `gorm:"column:id" json:"id" form:"id"`
468
-  ProjectName                 string  `gorm:"column:project_name" json:"project_name" form:"project_name"`
469
-  Pinyin                      string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
470
-  Wubi                        string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
471
-  Price                       float64 `gorm:"column:price" json:"price" form:"price"`
472
-  Unit                        string  `gorm:"column:unit" json:"unit" form:"unit"`
473
-  CostClassify                int64   `gorm:"column:cost_classify" json:"cost_classify" form:"cost_classify"`
474
-  ExecutiveSection            int64   `gorm:"column:executive_section" json:"executive_section" form:"executive_section"`
475
-  MedicalCoverage             int64   `gorm:"column:medical_coverage" json:"medical_coverage" form:"medical_coverage"`
476
-  StatisticalClassification   int64   `gorm:"column:statistical_classification" json:"statistical_classification" form:"statistical_classification"` //统计分类(组
477
-  DiseaseDirectory            int64   `gorm:"column:disease_directory" json:"disease_directory" form:"disease_directory"`
478
-  IsRecord                    int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
479
-  MedicalCode                 string  `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
480
-  TubeColor                   int64   `gorm:"column:tube_color" json:"tube_color" form:"tube_color"`
481
-  MedicalStatus               int64   `gorm:"column:medical_status" json:"medical_status" form:"medical_status"`
482
-  Remark                      string  `gorm:"column:remark" json:"remark" form:"remark"`
483
-  Sign                        int64   `gorm:"column:sign" json:"sign" form:"sign"`
484
-  DefaultNumber               string  `gorm:"column:default_number" json:"prescribing_number" form:"default_number"`
485
-  IsDefault                   int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
486
-  IsCharge                    int64   `gorm:"column:is_charge" json:"is_charge" form:"is_charge"`
487
-  IsEstimate                  int64   `gorm:"column:is_estimate" json:"is_estimate" form:"is_estimate"`
488
-  IsWorkload                  int64   `gorm:"column:is_workload" json:"is_workload" form:"is_workload"`
489
-  Sort                        string  `gorm:"column:sort" json:"sort" form:"sort"`
490
-  DoctorAdvice                int64   `gorm:"column:doctor_advice" json:"doctor_advice" form:"doctor_advice"`
491
-  UserOrgId                   int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
492
-  Status                      int64   `gorm:"column:status" json:"status" form:"status"`
493
-  CreatedTime                 int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
494
-  UpdatedTime                 int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
495
-  SingleDose                  string  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
496
-  ExecutionFrequency          string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
497
-  DeliveryWay                 string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
498
-  NumberDays                  string  `gorm:"column:number_days" json:"day" form:"number_days"`
499
-  Total                       string  `gorm:"column:total" json:"total" form:"total"`
500
-  Category                    int64   `gorm:"column:category" json:"category" form:"category"`
501
-  IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
502
-  SpecailProject              int64   `gorm:"column:specail_project" json:"specail_project" form:"specail_project"`
503
-  SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
504
-  RecordDate                  int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
505
-  Translate                   string  `json:"translate"` //翻译——统计分类(组
506
-}
507
-
508
-func (XtHisProjectL) TableName() string {
509
-  return "sgj_xt.xt_his_project"
510
-}
511
-
512
-type GoodInfoL struct {
513
-  ID                     int64   `gorm:"column:id" json:"id" form:"id"`
514
-  GoodCode               string  `gorm:"column:good_code" json:"good_code" form:"good_code"`
515
-  SpecificationName      string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
516
-  GoodTypeId             int64   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
517
-  GoodUnit               int64   `gorm:"column:good_unit" json:"good_unit" form:"good_unit"`
518
-  BuyPrice               float64 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
519
-  SellPrice              float64 `gorm:"column:sell_price" json:"sell_price" form:"sell_price"`
520
-  Remark                 string  `gorm:"column:remark" json:"remark" form:"remark"`
521
-  Ctime                  int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
522
-  Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
523
-  Manufacturer           int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
524
-  Dealer                 int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
525
-  ExpiryDateWarnDayCount int64   `gorm:"column:expiry_date_warn_day_count" json:"expiry_date_warn_day_count" form:"expiry_date_warn_day_count"`
526
-  StockWarnCount         int64   `gorm:"column:stock_warn_count" json:"stock_warn_count" form:"stock_warn_count"`
527
-  IsReuse                int64   `gorm:"column:is_reuse" json:"is_reuse" form:"is_reuse"`
528
-  Status                 int64   `gorm:"column:status" json:"status" form:"status"`
529
-  FilmArea               string  `gorm:"column:film_area" json:"film_area" form:"film_area"`
530
-  IsUse                  int64   `gorm:"column:is_use" json:"is_use" form:"is_use"`
531
-  FilmMaterialQuality    string  `gorm:"column:film_material_quality" json:"film_material_quality" form:"film_material_quality"`
532
-  OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
533
-  Modifier               int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
534
-  Creater                int64   `gorm:"column:creater" json:"creater" form:"creater"`
535
-  GoodName               string  `gorm:"column:good_name" json:"good_name" form:"good_name"`
536
-  Pinyin                 string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
537
-  Wubi                   string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
538
-  GoodKind               int64   `gorm:"column:good_kind" json:"good_kind" form:"good_kind"` //组
539
-  MedicalInsuranceLevel  int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
540
-  RetailPrice            float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
541
-  MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
542
-  ProvincesCode          string  `gorm:"column:provinces_code" json:"provinces_code" form:"provinces_code"`
543
-
544
-  IsSpecialDiseases           int64                `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
545
-  IsRecord                    int64                `gorm:"column:is_record" json:"is_record" form:"is_record"`
546
-  StatisticsCategory          int64                `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
547
-  GoodStatus                  string               `gorm:"column:good_status" json:"good_status" form:"good_status"`
548
-  DefaultCount                int64                `gorm:"column:default_count" json:"default_count" form:"default_count"`
549
-  Sign                        int64                `gorm:"column:sign" json:"sign" form:"sign"`
550
-  IsDefault                   int64                `gorm:"column:is_default" json:"is_default" form:"is_default"`
551
-  IsChargeUse                 int64                `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
552
-  IsChargePredict             int64                `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
553
-  IsStatisticsWork            int64                `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
554
-  Sort                        int64                `gorm:"column:sort" json:"sort" form:"sort"`
555
-  IsDoctorUse                 int64                `gorm:"column:is_doctor_use" json:"is_doctor_use" form:"is_doctor_use"`
556
-  Agent                       string               `gorm:"column:agent" json:"agent" form:"agent"`
557
-  GoodNumber                  string               `gorm:"column:good_number" json:"good_number" form:"good_number"`
558
-  GoodsType                   GoodsType            `gorm:"ForeignKey:ID;AssociationForeignKey:GoodTypeId" json:"type"`
559
-  CommdityCode                string               `gorm:"column:commdity_code" json:"commdity_code" form:"commdity_code"`
560
-  SocialSecurityDirectoryCode string               `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
561
-  ProductionType              string               `gorm:"column:production_type" json:"production_type" form:"production_type"`
562
-  SpecialMedical              string               `gorm:"column:special_medical" json:"special_medical" form:"special_medical"`
563
-  IsMark                      int64                `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
564
-  MinNumber                   int64                `gorm:"column:min_number" json:"min_number" form:"min_number"`
565
-  PackingUnit                 string               `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
566
-  PackingPrice                float64              `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
567
-  DefaultCountUnit            string               `gorm:"column:default_count_unit" json:"default_count_unit" form:"default_count_unit"`
568
-  MinUnit                     string               `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
569
-  Total                       float64              `gorm:"column:total" json:"total" form:"total"`
570
-  StWarehousingInfo           []*StWarehousingInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
571
-  CancelStockInfo             []*CancelStockInfo   `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"cancel_stock_info"`
572
-  RegisterNumber              string               `gorm:"column:register_number" json:"register_number" form:"register_number"`
573
-  GoodSotckInfo               []*GoodSotckInfo     `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_stock_in"`
574
-  IsUser                      int64                `gorm:"column:is_user" json:"is_user" form:"is_user"`
575
-  Number                      string               `gorm:"column:number" json:"number" form:"number"`
576
-  IsWarehouse                 int64                `gorm:"column:is_warehouse" json:"is_warehouse" form:"is_warehouse"`
577
-  SumCount                    int64                `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
578
-  BatchRetaiPrice             float64              `gorm:"column:batch_retai_price" json:"batch_retai_price" form:"batch_retai_price"`
579
-  SumInCount                  int64                `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
580
-  WarehousingInfo             []*WarehousingInfo   `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"warehouse_info"`
581
-  Translate                   string               `json:"translate"` //翻译——统计分类(组
582
-}
583
-
584
-func (GoodInfoL) TableName() string {
585
-  return "sgj_xt.xt_good_information"
586
-}
587
-
588
-type BaseDrugLibL struct {
589
-  ID                          int64   `gorm:"column:id" json:"id" form:"id"`
590
-  DrugName                    string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
591
-  Pinyin                      string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
592
-  Wubi                        string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
593
-  DrugAlias                   string  `gorm:"column:drug_alias" json:"drug_alias" form:"drug_alias"`
594
-  DrugAliasPinyin             string  `gorm:"column:drug_alias_pinyin" json:"drug_alias_pinyin" form:"drug_alias_pinyin"`
595
-  DrugAliasWubi               string  `gorm:"column:drug_alias_wubi" json:"drug_alias_wubi" form:"drug_alias_wubi"`
596
-  DrugCategory                int64   `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
597
-  DrugSpec                    string  `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
598
-  DrugType                    int64   `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
599
-  DrugStockLimit              string  `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
600
-  DrugOriginPlace             string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
601
-  DrugDosageForm              int64   `gorm:"column:drug_dosage_form" json:"drug_dosage_form" form:"drug_dosage_form"`
602
-  MedicalInsuranceLevel       int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
603
-  MaxUnit                     string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
604
-  MinNumber                   int64   `gorm:"column:min_number" json:"min_number" form:"min_number"`
605
-  MinUnit                     string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
606
-  Dose                        string  `gorm:"column:dose" json:"dose" form:"dose"`
607
-  DoseUnit                    string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
608
-  MinPrice                    float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
609
-  UnitMatrixing               string  `gorm:"column:unit_matrixing" json:"unit_matrixing" form:"unit_matrixing"`
610
-  RetailPrice                 float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
611
-  LastPrice                   float64 `gorm:"column:last_price" json:"last_price" form:"last_price"`
612
-  DrugControl                 int64   `gorm:"column:drug_control" json:"drug_control" form:"drug_control"`
613
-  Number                      string  `gorm:"column:number" json:"number" form:"number"`
614
-  DrugClassify                string  `gorm:"column:drug_classify" json:"drug_classify" form:"drug_classify"`
615
-  DrugDose                    float64 `gorm:"column:drug_dose" json:"drug_dose" form:"drug_dose"`
616
-  DrugDoseUnit                int64   `gorm:"column:drug_dose_unit" json:"drug_dose_unit" form:"drug_dose_unit"`
617
-  MedicalInsuranceNumber      string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
618
-  ProvincesCode               string  `gorm:"column:provinces_code" json:"provinces_code" form:"provinces_code"`
619
-  Manufacturer                int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
620
-  PharmacologyCategory        int64   `gorm:"column:pharmacology_category" json:"pharmacology_category" form:"pharmacology_category"`
621
-  StatisticsCategory          int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
622
-  Code                        string  `gorm:"column:code" json:"code" form:"code"`
623
-  IsSpecialDiseases           int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
624
-  IsRecord                    int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
625
-  Agent                       string  `gorm:"column:agent" json:"agent" form:"agent"`
626
-  DrugStatus                  string  `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
627
-  LimitRemark                 string  `gorm:"column:limit_remark" json:"limit_remark" form:"limit_remark"`
628
-  DeliveryWay                 string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
629
-  ExecutionFrequency          string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
630
-  SingleDose                  float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
631
-  SingleDoseUnit              string  `json:"single_dose_unit"` //danwei
632
-  PrescribingNumber           float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
633
-  Label                       int64   `gorm:"column:label" json:"label" form:"label"`
634
-  Sort                        int64   `gorm:"column:sort" json:"sort" form:"sort"`
635
-  IsUseDoctorAdvice           int64   `gorm:"column:is_use_doctor_advice" json:"is_use_doctor_advice" form:"is_use_doctor_advice"`
636
-  IsDefault                   int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
637
-  IsChargePredict             int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
638
-  IsStatisticsWork            int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
639
-  IsChargeUse                 int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
640
-  Status                      int64   `gorm:"column:status" json:"status" form:"status"`
641
-  Ctime                       int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
642
-  Mtime                       int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
643
-  OrgId                       int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
644
-  DrugCode                    string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
645
-  Dealer                      int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
646
-  PrescriptionMark            int64   `gorm:"column:prescription_mark" json:"prescription_mark" form:"prescription_mark"`
647
-  RecordDate                  int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
648
-  DrugRemark                  string  `gorm:"column:drug_remark" json:"drug_remark" form:"drug_remark"`
649
-  SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
650
-  DoseCode                    string  `gorm:"column:dose_code" json:"dose_code" form:"dose_code"`
651
-  IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
652
-  HospApprFlag                int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
653
-  LmtUsedFlag                 int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
654
-  //MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
655
-  DrugDay               string                 `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
656
-  Total                 float64                `gorm:"column:total" json:"total" form:"total"`
657
-  PrescribingNumberUnit string                 `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
658
-  DrugWarehouseInfo     []*XtDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
659
-  IsUse                 int64                  `gorm:"column:is_user" json:"is_user" form:"is_user"`
660
-  BatchRetaiPrice       float64                `gorm:"column:batch_retai_price" json:"batch_retai_price" form:"batch_retai_price"`
661
-  SumCount              int64                  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
662
-  SumInCount            int64                  `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
663
-  IsPharmacy            int64                  `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
664
-  List1                 interface{}            `json:"list_1"`
665
-  List2                 interface{}            `json:"list_2"`
666
-}
667
-
668
-func (BaseDrugLibL) TableName() string {
669
-  return "xt_base_drug"
670
-}
671
-
672
-//组
673
-type HisPrescriptionInfoTemplateL struct {
674
-  ID                             int64                              `gorm:"column:id" json:"id" form:"id"`
675
-  UserOrgId                      int64                              `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
676
-  RecordDate                     int64                              `gorm:"column:record_date" json:"record_date" form:"record_date"`
677
-  PatientId                      int64                              `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
678
-  Status                         int64                              `gorm:"column:status" json:"status" form:"status"`
679
-  Ctime                          int64                              `gorm:"column:ctime" json:"ctime" form:"ctime"`
680
-  Mtime                          int64                              `gorm:"column:mtime" json:"mtime" form:"mtime"`
681
-  Type                           int64                              `gorm:"column:type" json:"type" form:"type"`
682
-  Creator                        int64                              `gorm:"column:creator" json:"creator" form:"creator"`
683
-  Modifier                       int64                              `gorm:"column:modifier" json:"modifier" form:"modifier"`
684
-  PType                          int64                              `gorm:"column:p_type" json:"p_type" form:"p_type"`
685
-  PTemplateId                    int64                              `gorm:"column:p_template_id" json:"p_template_id" form:"p_template_id"`
686
-  HisPrescriptionAdviceTemplate  []*HisPrescriptionAdviceTemplate   `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
687
-  HisPrescriptionProjectTemplate []*HisPrescriptionProjectTemplateL `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
688
-  MedType                        string                             `gorm:"column:med_type" json:"med_type" form:"med_type"`
689
-}
690
-
691
-func (HisPrescriptionInfoTemplateL) TableName() string {
692
-  return "his_prescription_info_template"
693
-}
694
-
695
-type HisPrescriptionProjectTemplateL struct {
696
-  ID                 int64         `gorm:"column:id" json:"id" form:"id"`
697
-  ProjectId          int64         `gorm:"column:project_id" json:"project_id" form:"project_id"`
698
-  Price              float64       `gorm:"column:price" json:"price" form:"price"`
699
-  UserOrgId          int64         `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
700
-  Status             int64         `gorm:"column:status" json:"status" form:"status"`
701
-  Ctime              int64         `gorm:"column:ctime" json:"ctime" form:"ctime"`
702
-  Mtime              int64         `gorm:"column:mtime" json:"mtime" form:"mtime"`
703
-  PatientId          int64         `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
704
-  HisPatientId       int64         `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
705
-  RecordDate         int64         `gorm:"column:record_date" json:"record_date" form:"record_date"`
706
-  Count              string        `gorm:"column:count" json:"count" form:"count"`
707
-  FeedetlSn          string        `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
708
-  MedListCodg        string        `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
709
-  SingleDose         string        `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
710
-  DeliveryWay        string        `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
711
-  ExecutionFrequency string        `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
712
-  Day                string        `gorm:"column:day" json:"day" form:"day"`
713
-  Remark             string        `gorm:"column:remark" json:"remark" form:"remark"`
714
-  Unit               string        `gorm:"column:unit" json:"unit" form:"unit"`
715
-  Type               int64         `gorm:"column:type" json:"type" form:"type"`
716
-  PrescriptionId     int64         `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
717
-  XtHisProject       XtHisProjectL `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"project"`
718
-  GoodInfo           GoodInfoL     `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"good_info"`
719
-  FrequencyType      int64         `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
720
-  DayCount           int64         `gorm:"column:day_count" json:"day_count" form:"day_count"`
721
-  WeekDay            string        `gorm:"column:week_day" json:"week_day" form:"week_day"`
722
-}
723
-
724
-func (HisPrescriptionProjectTemplateL) TableName() string {
725
-  return "his_prescription_project_template"
726
-}
727
-
728 266
 //替换药品名称
729 267
 type ReplacementDrugs struct {
730 268
 	Id   int64  `json:"id"`

+ 40 - 64
service/stock_service.go View File

@@ -4242,6 +4242,44 @@ func GetOrderDetialByOrderIdOne(id []string, orgid int64) (out []*models.Warehou
4242 4242
 	return out, err
4243 4243
 }
4244 4244
 
4245
+func GetOrderDetailStockFlowByStorehouseById(id []string, orgid int64) (list []*models.VmStockFlow, err error) {
4246
+	db := XTReadDB().Model(&list).Where("status = 1 and (consumable_type = 2 or consumable_type = 3)")
4247
+	if len(id) > 0 {
4248
+		db = db.Where("warehouse_out_id in (?)", id)
4249
+	}
4250
+	if orgid > 0 {
4251
+		db = db.Where("user_org_id = ?", orgid)
4252
+	}
4253
+	err = db.Group("warehousing_id").Find(&list).Error
4254
+	return list, err
4255
+}
4256
+
4257
+func GetOrderDetailStockFlow(id []string, orgid int64) (list []*models.VmStockFlow, err error) {
4258
+
4259
+	db := XTReadDB().Model(&list).Where("status = 1 and (consumable_type = 2 or consumable_type = 3)")
4260
+	if len(id) > 0 {
4261
+		db = db.Where("warehouse_out_id in (?)", id)
4262
+	}
4263
+	if orgid > 0 {
4264
+		db = db.Where("user_org_id = ?", orgid)
4265
+	}
4266
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&list).Error
4267
+	return list, err
4268
+}
4269
+
4270
+func GetOrderStockFlow(id []string, orgid int64) (list []*models.VmStockFlow, err error) {
4271
+
4272
+	db := XTReadDB().Model(&list).Where("status = 1 and consumable_type = 7 and patient_id > 0")
4273
+	if len(id) > 0 {
4274
+		db = db.Where("warehouse_out_id in (?)", id)
4275
+	}
4276
+	if orgid > 0 {
4277
+		db = db.Where("user_org_id = ?", orgid)
4278
+	}
4279
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&list).Error
4280
+	return list, err
4281
+}
4282
+
4245 4283
 func GetLastWarehouseOutInfo(ids []string, orgId int64) (info []*models.WarehouseOutInfoSix, err error) {
4246 4284
 
4247 4285
 	db := XTReadDB().Model(&info)
@@ -7202,14 +7240,6 @@ func UpdateCheckWarehouseInfo(id int64) error {
7202 7240
 	}
7203 7241
 	tx.Commit()
7204 7242
 	return err
7205
-	tx := XTWriteDB().Begin()
7206
-	err := tx.Model(&models.Warehousing{}).Where("id =? and status = 1", id).Update(map[string]interface{}{"is_check": 1}).Error
7207
-	if err != nil {
7208
-		tx.Rollback()
7209
-		return err
7210
-	}
7211
-	tx.Commit()
7212
-	return err
7213 7243
 }
7214 7244
 
7215 7245
 func GetWarehouseInfoList(id int64, orgid int64) (info []*models.WarehousingInfo, err error) {
@@ -7233,19 +7263,6 @@ func UpdateWarehouseInfoByIdList(count int64, id int64) error {
7233 7263
 	}
7234 7264
 	tx.Commit()
7235 7265
 	return err
7236
-	tx := XTWriteDB().Begin()
7237
-	err := tx.Model(&models.WarehousingInfo{}).Where("id = ? and status = 1", id).UpdateColumn("stock_count", gorm.Expr("stock_count + ?", count)).Error
7238
-	if err != nil {
7239
-		tx.Rollback()
7240
-		return err
7241
-	}
7242
-	err = tx.Model(&models.WarehousingInfo{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"is_check": 1}).Error
7243
-	if err != nil {
7244
-		tx.Rollback()
7245
-		return err
7246
-	}
7247
-	tx.Commit()
7248
-	return err
7249 7266
 }
7250 7267
 
7251 7268
 func ReturnCheckWarehouseInfo(id int64) error {
@@ -7259,15 +7276,6 @@ func ReturnCheckWarehouseInfo(id int64) error {
7259 7276
 	err = tx.Model(&models.WarehousingInfo{}).Where("warehousing_id = ? and status = 1", id).Update(map[string]interface{}{"is_check": 2}).Error
7260 7277
 	tx.Commit()
7261 7278
 	return err
7262
-	tx := XTWriteDB().Begin()
7263
-	err := tx.Model(&models.Warehousing{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"is_check": 2}).Error
7264
-	if err != nil {
7265
-		tx.Rollback()
7266
-		return err
7267
-	}
7268
-	err = tx.Model(&models.WarehousingInfo{}).Where("warehousing_id = ? and status = 1", id).Update(map[string]interface{}{"is_check": 2}).Error
7269
-	tx.Commit()
7270
-	return err
7271 7279
 }
7272 7280
 
7273 7281
 func UpdateWarehouseInfoByIdListTwo(count int64, id int64) error {
@@ -7285,19 +7293,6 @@ func UpdateWarehouseInfoByIdListTwo(count int64, id int64) error {
7285 7293
 	}
7286 7294
 	tx.Commit()
7287 7295
 	return err
7288
-	tx := XTWriteDB().Begin()
7289
-	err := tx.Model(&models.WarehousingInfo{}).Where("id = ? and status = 1", id).UpdateColumn("stock_count", gorm.Expr("stock_count - ?", count)).Error
7290
-	if err != nil {
7291
-		tx.Rollback()
7292
-		return err
7293
-	}
7294
-	err = tx.Model(&models.WarehousingInfo{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"is_check": 2}).Error
7295
-	if err != nil {
7296
-		tx.Rollback()
7297
-		return err
7298
-	}
7299
-	tx.Commit()
7300
-	return err
7301 7296
 }
7302 7297
 
7303 7298
 func UpdateWarehouseInfoFlow(id int64) error {
@@ -7579,21 +7574,14 @@ func UpdateGoodInfoReduceSumCount(goodid int64, sum_count int64, orgid int64) er
7579 7574
 	return err
7580 7575
 }
7581 7576
 
7582
-func UpdateGoodInfoAddSumCount(goodid int64, sum_count int64, orgid int64) error {
7577
+func UpdateGoodInfoAddSumCount(goodid int64, sum_count int64, orgid int64, sum_in_count int64) error {
7583 7578
 	tx := XTWriteDB().Begin()
7584 7579
 	err := tx.Model(&models.GoodInfo{}).Where("id = ? and org_id = ? and status = 1", goodid, orgid).Update(map[string]interface{}{"sum_count": sum_count}).Error
7585 7580
 	if err != nil {
7586 7581
 		tx.Rollback()
7587 7582
 		return err
7588 7583
 	}
7589
-	tx.Commit()
7590
-	return err
7591
-}
7592
-
7593
-func UpdateGoodInfoAddSumCount(goodid int64, sum_count int64, orgid int64, sum_in_count int64) error {
7594
-
7595
-	tx := XTWriteDB().Begin()
7596
-	err := tx.Model(&models.GoodInfo{}).Where("id = ? and org_id = ? and status = 1", goodid, orgid).Update(map[string]interface{}{"sum_count": sum_count, "sum_in_count": sum_in_count}).Error
7584
+	err = tx.Model(&models.GoodInfo{}).Where("id = ? and org_id = ? and status = 1", goodid, orgid).Update(map[string]interface{}{"sum_in_count": sum_in_count}).Error
7597 7585
 	if err != nil {
7598 7586
 		tx.Rollback()
7599 7587
 		return err
@@ -7758,18 +7746,6 @@ func UpdateBaseDrugSumInfo(sum_count int64, drugid int64, orgid int64, sum_in_co
7758 7746
 		return err
7759 7747
 	}
7760 7748
 	ut.Commit()
7761
-	tx := XTWriteDB().Begin()
7762
-	err := tx.Model(&models.BaseDrugLib{}).Where("id = ? and status = 1 and org_id = ?", drugid, orgid).Update(map[string]interface{}{"sum_count": sum_count}).Error
7763
-	if err != nil {
7764
-		tx.Rollback()
7765
-		return err
7766
-	}
7767
-	err = tx.Model(&models.BaseDrugLib{}).Where("id = ? and status = 1 and org_id = ?", drugid, orgid).Update(map[string]interface{}{"sum_in_count": sum_in_count}).Error
7768
-	if err != nil {
7769
-		tx.Rollback()
7770
-		return err
7771
-	}
7772
-	tx.Commit()
7773 7749
 	return err
7774 7750
 }
7775 7751