Browse Source

医保对接

csx 3 years ago
parent
commit
2c449c6381

+ 46 - 19
controllers/his_api_controller.go View File

@@ -960,6 +960,7 @@ func (c *HisApiController) CreateHisPrescription() {
960 960
 							s.PatientId = patient_id
961 961
 							s.HisPatientId = his_patient_id
962 962
 							s.StartTime = pTime
963
+
963 964
 							errcode := c.setAdviceWithJSON(&s, advice.(map[string]interface{}))
964 965
 							if errcode > 0 {
965 966
 								c.ServeFailJSONWithSGJErrorCode(errcode)
@@ -1062,7 +1063,8 @@ func (c *HisApiController) CreateHisPrescription() {
1062 1063
 							if p.Type == 3 { //处理透前准备耗材数量数据
1063 1064
 								consumables, _ := service.FindHisConsumablesByID(adminInfo.CurrentOrgId, patient_id, recordDateTime, p.ProjectId)
1064 1065
 								if consumables.ID > 0 {
1065
-									consumables.Count = int64(p.Count)
1066
+									cnt, _ := strconv.ParseInt(p.Count, 10, 64)
1067
+									consumables.Count = cnt
1066 1068
 									service.UpdateConsumables(&consumables)
1067 1069
 								}
1068 1070
 							}
@@ -1380,7 +1382,8 @@ func (c *HisApiController) DeletePrescription() {
1380 1382
 				if stockConfig.IsOpen == 1 {
1381 1383
 					if item.Type == 3 {
1382 1384
 						good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
1383
-						f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(item.Count), 10), 64)
1385
+						//cnt, _ := strconv.ParseInt(item.Count, 10, 64)
1386
+						f_count, _ := strconv.ParseFloat(item.Count, 64)
1384 1387
 						good.Total = good.Total + f_count
1385 1388
 						service.UpdateGoodInfo(&good)
1386 1389
 					}
@@ -1473,7 +1476,8 @@ func (c *HisApiController) DeleteProject() {
1473 1476
 		if stockConfig.IsOpen == 1 {
1474 1477
 			if project.Type == 3 {
1475 1478
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
1476
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
1479
+
1480
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
1477 1481
 				good.Total = good.Total + f_count
1478 1482
 				service.UpdateGoodInfo(&good)
1479 1483
 			}
@@ -1971,8 +1975,7 @@ func (c *HisApiController) setProjectWithJSONTwo(project *models.HisPrescription
1971 1975
 
1972 1976
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
1973 1977
 		total, _ := json["total"].(string)
1974
-		totals, _ := strconv.ParseInt(total, 10, 64)
1975
-		project.Count = totals
1978
+		project.Count = total
1976 1979
 	}
1977 1980
 
1978 1981
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -2130,6 +2133,11 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
2130 2133
 			hisAdvice, err := service.GetHisDoctorAdvicesById(advice.ID)
2131 2134
 			if err == nil {
2132 2135
 				if hisAdvice.ID > 0 {
2136
+					if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
2137
+						singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
2138
+						advice.SingleDose = singleDose
2139
+					}
2140
+
2133 2141
 					advice.ExecutionTime = hisAdvice.ExecutionTime
2134 2142
 					advice.ExecutionStaff = hisAdvice.ExecutionStaff
2135 2143
 					advice.ExecutionState = hisAdvice.ExecutionState
@@ -2138,6 +2146,16 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
2138 2146
 					advice.CheckState = hisAdvice.CheckState
2139 2147
 					advice.StartTime = hisAdvice.StartTime
2140 2148
 					advice.HospApprFlag = hisAdvice.HospApprFlag
2149
+
2150
+					if hisAdvice.SingleDose != advice.SingleDose || hisAdvice.DeliveryWay != advice.DeliveryWay || hisAdvice.ExecutionFrequency != advice.ExecutionFrequency || hisAdvice.Day != advice.Day || hisAdvice.PrescribingNumber != advice.PrescribingNumber || hisAdvice.Price != advice.Price || hisAdvice.Remark != advice.Remark {
2151
+						advice.ExecutionTime = 0
2152
+						advice.ExecutionStaff = 0
2153
+						advice.ExecutionState = 2
2154
+						advice.CheckTime = 0
2155
+						advice.Checker = 0
2156
+						advice.CheckState = 2
2157
+					}
2158
+
2141 2159
 					//advice.Groupno = hisAdvice.Groupno
2142 2160
 
2143 2161
 				}
@@ -2345,8 +2363,8 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2345 2363
 
2346 2364
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
2347 2365
 		total, _ := json["total"].(string)
2348
-		totals, _ := strconv.ParseInt(total, 10, 64)
2349
-		project.Count = totals
2366
+		//totals, _ := strconv.ParseInt(total, 10, 64)
2367
+		project.Count = total
2350 2368
 	}
2351 2369
 
2352 2370
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -2402,7 +2420,7 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2402 2420
 		if stockConfig.IsOpen == 1 {
2403 2421
 			if project.Type == 3 {
2404 2422
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
2405
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
2423
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
2406 2424
 				good.Total = good.Total - f_count
2407 2425
 				service.UpdateGoodInfo(&good)
2408 2426
 			}
@@ -2415,12 +2433,18 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2415 2433
 			if project.Type == 3 {
2416 2434
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
2417 2435
 				if project.Count < temp_project.Count {
2418
-					other_count := temp_project.Count - project.Count
2436
+					f_count_one, _ := strconv.ParseFloat(project.Count, 64)
2437
+					f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
2438
+
2439
+					other_count := f_count_two - f_count_one
2419 2440
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
2420 2441
 					good.Total = good.Total + other_count_two
2421 2442
 					service.UpdateGoodInfo(&good)
2422 2443
 				} else if project.Count > temp_project.Count {
2423
-					other_count := project.Count - temp_project.Count
2444
+					f_count_one, _ := strconv.ParseFloat(project.Count, 64)
2445
+					f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
2446
+
2447
+					other_count := f_count_one - f_count_two
2424 2448
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
2425 2449
 					good.Total = good.Total - other_count_two
2426 2450
 					service.UpdateGoodInfo(&good)
@@ -2576,8 +2600,8 @@ func (c *HisApiController) setProjectTemplateWithJSON(project *models.HisPrescri
2576 2600
 
2577 2601
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
2578 2602
 		total, _ := json["total"].(string)
2579
-		totals, _ := strconv.ParseInt(total, 10, 64)
2580
-		project.Count = totals
2603
+		//totals, _ := strconv.ParseInt(total, 10, 64)
2604
+		project.Count = total
2581 2605
 	}
2582 2606
 
2583 2607
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -3279,7 +3303,8 @@ func (c *HisApiController) GetUploadInfo() {
3279 3303
 			}
3280 3304
 			if item.Type == 2 { //项目
3281 3305
 				for _, subItem := range item.HisPrescriptionProject {
3282
-					total = total + (subItem.Price * float64(subItem.Count))
3306
+					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
3307
+					total = total + (subItem.Price * cnt)
3283 3308
 				}
3284 3309
 			}
3285 3310
 
@@ -3349,11 +3374,12 @@ func (c *HisApiController) GetUploadInfo() {
3349 3374
 			}
3350 3375
 			if item.Type == 2 { //项目
3351 3376
 				for _, subItem := range item.HisPrescriptionProject {
3377
+					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
3352 3378
 					cus := &Custom{
3353 3379
 						AdviceId:         0,
3354 3380
 						ProjectId:        subItem.ID,
3355
-						DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*float64(subItem.Count)),
3356
-						Cut:              fmt.Sprintf("%.4f", float64(subItem.Count)),
3381
+						DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
3382
+						Cut:              fmt.Sprintf("%.4f", cnt),
3357 3383
 						FeedetlSn:        subItem.FeedetlSn,
3358 3384
 						Price:            fmt.Sprintf("%.4f", float64(subItem.Price)),
3359 3385
 						MedListCodg:      subItem.MedListCodg,
@@ -5116,7 +5142,8 @@ func (c *HisApiController) PreSettle() {
5116 5142
 		}
5117 5143
 		if item.Type == 2 { //项目
5118 5144
 			for _, subItem := range item.HisPrescriptionProject {
5119
-				total = total + (subItem.Price * float64(subItem.Count))
5145
+				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
5146
+				total = total + (subItem.Price * cnt)
5120 5147
 			}
5121 5148
 		}
5122 5149
 
@@ -5174,12 +5201,12 @@ func (c *HisApiController) PreSettle() {
5174 5201
 
5175 5202
 		if item.Type == 2 { //项目
5176 5203
 			for _, subItem := range item.HisPrescriptionProject {
5177
-
5204
+				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
5178 5205
 				cus := &Custom{
5179 5206
 					AdviceId:         0,
5180 5207
 					ProjectId:        subItem.ID,
5181
-					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
5182
-					Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
5208
+					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cnt),
5209
+					Cut:              fmt.Sprintf("%.2f", cnt),
5183 5210
 					FeedetlSn:        subItem.FeedetlSn,
5184 5211
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
5185 5212
 					MedListCodg:      subItem.MedListCodg,

+ 2 - 2
controllers/his_config_api_controller.go View File

@@ -413,8 +413,8 @@ func (c *HisConfigApiController) setProjectTemplateWithJSON(project *models.HisP
413 413
 
414 414
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
415 415
 		total, _ := json["total"].(string)
416
-		totals, _ := strconv.ParseInt(total, 10, 64)
417
-		project.Count = totals
416
+		//totals, _ := strconv.ParseInt(total, 10, 64)
417
+		project.Count = total
418 418
 	}
419 419
 
420 420
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {

+ 7 - 3
controllers/his_hospital_api_controller.go View File

@@ -468,7 +468,8 @@ func (c *HisHospitalApiController) GetSettleInfo() {
468 468
 		}
469 469
 		if item.Type == 2 { //项目
470 470
 			for _, subItem := range item.HisPrescriptionProject {
471
-				total = total + (subItem.Price * float64(subItem.Count))
471
+				cut, _ := strconv.ParseFloat(subItem.Count, 64)
472
+				total = total + (subItem.Price * cut)
472 473
 			}
473 474
 		}
474 475
 
@@ -532,12 +533,15 @@ func (c *HisHospitalApiController) GetSettleInfo() {
532 533
 			}
533 534
 		}
534 535
 		if item.Type == 2 { //项目
536
+
535 537
 			for _, subItem := range item.HisPrescriptionProject {
538
+				cut, _ := strconv.ParseFloat(subItem.Count, 64)
539
+
536 540
 				cus := &Custom{
537 541
 					AdviceId:         0,
538 542
 					ProjectId:        subItem.ID,
539
-					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
540
-					Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
543
+					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cut),
544
+					Cut:              fmt.Sprintf("%.2f", cut),
541 545
 					FeedetlSn:        subItem.FeedetlSn,
542 546
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
543 547
 					MedListCodg:      subItem.MedListCodg,

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

@@ -2682,6 +2682,7 @@ func (c *PatientApiController) GetPrintDialysisOrder() {
2682 2682
 	projects, _ := service.FindAllHisProjectById(adminUserInfo.Org.Id, patientInfo.ID, xttime)
2683 2683
 	if config.IsOpen == 1 && project_config.IsOpen == 1 && len(projects) > 0 {
2684 2684
 		for _, item := range projects {
2685
+			cnt, _ := strconv.ParseFloat(item.Count, 64)
2685 2686
 			var advice models.HisDoctorAdviceInfo
2686 2687
 			advice.ID = item.ID
2687 2688
 			advice.Checker = item.Checker
@@ -2689,7 +2690,7 @@ func (c *PatientApiController) GetPrintDialysisOrder() {
2689 2690
 			advice.CheckState = item.CheckState
2690 2691
 			advice.ExecutionState = item.ExecutionState
2691 2692
 			advice.ExecutionStaff = item.ExecutionStaff
2692
-			advice.PrescribingNumber = float64(item.Count)
2693
+			advice.PrescribingNumber = cnt
2693 2694
 			advice.PrescribingNumberUnit = item.Unit
2694 2695
 			advice.AdviceDoctor = item.Doctor
2695 2696
 			if item.Type == 3 {

+ 15 - 8
controllers/new_mobile_api_controllers/mobile_his_api_controller.go View File

@@ -289,7 +289,7 @@ func (c *MobileHisApiController) DeletePrescription() {
289 289
 				if stockConfig.IsOpen == 1 {
290 290
 					if item.Type == 3 {
291 291
 						good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
292
-						f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(item.Count), 10), 64)
292
+						f_count, _ := strconv.ParseFloat(item.Count, 64)
293 293
 						good.Total = good.Total + f_count
294 294
 						service.UpdateGoodInfo(&good)
295 295
 					}
@@ -367,7 +367,7 @@ func (c *MobileHisApiController) DeleteProject() {
367 367
 		if stockConfig.IsOpen == 1 {
368 368
 			if project.Type == 3 {
369 369
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
370
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
370
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
371 371
 				good.Total = good.Total + f_count
372 372
 				service.UpdateGoodInfo(&good)
373 373
 			}
@@ -765,7 +765,8 @@ func (c *MobileHisApiController) CreateHisPrescription() {
765 765
 							if p.Type == 3 { //处理透前准备耗材数量数据
766 766
 								consumables, _ := service.FindHisConsumablesByID(adminInfo.Org.Id, patient_id, recordDateTime, p.ProjectId)
767 767
 								if consumables.ID > 0 {
768
-									consumables.Count = int64(p.Count)
768
+									cnt, _ := strconv.ParseInt(p.Count, 10, 64)
769
+									consumables.Count = cnt
769 770
 									service.UpdateConsumables(&consumables)
770 771
 								}
771 772
 							}
@@ -1089,8 +1090,8 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
1089 1090
 
1090 1091
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
1091 1092
 		total, _ := json["total"].(string)
1092
-		totals, _ := strconv.ParseInt(total, 10, 64)
1093
-		project.Count = totals
1093
+		//totals, _ := strconv.ParseInt(total, 10, 64)
1094
+		project.Count = total
1094 1095
 	}
1095 1096
 
1096 1097
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -1130,7 +1131,7 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
1130 1131
 		if stockConfig.IsOpen == 1 {
1131 1132
 			if project.Type == 3 {
1132 1133
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
1133
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
1134
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
1134 1135
 				good.Total = good.Total - f_count
1135 1136
 				service.UpdateGoodInfo(&good)
1136 1137
 			}
@@ -1143,12 +1144,18 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
1143 1144
 			if project.Type == 3 {
1144 1145
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
1145 1146
 				if project.Count < temp_project.Count {
1146
-					other_count := temp_project.Count - project.Count
1147
+					f_count_one, _ := strconv.ParseFloat(project.Count, 64)
1148
+					f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
1149
+
1150
+					other_count := f_count_two - f_count_one
1147 1151
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
1148 1152
 					good.Total = good.Total + other_count_two
1149 1153
 					service.UpdateGoodInfo(&good)
1150 1154
 				} else if project.Count > temp_project.Count {
1151
-					other_count := project.Count - temp_project.Count
1155
+					f_count_one, _ := strconv.ParseFloat(project.Count, 64)
1156
+					f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
1157
+
1158
+					other_count := f_count_one - f_count_two
1152 1159
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
1153 1160
 					good.Total = good.Total - other_count_two
1154 1161
 					service.UpdateGoodInfo(&good)

+ 23 - 31
controllers/public_api_controller.go View File

@@ -69,7 +69,7 @@ func PublicApiRegistRouters() {
69 69
 
70 70
 	beego.Router("/handle10215", &PublicApiController{}, "get:Handle10215")
71 71
 
72
-	//beego.Router("/handelOrder", &PublicApiController{}, "get:HandleOrder")
72
+	beego.Router("/handelOrder", &PublicApiController{}, "get:HandleOrder")
73 73
 
74 74
 }
75 75
 
@@ -1700,35 +1700,27 @@ func (c *PublicApiController) HandleHIS() {
1700 1700
 
1701 1701
 }
1702 1702
 
1703
-//func (c *PublicApiController)HandleOrder(){
1704
-//	//orders, _ := service.GetAllHisOrder()
1705
-//
1706
-//
1707
-//	order, _ := service.GetLastHisOrder()
1708
-//
1709
-//	fpNumber, _ := strconv.Atoi(order.FaPiaoNumber)
1710
-//
1711
-//
1712
-//	//fmt.Println(fpNumber)
1713
-//
1714
-//	//for index, item := range orders {
1715
-//	//	item.FaPiaoCode ="144072080589"
1716
-//	//	var zero string
1717
-//	//	if 1520 + int64(index) >= 1000{
1718
-//	//		zero = "0000" + strconv.FormatInt(1520 + int64(index),10)
1719
-//	//	}else if 1520 + int64(index) >= 10000{
1720
-//	//		zero = "000" + strconv.FormatInt(1520 + int64(index),10)
1721
-//	//	} else if 1520 + int64(index) >= 100000{
1722
-//	//		zero = "00" +strconv.FormatInt(1520 + int64(index),10)
1723
-//	//	} else if 1520 + int64(index) >= 1000000{
1724
-//	//		zero = "0" +strconv.FormatInt(1520 + int64(index),10)
1725
-//	//	}else {
1726
-//	//		zero = strconv.FormatInt(1520 + int64(index),10)
1727
-//	//	}
1728
-//	//	item.FaPiaoNumber = zero
1729
-//	//	service.SaveOrder(item)
1730
-//	//}
1731
-//}
1703
+func (c *PublicApiController) HandleOrder() {
1704
+	orders, _ := service.GetAllHisOrder()
1705
+
1706
+	for index, item := range orders {
1707
+		item.FaPiaoCode = "144072080589"
1708
+		var zero string
1709
+		if 1520+int64(index) >= 1000 {
1710
+			zero = "0000" + strconv.FormatInt(1520+int64(index), 10)
1711
+		} else if 1520+int64(index) >= 10000 {
1712
+			zero = "000" + strconv.FormatInt(1520+int64(index), 10)
1713
+		} else if 1520+int64(index) >= 100000 {
1714
+			zero = "00" + strconv.FormatInt(1520+int64(index), 10)
1715
+		} else if 1520+int64(index) >= 1000000 {
1716
+			zero = "0" + strconv.FormatInt(1520+int64(index), 10)
1717
+		} else {
1718
+			zero = strconv.FormatInt(1520+int64(index), 10)
1719
+		}
1720
+		item.FaPiaoNumber = zero
1721
+		service.SaveOrder(item)
1722
+	}
1723
+}
1732 1724
 
1733 1725
 func Mkdir(dir string) {
1734 1726
 	// 创建文件夹
@@ -1896,7 +1888,7 @@ func (c *PublicApiController) Handle10215() {
1896 1888
 							Mtime:              time.Now().Unix(),
1897 1889
 							PatientId:          ssubItem.PatientId,
1898 1890
 							RecordDate:         ssubItem.AdviceDate,
1899
-							Count:              1,
1891
+							Count:              "1",
1900 1892
 							FeedetlSn:          "",
1901 1893
 							MedListCodg:        "",
1902 1894
 							SingleDose:         "1",

+ 8 - 8
models/his_charge_models.go View File

@@ -1,14 +1,14 @@
1 1
 package models
2 2
 
3 3
 type HisChargePrescriptionProject struct {
4
-	ID         int64 `gorm:"column:id" json:"id" form:"id"`
5
-	ProjectId  int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
6
-	UserOrgId  int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
7
-	Status     int64 `gorm:"column:status" json:"status" form:"status"`
8
-	PatientId  int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
9
-	RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
10
-	Count      int64 `gorm:"column:count" json:"count" form:"count"`
11
-	Type       int64 `gorm:"column:type" json:"type" form:"type"`
4
+	ID         int64  `gorm:"column:id" json:"id" form:"id"`
5
+	ProjectId  int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
6
+	UserOrgId  int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
7
+	Status     int64  `gorm:"column:status" json:"status" form:"status"`
8
+	PatientId  int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
9
+	RecordDate int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
10
+	Count      string `gorm:"column:count" json:"count" form:"count"`
11
+	Type       int64  `gorm:"column:type" json:"type" form:"type"`
12 12
 
13 13
 	HisChargeProject  HisChargeProject  `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
14 14
 	HisChargeGoodInfo HisChargeGoodInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`

+ 2 - 2
models/his_models.go View File

@@ -749,7 +749,7 @@ type HisPrescriptionProject struct {
749 749
 	HisPatientId       int64      `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
750 750
 	RecordDate         int64      `gorm:"column:record_date" json:"record_date" form:"record_date"`
751 751
 	PrescriptionId     int64      `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
752
-	Count              int64      `gorm:"column:count" json:"count" form:"count"`
752
+	Count              string     `gorm:"column:count" json:"count" form:"count"`
753 753
 	FeedetlSn          string     `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
754 754
 	MedListCodg        string     `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
755 755
 	SingleDose         string     `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
@@ -1429,7 +1429,7 @@ type HisPrescriptionProjectTemplate struct {
1429 1429
 	PatientId          int64        `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1430 1430
 	HisPatientId       int64        `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1431 1431
 	RecordDate         int64        `gorm:"column:record_date" json:"record_date" form:"record_date"`
1432
-	Count              int64        `gorm:"column:count" json:"count" form:"count"`
1432
+	Count              string       `gorm:"column:count" json:"count" form:"count"`
1433 1433
 	FeedetlSn          string       `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1434 1434
 	MedListCodg        string       `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1435 1435
 	SingleDose         string       `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`

+ 3 - 3
service/gdyb_service.go View File

@@ -384,10 +384,10 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
384 384
 				//var randNum int
385 385
 				//randNum = rand.Intn(10000) + 1000
386 386
 				if len(subItem.MedListCodg) > 0 {
387
-
387
+					cut, _ := strconv.ParseFloat(subItem.Count, 64)
388 388
 					cus := &Custom{
389
-						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
390
-						Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
389
+						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cut),
390
+						Cut:              fmt.Sprintf("%.2f", cut),
391 391
 						FeedetlSn:        subItem.FeedetlSn,
392 392
 						Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
393 393
 						MedListCodg:      subItem.MedListCodg,

+ 1 - 1
service/his_service.go View File

@@ -1516,7 +1516,7 @@ type HisPrescriptionProject struct {
1516 1516
 	HisPatientId       int64        `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1517 1517
 	RecordDate         int64        `gorm:"column:record_date" json:"record_date" form:"record_date"`
1518 1518
 	PrescriptionId     int64        `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1519
-	Count              int64        `gorm:"column:count" json:"count" form:"count"`
1519
+	Count              string       `gorm:"column:count" json:"count" form:"count"`
1520 1520
 	FeedetlSn          string       `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1521 1521
 	MedListCodg        string       `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1522 1522
 	SingleDose         string       `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`