Ver código fonte

耗材参数

XMLWAN 3 anos atrás
pai
commit
e869bc112b

+ 163 - 69
controllers/doctors_api_controller.go Ver arquivo

@@ -5,6 +5,7 @@ import (
5 5
 	"XT_New/models"
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8
+	"encoding/json"
8 9
 	"fmt"
9 10
 	"github.com/astaxie/beego"
10 11
 	"github.com/jinzhu/gorm"
@@ -46,11 +47,11 @@ func DoctorApiRegistRouters() {
46 47
 	beego.Router("/api/patient/getinspectiondetail", &DoctorsApiController{}, "Get:GetInspectionDetailByProject")
47 48
 	beego.Router("/api/patient/getinspectionitemlist", &DoctorsApiController{}, "Get:GetInspectionItemlist")
48 49
 	beego.Router("/api/patient/getinitdatelist", &DoctorsApiController{}, "Get:GetInitDateList")
49
-	beego.Router("/api/patient/savecreationinspection", &DoctorsApiController{}, "Get:SaveCreationInspection")
50
+	beego.Router("/api/patient/savecreationinspection", &DoctorsApiController{}, "Post:SaveCreationInspection")
50 51
 	beego.Router("/api/patient/getemlatesummarylist", &DoctorsApiController{}, "Get:GetTemplateSummaryList")
51 52
 	beego.Router("/api/patient/gettemplatesummarydetail", &DoctorsApiController{}, "Get:GetTemplateSummaryDetail")
52 53
 	beego.Router("/api/patient/gettemplatesummaryprintdetail", &DoctorsApiController{}, "Get:GetTemplateSummaryPrintDetail")
53
-	beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Get:UpdateTempalteSummary")
54
+	beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Post:UpdateTempalteSummary")
54 55
 	beego.Router("/api/patient/deletesummary", &DoctorsApiController{}, "Get:DeleteSummary")
55 56
 }
56 57
 
@@ -763,48 +764,93 @@ func (this *DoctorsApiController) GetInitDateList() {
763 764
 
764 765
 func (this *DoctorsApiController) SaveCreationInspection() {
765 766
 
766
-	title := this.GetString("title")
767
-
768
-	dryWeight := this.GetString("dry_weight")
767
+	dataBody := make(map[string]interface{}, 0)
768
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
769
+	if err != nil {
770
+		utils.ErrorLog(err.Error())
771
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
772
+		return
773
+	}
774
+	title := dataBody["title"].(string)
775
+	dryWeight := dataBody["dry_weight"].(string)
769 776
 	dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
770
-	dialysis_count, _ := this.GetInt64("dialysis_count")
771
-	hd_count, _ := this.GetInt64("hd_count")
772
-	hdf_count, _ := this.GetInt64("hdf_count")
773
-	hp_count, _ := this.GetInt64("hp_count")
774
-	other_count, _ := this.GetInt64("other_count")
775
-	dialzer_apparatus := this.GetString("dialzer_apparatus")
776
-	perfusion_apparatus := this.GetString("perfusion_apparatus")
777
-	anticoagulant, _ := this.GetInt64("anticoagulant")
778
-	kaliumstr := this.GetString("kalium")
777
+	dialysis_count := int64(dataBody["dialysis_count"].(float64))
778
+	hd_count := int64(dataBody["hd_count"].(float64))
779
+	hdf_count := int64(dataBody["hdf_count"].(float64))
780
+	hp_count := int64(dataBody["hp_count"].(float64))
781
+	other_count := int64(dataBody["other_count"].(float64))
782
+	dialzer_apparatus := dataBody["dialzer_apparatus"].(string)
783
+	perfusion_apparatus := dataBody["perfusion_apparatus"].(string)
784
+	anticoagulant := int64(dataBody["anticoagulant"].(float64))
785
+	kaliumstr := dataBody["kalium"].(string)
779 786
 	kalium, _ := strconv.ParseFloat(kaliumstr, 64)
780
-
781
-	autunitestr := this.GetString("autunite")
787
+	autunitestr := dataBody["autunite"].(string)
782 788
 	autunite, _ := strconv.ParseFloat(autunitestr, 64)
783
-	natriumstr := this.GetString("natrium")
789
+	natriumstr := dataBody["natrium"].(string)
784 790
 	natrium, _ := strconv.ParseFloat(natriumstr, 64)
785
-	hour, _ := this.GetInt64("hour")
786
-	minute, _ := this.GetInt64("minute")
787
-	beforWeight := this.GetString("befor_weight")
791
+	hour := int64(dataBody["hour"].(float64))
792
+	minute := int64(dataBody["minute"].(float64))
793
+	beforWeight := dataBody["befor_weight"].(string)
788 794
 	befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
789
-	afterWeight := this.GetString("after_weight")
795
+	afterWeight := dataBody["after_weight"].(string)
790 796
 	after_weight, _ := strconv.ParseFloat(afterWeight, 64)
791
-	befor_pressure := this.GetString("befor_pressure")
792
-	template_summary_content := this.GetString("template_summary_content")
793
-	template_plan_content := this.GetString("template_plan_content")
794
-	admin_user_id, _ := this.GetInt64("admin_user_id")
795
-	record_time := this.GetString("record_time")
797
+	befor_pressure := dataBody["befor_pressure"].(string)
798
+	template_summary_content := dataBody["template_summary_content"].(string)
799
+	template_plan_content := dataBody["template_plan_content"].(string)
800
+	admin_user_id := int64(dataBody["admin_user_id"].(float64))
801
+	record_time := dataBody["record_time"].(string)
796 802
 	timeLayout := "2006-01-02"
797 803
 	loc, _ := time.LoadLocation("Local")
798 804
 	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
799
-	after_pressure := this.GetString("after_pressure")
800
-	template_summary_id, _ := this.GetInt64("template_summary_id")
801
-	template_plan_id, _ := this.GetInt64("template_plan_id")
802
-	template_inspection_id, _ := this.GetInt64("template_inspection_id")
803
-	patient_id, _ := this.GetInt64("patient_id")
804
-	fmt.Println("patient_id", patient_id)
805
+	after_pressure := dataBody["after_pressure"].(string)
806
+	template_summary_id := int64(dataBody["template_summary_id"].(float64))
807
+	template_plan_id := int64(dataBody["template_plan_id"].(float64))
808
+	patient_id := int64(dataBody["patient_id"].(float64))
805 809
 	orgId := this.GetAdminUserInfo().CurrentOrgId
806
-	inspect_date := this.GetString("inspect_date")
807
-	project_id := this.GetString("project_id")
810
+	inspect_date := dataBody["inspect_date"].(string)
811
+	project_id := dataBody["project_id"].(string)
812
+	template_inspection_id := int64(dataBody["template_inspection_id"].(float64))
813
+	//title := this.GetString("title")
814
+	//dryWeight := this.GetString("dry_weight")
815
+	//dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
816
+	//dialysis_count, _ := this.GetInt64("dialysis_count")
817
+	//hd_count, _ := this.GetInt64("hd_count")
818
+	//hdf_count, _ := this.GetInt64("hdf_count")
819
+	//hp_count, _ := this.GetInt64("hp_count")
820
+	//other_count, _ := this.GetInt64("other_count")
821
+	//dialzer_apparatus := this.GetString("dialzer_apparatus")
822
+	//perfusion_apparatus := this.GetString("perfusion_apparatus")
823
+	//anticoagulant, _ := this.GetInt64("anticoagulant")
824
+	//kaliumstr := this.GetString("kalium")
825
+	//kalium, _ := strconv.ParseFloat(kaliumstr, 64)
826
+	//
827
+	//autunitestr := this.GetString("autunite")
828
+	//autunite, _ := strconv.ParseFloat(autunitestr, 64)
829
+	//natriumstr := this.GetString("natrium")
830
+	//natrium, _ := strconv.ParseFloat(natriumstr, 64)
831
+	//hour, _ := this.GetInt64("hour")
832
+	//minute, _ := this.GetInt64("minute")
833
+	//beforWeight := this.GetString("befor_weight")
834
+	//befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
835
+	//afterWeight := this.GetString("after_weight")
836
+	//after_weight, _ := strconv.ParseFloat(afterWeight, 64)
837
+	//befor_pressure := this.GetString("befor_pressure")
838
+	//template_summary_content := this.GetString("template_summary_content")
839
+	//template_plan_content := this.GetString("template_plan_content")
840
+	//admin_user_id, _ := this.GetInt64("admin_user_id")
841
+	//record_time := this.GetString("record_time")
842
+	//timeLayout := "2006-01-02"
843
+	//loc, _ := time.LoadLocation("Local")
844
+	//recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
845
+	//after_pressure := this.GetString("after_pressure")
846
+	//template_summary_id, _ := this.GetInt64("template_summary_id")
847
+	//template_plan_id, _ := this.GetInt64("template_plan_id")
848
+	//template_inspection_id, _ := this.GetInt64("template_inspection_id")
849
+	//patient_id, _ := this.GetInt64("patient_id")
850
+	//fmt.Println("patient_id", patient_id)
851
+	//orgId := this.GetAdminUserInfo().CurrentOrgId
852
+	//inspect_date := this.GetString("inspect_date")
853
+	//project_id := this.GetString("project_id")
808 854
 	summary := models.XtTemplateSummary{
809 855
 		StartYear:              0,
810 856
 		StartMonth:             0,
@@ -845,7 +891,7 @@ func (this *DoctorsApiController) SaveCreationInspection() {
845 891
 		ProjectId:              project_id,
846 892
 	}
847 893
 
848
-	err := service.CreateSummary(&summary)
894
+	err = service.CreateSummary(&summary)
849 895
 	if err == nil {
850 896
 		this.ServeSuccessJSON(map[string]interface{}{
851 897
 			"summary": summary,
@@ -912,49 +958,97 @@ func (this *DoctorsApiController) GetTemplateSummaryPrintDetail() {
912 958
 
913 959
 func (this *DoctorsApiController) UpdateTempalteSummary() {
914 960
 
915
-	id, _ := this.GetInt64("id")
916
-	title := this.GetString("title")
917
-
918
-	dryWeight := this.GetString("dry_weight")
961
+	dataBody := make(map[string]interface{}, 0)
962
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
963
+	if err != nil {
964
+		utils.ErrorLog(err.Error())
965
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
966
+		return
967
+	}
968
+	id := int64(dataBody["id"].(float64))
969
+	title := dataBody["title"].(string)
970
+	dryWeight := dataBody["dry_weight"].(string)
919 971
 	dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
920
-	dialysis_count, _ := this.GetInt64("dialysis_count")
921
-	hd_count, _ := this.GetInt64("hd_count")
922
-	hdf_count, _ := this.GetInt64("hdf_count")
923
-	hp_count, _ := this.GetInt64("hp_count")
924
-	other_count, _ := this.GetInt64("other_count")
925
-	dialzer_apparatus := this.GetString("dialzer_apparatus")
926
-	perfusion_apparatus := this.GetString("perfusion_apparatus")
927
-	anticoagulant, _ := this.GetInt64("anticoagulant")
928
-	kaliumstr := this.GetString("kalium")
972
+	dialysis_count := int64(dataBody["dialysis_count"].(float64))
973
+	hd_count := int64(dataBody["hd_count"].(float64))
974
+	hdf_count := int64(dataBody["hdf_count"].(float64))
975
+	hp_count := int64(dataBody["hp_count"].(float64))
976
+	other_count := int64(dataBody["other_count"].(float64))
977
+	dialzer_apparatus := dataBody["dialzer_apparatus"].(string)
978
+	perfusion_apparatus := dataBody["perfusion_apparatus"].(string)
979
+	anticoagulant := int64(dataBody["anticoagulant"].(float64))
980
+	kaliumstr := dataBody["kalium"].(string)
929 981
 	kalium, _ := strconv.ParseFloat(kaliumstr, 64)
930
-
931
-	autunitestr := this.GetString("autunite")
982
+	autunitestr := dataBody["autunite"].(string)
932 983
 	autunite, _ := strconv.ParseFloat(autunitestr, 64)
933
-	natriumstr := this.GetString("natrium")
984
+	natriumstr := dataBody["natrium"].(string)
934 985
 	natrium, _ := strconv.ParseFloat(natriumstr, 64)
935
-	hour, _ := this.GetInt64("hour")
936
-	minute, _ := this.GetInt64("minute")
937
-	beforWeight := this.GetString("befor_weight")
986
+	hour := int64(dataBody["hour"].(float64))
987
+	minute := int64(dataBody["minute"].(float64))
988
+	beforWeight := dataBody["befor_weight"].(string)
938 989
 	befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
939
-	afterWeight := this.GetString("after_weight")
990
+	afterWeight := dataBody["after_weight"].(string)
940 991
 	after_weight, _ := strconv.ParseFloat(afterWeight, 64)
941
-	befor_pressure := this.GetString("befor_pressure")
942
-	template_summary_content := this.GetString("template_summary_content")
943
-	template_plan_content := this.GetString("template_plan_content")
944
-	admin_user_id, _ := this.GetInt64("admin_user_id")
945
-	record_time := this.GetString("record_time")
992
+	befor_pressure := dataBody["befor_pressure"].(string)
993
+	template_summary_content := dataBody["template_summary_content"].(string)
994
+	template_plan_content := dataBody["template_plan_content"].(string)
995
+	admin_user_id := int64(dataBody["admin_user_id"].(float64))
996
+	record_time := dataBody["record_time"].(string)
946 997
 	timeLayout := "2006-01-02"
947 998
 	loc, _ := time.LoadLocation("Local")
948 999
 	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
949
-	after_pressure := this.GetString("after_pressure")
950
-	template_summary_id, _ := this.GetInt64("template_summary_id")
951
-	template_plan_id, _ := this.GetInt64("template_plan_id")
952
-	template_inspection_id, _ := this.GetInt64("template_inspection_id")
953
-	patient_id, _ := this.GetInt64("patient_id")
954
-	fmt.Println("patient_id", patient_id)
1000
+	after_pressure := dataBody["after_pressure"].(string)
1001
+	template_summary_id := int64(dataBody["template_summary_id"].(float64))
1002
+	template_plan_id := int64(dataBody["template_plan_id"].(float64))
1003
+	patient_id := int64(dataBody["patient_id"].(float64))
955 1004
 	orgId := this.GetAdminUserInfo().CurrentOrgId
956
-	inspect_date := this.GetString("inspect_date")
957
-	project_id := this.GetString("project_id")
1005
+	inspect_date := dataBody["inspect_date"].(string)
1006
+	project_id := dataBody["project_id"].(string)
1007
+	template_inspection_id := int64(dataBody["template_inspection_id"].(float64))
1008
+
1009
+	//id, _ := this.GetInt64("id")
1010
+	//title := this.GetString("title")
1011
+	//
1012
+	//dryWeight := this.GetString("dry_weight")
1013
+	//dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
1014
+	//dialysis_count, _ := this.GetInt64("dialysis_count")
1015
+	//hd_count, _ := this.GetInt64("hd_count")
1016
+	//hdf_count, _ := this.GetInt64("hdf_count")
1017
+	//hp_count, _ := this.GetInt64("hp_count")
1018
+	//other_count, _ := this.GetInt64("other_count")
1019
+	//dialzer_apparatus := this.GetString("dialzer_apparatus")
1020
+	//perfusion_apparatus := this.GetString("perfusion_apparatus")
1021
+	//anticoagulant, _ := this.GetInt64("anticoagulant")
1022
+	//kaliumstr := this.GetString("kalium")
1023
+	//kalium, _ := strconv.ParseFloat(kaliumstr, 64)
1024
+	//
1025
+	//autunitestr := this.GetString("autunite")
1026
+	//autunite, _ := strconv.ParseFloat(autunitestr, 64)
1027
+	//natriumstr := this.GetString("natrium")
1028
+	//natrium, _ := strconv.ParseFloat(natriumstr, 64)
1029
+	//hour, _ := this.GetInt64("hour")
1030
+	//minute, _ := this.GetInt64("minute")
1031
+	//beforWeight := this.GetString("befor_weight")
1032
+	//befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
1033
+	//afterWeight := this.GetString("after_weight")
1034
+	//after_weight, _ := strconv.ParseFloat(afterWeight, 64)
1035
+	//befor_pressure := this.GetString("befor_pressure")
1036
+	//template_summary_content := this.GetString("template_summary_content")
1037
+	//template_plan_content := this.GetString("template_plan_content")
1038
+	//admin_user_id, _ := this.GetInt64("admin_user_id")
1039
+	//record_time := this.GetString("record_time")
1040
+	//timeLayout := "2006-01-02"
1041
+	//loc, _ := time.LoadLocation("Local")
1042
+	//recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
1043
+	//after_pressure := this.GetString("after_pressure")
1044
+	//template_summary_id, _ := this.GetInt64("template_summary_id")
1045
+	//template_plan_id, _ := this.GetInt64("template_plan_id")
1046
+	//template_inspection_id, _ := this.GetInt64("template_inspection_id")
1047
+	//patient_id, _ := this.GetInt64("patient_id")
1048
+	//fmt.Println("patient_id", patient_id)
1049
+	//orgId := this.GetAdminUserInfo().CurrentOrgId
1050
+	//inspect_date := this.GetString("inspect_date")
1051
+	//project_id := this.GetString("project_id")
958 1052
 	summary := models.XtTemplateSummary{
959 1053
 		ID:                     id,
960 1054
 		StartYear:              0,
@@ -995,7 +1089,7 @@ func (this *DoctorsApiController) UpdateTempalteSummary() {
995 1089
 		ProjectId:              project_id,
996 1090
 		InspectDate:            inspect_date,
997 1091
 	}
998
-	err := service.UpdateTempalteSummary(&summary)
1092
+	err = service.UpdateTempalteSummary(&summary)
999 1093
 	if err == nil {
1000 1094
 		this.ServeSuccessJSON(map[string]interface{}{
1001 1095
 			"list": summary,

+ 7 - 3
controllers/schedule_api_controller.go Ver arquivo

@@ -1980,7 +1980,9 @@ func (this *ScheduleApiController) GetNextWeekDaySchedule() {
1980 1980
 	week_time, _ := this.GetInt64("week_time")
1981 1981
 	start_time, _ := this.GetInt64("start_time")
1982 1982
 	end_time, _ := this.GetInt64("end_time")
1983
-	zone, _ := this.GetInt64("zone")
1983
+	//zone, _ := this.GetInt64("zone")
1984
+	zons := this.GetString("zone")
1985
+	zone := strings.Split(zons, ",")
1984 1986
 	adminUserInfo := this.GetAdminUserInfo()
1985 1987
 
1986 1988
 	schedule, err := service.GetNextWeekDaySchedule(week_type, week_time, start_time, end_time, adminUserInfo.CurrentOrgId, zone)
@@ -2299,7 +2301,9 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
2299 2301
 
2300 2302
 	week_type, _ := this.GetInt64("week_type", -1)
2301 2303
 	week_time, _ := this.GetInt64("week_time")
2302
-	zone, _ := this.GetInt64("zone")
2304
+	//zone, _ := this.GetInt64("zone")
2305
+	zones := this.GetString("zone")
2306
+	zone := strings.Split(zones, ",")
2303 2307
 	thisTime := time.Now()
2304 2308
 	weekDay := int(thisTime.Weekday())
2305 2309
 	if weekDay == 0 {
@@ -2363,7 +2367,7 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
2363 2367
 
2364 2368
 	orgId := this.GetAdminUserInfo().CurrentOrgId
2365 2369
 	if week_type > 0 {
2366
-		list, err := service.GetWeekDayScheduleById(orgId, targetDay.Unix(), week_time, zone)
2370
+		list, err := service.GetWeekDayScheduleByIdThee(orgId, targetDay.Unix(), week_time, zone)
2367 2371
 		if err != nil {
2368 2372
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2369 2373
 			return

+ 36 - 38
controllers/self_drug_api_congtroller.go Ver arquivo

@@ -1047,13 +1047,13 @@ func (this *SelfDrugApiController) SaveDrugPrice() {
1047 1047
 				return
1048 1048
 			}
1049 1049
 			last_price, _ := strconv.ParseFloat(items["last_price"].(string), 64)
1050
-
1051
-			if items["count"] == nil || reflect.TypeOf(items["count"]).String() != "float64" {
1052
-				utils.ErrorLog("count")
1053
-				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1054
-				return
1055
-			}
1056
-			count := int64(items["count"].(float64))
1050
+			//
1051
+			//if items["count"] == nil || reflect.TypeOf(items["count"]).String() != "float64" {
1052
+			//	utils.ErrorLog("count")
1053
+			//	this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1054
+			//	return
1055
+			//}
1056
+			//count := int64(items["count"].(float64))
1057 1057
 
1058 1058
 			if items["new_price"] == nil || reflect.TypeOf(items["new_price"]).String() != "string" {
1059 1059
 				utils.ErrorLog("new_price")
@@ -1092,7 +1092,6 @@ func (this *SelfDrugApiController) SaveDrugPrice() {
1092 1092
 				DrugName:          drug_name,
1093 1093
 				SpecificationName: "",
1094 1094
 				WarehousingUnit:   warehousing_unit,
1095
-				Count:             count,
1096 1095
 				LastPrice:         last_price,
1097 1096
 				RetailPrice:       retail_price,
1098 1097
 				NewPrice:          new_price,
@@ -1482,6 +1481,29 @@ func (this *SelfDrugApiController) SaveDrugDamagePrice() {
1482 1481
 	dealerList, _ := service.GetAllDealerList(adminUserInfo.CurrentOrgId)
1483 1482
 	var manufacturer_id int64
1484 1483
 	var dealer_id int64
1484
+	timeStr := time.Now().Format("2006-01-02")
1485
+	timeArr := strings.Split(timeStr, "-")
1486
+	total, _ := service.FindAllDrugWarehouseOut(adminUserInfo.CurrentOrgId)
1487
+
1488
+	total = total + 1
1489
+	warehousing_out_order := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + timeArr[0] + timeArr[1] + timeArr[2] + "000"
1490
+	number, _ := strconv.ParseInt(warehousing_out_order, 10, 64)
1491
+	number = number + total
1492
+	warehousing_out_order = "YPCKD" + strconv.FormatInt(number, 10)
1493
+	operation_time := time.Now().Unix()
1494
+	creater := adminUserInfo.AdminUser.Id
1495
+
1496
+	warehouseOut := models.DrugWarehouseOut{
1497
+		WarehouseOutOrderNumber: warehousing_out_order,
1498
+		OperationTime:           operation_time,
1499
+		OrgId:                   adminUserInfo.CurrentOrgId,
1500
+		Creater:                 creater,
1501
+		Ctime:                   ctime,
1502
+		Status:                  1,
1503
+		WarehouseOutTime:        time.Now().Unix(),
1504
+		Type:                    1,
1505
+	}
1506
+	service.AddSigleDrugWarehouseOut(&warehouseOut)
1485 1507
 	for _, item := range list {
1486 1508
 		for _, it := range manufacturerList {
1487 1509
 			if item.Manufacturer == it.ManufacturerName {
@@ -1495,29 +1517,6 @@ func (this *SelfDrugApiController) SaveDrugDamagePrice() {
1495 1517
 			}
1496 1518
 		}
1497 1519
 
1498
-		timeStr := time.Now().Format("2006-01-02")
1499
-		timeArr := strings.Split(timeStr, "-")
1500
-		total, _ := service.FindAllDrugWarehouseOut(adminUserInfo.CurrentOrgId)
1501
-
1502
-		total = total + 1
1503
-		warehousing_out_order := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + timeArr[0] + timeArr[1] + timeArr[2] + "000"
1504
-		number, _ := strconv.ParseInt(warehousing_out_order, 10, 64)
1505
-		number = number + total
1506
-		warehousing_out_order = "YPCKD" + strconv.FormatInt(number, 10)
1507
-		operation_time := time.Now().Unix()
1508
-		creater := adminUserInfo.AdminUser.Id
1509
-
1510
-		warehouseOut := models.DrugWarehouseOut{
1511
-			WarehouseOutOrderNumber: warehousing_out_order,
1512
-			OperationTime:           operation_time,
1513
-			OrgId:                   adminUserInfo.CurrentOrgId,
1514
-			Creater:                 creater,
1515
-			Ctime:                   ctime,
1516
-			Status:                  1,
1517
-			WarehouseOutTime:        time.Now().Unix(),
1518
-			Type:                    1,
1519
-		}
1520
-
1521 1520
 		warehouseOutInfo := models.XtDrugWarehouseOutInfo{
1522 1521
 			WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1523 1522
 			WarehouseOutId:          warehouseOut.ID,
@@ -1563,7 +1562,6 @@ func (this *SelfDrugApiController) SaveDrugDamagePrice() {
1563 1562
 			IsSys:                   0,
1564 1563
 		}
1565 1564
 		service.CreateWareHouseOutInfo(&warehouseOutInfo)
1566
-		service.AddSigleDrugWarehouseOut(&warehouseOut)
1567 1565
 		service.CreateDrugFlowOne(drugflow)
1568 1566
 
1569 1567
 	}
@@ -2086,19 +2084,19 @@ func (this *SelfDrugApiController) SaveDrugProofInventory() {
2086 2084
 	warehousing_unit := this.GetString("warehousing_unit")
2087 2085
 	remark := this.GetString("remark")
2088 2086
 	//total := this.GetString("total")
2089
-	prof_count, _ := this.GetInt64("prof_count")
2090
-
2087
+	proof_count, _ := this.GetInt64("proof_count")
2088
+	fmt.Println("pof_count2222222", proof_count)
2091 2089
 	inventory := models.XtDrugInventory{
2092 2090
 		WarehouseInfoId: warehouse_info_id,
2093
-		ProofCount:      prof_count,
2091
+		ProofCount:      proof_count,
2094 2092
 		WarehousingUnit: warehousing_unit,
2095 2093
 		Remark:          remark,
2096 2094
 	}
2097
-	err := service.UpdateDrugProofInventory(warehouse_info_id, &inventory)
2095
+	err := service.UpdateDrugProofInventory(id, &inventory)
2098 2096
 	info := models.XtDrugWarehouseInfo{
2099
-		StockMaxNumber: prof_count,
2097
+		StockMaxNumber: proof_count,
2100 2098
 	}
2101
-	service.UpdateDrugWarehouseInfoById(id, &info)
2099
+	service.UpdateDrugWarehouseInfoById(warehouse_info_id, &info)
2102 2100
 	if err != nil {
2103 2101
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更新设备失败")
2104 2102
 		return

+ 87 - 4
controllers/stock_in_api_controller.go Ver arquivo

@@ -5147,6 +5147,20 @@ func (this *StockManagerApiController) SaveReportStock() {
5147 5147
 			product_date := int64(items["product_date"].(float64))
5148 5148
 			orgId := this.GetAdminUserInfo().CurrentOrgId
5149 5149
 			Creater := this.GetAdminUserInfo().AdminUser.Id
5150
+
5151
+			if items["total"] == nil || reflect.TypeOf(items["total"]).String() != "float64" {
5152
+				utils.ErrorLog("total")
5153
+				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5154
+				return
5155
+			}
5156
+			total := int64(items["total"].(float64))
5157
+
5158
+			if items["good_origin_place"] == nil || reflect.TypeOf(items["good_origin_place"]).String() != "string" {
5159
+				utils.ErrorLog("good_origin_place")
5160
+				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5161
+				return
5162
+			}
5163
+			good_origin_place := items["good_origin_place"].(string)
5150 5164
 			reportPrice := models.XtStockReportPrice{
5151 5165
 				GoodName:          good_name,
5152 5166
 				SpecificationName: specification_name,
@@ -5173,6 +5187,8 @@ func (this *StockManagerApiController) SaveReportStock() {
5173 5187
 				WarehousingInfoId: warehousing_info_id,
5174 5188
 				ExpiryDate:        expiry_date,
5175 5189
 				ProductDate:       product_date,
5190
+				Total:             total,
5191
+				GoodOriginPlace:   good_origin_place,
5176 5192
 			}
5177 5193
 			err := service.CreateReportPrice(&reportPrice)
5178 5194
 			fmt.Println(err)
@@ -5277,7 +5293,7 @@ func (this *StockManagerApiController) SaveCheckDamage() {
5277 5293
 		Ctime:                   ctime,
5278 5294
 		Status:                  1,
5279 5295
 		WarehouseOutTime:        ctime,
5280
-		Type:                    2,
5296
+		Type:                    1,
5281 5297
 	}
5282 5298
 
5283 5299
 	_, errcodes := service.FindStockOutByIsSys(adminUserInfo.CurrentOrgId, 0, operation_time)
@@ -5526,6 +5542,13 @@ func (this *StockManagerApiController) SaveInventory() {
5526 5542
 				return
5527 5543
 			}
5528 5544
 			warehousing_info_id := int64(items["warehousing_info_id"].(float64))
5545
+
5546
+			if items["good_origin_place"] == nil || reflect.TypeOf(items["good_origin_place"]).String() != "string" {
5547
+				utils.ErrorLog("good_origin_place")
5548
+				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5549
+				return
5550
+			}
5551
+			good_origin_place := items["good_origin_place"].(string)
5529 5552
 			orgId := this.GetAdminUserInfo().CurrentOrgId
5530 5553
 			Creater := this.GetAdminUserInfo().AdminUser.Id
5531 5554
 
@@ -5557,6 +5580,7 @@ func (this *StockManagerApiController) SaveInventory() {
5557 5580
 				ProductDate:       product_date,
5558 5581
 				Number:            number,
5559 5582
 				WarehousingInfoId: warehousing_info_id,
5583
+				GoodOriginPlace:   good_origin_place,
5560 5584
 			}
5561 5585
 			err = service.CreateInentory(inventory)
5562 5586
 			fmt.Println(err)
@@ -5645,6 +5669,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5645 5669
 func (this *StockManagerApiController) GetModifyPriceDetail() {
5646 5670
 
5647 5671
 	id, _ := this.GetInt64("id")
5672
+
5648 5673
 	detail, _ := service.GetModifyPriceDetail(id)
5649 5674
 	this.ServeSuccessJSON(map[string]interface{}{
5650 5675
 		"detail": detail,
@@ -5661,12 +5686,16 @@ func (this *StockManagerApiController) UpdateStockPrice() {
5661 5686
 	packing_price, _ := strconv.ParseFloat(packingPrice, 64)
5662 5687
 	remark := this.GetString("remark")
5663 5688
 	good_id, _ := this.GetInt64("good_id")
5689
+	manufacturer := this.GetString("manufacturer")
5690
+	dealer := this.GetString("dealer")
5664 5691
 	adjust := models.XtStockAdjustPrice{
5665 5692
 		NewPrice:     new_price,
5666 5693
 		GoodName:     good_name,
5667 5694
 		PackingPrice: packing_price,
5668 5695
 		Remark:       remark,
5669 5696
 		GoodId:       good_id,
5697
+		Manufacturer: manufacturer,
5698
+		Dealer:       dealer,
5670 5699
 	}
5671 5700
 	err := service.UpdateStockPrice(adjust, id)
5672 5701
 	fmt.Println(err)
@@ -5700,8 +5729,36 @@ func (this *StockManagerApiController) ModifyPrice() {
5700 5729
 
5701 5730
 	count, _ := this.GetInt64("count")
5702 5731
 	id, _ := this.GetInt64("id")
5732
+	good_name := this.GetString("good_name")
5733
+	specification_name := this.GetString("specification_name")
5734
+	number := this.GetString("number")
5735
+	warehousing_unit := this.GetString("warehousing_unit")
5736
+	buyPrice := this.GetString("buy_price")
5737
+	buy_price, _ := strconv.ParseFloat(buyPrice, 64)
5738
+	packingPrice := this.GetString("packing_price")
5739
+	packing_price, _ := strconv.ParseFloat(packingPrice, 64)
5740
+	good_origin_place := this.GetString("good_origin_place")
5741
+	manufacturer := this.GetString("manufacturer")
5742
+	dealer := this.GetString("dealer")
5743
+	total, _ := this.GetInt64("total")
5744
+	remark := this.GetString("remark")
5745
+	warehousing_info_id, _ := this.GetInt64("warehousing_info_id")
5746
+	good_id, _ := this.GetInt64("good_id")
5703 5747
 	adjust := models.XtStockReportPrice{
5704
-		Count: count,
5748
+		Count:             count,
5749
+		SpecificationName: specification_name,
5750
+		Number:            number,
5751
+		GoodName:          good_name,
5752
+		WarehousingUnit:   warehousing_unit,
5753
+		BuyPrice:          buy_price,
5754
+		PackingPrice:      packing_price,
5755
+		GoodOriginPlace:   good_origin_place,
5756
+		Manufacturer:      manufacturer,
5757
+		Dealer:            dealer,
5758
+		Total:             total,
5759
+		Remark:            remark,
5760
+		WarehousingInfoId: warehousing_info_id,
5761
+		GoodId:            good_id,
5705 5762
 	}
5706 5763
 	err := service.ModifyPrice(id, adjust)
5707 5764
 	fmt.Println(err)
@@ -5742,11 +5799,37 @@ func (this *StockManagerApiController) GetInventoryDetail() {
5742 5799
 
5743 5800
 func (this *StockManagerApiController) ModifyInventory() {
5744 5801
 	id, _ := this.GetInt64("id")
5802
+	good_id, _ := this.GetInt64("good_id")
5803
+	good_name := this.GetString("good_name")
5804
+	specification_name := this.GetString("specification_name")
5805
+	number := this.GetString("number")
5806
+	warehousing_unit := this.GetString("warehousing_unit")
5807
+	buyPrice := this.GetString("buy_price")
5808
+	buy_price, _ := strconv.ParseFloat(buyPrice, 64)
5809
+	packingPrice := this.GetString("packing_price")
5810
+	packing_price, _ := strconv.ParseFloat(packingPrice, 64)
5811
+	total, _ := this.GetInt64("total")
5812
+	good_origin_place := this.GetString("good_origin_place")
5813
+	license_number := this.GetString("license_number")
5814
+	dealer := this.GetString("dealer")
5815
+	manufacturer := this.GetString("manufacturer")
5745 5816
 	count, _ := this.GetInt64("count")
5746 5817
 	remark := this.GetString("remark")
5747 5818
 	inventory := models.XtStockInventory{
5748
-		Count:  count,
5749
-		Remark: remark,
5819
+		GoodId:            good_id,
5820
+		GoodName:          good_name,
5821
+		SpecificationName: specification_name,
5822
+		Number:            number,
5823
+		WarehousingUnit:   warehousing_unit,
5824
+		BuyPrice:          buy_price,
5825
+		PackingPrice:      packing_price,
5826
+		Total:             total,
5827
+		GoodOriginPlace:   good_origin_place,
5828
+		LicenseNumber:     license_number,
5829
+		Dealer:            dealer,
5830
+		Manufacturer:      manufacturer,
5831
+		Count:             count,
5832
+		Remark:            remark,
5750 5833
 	}
5751 5834
 	err := service.ModifyInventory(id, inventory)
5752 5835
 	fmt.Println(err)

+ 1 - 1
models/self_drug_models.go Ver arquivo

@@ -829,6 +829,6 @@ type VmDrugInventory struct {
829 829
 	DoseUnit          string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
830 830
 	MaxUnit           string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
831 831
 	MinUnit           string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
832
-	Total             int64   `gorm:"column:total" json:"total" form:"total"`
832
+	Total             string  `gorm:"column:total" json:"total" form:"total"`
833 833
 	DrugOriginPlace   string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
834 834
 }

+ 3 - 0
models/stock_models.go Ver arquivo

@@ -947,6 +947,8 @@ type XtStockReportPrice struct {
947 947
 	WarehousingInfoId int64   `gorm:"column:warehousing_info_id" json:"warehousing_info_id" form:"warehousing_info_id"`
948 948
 	ExpiryDate        int64   `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
949 949
 	ProductDate       int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
950
+	Total             int64   `gorm:"column:total" json:"total" form:"total"`
951
+	GoodOriginPlace   string  `gorm:"column:good_origin_place" json:"good_origin_place" form:"good_origin_place"`
950 952
 }
951 953
 
952 954
 func (XtStockReportPrice) TableName() string {
@@ -982,6 +984,7 @@ type XtStockInventory struct {
982 984
 	WarehousingInfoId int64   `gorm:"column:warehousing_info_id" json:"warehousing_info_id" form:"warehousing_info_id"`
983 985
 	ExpireDate        int64   `gorm:"column:expire_date" json:"expire_date" form:"expire_date"`
984 986
 	ProductDate       int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
987
+	GoodOriginPlace   string  `gorm:"column:good_origin_place" json:"good_origin_place" form:"good_origin_place"`
985 988
 }
986 989
 
987 990
 func (XtStockInventory) TableName() string {

+ 31 - 6
service/schedule_service.go Ver arquivo

@@ -589,7 +589,32 @@ func GetWeekDayScheduleById(orgid int64, scheduleDate int64, scheduleType int64,
589 589
 	return list, err
590 590
 }
591 591
 
592
-func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int64, startDate int64, zone int64) (list []*models.VmSchedulesRemind, err error) {
592
+func GetWeekDayScheduleByIdThee(orgid int64, scheduleDate int64, scheduleType int64, zone []string) (list []*models.VmSchedulesRemind, err error) {
593
+
594
+	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
595
+	if orgid > 0 {
596
+		db = db.Where("x.user_org_id = ?", orgid)
597
+	}
598
+	if scheduleDate > 0 {
599
+		db = db.Where("x.schedule_date = ?", scheduleDate)
600
+	}
601
+	if scheduleType > 0 {
602
+		db = db.Where("x.schedule_type = ?", scheduleType)
603
+	}
604
+	if len(zone) > 0 {
605
+		db = db.Where("x.partition_id in (?)", zone)
606
+	}
607
+
608
+	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
609
+		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
610
+	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
611
+		return db.Where("status =1").Order("id asc")
612
+	}).Find(&list).Error
613
+
614
+	return list, err
615
+}
616
+
617
+func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int64, startDate int64, zone []string) (list []*models.VmSchedulesRemind, err error) {
593 618
 
594 619
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
595 620
 	if orgid > 0 {
@@ -601,8 +626,8 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
601 626
 	if scheduleType > 0 {
602 627
 		db = db.Where("x.schedule_type = ?", scheduleType)
603 628
 	}
604
-	if zone > 0 {
605
-		db = db.Where("x.partition_id = ?", zone)
629
+	if len(zone) > 0 {
630
+		db = db.Where("x.partition_id in (?)", zone)
606 631
 	}
607 632
 
608 633
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
@@ -758,7 +783,7 @@ func UpdateNewScheduleTemplateStatus(id int64, org_id int64) (err error) {
758 783
 	return
759 784
 }
760 785
 
761
-func GetNextWeekDaySchedule(weektype int64, weektime int64, startime int64, endtime int64, orgID int64, zone int64) (schedules []*models.WeekSchedule, err error) {
786
+func GetNextWeekDaySchedule(weektype int64, weektime int64, startime int64, endtime int64, orgID int64, zone []string) (schedules []*models.WeekSchedule, err error) {
762 787
 
763 788
 	db := readDb.Table("xt_schedule as s ").Where("s.status =1")
764 789
 	if orgID > 0 {
@@ -776,8 +801,8 @@ func GetNextWeekDaySchedule(weektype int64, weektime int64, startime int64, endt
776 801
 	if weektype > 0 {
777 802
 		db = db.Where("s.schedule_week = ?", weektype)
778 803
 	}
779
-	if zone > 0 {
780
-		db = db.Where("s.partition_id = ?", zone)
804
+	if len(zone) > 0 {
805
+		db = db.Where("s.partition_id in (?)", zone)
781 806
 	}
782 807
 	err = db.
783 808
 		Preload("DeviceZone", "status = 1 ").

+ 7 - 7
service/stock_service.go Ver arquivo

@@ -4311,7 +4311,7 @@ func GetSearchGoodWarehouseList(keyword string, orgid int64) (info []*models.Blo
4311 4311
 	if orgid > 0 {
4312 4312
 		db = db.Where("x.org_id = ?", orgid)
4313 4313
 	}
4314
-	err = db.Select("x.id,x.warehousing_id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,x.remark,x.warehousing_order,x.warehousing_unit,x.stock_count,x.license_number,x.warehousing_unit,t.good_name,t.specification_name,x.manufacturer,t.packing_price,t.id as good_id,t.packing_unit,t.buy_price").Joins("left join xt_good_information as t on t.id = x.good_id").Where("t.good_name like ? and t.org_id = ?", likeKey, orgid).Order("x.ctime desc").Scan(&info).Error
4314
+	err = db.Group("x.good_id").Select("x.id,x.warehousing_id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,t.dealer,x.remark,x.warehousing_order,x.warehousing_unit,x.stock_count,x.license_number,x.warehousing_unit,t.good_name,t.specification_name,t.manufacturer,t.packing_price,t.id as good_id,t.packing_unit,t.buy_price").Joins("left join xt_good_information as t on t.id = x.good_id").Where("t.good_name like ? and t.org_id = ?", likeKey, orgid).Order("x.ctime desc").Scan(&info).Error
4315 4315
 	return info, err
4316 4316
 }
4317 4317
 
@@ -4332,7 +4332,7 @@ func GetAllStockPrice(orgid int64, startime int64, endtime int64, keyword string
4332 4332
 		db = db.Where("x.start_time>=?", startime)
4333 4333
 	}
4334 4334
 	if endtime > 0 {
4335
-		db = db.Where("x.end_time<=?", endtime)
4335
+		db = db.Where("x.start_time<=?", endtime)
4336 4336
 	}
4337 4337
 	if len(keyword) > 0 {
4338 4338
 		db = db.Where("x.warehousing_order = ? or r.user_name like ?", keyword, likeKey)
@@ -4382,10 +4382,10 @@ func GetReportStockList(startime int64, endtime int64, orgid int64, keyword stri
4382 4382
 	tab := UserReadDB().Table("sgj_user_admin_role as r").Where("r.status = 1")
4383 4383
 	fmt.Println(table, tab)
4384 4384
 	if startime > 0 {
4385
-		db = db.Where("x.start_time>=?", startime)
4385
+		db = db.Where("x.ctime>=?", startime)
4386 4386
 	}
4387 4387
 	if endtime > 0 {
4388
-		db = db.Where("x.end_time<=?", endtime)
4388
+		db = db.Where("x.ctime<=?", endtime)
4389 4389
 	}
4390 4390
 	if len(keyword) > 0 {
4391 4391
 		db = db.Where("x.warehousing_order like ? or r.user_name like ?", likeKey, likeKey)
@@ -4459,7 +4459,7 @@ func GetModifyPriceDetail(id int64) (models.XtStockAdjustPrice, error) {
4459 4459
 
4460 4460
 func UpdateStockPrice(info models.XtStockAdjustPrice, id int64) error {
4461 4461
 
4462
-	err := XTWriteDB().Model(&info).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"new_price": info.NewPrice, "good_name": info.GoodName, "packing_price": info.PackingPrice, "good_id": info.GoodId, "remark": info.Remark}).Error
4462
+	err := XTWriteDB().Model(&info).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"new_price": info.NewPrice, "good_name": info.GoodName, "packing_price": info.PackingPrice, "good_id": info.GoodId, "remark": info.Remark, "manufacturer": info.Manufacturer, "dealer": info.Dealer}).Error
4463 4463
 	return err
4464 4464
 }
4465 4465
 
@@ -4477,7 +4477,7 @@ func GetStockDamageDetail(id int64) (models.XtStockReportPrice, error) {
4477 4477
 
4478 4478
 func ModifyPrice(id int64, info models.XtStockReportPrice) error {
4479 4479
 
4480
-	err := XTWriteDB().Model(&info).Where("id = ?", id).Updates(map[string]interface{}{"count": info.Count}).Error
4480
+	err := XTWriteDB().Model(&info).Where("id = ?", id).Updates(map[string]interface{}{"count": info.Count, "specification_name": info.SpecificationName, "good_name": info.GoodName, "number": info.Number, "warehousing_unit": info.WarehousingUnit, "buy_price": info.BuyPrice, "packing_price": info.PackingPrice, "good_origin_place": info.GoodOriginPlace, "manufacturer": info.Manufacturer, "dealer": info.Dealer, "total": info.Total, "remark": info.Remark, "warehousing_info_id": info.WarehousingInfoId, "good_id": info.GoodId}).Error
4481 4481
 	return err
4482 4482
 }
4483 4483
 
@@ -4502,7 +4502,7 @@ func GetInventoryDetail(id int64) (models.XtStockInventory, error) {
4502 4502
 
4503 4503
 func ModifyInventory(id int64, inventory models.XtStockInventory) error {
4504 4504
 
4505
-	err := XTWriteDB().Model(&inventory).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"count": inventory.Count, "remark": inventory.Remark}).Error
4505
+	err := XTWriteDB().Model(&inventory).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"good_id": inventory.GoodId, "good_name": inventory.GoodName, "specification_name": inventory.SpecificationName, "number": inventory.Number, "warehousing_unit": inventory.WarehousingUnit, "buy_price": inventory.BuyPrice, "packing_price": inventory.PackingPrice, "total": inventory.Total, "good_origin_place": inventory.GoodOriginPlace, "license_number": inventory.LicenseNumber, "dealer": inventory.Dealer, "manufacturer": inventory.Dealer, "count": inventory.Count, "remark": inventory.Remark}).Error
4506 4506
 	return err
4507 4507
 }
4508 4508