Selaa lähdekoodia

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

XMLWAN 3 vuotta sitten
vanhempi
commit
9968bbc58d

+ 69 - 0
controllers/gobal_config_api_controller.go Näytä tiedosto

@@ -67,6 +67,12 @@ func GobalConfigRegistRouters() {
67 67
 	beego.Router("/api/xtconfig/get", &GobalConfigApiController{}, "get:GetXTHisConfig")
68 68
 	beego.Router("/api/xtconfig/isopen", &GobalConfigApiController{}, "post:PostXTHisConfig")
69 69
 
70
+	beego.Router("/api/hisstockpriceconfig/get", &GobalConfigApiController{}, "get:GetHisStockPriceConfig")
71
+	beego.Router("/api/hisstockpriceconfig/isopen", &GobalConfigApiController{}, "post:PostHisStockPriceConfig")
72
+
73
+	beego.Router("/api/xtconfig/get", &GobalConfigApiController{}, "get:GetXTHisConfig")
74
+	beego.Router("/api/xtconfig/isopen", &GobalConfigApiController{}, "post:PostXTHisConfig")
75
+
70 76
 	beego.Router("/api/xtconfigproject/isopen", &GobalConfigApiController{}, "post:PostXTHisProjectConfig")
71 77
 
72 78
 	beego.Router("/api/isopen/init", &GobalConfigApiController{}, "get:GetAllIsOpenConfig")
@@ -1405,6 +1411,60 @@ func (c *GobalConfigApiController) PostXTHisConfig() {
1405 1411
 	return
1406 1412
 }
1407 1413
 
1414
+func (c *GobalConfigApiController) PostHisStockPriceConfig() {
1415
+	is_open, _ := c.GetBool("is_open", false)
1416
+	adminUserInfo := c.GetAdminUserInfo()
1417
+	org_id := adminUserInfo.CurrentOrgId
1418
+	isOpen := 0
1419
+
1420
+	if is_open {
1421
+		isOpen = 1
1422
+	} else {
1423
+		isOpen = 2
1424
+	}
1425
+
1426
+	config := models.HisStockPriceConfig{
1427
+		UserOrgId: org_id,
1428
+		IsOpen:    int64(isOpen),
1429
+		Status:    1,
1430
+		Ctime:     time.Now().Unix(),
1431
+		Mtime:     time.Now().Unix(),
1432
+	}
1433
+
1434
+	errs, configs := service.FindHisStockPriceRecordByOrgId(org_id)
1435
+
1436
+	if errs == gorm.ErrRecordNotFound {
1437
+		err := service.CreateHisStockPriceRecord(&config)
1438
+		if err != nil {
1439
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
1440
+			return
1441
+		}
1442
+
1443
+	} else if errs == nil {
1444
+		modifyConfig := models.HisStockPriceConfig{
1445
+			ID:        configs.ID,
1446
+			UserOrgId: org_id,
1447
+			Status:    1,
1448
+			Ctime:     time.Now().Unix(),
1449
+			Mtime:     time.Now().Unix(),
1450
+			IsOpen:    int64(isOpen),
1451
+		}
1452
+
1453
+		err := service.UpdateHisStockPriceRecord(&modifyConfig)
1454
+		if err != nil {
1455
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
1456
+			return
1457
+		}
1458
+
1459
+	}
1460
+
1461
+	c.ServeSuccessJSON(map[string]interface{}{
1462
+		"is_open": is_open,
1463
+	})
1464
+
1465
+	return
1466
+}
1467
+
1408 1468
 func (c *GobalConfigApiController) PostXTHisProjectConfig() {
1409 1469
 	is_open, _ := c.GetBool("is_open", false)
1410 1470
 	adminUserInfo := c.GetAdminUserInfo()
@@ -1470,6 +1530,15 @@ func (c *GobalConfigApiController) GetXTHisConfig() {
1470 1530
 	})
1471 1531
 }
1472 1532
 
