Browse Source

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 2 weeks ago
parent
commit
02750ff745

+ 14 - 10
controllers/his_api_controller.go View File

@@ -11452,6 +11452,9 @@ func (c *HisApiController) GetHisChargePatientInfo() {
11452 11452
 
11453 11453
 	admin := c.GetAdminUserInfo()
11454 11454
 	his_patient_info, _ := service.GetNewHisPatientInfo(his_patient_id)
11455
+
11456
+	last_his_patient_info, _ := service.GetLastNewHisPatientInfo(patient_id, recordDateTime)
11457
+
11455 11458
 	xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
11456 11459
 
11457 11460
 	var prescriptions []*models.HisPrescription
@@ -11478,16 +11481,17 @@ func (c *HisApiController) GetHisChargePatientInfo() {
11478 11481
 	sch, _ := service.GetScheduleByDate(c.GetAdminUserInfo().CurrentOrgId, recordDateTime, patient_id)
11479 11482
 
11480 11483
 	c.ServeSuccessJSON(map[string]interface{}{
11481
-		"his_info":     his_patient_info,
11482
-		"xt_info":      xt_patient_info,
11483
-		"prescription": prescriptions,
11484
-		"case_history": case_history,
11485
-		"info":         patientPrescriptionInfo,
11486
-		"last_info":    lastPatientPrescriptionInfo,
11487
-		"order":        order,
11488
-		"doctors":      doctors,
11489
-		"department":   department,
11490
-		"sch":          sch,
11484
+		"his_info":              his_patient_info,
11485
+		"last_his_patient_info": last_his_patient_info,
11486
+		"xt_info":               xt_patient_info,
11487
+		"prescription":          prescriptions,
11488
+		"case_history":          case_history,
11489
+		"info":                  patientPrescriptionInfo,
11490
+		"last_info":             lastPatientPrescriptionInfo,
11491
+		"order":                 order,
11492
+		"doctors":               doctors,
11493
+		"department":            department,
11494
+		"sch":                   sch,
11491 11495
 	})
11492 11496
 	return
11493 11497
 }

+ 12 - 0
controllers/manager_center_api_controller.go View File

@@ -165,6 +165,8 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
165 165
 	is_show, _ := c.GetInt64("is_show")
166 166
 	adminInfo := c.GetAdminUserInfo()
167 167
 	is_self_drug, _ := c.GetInt64("is_self_drug")
168
+	is_zero_flag, _ := c.GetInt64("is_zero_flag")
169
+
168 170
 	specification_name := c.GetString("specification_name")
169 171
 	hans := drug_name // 要转换的汉字字符串
170 172
 
@@ -257,6 +259,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
257 259
 		IsShow:                      is_show,
258 260
 		IsSelfDrug:                  is_self_drug,
259 261
 		SpecificationName:           specification_name,
262
+		IsZeroFlag:                  is_zero_flag,
260 263
 	}
261 264
 	drugLib.FirstLetter = firstLetter
262 265
 	drugLib.Pinyin = firstLetter
@@ -381,6 +384,8 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
381 384
 	is_show, _ := c.GetInt64("is_show")
382 385
 	is_self_drug, _ := c.GetInt64("is_self_drug")
383 386
 	specification_name := c.GetString("specification_name")
387
+	is_zero_flag, _ := c.GetInt64("is_zero_flag")
388
+
384 389
 	adminInfo := c.GetAdminUserInfo()
385 390
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
386 391
 
@@ -478,6 +483,7 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
478 483
 		IsShow:                      is_show,
479 484
 		IsSelfDrug:                  is_self_drug,
480 485
 		SpecificationName:           specification_name,
486
+		IsZeroFlag:                  is_zero_flag,
481 487
 	}
482 488
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
483 489
 
@@ -1643,6 +1649,8 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1643 1649
 	bbx01 := c.GetString("bbx01")
1644 1650
 	bby01 := c.GetString("bby01")
1645 1651
 	is_show, _ := c.GetInt64("is_show")
1652
+	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1653
+
1646 1654
 	adminUserInfo := c.GetAdminUserInfo()
