Browse Source

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

csx 4 years ago
parent
commit
62a0a88b95

+ 114 - 37
controllers/his_api_controller.go View File

@@ -32,6 +32,7 @@ func HisManagerApiRegistRouters() {
32 32
 	beego.Router("/api/hisprescription/delete", &HisApiController{}, "post:DeletePrescription")
33 33
 	beego.Router("/api/advice/delete", &HisApiController{}, "post:DeleteDoctorAdvice")
34 34
 	beego.Router("/api/project/delete", &HisApiController{}, "post:DeleteProject")
35
+	beego.Router("/api/addition_charge/delete", &HisApiController{}, "post:DeleteAddition")
35 36
 
36 37
 	beego.Router("/api/hisprescription/list", &HisApiController{}, "get:GetHisPrescriptionList")
37 38
 	beego.Router("/api/hisprescription/info", &HisApiController{}, "get:GetHisPrescriptionInfo")
@@ -145,17 +146,16 @@ func (c *HisApiController) GetHisPatientInfo() {
145 146
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime)
146 147
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime)
147 148
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
148
-	addtions, _ := service.GetAllAdditionCharge(admin.CurrentOrgId, patient_id, recordDateTime)
149
+	//addtions, _ := service.GetAllAdditionCharge(admin.CurrentOrgId, patient_id, recordDateTime)
149 150
 
150 151
 	c.ServeSuccessJSON(map[string]interface{}{
151
-		"his_info":        his_patient_info,
152
-		"xt_info":         xt_patient_info,
153
-		"prescription":    prescriptions,
154
-		"case_history":    case_history,
155
-		"info":            patientPrescriptionInfo,
156
-		"last_info":       lastPatientPrescriptionInfo,
157
-		"order":           order,
158
-		"addtions_charge": addtions,
152
+		"his_info":     his_patient_info,
153
+		"xt_info":      xt_patient_info,
154
+		"prescription": prescriptions,
155
+		"case_history": case_history,
156
+		"info":         patientPrescriptionInfo,
157
+		"last_info":    lastPatientPrescriptionInfo,
158
+		"order":        order,
159 159
 	})
160 160
 	return
161 161
 
@@ -200,7 +200,7 @@ func (c *HisApiController) CreateHisPrescription() {
200 200
 	diagnose := c.GetString("diagnose")
201 201
 	sick_history := c.GetString("sick_history")
202 202
 	doctor_id, _ := c.GetInt64("doctor", 0)
203
-	department := c.GetString("department")
203
+	department, _ := c.GetInt64("department", 0)
204 204
 	his_patient_id, _ := c.GetInt64("his_patient_id")
205 205
 	dataBody := make(map[string]interface{}, 0)
206 206
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
@@ -386,6 +386,40 @@ func (c *HisApiController) CreateHisPrescription() {
386 386
 						}
387 387
 					}
388 388
 				}
389
+				if items["addition"] != nil && reflect.TypeOf(items["addition"]).String() == "[]interface {}" {
390
+					addition := items["addition"].([]interface{})
391
+					//group := service.GetMaxAdviceGroupID(adminInfo.CurrentOrgId)
392
+					ctime := time.Now().Unix()
393
+					mtime := ctime
394
+					if len(addition) > 0 {
395
+						for _, item := range addition {
396
+							var s models.HisAdditionalCharge
397
+							s.PrescriptionId = prescription.ID
398
+							s.Status = 1
399
+							s.UserOrgId = adminInfo.CurrentOrgId
400
+							s.RecordDate = recordDateTime
401
+							s.CreatedTime = ctime
402
+							s.UpdatedTime = mtime
403
+							s.PatientId = patient_id
404
+							s.HisPatientId = his_patient_id
405
+							errcode := c.setAddtionWithJSON(&s, item.(map[string]interface{}))
406
+							if errcode > 0 {
407
+								c.ServeFailJSONWithSGJErrorCode(errcode)
408
+								return
409
+							}
410
+							service.CreateAdditionalCharge(&s)
411
+							var randNum int
412
+							randNum = rand.Intn(10000) + 1000
413
+							timestamp := time.Now().Unix()
414
+							tempTime := time.Unix(timestamp, 0)
415
+							timeFormat := tempTime.Format("20060102150405")
416
+							s.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "3" + "-" + strconv.FormatInt(s.ID, 10)
417
+							service.CreateAdditionalCharge(&s)
418
+
419
+						}
420
+					}
421
+				}
422
+
389 423
 			}