1533
+func (c *GobalConfigApiController) GetHisStockPriceConfig() {
1534
+	adminUserInfo := c.GetAdminUserInfo()
1535
+	_, config := service.FindHisStockPriceRecordByOrgId(adminUserInfo.CurrentOrgId)
1536
+
1537
+	c.ServeSuccessJSON(map[string]interface{}{
1538
+		"config": config,
1539
+	})
1540
+}
1541
+
1473 1542
 func (c *GobalConfigApiController) GetAllIsOpenConfig() {
1474 1543
 	adminUserInfo := c.GetAdminUserInfo()
1475 1544
 	_, config := service.FindXTHisRecordByOrgId(adminUserInfo.CurrentOrgId)

+ 96 - 53
controllers/his_api_controller.go Näytä tiedosto

@@ -559,12 +559,29 @@ func (c *HisApiController) GetHisPatientInfo() {
559 559
 	return
560 560
 
561 561
 }
562
+
562 563
 func (c *HisApiController) GetHisPrescriptionConfig() {
563 564
 	adminInfo := c.GetAdminUserInfo()
564 565
 	//获取医嘱模版
565 566
 	advices, _ := service.FindAllHisAdviceTemplate(adminInfo.CurrentOrgId)
566 567
 	//获取所有基础药
567 568
 	drugs, _ := service.GetAllDrugLibList(adminInfo.CurrentOrgId)
569
+
570
+	_, config := service.FindHisStockPriceRecordByOrgId(adminInfo.CurrentOrgId)
571
+	if config.ID > 0 && config.IsOpen == 1 {
572
+		for _, item := range drugs {
573
+			var index = 0
574
+			for _, subItem := range item.OtherDrugWarehouseInfo {
575
+				if index == 0 {
576
+					if subItem.StockMaxNumber*item.MinNumber+subItem.StockMinNumber > 0 {
577
+						index = index + 1
578
+						item.MinPrice = subItem.Price
579
+					}
580
+				}
581
+			}
582
+		}
583
+	}
584
+
568 585
 	drugways, _, _ := service.GetDrugWayDics(adminInfo.CurrentOrgId)
569 586
 	efs, _, _ := service.GetExecutionFrequencyDics(adminInfo.CurrentOrgId)
570 587
 	doctors, _ := service.GetHisAdminUserDoctors(adminInfo.CurrentOrgId)
@@ -943,6 +960,7 @@ func (c *HisApiController) CreateHisPrescription() {
943 960
 							s.PatientId = patient_id
944 961
 							s.HisPatientId = his_patient_id
945 962
 							s.StartTime = pTime
963
+
946 964
 							errcode := c.setAdviceWithJSON(&s, advice.(map[string]interface{}))
947 965
 							if errcode > 0 {
948 966
 								c.ServeFailJSONWithSGJErrorCode(errcode)
@@ -1045,7 +1063,8 @@ func (c *HisApiController) CreateHisPrescription() {
1045 1063
 							if p.Type == 3 { //处理透前准备耗材数量数据
1046 1064
 								consumables, _ := service.FindHisConsumablesByID(adminInfo.CurrentOrgId, patient_id, recordDateTime, p.ProjectId)
1047 1065
 								if consumables.ID > 0 {
1048
-									consumables.Count = int64(p.Count)
1066
+									cnt, _ := strconv.ParseInt(p.Count, 10, 64)
1067
+									consumables.Count = cnt
1049 1068
 									service.UpdateConsumables(&consumables)
1050 1069
 								}
1051 1070
 							}
@@ -1359,10 +1378,12 @@ func (c *HisApiController) DeletePrescription() {
1359 1378
 	if err == nil {
1360 1379
 		if len(projects) > 0 {
1361 1380
 			for _, item := range projects {
1381
+				service.DeletePrintInfo(item.ID) //删除打印信息
1362 1382
 				if stockConfig.IsOpen == 1 {
1363 1383
 					if item.Type == 3 {
1364 1384
 						good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
1365
-						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)
1366 1387
 						good.Total = good.Total + f_count
1367 1388
 						service.UpdateGoodInfo(&good)
1368 1389
 					}
@@ -1447,6 +1468,7 @@ func (c *HisApiController) DeleteProject() {
1447 1468
 	}
1448 1469
 	err := service.DelelteProject(id, c.GetAdminUserInfo().CurrentOrgId)
1449 1470
 	if err == nil {
1471
+		service.DeletePrintInfo(id)
1450 1472
 		label, _ := service.GetProjectById(adminInfo.CurrentOrgId, id, project.RecordDate, project.PatientId)
1451 1473
 		label.Status = 0
1452 1474
 		service.CreateHisLabelRecord(&label)
@@ -1454,7 +1476,8 @@ func (c *HisApiController) DeleteProject() {
1454 1476
 		if stockConfig.IsOpen == 1 {
1455 1477
 			if project.Type == 3 {
1456 1478
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
1457
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
1479
+
1480
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
1458 1481
 				good.Total = good.Total + f_count
1459 1482
 				service.UpdateGoodInfo(&good)
1460 1483
 			}
@@ -1952,8 +1975,7 @@ func (c *HisApiController) setProjectWithJSONTwo(project *models.HisPrescription
1952 1975
 
1953 1976
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
1954 1977
 		total, _ := json["total"].(string)
1955
-		totals, _ := strconv.ParseInt(total, 10, 64)
1956
-		project.Count = totals
1978
+		project.Count = total
1957 1979
 	}
1958 1980
 
1959 1981
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -2099,6 +2121,41 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
2099 2121
 	//	advice.WeekDay = week_day
2100 2122
 	//}
2101 2123
 
2124
+	if json["min_unit"] != nil && reflect.TypeOf(json["min_unit"]).String() == "string" {
2125
+		drugSpecUnit, _ := json["min_unit"].(string)
2126
+		advice.DrugSpecUnit = drugSpecUnit
2127
+	}
2128
+	if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
2129
+		singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
2130
+		advice.SingleDose = singleDose
2131
+	}
2132
+	if json["single_dose_unit"] != nil && reflect.TypeOf(json["single_dose_unit"]).String() == "string" {
2133
+		singleDoseUnit, _ := json["single_dose_unit"].(string)
2134
+		advice.SingleDoseUnit = singleDoseUnit
2135
+	}
2136
+
2137
+	if json["delivery_way"] != nil && reflect.TypeOf(json["delivery_way"]).String() == "string" {
2138
+		deliveryWay, _ := json["delivery_way"].(string)
2139
+		advice.DeliveryWay = deliveryWay
2140
+	}
2141
+	if json["execution_frequency"] != nil && reflect.TypeOf(json["execution_frequency"]).String() == "string" {
2142
+		executionFrequency, _ := json["execution_frequency"].(string)
2143
+		advice.ExecutionFrequency = executionFrequency
2144
+	}
2145
+
2146
+	if json["retail_price"] != nil || reflect.TypeOf(json["retail_price"]).String() == "string" {
2147
+		price, _ := strconv.ParseFloat(json["retail_price"].(string), 64)
2148
+		advice.Price = price
2149
+	}
2150
+	if json["medical_insurance_number"] != nil || reflect.TypeOf(json["medical_insurance_number"]).String() == "string" {
2151
+		med_list_codg, _ := json["medical_insurance_number"].(string)
2152
+		advice.MedListCodg = med_list_codg
2153
+	}
2154
+	if json["day"] != nil || reflect.TypeOf(json["day"]).String() == "float64" {
2155
+		day := int64(json["day"].(float64))
2156
+		advice.Day = day
2157
+	}
2158
+
2102 2159
 	if json["prescribing_number_unit"] != nil && reflect.TypeOf(json["prescribing_number_unit"]).String() == "string" {
2103 2160
 		prescribingNumberUnit, _ := json["prescribing_number_unit"].(string)
2104 2161
 		advice.PrescribingNumberUnit = prescribingNumberUnit
@@ -2111,6 +2168,7 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
2111 2168
 			hisAdvice, err := service.GetHisDoctorAdvicesById(advice.ID)
2112 2169
 			if err == nil {
2113 2170
 				if hisAdvice.ID > 0 {
2171
+
2114 2172
 					advice.ExecutionTime = hisAdvice.ExecutionTime
2115 2173
 					advice.ExecutionStaff = hisAdvice.ExecutionStaff
2116 2174
 					advice.ExecutionState = hisAdvice.ExecutionState
@@ -2119,6 +2177,16 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
2119 2177
 					advice.CheckState = hisAdvice.CheckState
2120 2178
 					advice.StartTime = hisAdvice.StartTime
2121 2179
 					advice.HospApprFlag = hisAdvice.HospApprFlag
2180
+
2181
+					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 {
2182
+						advice.ExecutionTime = 0
2183
+						advice.ExecutionStaff = 0
2184
+						advice.ExecutionState = 2
2185
+						advice.CheckTime = 0
2186
+						advice.Checker = 0
2187
+						advice.CheckState = 2
2188
+					}
2189
+
2122 2190
 					//advice.Groupno = hisAdvice.Groupno
2123 2191
 
2124 2192
 				}
@@ -2246,40 +2314,6 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
2246 2314
 	//	advice.StartTime = start_time
2247 2315
 	//}
2248 2316
 
2249
-	if json["min_unit"] != nil && reflect.TypeOf(json["min_unit"]).String() == "string" {
2250
-		drugSpecUnit, _ := json["min_unit"].(string)
2251
-		advice.DrugSpecUnit = drugSpecUnit
2252
-	}
2253
-	if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
2254
-		singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
2255
-		advice.SingleDose = singleDose
2256
-	}
2257
-	if json["single_dose_unit"] != nil && reflect.TypeOf(json["single_dose_unit"]).String() == "string" {
2258
-		singleDoseUnit, _ := json["single_dose_unit"].(string)
2259
-		advice.SingleDoseUnit = singleDoseUnit
2260
-	}
2261
-
2262
-	if json["delivery_way"] != nil && reflect.TypeOf(json["delivery_way"]).String() == "string" {
2263
-		deliveryWay, _ := json["delivery_way"].(string)
2264
-		advice.DeliveryWay = deliveryWay
2265
-	}
2266
-	if json["execution_frequency"] != nil && reflect.TypeOf(json["execution_frequency"]).String() == "string" {
2267
-		executionFrequency, _ := json["execution_frequency"].(string)
2268
-		advice.ExecutionFrequency = executionFrequency
2269
-	}
2270
-
2271
-	if json["retail_price"] != nil || reflect.TypeOf(json["retail_price"]).String() == "string" {
2272
-		price, _ := strconv.ParseFloat(json["retail_price"].(string), 64)
2273
-		advice.Price = price
2274
-	}
2275
-	if json["medical_insurance_number"] != nil || reflect.TypeOf(json["medical_insurance_number"]).String() == "string" {
2276
-		med_list_codg, _ := json["medical_insurance_number"].(string)
2277
-		advice.MedListCodg = med_list_codg
2278
-	}
2279
-	if json["day"] != nil || reflect.TypeOf(json["day"]).String() == "float64" {
2280
-		day := int64(json["day"].(float64))
2281
-		advice.Day = day
2282
-	}
2283 2317
 	return 0
2284 2318
 }
2285 2319
 
@@ -2326,8 +2360,8 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2326 2360
 
2327 2361
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
2328 2362
 		total, _ := json["total"].(string)
2329
-		totals, _ := strconv.ParseInt(total, 10, 64)
2330
-		project.Count = totals
2363
+		//totals, _ := strconv.ParseInt(total, 10, 64)
2364
+		project.Count = total
2331 2365
 	}
2332 2366
 
2333 2367
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -2383,7 +2417,7 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2383 2417
 		if stockConfig.IsOpen == 1 {
2384 2418
 			if project.Type == 3 {
2385 2419
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
2386
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
2420
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
2387 2421
 				good.Total = good.Total - f_count
2388 2422
 				service.UpdateGoodInfo(&good)
2389 2423
 			}
@@ -2396,12 +2430,18 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2396 2430
 			if project.Type == 3 {
2397 2431
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
2398 2432
 				if project.Count < temp_project.Count {
2399
-					other_count := temp_project.Count - project.Count
2433
+					f_count_one, _ := strconv.ParseFloat(project.Count, 64)
2434
+					f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
2435
+
2436
+					other_count := f_count_two - f_count_one
2400 2437
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
2401 2438
 					good.Total = good.Total + other_count_two
2402 2439
 					service.UpdateGoodInfo(&good)
2403 2440
 				} else if project.Count > temp_project.Count {
2404
-					other_count := project.Count - temp_project.Count
2441
+					f_count_one, _ := strconv.ParseFloat(project.Count, 64)
2442
+					f_count_two, _ := strconv.ParseFloat(temp_project.Count, 64)
2443
+
2444
+					other_count := f_count_one - f_count_two
2405 2445
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
2406 2446
 					good.Total = good.Total - other_count_two
2407 2447
 					service.UpdateGoodInfo(&good)
@@ -2557,8 +2597,8 @@ func (c *HisApiController) setProjectTemplateWithJSON(project *models.HisPrescri
2557 2597
 
2558 2598
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
2559 2599
 		total, _ := json["total"].(string)
2560
-		totals, _ := strconv.ParseInt(total, 10, 64)
2561
-		project.Count = totals
2600
+		//totals, _ := strconv.ParseInt(total, 10, 64)
2601
+		project.Count = total
2562 2602
 	}
2563 2603
 
2564 2604
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -3260,7 +3300,8 @@ func (c *HisApiController) GetUploadInfo() {
3260 3300
 			}
3261 3301
 			if item.Type == 2 { //项目
3262 3302
 				for _, subItem := range item.HisPrescriptionProject {
3263
-					total = total + (subItem.Price * float64(subItem.Count))
3303
+					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
3304
+					total = total + (subItem.Price * cnt)
3264 3305
 				}
3265 3306
 			}
3266 3307
 
@@ -3330,11 +3371,12 @@ func (c *HisApiController) GetUploadInfo() {
3330 3371
 			}
3331 3372
 			if item.Type == 2 { //项目
3332 3373
 				for _, subItem := range item.HisPrescriptionProject {
3374
+					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
3333 3375
 					cus := &Custom{
3334 3376
 						AdviceId:         0,
3335 3377
 						ProjectId:        subItem.ID,
3336
-						DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*float64(subItem.Count)),
3337
-						Cut:              fmt.Sprintf("%.4f", float64(subItem.Count)),
3378
+						DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
3379
+						Cut:              fmt.Sprintf("%.4f", cnt),
3338 3380
 						FeedetlSn:        subItem.FeedetlSn,
3339 3381
 						Price:            fmt.Sprintf("%.4f", float64(subItem.Price)),
3340 3382
 						MedListCodg:      subItem.MedListCodg,
@@ -5097,7 +5139,8 @@ func (c *HisApiController) PreSettle() {
5097 5139
 		}
5098 5140
 		if item.Type == 2 { //项目
5099 5141
 			for _, subItem := range item.HisPrescriptionProject {
5100
-				total = total + (subItem.Price * float64(subItem.Count))
5142
+				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
5143
+				total = total + (subItem.Price * cnt)
5101 5144
 			}
5102 5145
 		}
5103 5146
 
@@ -5155,12 +5198,12 @@ func (c *HisApiController) PreSettle() {
5155 5198
 
5156 5199
 		if item.Type == 2 { //项目
5157 5200
 			for _, subItem := range item.HisPrescriptionProject {
5158
-
5201
+				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
5159 5202
 				cus := &Custom{
5160 5203
 					AdviceId:         0,
5161 5204
 					ProjectId:        subItem.ID,
5162
-					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
5163
-					Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
5205
+					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cnt),
5206
+					Cut:              fmt.Sprintf("%.2f", cnt),
5164 5207
 					FeedetlSn:        subItem.FeedetlSn,
5165 5208
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
5166 5209
 					MedListCodg:      subItem.MedListCodg,

+ 2 - 2
controllers/his_config_api_controller.go Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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,

+ 9 - 2
controllers/his_project_api_controller.go Näytä tiedosto

@@ -809,12 +809,19 @@ func (this *HisProjectApiController) DeleteProject() {
809 809
 }
810 810
 
811 811
 func (this *HisProjectApiController) GetHisProject() {
812
-
813 812
 	adminUserInfo := this.GetAdminUserInfo()
814 813
 	orgId := adminUserInfo.CurrentOrgId
815 814
 	project, err := service.GetHisProject(orgId)
816 815
 	good_info, err := service.GetGoodInfoMation(orgId)
817
-
816
+	_, config := service.FindHisStockPriceRecordByOrgId(orgId)
817
+	if config.ID > 0 && config.IsOpen == 1 {
818
+		//处理耗材不同批号价格问题
819
+		for _, item := range good_info {
820
+			if len(item.GoodSotckInfo) > 0 {
821
+				item.PackingPrice = item.GoodSotckInfo[0].Price
822
+			}
823
+		}
824
+	}
818 825
 	if err != nil {
819 826
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
820 827
 		return

+ 2 - 1
controllers/mobile_api_controllers/patient_api_controller.go Näytä tiedosto

@@ -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 {

+ 19 - 9
controllers/new_mobile_api_controllers/mobile_his_api_controller.go Näytä tiedosto

@@ -270,12 +270,14 @@ func (c *MobileHisApiController) DeletePrescription() {
270 270
 	projects, _ := service.GetHisPrescriptionProjectsByID(prescription_id)
271 271
 	advices, _ := service.GetHisPrescriptionAdviceByID(prescription_id)
272 272
 	_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(c.GetMobileAdminUserInfo().Org.Id)
273
-	_, stockConfig := service.FindAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
273
+	_, stockConfig := service.FindAutomaticReduceRecordByOrgId(c.GetMobileAdminUserInfo().Org.Id)
274 274
 
275 275
 	err := service.DelelteHisPrescription(prescription_id, c.GetMobileAdminUserInfo().Org.Id)
276 276
 	if err == nil {
277 277
 		if len(projects) > 0 {
278 278
 			for _, item := range projects {
279
+				service.DeletePrintInfo(item.ID)
280
+
279 281
 				if item.Type == 3 { //处理透前准备耗材数量数据
280 282
 					consumables, _ := service.FindHisConsumablesByID(item.UserOrgId, item.PatientId, item.RecordDate, item.ProjectId)
281 283
 					if consumables.ID > 0 {
@@ -287,7 +289,7 @@ func (c *MobileHisApiController) DeletePrescription() {
287 289
 				if stockConfig.IsOpen == 1 {
288 290
 					if item.Type == 3 {
289 291
 						good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
290
-						f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(item.Count), 10), 64)
292
+						f_count, _ := strconv.ParseFloat(item.Count, 64)
291 293
 						good.Total = good.Total + f_count
292 294
 						service.UpdateGoodInfo(&good)
293 295
 					}
@@ -361,10 +363,11 @@ func (c *MobileHisApiController) DeleteProject() {
361 363
 
362 364
 	err := service.DelelteProject(id, c.GetMobileAdminUserInfo().Org.Id)
363 365
 	if err == nil {
366
+		service.DeletePrintInfo(id)
364 367
 		if stockConfig.IsOpen == 1 {
365 368
 			if project.Type == 3 {
366 369
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
367
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
370
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
368 371
 				good.Total = good.Total + f_count
369 372
 				service.UpdateGoodInfo(&good)
370 373
 			}
@@ -762,7 +765,8 @@ func (c *MobileHisApiController) CreateHisPrescription() {
762 765
 							if p.Type == 3 { //处理透前准备耗材数量数据
763 766
 								consumables, _ := service.FindHisConsumablesByID(adminInfo.Org.Id, patient_id, recordDateTime, p.ProjectId)
764 767
 								if consumables.ID > 0 {
765
-									consumables.Count = int64(p.Count)
768
+									cnt, _ := strconv.ParseInt(p.Count, 10, 64)
769
+									consumables.Count = cnt
766 770
 									service.UpdateConsumables(&consumables)
767 771
 								}
768 772
 							}
@@ -1086,8 +1090,8 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
1086 1090
 
1087 1091
 	if json["total"] != nil && reflect.TypeOf(json["total"]).String() == "string" {
1088 1092
 		total, _ := json["total"].(string)
1089
-		totals, _ := strconv.ParseInt(total, 10, 64)
1090
-		project.Count = totals
1093
+		//totals, _ := strconv.ParseInt(total, 10, 64)
1094
+		project.Count = total
1091 1095
 	}
1092 1096
 
1093 1097
 	if json["medical_code"] != nil && reflect.TypeOf(json["medical_code"]).String() == "string" {
@@ -1127,7 +1131,7 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
1127 1131
 		if stockConfig.IsOpen == 1 {
1128 1132
 			if project.Type == 3 {
1129 1133
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
1130
-				f_count, _ := strconv.ParseFloat(strconv.FormatInt(int64(project.Count), 10), 64)
1134
+				f_count, _ := strconv.ParseFloat(project.Count, 64)
1131 1135
 				good.Total = good.Total - f_count
1132 1136
 				service.UpdateGoodInfo(&good)
1133 1137
 			}
@@ -1140,12 +1144,18 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
1140 1144
 			if project.Type == 3 {
1141 1145
 				good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
1142 1146
 				if project.Count < temp_project.Count {
1143
-					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
1144 1151
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
1145 1152
 					good.Total = good.Total + other_count_two
1146 1153
 					service.UpdateGoodInfo(&good)
1147 1154
 				} else if project.Count > temp_project.Count {
1148
-					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
1149 1159
 					other_count_two, _ := strconv.ParseFloat(strconv.FormatInt(int64(other_count), 10), 64)
1150 1160
 					good.Total = good.Total - other_count_two
1151 1161
 					service.UpdateGoodInfo(&good)

+ 23 - 31
controllers/public_api_controller.go Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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"`

+ 15 - 2
models/his_models.go Näytä tiedosto

@@ -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"`
@@ -1618,3 +1618,16 @@ type VMHisOrderTwo struct {
1618 1618
 func (VMHisOrderTwo) TableName() string {
1619 1619
 	return "his_order"
1620 1620
 }
1621
+
1622
+type HisStockPriceConfig struct {
1623
+	ID        int64 `gorm:"column:id" json:"id" form:"id"`
1624
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1625
+	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1626
+	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1627
+	Status    int64 `gorm:"column:status" json:"status" form:"status"`
1628
+	IsOpen    int64 `gorm:"column:is_open" json:"is_open" form:"is_open"`
1629
+}
1630
+
1631
+func (HisStockPriceConfig) TableName() string {
1632
+	return "his_stock_price_config"
1633
+}

+ 5 - 4
models/stock_models.go Näytä tiedosto

@@ -1116,10 +1116,11 @@ type SgjCancelStockInfo struct {
1116 1116
 }
1117 1117
 
1118 1118
 type GoodSotckInfo struct {
1119
-	GoodId            int64  `gorm:"column:good_id" json:"good_id" form:"good_id"`
1120
-	StockCount        int64  `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1121
-	GoodName          string `gorm:"column:good_name" json:"good_name"`
1122
-	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1119
+	GoodId            int64   `gorm:"column:good_id" json:"good_id" form:"good_id"`
1120
+	StockCount        int64   `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1121
+	GoodName          string  `gorm:"column:good_name" json:"good_name"`
1122
+	SpecificationName string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1123
+	Price             float64 `gorm:"column:price" json:"price" form:"price"`
1123 1124
 }
1124 1125
 
1125 1126
 func (GoodSotckInfo) TableName() string {

+ 1 - 1
service/dialysis_service.go Näytä tiedosto

@@ -1179,7 +1179,7 @@ func SaveHisDoctorAdvice(advice *models.HisDoctorAdviceInfo) (err error) {
1179 1179
 
1180 1180
 func GetGoodInfoMation(orgid int64) (goodinfo []*models.GoodInfo, err error) {
1181 1181
 
1182
-	err = XTReadDB().Model(&goodinfo).Where("org_id = ? and status = 1 AND  find_in_set('停用',good_status) = 0", orgid).Preload("GoodSotckInfo", "stock_count >0 and status = 1").Find(&goodinfo).Error
1182
+	err = XTReadDB().Model(&goodinfo).Where("org_id = ? and status = 1 AND  find_in_set('停用',good_status) = 0", orgid).Preload("GoodSotckInfo", "stock_count > 0 and status = 1").Find(&goodinfo).Error
1183 1183
 	return goodinfo, err
1184 1184
 }
1185 1185
 

+ 3 - 3
service/gdyb_service.go Näytä tiedosto

@@ -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,

+ 15 - 0
service/gobal_config_service.go Näytä tiedosto

@@ -185,6 +185,11 @@ func FindXTHisRecordByOrgId(org_id int64) (err error, config models.XtHisConfig)
185 185
 	return
186 186
 }
187 187
 
188
+func FindHisStockPriceRecordByOrgId(org_id int64) (err error, config models.HisStockPriceConfig) {
189
+	err = readDb.Model(&models.HisStockPriceConfig{}).Where("status = 1 AND user_org_id = ?", org_id).Find(&config).Error
190
+	return
191
+}
192
+
188 193
 func UpdateXTHisRecord(config *models.XtHisConfig) (err error) {
189 194
 	err = writeDb.Save(config).Error
190 195
 	return
@@ -195,6 +200,16 @@ func CreateXTHisRecord(config *models.XtHisConfig) (err error) {
195 200
 	return
196 201
 }
197 202
 
203
+func CreateHisStockPriceRecord(config *models.HisStockPriceConfig) (err error) {
204
+	err = writeDb.Model(&models.HisStockPriceConfig{}).Create(config).Error
205
+	return
206
+}
207
+
208
+func UpdateHisStockPriceRecord(config *models.HisStockPriceConfig) (err error) {
209
+	err = writeDb.Save(config).Error
210
+	return
211
+}
212
+
198 213
 //TODO:项目开关
199 214
 func FindXTHisProjectByOrgId(org_id int64) (err error, config models.XtHisProjectConfig) {
200 215
 	err = readDb.Model(&models.XtHisProjectConfig{}).Where("status = 1 AND user_org_id = ?", org_id).Find(&config).Error

+ 13 - 8
service/his_service.go Näytä tiedosto

@@ -588,13 +588,14 @@ func GetChargeMonthHisPrescriptionFour(org_id int64, patient_id int64, start_dat
588 588
 }
589 589
 
590 590
 type OtherDrugWarehouseInfo struct {
591
-	ID               int64 `gorm:"column:id" json:"id" form:"id"`
592
-	DrugId           int64 `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
593
-	WarehousingCount int64 `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
594
-	Status           int64 `gorm:"column:status" json:"status" form:"status"`
595
-	OrgId            int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
596
-	StockMaxNumber   int64 `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
597
-	StockMinNumber   int64 `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
591
+	ID               int64   `gorm:"column:id" json:"id" form:"id"`
592
+	DrugId           int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
593
+	WarehousingCount int64   `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
594
+	Status           int64   `gorm:"column:status" json:"status" form:"status"`
595
+	OrgId            int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
596
+	StockMaxNumber   int64   `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
597
+	StockMinNumber   int64   `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
598
+	Price            float64 `gorm:"column:price" json:"price" form:"price"`
598 599
 }
599 600
 
600 601
 func (OtherDrugWarehouseInfo) TableName() string {
@@ -1515,7 +1516,7 @@ type HisPrescriptionProject struct {
1515 1516
 	HisPatientId       int64        `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1516 1517
 	RecordDate         int64        `gorm:"column:record_date" json:"record_date" form:"record_date"`
1517 1518
 	PrescriptionId     int64        `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1518
-	Count              int64        `gorm:"column:count" json:"count" form:"count"`
1519
+	Count              string       `gorm:"column:count" json:"count" form:"count"`
1519 1520
 	FeedetlSn          string       `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1520 1521
 	MedListCodg        string       `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1521 1522
 	SingleDose         string       `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
@@ -2209,6 +2210,10 @@ func GetProjectById(user_org_id int64, p_project_id int64, record_time int64, pa
2209 2210
 	return
2210 2211
 }
2211 2212
 
2213
+func DeletePrintInfo(id int64) {
2214
+	writeDb.Model(&models.HisLabelPrintInfo{}).Where("p_project_id = ?", id).Updates(map[string]interface{}{"status": 0})
2215
+}
2216
+
2212 2217
 func CreateHisLabelRecord(label *models.HisLabelPrintInfo) error {
2213 2218
 	err := writeDb.Save(&label).Error
2214 2219
 	return err