1647 1655
 
1648 1656
 	totals := service.FindGoodInfoByNameTwo(specification_name, adminUserInfo.CurrentOrgId, good_id, good_name)
@@ -1726,6 +1734,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1726 1734
 		ZuobiaoId:                   bbx01,
1727 1735
 		Bck01b:                      "55",
1728 1736
 		IsShow:                      is_show,
1737
+		IsZeroFlag:                  is_zero_flag,
1729 1738
 	}
1730 1739
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1731 1740
 	if err == nil {
@@ -1796,6 +1805,8 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1796 1805
 	bbx01 := c.GetString("bbx01")
1797 1806
 	bby01 := c.GetString("bby01")
1798 1807
 	is_show, _ := c.GetInt64("is_show")
1808
+	is_zero_flag, _ := c.GetInt64("is_zero_flag")
1809
+
1799 1810
 	// 创建一个拼音转换器
1800 1811
 	p := pinyin.NewArgs()
1801 1812
 
@@ -1871,6 +1882,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1871 1882
 		ZuobiaoId:                   bbx01,
1872 1883
 		Bck01b:                      "55",
1873 1884
 		IsShow:                      is_show,
1885
+		IsZeroFlag:                  is_zero_flag,
1874 1886
 	}
1875 1887
 
1876 1888
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

+ 8 - 0
models/drug.go View File

@@ -91,6 +91,7 @@ type BaseDrugLib struct {
91 91
 	IsShow             int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
92 92
 	IsSelfDrug         int64  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
93 93
 	SpecificationName  string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
94
+	IsZeroFlag         int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
94 95
 }
95 96
 