390 424
 		}
391 425
 	}
@@ -864,6 +898,34 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
864 898
 	return 0
865 899
 }
866 900
 
901
+func (c *HisApiController) setAddtionWithJSON(additionalCharge *models.HisAdditionalCharge, json map[string]interface{}) int {
902
+	if json["id"] != nil || reflect.TypeOf(json["id"]).String() == "float64" {
903
+		id := int64(json["id"].(float64))
904
+		additionalCharge.ID = id
905
+	}
906
+	if json["item_id"] != nil || reflect.TypeOf(json["item_id"]).String() == "float64" {
907
+		item_id := int64(json["item_id"].(float64))
908
+		additionalCharge.ItemId = item_id
909
+	}
910
+	if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "float64" {
911
+		price := int64(json["price"].(float64))
912
+		formatInt_price := strconv.FormatInt(price, 10)
913
+		float_price, _ := strconv.ParseFloat(formatInt_price, 64)
914
+		additionalCharge.Price = float_price
915
+	}
916
+	if json["count"] != nil && reflect.TypeOf(json["count"]).String() == "string" {
917
+		count, _ := json["count"].(string)
918
+		counts, _ := strconv.ParseInt(count, 10, 64)
919
+		additionalCharge.Count = counts
920
+	}
921
+	if json["item_name"] != nil && reflect.TypeOf(json["item_name"]).String() == "string" {
922
+		item_name, _ := json["item_name"].(string)
923
+		additionalCharge.ItemName = item_name
924
+	}
925
+
926
+	return 0
927
+}
928
+
867 929
 func (c *HisApiController) GetHisOrderList() {
868 930
 	adminUser := c.GetAdminUserInfo()
869 931
 	org_id := adminUser.CurrentOrgId
@@ -1202,11 +1264,14 @@ func (c *HisApiController) GetRegisterInfo() {
1202 1264
 		ipt_otp_no := timeFormat + strconv.FormatInt(int64(chrgBchno), 10) + strconv.FormatInt(his.PatientId, 10)
1203 1265
 
1204 1266
 		count, _ := service.FindHisRegisterRecord(theTime.Unix(), patient.ID, adminInfo.CurrentOrgId)
1267
+
1268
+		department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
1269
+
1205 1270
 		if count <= 0 {
1206 1271
 			api := "http://127.0.0.1:9531/" + "gdyb/two?cert_no=" + patient.IdCardNo + "&insutype=" +
1207 1272
 				res.Output.Iinfo[0].Insutype + "&psn_no=" + res.Output.Baseinfo.PsnNo +
1208 1273
 				"&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&ipt_otp_no=" + ipt_otp_no +
1209
-				"&dept=" + patientPrescription.Departments + "&fixmedins_code=" + miConfig.Code
1274
+				"&dept=" + department.Name + "&fixmedins_code=" + miConfig.Code
1210 1275
 			resp, requestErr := http.Get(api)
1211 1276
 			if requestErr != nil {
1212 1277
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -1256,7 +1321,7 @@ func (c *HisApiController) GetRegisterInfo() {
1256 1321
 			err := service.CreateHisPatientTwo(&his)
1257 1322
 			if err == nil {
1258 1323
 				api := "http://127.0.0.1:9531/" + "gdyb/four?psn_no=" + his.PsnNo +
1259
-					"&mdtrt_id=" + his.Number + "&doctor=" + patientPrescription.Doctor + "&department=" + patientPrescription.Departments +
1324
+					"&mdtrt_id=" + his.Number + "&doctor=" + patientPrescription.Doctor + "&department=" + department.Name +
1260 1325
 					"&diag=" + patientPrescription.Diagnosis + "&org_name=" + miConfig.OrgName + "&med_type=" + "11" + "&doctor_id=" + strconv.FormatInt(patientPrescription.DoctorId, 10) + "&fixmedins_code=" + miConfig.Code
1261 1326
 				resp, requestErr := http.Get(api)
1262 1327
 				if requestErr != nil {
@@ -1345,7 +1410,6 @@ func (c *HisApiController) GetUploadInfo() {
1345 1410
 	recordDateTime := theTime.Unix()
1346 1411
 	adminUser := c.GetAdminUserInfo()
1347 1412
 	prescriptions, _ := service.GetHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
1348
-	additions, _ := service.GetAllAdditionCharge(adminUser.CurrentOrgId, id, recordDateTime)
1349 1413
 
1350 1414
 	his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, id, recordDateTime)
1351 1415
 
@@ -1372,15 +1436,12 @@ func (c *HisApiController) GetUploadInfo() {
1372 1436
 	data["fixmedins_code"] = miConfig.Code
1373 1437
 
1374 1438
 	var ids []int64
1375
-	var idsTwo []int64
1376
-
1439
+	//var idsTwo []int64
1440
+	//
1377 1441
 	for _, item := range prescriptions {
1378 1442
 		ids = append(ids, item.ID)
1379 1443
 	}
1380 1444
 
1381
-	for _, item := range additions {
1382
-		idsTwo = append(idsTwo, item.ID)
1383
-	}
1384 1445
 	config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
1385 1446
 
1386 1447
 	if config.IsOpen == 1 { //对接了医保,走医保流程
@@ -1631,11 +1692,10 @@ func (c *HisApiController) GetUploadInfo() {
1631 1692
 					total = total + (subItem.Price * float64(subItem.Count))
1632 1693
 				}
1633 1694
 			}
1634
-		}
1635
-
1636
-		for _, item := range additions {
1637
-			total = total + item.Price
1638 1695
 
1696
+			for _, subItem := range item.HisAdditionalCharge {
1697
+				total = total + (subItem.Price * float64(subItem.Count))
1698
+			}
1639 1699
 		}
1640 1700
 
1641 1701
 		allTotal := fmt.Sprintf("%.2f", total)
@@ -1679,6 +1739,7 @@ func (c *HisApiController) GetUploadInfo() {
1679 1739
 
1680 1740
 			if item.Type == 2 { //项目
1681 1741
 				for _, subItem := range item.HisPrescriptionProject {
1742
+
1682 1743
 					cus := &Custom{
1683 1744
 						AdviceId:         0,
1684 1745
 						ProjectId:        subItem.ID,
@@ -1693,22 +1754,23 @@ func (c *HisApiController) GetUploadInfo() {
1693 1754
 					customs = append(customs, cus)
1694 1755
 				}
1695 1756
 			}
1696
-		}
1697 1757
 
1698
-		for _, item := range additions {
1699
-			cus := &Custom{
1700
-				ItemId:           item.ID,
1701
-				AdviceId:         0,
1702
-				ProjectId:        0,
1703
-				DetItemFeeSumamt: fmt.Sprintf("%.2f", item.Price),
1704
-				Cut:              fmt.Sprintf("%.2f", float64(1)),
1705
-				FeedetlSn:        item.FeedetlSn,
1706
-				Price:            fmt.Sprintf("%.2f", float64(item.Price)),
1707
-				MedListCodg:      item.XtHisAddtionConfig.Code,
1708
-				Type:             3,
1758
+			for _, item := range item.HisAdditionalCharge {
1759
+				cus := &Custom{
1760
+					ItemId:           item.ID,
1761
+					AdviceId:         0,
1762
+					ProjectId:        0,
1763
+					DetItemFeeSumamt: fmt.Sprintf("%.2f", item.Price),
1764
+					Cut:              fmt.Sprintf("%.2f", float64(item.Count)),
1765
+					FeedetlSn:        item.FeedetlSn,
1766
+					Price:            fmt.Sprintf("%.2f", float64(item.Price)),
1767
+					MedListCodg:      item.XtHisAddtionConfig.Code,
1768
+					Type:             3,
1769
+				}
1770
+
1771
+				customs = append(customs, cus)
1709 1772
 			}
1710 1773
 
1711
-			customs = append(customs, cus)
1712 1774
 		}
1713 1775
 
1714 1776
 		for _, item := range customs {
@@ -1730,7 +1792,6 @@ func (c *HisApiController) GetUploadInfo() {
1730 1792
 			} else if item.Type == 3 {
1731 1793
 				advice_id = 0
1732 1794
 				item_id = item.ItemId
1733
-
1734 1795
 				project_id = 0
1735 1796
 			}
1736 1797
 
@@ -1758,7 +1819,7 @@ func (c *HisApiController) GetUploadInfo() {
1758 1819
 			}
1759 1820
 			service.CreateOrderInfo(info)
1760 1821
 		}
1761
-		err := service.UpDateAddtionNumber(adminUser.CurrentOrgId, idsTwo, chrg_bchno)
1822
+		//err := service.UpDateAddtionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
1762 1823
 		err = service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
1763 1824
 		err = service.UpDatePrescriptionInfoNumber(adminUser.CurrentOrgId, id, chrg_bchno, recordDateTime)
1764 1825
 		err = service.UpdataOrderStatusTwo(chrg_bchno, adminUser.CurrentOrgId)
@@ -1856,3 +1917,19 @@ func (this *HisApiController) AdditionalCharge() {
1856 1917
 		"additional_charges": additionalCharges,
1857 1918
 	})
1858 1919
 }
1920
+
1921
+func (this *HisApiController) DeleteAddition() {
1922
+	id, _ := this.GetInt64("id")
1923
+	//TODO 需要判断是否已经结算
1924
+	err := service.DelelteAddition(id, this.GetAdminUserInfo().CurrentOrgId)
1925
+	if err == nil {
1926
+		this.ServeSuccessJSON(map[string]interface{}{
1927
+			"msg": "删除成功",
1928
+		})
1929
+		return
1930
+	} else {
1931
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1932
+		return
1933
+	}
1934
+
1935
+}

+ 0 - 3
controllers/manager_center_api_controller.go View File

@@ -76,9 +76,6 @@ func ManagerCenterRegistRouters() {
76 76
 
77 77
 func (c *ManagerCenterApiController) CreateBaseDrugLib() {
78 78
 	drug_name := c.GetString("drug_name")
79
-	fmt.Println("0000000")
80
-
81
-	fmt.Println(drug_name)
82 79
 	pinyin := c.GetString("pinyin")
83 80
 	wubi := c.GetString("wubi")
84 81
 	drug_alias := c.GetString("drug_alias")

+ 4 - 1
models/his_models.go View File

@@ -261,7 +261,7 @@ type HisPrescriptionInfo struct {
261 261
 	Diagnosis          string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
262 262
 	RegisterType       string `gorm:"column:register_type" json:"register_type" form:"register_type"`
263 263
 	Doctor             string `gorm:"column:doctor" json:"doctor" form:"doctor"`
264
-	Departments        string `gorm:"column:departments" json:"departments" form:"departments"`
264
+	Departments        int64  `gorm:"column:departments" json:"departments" form:"departments"`
265 265
 	SickHistory        string `gorm:"column:sick_history" json:"sick_history" form:"sick_history"`
266 266
 	PrescriptionNumber string `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
267 267
 	PrescriptionStatus int64  `gorm:"column:prescription_status" json:"prescription_status" form:"prescription_status"`
@@ -293,6 +293,7 @@ type HisPrescription struct {
293 293
 
294 294
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
295 295
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
296
+	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"addition"`
296 297
 }
297 298
 
298 299
 func (HisPrescription) TableName() string {
@@ -374,6 +375,8 @@ type HisAdditionalCharge struct {
374 375
 	PrescriptionNumber string             `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
375 376
 	XtHisAddtionConfig XtHisAddtionConfig `gorm:"ForeignKey:ID;AssociationForeignKey:ItemId" json:"config"`
376 377
 	FeedetlSn          string             `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
378
+	PrescriptionId     int64              `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
379
+	Count              int64              `gorm:"column:count" json:"count" form:"count"`
377 380
 }
378 381
 
379 382
 func (HisAdditionalCharge) TableName() string {

+ 29 - 14
service/gdyb_service.go View File

@@ -349,18 +349,19 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
349 349
 	for _, item := range hisPrescription {
350 350
 		if item.Type == 1 { //药品
351 351
 			for _, subItem := range item.HisDoctorAdviceInfo {
352
-
353
-				//var randNum int
354
-				//randNum = rand.Intn(10000) + 1000
355
-				cus := &Custom{
356
-					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber),
357
-					Cut:              fmt.Sprintf("%.2f", subItem.PrescribingNumber),
358
-					FeedetlSn:        subItem.FeedetlSn,
359
-					Price:            fmt.Sprintf("%.2f", subItem.Price),
360
-					MedListCodg:      subItem.MedListCodg,
352
+				if len(subItem.MedListCodg) > 0 {
353
+					//var randNum int
354
+					//randNum = rand.Intn(10000) + 1000
355
+					cus := &Custom{
356
+						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber),
357
+						Cut:              fmt.Sprintf("%.2f", subItem.PrescribingNumber),
358
+						FeedetlSn:        subItem.FeedetlSn,
359
+						Price:            fmt.Sprintf("%.2f", subItem.Price),
360
+						MedListCodg:      subItem.MedListCodg,
361
+					}
362
+
363
+					customs = append(customs, cus)
361 364
 				}
362
-
363
-				customs = append(customs, cus)
364 365
 			}
365 366
 		}
366 367
 
@@ -368,15 +369,29 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
368 369
 			for _, subItem := range item.HisPrescriptionProject {
369 370
 				//var randNum int
370 371
 				//randNum = rand.Intn(10000) + 1000
372
+				if len(subItem.MedListCodg) > 0 {
373
+
374
+					cus := &Custom{
375
+						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
376
+						Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
377
+						FeedetlSn:        subItem.FeedetlSn,
378
+						Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
379
+						MedListCodg:      subItem.MedListCodg,
380
+					}
381
+					customs = append(customs, cus)
382
+				}
383
+			}
384
+		}
385
+
386
+		for _, subItem := range item.HisAdditionalCharge {
387
+			if len(subItem.XtHisAddtionConfig.Code) > 0 {
371 388
 				cus := &Custom{
372 389
 					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
373 390
 					Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
374 391
 					FeedetlSn:        subItem.FeedetlSn,
375 392
 					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
376
-					MedListCodg:      subItem.MedListCodg,
393
+					MedListCodg:      subItem.XtHisAddtionConfig.Code,
377 394
 				}
378
-				fmt.Println(cus.FeedetlSn)
379
-
380 395
 				customs = append(customs, cus)
381 396
 			}
382 397
 		}

+ 7 - 3
service/his_service.go View File

@@ -194,6 +194,7 @@ func DelelteProject(id int64, user_org_id int64) (err error) {
194 194
 
195 195
 func GetHisPrescription(org_id int64, patient_id int64, record_date int64) (prescription []*models.HisPrescription, err error) {
196 196
 	err = readDb.Model(&models.HisPrescription{}).
197
+		Preload("HisAdditionalCharge", "status = 1 AND user_org_id = ?", org_id).
197 198
 		Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
198 199
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
199 200
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
@@ -370,7 +371,7 @@ type HisPrescriptionInfo struct {
370 371
 	Diagnosis             string                       `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
371 372
 	RegisterType          string                       `gorm:"column:register_type" json:"register_type" form:"register_type"`
372 373
 	Doctor                string                       `gorm:"column:doctor" json:"doctor" form:"doctor"`
373
-	Departments           string                       `gorm:"column:departments" json:"departments" form:"departments"`
374
+	Departments           int64                        `gorm:"column:departments" json:"departments" form:"departments"`
374 375
 	SickHistory           string                       `gorm:"column:sick_history" json:"sick_history" form:"sick_history"`
375 376
 	Patients              models.Patients              `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
376 377
 	HisPatient            models.HisPatient            `gorm:"ForeignKey:HisPatientId,RecordDate;AssociationForeignKey:ID,RecordDate" json:"his_patient"`
@@ -450,8 +451,6 @@ func UpDateOrder(order models.HisOrder) (err error) {
450 451
 func UpdataOrderStatusTwo(number string, user_org_id int64) (err error) {
451 452
 	err = writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 2, "mtime": time.Now().Unix()}).Error
452 453
 	err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 3, "mtime": time.Now().Unix()}).Error
453
-	err = writeDb.Model(&models.HisAdditionalCharge{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 2, "mtime": time.Now().Unix()}).Error
454
-
455 454
 	return
456 455
 }
457 456
 
@@ -526,3 +525,8 @@ func GetAllAdditionCharge(org_id int64, patient_id int64, record_time int64) (ad
526 525
 	return
527 526
 
528 527
 }
528
+
529
+func DelelteAddition(id int64, user_org_id int64) (err error) {
530
+	err = writeDb.Model(&models.HisAdditionalCharge{}).Where("user_org_id = ? AND id = ?", user_org_id, id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
531
+	return
532
+}