96 97
 func (BaseDrugLib) TableName() string {
@@ -112,6 +113,7 @@ type BaseDrugLibSeven struct {
112 113
 	IsSelfDrug int64  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
113 114
 	Dose       string `gorm:"column:dose" json:"dose" form:"dose"`
114 115
 	DoseUnit   string `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
116
+	IsZeroFlag int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
115 117
 }
116 118
 
117 119
 func (BaseDrugLibSeven) TableName() string {
@@ -135,6 +137,7 @@ type BaseDrugLibTwentyOne struct {
135 137
 	DoseUnit     string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
136 138
 	DrugDay      string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
137 139
 	MinPrice     float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
140
+	IsZeroFlag   int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
138 141
 }
139 142
 
140 143
 func (BaseDrugLibTwentyOne) TableName() string {
@@ -151,6 +154,7 @@ type BaseDrugLibEleven struct {
151 154
 	MinUnit          string `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
152 155
 	Dose             string `gorm:"column:dose" json:"dose" form:"dose"`
153 156
 	DoseUnit         string `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
157
+	IsZeroFlag       int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
154 158
 }
155 159
 
156 160
 func (BaseDrugLibEleven) TableName() string {
@@ -163,6 +167,7 @@ type BaseDrugLibTen struct {
163 167
 	TotalCount          int64 `gorm:"column:total_count" json:"total_count" form:"total_count"`
164 168
 	DrugStockLimitCount int64 `gorm:"column:drug_stock_limit_count" json:"drug_stock_limit_count" form:"drug_stock_limit_count"`
165 169
 	Status              int64 `gorm:"column:status" json:"status" form:"status"`
170
+	IsZeroFlag          int64 `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
166 171
 }
167 172
 
168 173
 func (BaseDrugLibTen) TableName() string {
@@ -280,6 +285,7 @@ type BaseDrugLibNight struct {
280 285
 	SumCount                    int64                   `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
281 286
 	SumInCount                  int64                   `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
282 287
 	IsPharmacy                  int64                   `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
288
+	IsZeroFlag                  int64                   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
283 289
 }
284 290
 
285 291
 func (BaseDrugLibNight) TableName() string {
@@ -299,6 +305,7 @@ type BaseDrugLibTwenty struct {
299 305
 	DrugStatus     string `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
300 306
 	DrugStockLimit string `gorm:"column:drug_stock_limit" json:"drug_stock_limit_count" form:"drug_stock_limit"`
301 307
 	Manufacturer   int64  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
308
+	IsZeroFlag     int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
302 309
 }
303 310
 
304 311
 func (BaseDrugLibTwenty) TableName() string {
@@ -322,6 +329,7 @@ type BaseDrugLibThrity struct {
322 329
 	DrugType              int64                      `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
323 330
 	LastDrugWarehouseInfo XtSelfDrugWarehouseInfo    `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"first_drug_warehouse_info"`
324 331
 	DrugWarehouseInfo     []*XtSelfDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
332
+	IsZeroFlag            int64                      `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
325 333
 }
326 334
 
327 335
 func (BaseDrugLibThrity) TableName() string {

+ 1 - 0
models/drug_pharmacy_management_models.go View File

@@ -74,6 +74,7 @@ type PharmacyBaseDrug struct {
74 74
 	SumInCount                  int64                  `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
75 75
 	IsPharmacy                  int64                  `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
76 76
 	DrugWarehouseInfo           []*XtDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
77
+	IsZeroFlag                  int64                  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
77 78
 }
78 79
 
79 80
 func (PharmacyBaseDrug) TableName() string {

+ 1 - 0
models/good_models.go View File

@@ -105,6 +105,7 @@ type GoodInfo struct {
105 105
 	Bbx01                       string               `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
106 106
 	Bby01                       string               `gorm:"column:bby01" json:"bby01" form:"bby01"`
107 107
 	Bck01b                      string               `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
108
+	IsZeroFlag                  int64                `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
108 109
 
109 110
 	ZuobiaoId string `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
110 111
 

+ 1 - 0
models/his_charge_models.go View File

@@ -461,6 +461,7 @@ type NewDrug struct {
461 461
 	RetailPrice  float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
462 462
 	DrugDose     float64 `gorm:"column:drug_dose" json:"drug_dose" form:"drug_dose"`
463 463
 	DrugDoseUnit int64   `gorm:"column:drug_dose_unit" json:"drug_dose_unit" form:"drug_dose_unit"`
464
+	IsZeroFlag   int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
464 465
 }
465 466
 
466 467
 func (NewDrug) TableName() string {

+ 2 - 0
models/his_models.go View File

@@ -360,6 +360,7 @@ type Drug struct {
360 360
 	Bck01b                      string  `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
361 361
 	Bby01                       string  `gorm:"column:bby01" json:"bby01" form:"bby01"`
362 362
 	Bbx01                       string  `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
363
+	IsZeroFlag                  int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
363 364
 }
364 365
 
365 366
 func (Drug) TableName() string {
@@ -768,6 +769,7 @@ type VMDrug struct {
768 769
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
769 770
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
770 771
 	PrescribingNumberUnit       string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
772
+	IsZeroFlag                  int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
771 773
 }
772 774
 
773 775
 func (VMDrug) TableName() string {

+ 3 - 0
models/new_stock_models.go View File

@@ -138,6 +138,7 @@ type NewBaseDrug struct {
138 138
 	SumCount                    int64                  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
139 139
 	SumInCount                  int64                  `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
140 140
 	IsPharmacy                  int64                  `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
141
+	IsZeroFlag                  int64                  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
141 142
 }
142 143
 
143 144
 func (NewBaseDrug) TableName() string {
@@ -175,6 +176,7 @@ type NewBaseDrugOne struct {
175 176
 	DrugType               int64                  `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
176 177
 	MedicalInsuranceLevel  int64                  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
177 178
 	IsSelfDrug             int64                  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
179
+	IsZeroFlag             int64                  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
178 180
 }
179 181
 
180 182
 func (NewBaseDrugOne) TableName() string {
@@ -454,6 +456,7 @@ type VmBaseDrugTwenty struct {
454 456
 	NewDrugFlowPofitWarehouseInfo    []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"new_drug_profit_flow_info"`
455 457
 	NewDrugFlowNoPofitWarehouseInfo  []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"new_drug_no_profit_flow_info"`
456 458
 	NewDrugFlowNoCancelWarehouseInfo []*DrugFlowTwenty `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"new_drug_cancel_flow_info"`
459
+	IsZeroFlag                       int64             `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
457 460
 }
458 461
 
459 462
 func (VmBaseDrugTwenty) TableName() string {

+ 1 - 0
models/pharmacy_models.go View File

@@ -506,6 +506,7 @@ type BaseDrugLibL struct {
506 506
 	IsPharmacy            int64                  `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
507 507
 	List1                 interface{}            `json:"list_1"`
508 508
 	List2                 interface{}            `json:"list_2"`
509
+	IsZeroFlag            int64                  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
509 510
 }
510 511
 
511 512
 func (BaseDrugLibL) TableName() string {

+ 1 - 0
models/self_drug_models.go View File

@@ -83,6 +83,7 @@ type XtBaseDrug struct {
83 83
 	IsSelfDrug             int64   `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
84 84
 	SumCount               int64   `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
85 85
 	SpecificationName      string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
86
+	IsZeroFlag             int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
86 87
 }
87 88
 
88 89
 func (XtBaseDrug) TableName() string {

+ 1 - 1
models/stock_models.go View File

@@ -853,7 +853,7 @@ type VmBaseDrug struct {
853 853
 	WareStartStockCancelInfo         []*DrugFlow               //期初结余退库
854 854
 	WareEndStockCancelInfo           []*DrugFlow               //期末结余退库
855 855
 	WareStartEndStockCancelInfo      []*DrugFlow               //期中减少退库
856
-
856
+	IsZeroFlag                       int64                     `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
857 857
 }
858 858
 
859 859
 func (VmBaseDrug) TableName() string {

+ 1 - 0
models/supply.models.go View File

@@ -39,6 +39,7 @@ type SpBaseDrug struct {
39 39
 	DrugStatus             string                 `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
40 40
 	MinPrice               float64                `gorm:"column:min_price" json:"min_price" form:"min_price"`
41 41
 	MedicalInsuranceNumber string                 `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
42
+	IsZeroFlag             int64                  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
42 43
 }
43 44
 
44 45
 func (SpBaseDrug) TableName() string {

+ 5 - 0
service/his_service.go View File

@@ -2266,6 +2266,11 @@ func GetNewHisPatientInfo(his_patient_id int64) (info models.HisPatient, err err
2266 2266
 	err = readDb.Model(&models.HisPatient{}).Where("id = ? AND status = 1 ", his_patient_id).First(&info).Error
2267 2267
 	return
2268 2268
 }
2269
+func GetLastNewHisPatientInfo(patient_id int64, recordDateTime int64) (info models.HisPatient, err error) {
2270
+	err = readDb.Model(&models.HisPatient{}).Where("patient_id = ? AND status = 1  and record_date < ?", patient_id, recordDateTime).First(&info).Error
2271
+	return
2272
+
2273
+}
2269 2274
 
2270 2275
 func GetNewHisOrder(user_org_id int64, mdtrt_id string, patient_id int64) (order models.HisOrder, err error) {
2271 2276
 	err = readDb.Model(&models.HisOrder{}).Where("status = 1 AND user_org_id = ? AND patient_id = ? AND mdtrt_id=? ", user_org_id, patient_id, mdtrt_id).

+ 2 - 0
service/stock_service.go View File

@@ -279,6 +279,7 @@ func ModifyGoodInfo(goodInfo *models.GoodInfo) (error, *models.GoodInfo) {
279 279
 		"zuobiao_id":                     goodInfo.Bbx01,
280 280
 		"first_letter":                   goodInfo.FirstLetter,
281 281
 		"is_show":                        goodInfo.IsShow,
282
+		"is_zero_flag":                   goodInfo.IsZeroFlag,
282 283
 	}).Error
283 284
 
284 285
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})
@@ -1180,6 +1181,7 @@ type Drug struct {
1180 1181
 	DoseUnit                    string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
1181 1182
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
1182 1183
 	MinPrice                    float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
1184
+	IsZeroFlag                  int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
1183 1185
 }
1184 1186
 
1185 1187
 func (Drug) TableName() string {