Explorar el Código

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

csx hace 3 años
padre
commit
2f587bc584

+ 3 - 0
controllers/dialysis_api_controller.go Ver fichero

1266
 	assessment.Consciousness = data.Consciousness
1266
 	assessment.Consciousness = data.Consciousness
1267
 	assessment.Fallrisk = data.Fallrisk
1267
 	assessment.Fallrisk = data.Fallrisk
1268
 	assessment.MachineRun = data.MachineRun
1268
 	assessment.MachineRun = data.MachineRun
1269
+	assessment.AfterUrea = data.AfterUrea
1269
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1270
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1270
 
1271
 
1271
 	if assessment.ID > 0 {
1272
 	if assessment.ID > 0 {
1421
 	period, _ := c.GetInt64("period")
1422
 	period, _ := c.GetInt64("period")
1422
 	estimated_food_intake := c.GetString("estimated_food_intake")
1423
 	estimated_food_intake := c.GetString("estimated_food_intake")
1423
 	blood_pressure_during_dialysis := c.GetString("blood_pressure_during_dialysis")
1424
 	blood_pressure_during_dialysis := c.GetString("blood_pressure_during_dialysis")
1425
+	urea_befor := c.GetString("urea_befor")
1424
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1426
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1425
 		DialysisCount:                  dialysis_count,
1427
 		DialysisCount:                  dialysis_count,
1426
 		EmergencyTreatment:             emergency_treatment,
1428
 		EmergencyTreatment:             emergency_treatment,
1487
 		Period:                         period,
1489
 		Period:                         period,
1488
 		EstimatedFoodIntake:            estimated_food_intake,
1490
 		EstimatedFoodIntake:            estimated_food_intake,
1489
 		BloodPressureDuringDialysis:    blood_pressure_during_dialysis,
1491
 		BloodPressureDuringDialysis:    blood_pressure_during_dialysis,
1492
+		UreaBefor:                      urea_befor,
1490
 	}
1493
 	}
1491
 
1494
 
1492
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1495
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 2 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go Ver fichero

1055
 	consciousness, _ := c.GetInt64("consciousness")
1055
 	consciousness, _ := c.GetInt64("consciousness")
1056
 	fallrisk, _ := c.GetInt64("fallrisk")
1056
 	fallrisk, _ := c.GetInt64("fallrisk")
1057
 	machine_run := c.GetString("machine_run")
1057
 	machine_run := c.GetString("machine_run")
1058
+	after_urea := c.GetString("after_urea")
1058
 	if id <= 0 {
1059
 	if id <= 0 {
1059
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1060
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1060
 		return
1061
 		return
1156
 		Consciousness:                consciousness,
1157
 		Consciousness:                consciousness,
1157
 		Fallrisk:                     fallrisk,
1158
 		Fallrisk:                     fallrisk,
1158
 		MachineRun:                   machine_run,
1159
 		MachineRun:                   machine_run,
1160
+		AfterUrea:                    after_urea,
1159
 	}
1161
 	}
1160
 
1162
 
1161
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1163
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)

+ 5 - 0
controllers/mobile_api_controllers/patient_api_controller.go Ver fichero

2611
 		pre_dialysis_drugs := dataBody["pre_dialysis_drugs"].(string)
2611
 		pre_dialysis_drugs := dataBody["pre_dialysis_drugs"].(string)
2612
 		evaluation.PreDialysisDrugs = pre_dialysis_drugs
2612
 		evaluation.PreDialysisDrugs = pre_dialysis_drugs
2613
 	}
2613
 	}
2614
+
2615
+	if dataBody["urea_befor"] != nil && reflect.TypeOf(dataBody["urea_befor"]).String() == "string" {
2616
+		urea_befor := dataBody["urea_befor"].(string)
2617
+		evaluation.UreaBefor = urea_befor
2618
+	}
2614
 	return
2619
 	return
2615
 }
2620
 }
2616
 
2621
 

+ 2 - 0
controllers/stock_in_api_controller.go Ver fichero

5606
 
5606
 
5607
 	list, total, _ := service.GetStockFlowList(limit, page, consumable_type, orgId, startTime, endTime, good_id)
5607
 	list, total, _ := service.GetStockFlowList(limit, page, consumable_type, orgId, startTime, endTime, good_id)
5608
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
5608
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
5609
+	good, _ := service.GetGoodInformationByGoodId(good_id)
5609
 	this.ServeSuccessJSON(map[string]interface{}{
5610
 	this.ServeSuccessJSON(map[string]interface{}{
5610
 		"list":             list,
5611
 		"list":             list,
5611
 		"total":            total,
5612
 		"total":            total,
5612
 		"manufacturerList": manufacturerList,
5613
 		"manufacturerList": manufacturerList,
5614
+		"good":             good,
5613
 	})
5615
 	})
5614
 }
5616
 }
5615
 
5617
 

+ 105 - 9
controllers/supply_order_api_contorller.go Ver fichero

25
 	beego.Router("/api/supply/getallsupply", &SupplyOrderApiController{}, "get:GetAllSupply")
25
 	beego.Router("/api/supply/getallsupply", &SupplyOrderApiController{}, "get:GetAllSupply")
26
 	beego.Router("/api/supply/getallpurchaseorderlist", &SupplyOrderApiController{}, "get:GetAllPurchaseOrderList")
26
 	beego.Router("/api/supply/getallpurchaseorderlist", &SupplyOrderApiController{}, "get:GetAllPurchaseOrderList")
27
 	beego.Router("/api/supply/updatepurchaseorder", &SupplyOrderApiController{}, "Post:UpdatePurchaseOrder")
27
 	beego.Router("/api/supply/updatepurchaseorder", &SupplyOrderApiController{}, "Post:UpdatePurchaseOrder")
28
+	beego.Router("/api/supply/checkpurchaseorder", &SupplyOrderApiController{}, "get:UpdateSupplyWaresing")
29
+	beego.Router("/api/supply/getpurchaseorderdetail", &SupplyOrderApiController{}, "get:GetPurchaseOrderDetail")
30
+	beego.Router("/api/supply/addgoodorder", &SupplyOrderApiController{}, "post:AddGoodOrder")
28
 }
31
 }
29
 
32
 
30
 func (this *SupplyOrderApiController) GetInitOrder() {
33
 func (this *SupplyOrderApiController) GetInitOrder() {
130
 			for _, item := range thisStockIn {
133
 			for _, item := range thisStockIn {
131
 				items := item.(map[string]interface{})
134
 				items := item.(map[string]interface{})
132
 
135
 
133
-				if items["id"] == nil || reflect.TypeOf(items["id"]).String() != "float64" {
134
-					utils.ErrorLog("id")
136
+				if items["project_id"] == nil || reflect.TypeOf(items["project_id"]).String() != "float64" {
137
+					utils.ErrorLog("project_id")
135
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
138
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
136
 					return
139
 					return
137
 				}
140
 				}
138
-				id := int64(items["id"].(float64))
141
+				project_id := int64(items["project_id"].(float64))
139
 
142
 
140
 				if items["supply_count"] == nil || reflect.TypeOf(items["supply_count"]).String() != "float64" {
143
 				if items["supply_count"] == nil || reflect.TypeOf(items["supply_count"]).String() != "float64" {
141
 					utils.ErrorLog("supply_count")
144
 					utils.ErrorLog("supply_count")
224
 
227
 
225
 				name := items["name"].(string)
228
 				name := items["name"].(string)
226
 
229
 
230
+				if items["supply_unit"] == nil || reflect.TypeOf(items["supply_unit"]).String() != "string" {
231
+					utils.ErrorLog("supply_unit")
232
+					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
233
+					return
234
+				}
235
+
236
+				supply_unit := items["supply_unit"].(string)
237
+
227
 				order := models.SupplierWarehousingInfoOrder{
238
 				order := models.SupplierWarehousingInfoOrder{
228
 					OrderNumber:             warehousing_order,
239
 					OrderNumber:             warehousing_order,
229
 					IsSource:                is_source,
240
 					IsSource:                is_source,
236
 					Status:                  1,
247
 					Status:                  1,
237
 					Mtime:                   0,
248
 					Mtime:                   0,
238
 					WarehousingId:           warehouseInfo.ID,
249
 					WarehousingId:           warehouseInfo.ID,
239
-					ProjectId:               id,
250
+					ProjectId:               project_id,
240
 					SupplyLicenseNumber:     supply_license_number,
251
 					SupplyLicenseNumber:     supply_license_number,
241
 					SupplyType:              supply_type,
252
 					SupplyType:              supply_type,
242
 					SupplySpecificationName: supply_specification_name,
253
 					SupplySpecificationName: supply_specification_name,
243
 					SupplyTotal:             supply_total,
254
 					SupplyTotal:             supply_total,
244
 					SupplyManufacturer:      supply_manufacturer,
255
 					SupplyManufacturer:      supply_manufacturer,
245
 					Name:                    name,
256
 					Name:                    name,
257
+					SupplyUnit:              supply_unit,
246
 				}
258
 				}
247
 
259
 
248
 				warehousingInfo = append(warehousingInfo, &order)
260
 				warehousingInfo = append(warehousingInfo, &order)
358
 	discount_amount_float, _ := strconv.ParseFloat(discount_amount, 64)
370
 	discount_amount_float, _ := strconv.ParseFloat(discount_amount, 64)
359
 	warehousing_id, _ := this.GetInt64("id")
371
 	warehousing_id, _ := this.GetInt64("id")
360
 	number := this.GetString("number")
372
 	number := this.GetString("number")
361
-	fmt.Println("supplier_id23323232323232", supplier_id, startTime, endTime, rate_of_concession, rate_of_concession_float, discount_amount, discount_amount_float)
373
+	//fmt.Println("supplier_id23323232323232", supplier_id, startTime, endTime, rate_of_concession, rate_of_concession_float, discount_amount, discount_amount_float)
362
 	orgId := this.GetAdminUserInfo().CurrentOrgId
374
 	orgId := this.GetAdminUserInfo().CurrentOrgId
363
 	info := models.SupplierWarehouseInfo{
375
 	info := models.SupplierWarehouseInfo{
364
 		RateOfConcession: rate_of_concession_float,
376
 		RateOfConcession: rate_of_concession_float,
438
 				supply_total_price := items["supply_total_price"].(string)
450
 				supply_total_price := items["supply_total_price"].(string)
439
 
451
 
440
 				supply_total_price_float, _ := strconv.ParseFloat(supply_total_price, 64)
452
 				supply_total_price_float, _ := strconv.ParseFloat(supply_total_price, 64)
441
-				if items["is_source"] == nil || reflect.TypeOf(items["is_source"]).String() != "float64" {
442
-					utils.ErrorLog("is_source")
453
+				if items["type"] == nil || reflect.TypeOf(items["type"]).String() != "float64" {
454
+					utils.ErrorLog("type")
443
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
455
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
444
 					return
456
 					return
445
 				}
457
 				}
446
-				is_source := int64(items["is_source"].(float64))
458
+				is_source := int64(items["type"].(float64))
447
 
459
 
448
 				if items["supply_type"] == nil || reflect.TypeOf(items["supply_type"]).String() != "string" {
460
 				if items["supply_type"] == nil || reflect.TypeOf(items["supply_type"]).String() != "string" {
449
 					utils.ErrorLog("supply_type")
461
 					utils.ErrorLog("supply_type")
485
 
497
 
486
 				name := items["name"].(string)
498
 				name := items["name"].(string)
487
 
499
 
500
+				if items["supply_unit"] == nil || reflect.TypeOf(items["supply_unit"]).String() != "string" {
501
+					utils.ErrorLog("supply_unit")
502
+					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
503
+					return
504
+				}
505
+
506
+				supply_unit := items["supply_unit"].(string)
488
 				if id > 0 {
507
 				if id > 0 {
489
 					order := models.SupplierWarehousingInfoOrder{
508
 					order := models.SupplierWarehousingInfoOrder{
490
 						ID:                      id,
509
 						ID:                      id,
503
 						SupplyTotal:             supply_total,
522
 						SupplyTotal:             supply_total,
504
 						SupplyManufacturer:      supply_manufacturer,
523
 						SupplyManufacturer:      supply_manufacturer,
505
 						Name:                    name,
524
 						Name:                    name,
525
+						SupplyUnit:              supply_unit,
506
 					}
526
 					}
507
 
527
 
508
 					updateWarehousingInfo = append(updateWarehousingInfo, &order)
528
 					updateWarehousingInfo = append(updateWarehousingInfo, &order)
522
 						Status:                  1,
542
 						Status:                  1,
523
 						Mtime:                   0,
543
 						Mtime:                   0,
524
 						WarehousingId:           warehousing_id,
544
 						WarehousingId:           warehousing_id,
525
-						ProjectId:               id,
545
+						ProjectId:               project_id,
526
 						SupplyLicenseNumber:     supply_license_number,
546
 						SupplyLicenseNumber:     supply_license_number,
527
 						SupplyType:              supply_type,
547
 						SupplyType:              supply_type,
528
 						SupplySpecificationName: supply_specification_name,
548
 						SupplySpecificationName: supply_specification_name,
529
 						SupplyTotal:             supply_total,
549
 						SupplyTotal:             supply_total,
530
 						SupplyManufacturer:      supply_manufacturer,
550
 						SupplyManufacturer:      supply_manufacturer,
531
 						Name:                    name,
551
 						Name:                    name,
552
+						SupplyUnit:              supply_unit,
532
 					}
553
 					}
533
 					warehousingInfo = append(warehousingInfo, &order)
554
 					warehousingInfo = append(warehousingInfo, &order)
534
 				}
555
 				}
553
 
574
 
554
 	}
575
 	}
555
 }
576
 }
577
+
578
+func (this *SupplyOrderApiController) UpdateSupplyWaresing() {
579
+
580
+	id, _ := this.GetInt64("id")
581
+	recordDateStr := time.Now().Format("2006-01-02")
582
+	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
583
+
584
+	record_date := recordDate.Unix()
585
+	checker := this.GetAdminUserInfo().AdminUser.Id
586
+	info := models.SupplierWarehouseInfo{
587
+		Mtime:     time.Now().Unix(),
588
+		Status:    1,
589
+		IsCheck:   1,
590
+		Checker:   checker,
591
+		CheckTime: record_date,
592
+	}
593
+	parseDateErr := service.UpdateSupplyWaresing(id, info)
594
+	if parseDateErr == nil {
595
+		this.ServeSuccessJSON(map[string]interface{}{
596
+			"info": info,
597
+		})
598
+	} else {
599
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
600
+	}
601
+}
602
+
603
+func (this *SupplyOrderApiController) GetPurchaseOrderDetail() {
604
+
605
+	id, _ := this.GetInt64("id")
606
+	info, _ := service.GetPurchaseOrderDetail(id)
607
+	//查询
608
+	orderInfo, err := service.GetSupplyWarehousingOrderInfo(id)
609
+	orgId := this.GetAdminUserInfo().CurrentOrgId
610
+	supplyList, _ := service.GetSupplierList(orgId)
611
+	//获取药品库数据
612
+	baseList, _ := service.GetSupplyDrugList(orgId)
613
+
614
+	goodList, _ := service.GetSupplyGoodList(orgId)
615
+	if err == nil {
616
+		this.ServeSuccessJSON(map[string]interface{}{
617
+			"info":       info,
618
+			"orderInfo":  orderInfo,
619
+			"supplyList": supplyList,
620
+			"baseList":   baseList,
621
+			"goodList":   goodList,
622
+		})
623
+	} else {
624
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
625
+	}
626
+}
627
+
628
+func (this *SupplyOrderApiController) AddGoodOrder() {
629
+
630
+	supplier_id, _ := this.GetInt64("supplier_id")
631
+	start_time := this.GetString("start")
632
+	timeLayout := "2006-01-02"
633
+	loc, _ := time.LoadLocation("Local")
634
+	var startTime int64
635
+	if len(start_time) > 0 {
636
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
637
+		if err != nil {
638
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
639
+			return
640
+		}
641
+		startTime = theTime.Unix()
642
+	}
643
+	good_number := this.GetString("good_number")
644
+	arrerage, _ := this.GetInt64("arrerage")
645
+	payment, _ := this.GetInt64("payment")
646
+	warehousing_id, _ := this.GetInt64("warehousing_id")
647
+	number := this.GetString("number")
648
+	rate_of_concession, _ := this.GetInt64("rate_of_concession")
649
+	discount_amount, _ := this.GetInt64("discount_amount")
650
+	fmt.Println(supplier_id, startTime, good_number, arrerage, payment, warehousing_id, number, rate_of_concession, discount_amount)
651
+}

+ 2 - 0
models/dialysis.go Ver fichero

318
 	Period                         int64   `gorm:"column:period" json:"period" form:"period"`
318
 	Period                         int64   `gorm:"column:period" json:"period" form:"period"`
319
 	EstimatedFoodIntake            string  `gorm:"column:estimated_food_intake" json:"estimated_food_intake" form:"estimated_food_intake"`
319
 	EstimatedFoodIntake            string  `gorm:"column:estimated_food_intake" json:"estimated_food_intake" form:"estimated_food_intake"`
320
 	BloodPressureDuringDialysis    string  `gorm:"column:blood_pressure_during_dialysis" json:"blood_pressure_during_dialysis" form:"blood_pressure_during_dialysis"`
320
 	BloodPressureDuringDialysis    string  `gorm:"column:blood_pressure_during_dialysis" json:"blood_pressure_during_dialysis" form:"blood_pressure_during_dialysis"`
321
+	UreaBefor                      string  `gorm:"column:urea_befor" json:"urea_befor" form:"urea_befor"`
321
 }
322
 }
322
 
323
 
323
 func (PredialysisEvaluation) TableName() string {
324
 func (PredialysisEvaluation) TableName() string {
632
 	Consciousness                   int64   `gorm:"column:consciousness" json:"consciousness" form:"consciousness"`
633
 	Consciousness                   int64   `gorm:"column:consciousness" json:"consciousness" form:"consciousness"`
633
 	Fallrisk                        int64   `gorm:"column:fallrisk" json:"fallrisk" form:"fallrisk"`
634
 	Fallrisk                        int64   `gorm:"column:fallrisk" json:"fallrisk" form:"fallrisk"`
634
 	MachineRun                      string  `gorm:"column:machine_run" json:"machine_run" form:"machine_run"`
635
 	MachineRun                      string  `gorm:"column:machine_run" json:"machine_run" form:"machine_run"`
636
+	AfterUrea                       string  `gorm:"column:after_urea" json:"after_urea" form:"after_urea"`
635
 }
637
 }
636
 
638
 
637
 func (AssessmentAfterDislysis) TableName() string {
639
 func (AssessmentAfterDislysis) TableName() string {

+ 4 - 0
models/supply.models.go Ver fichero

16
 	Manufacturer      int64                  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
16
 	Manufacturer      int64                  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
17
 	OrgId             int64                  `gorm:"column:org_id" json:"org_id" form:"org_id"`
17
 	OrgId             int64                  `gorm:"column:org_id" json:"org_id" form:"org_id"`
18
 	Number            string                 `gorm:"column:number" json:"number" form:"number"`
18
 	Number            string                 `gorm:"column:number" json:"number" form:"number"`
19
+	LastPrice         float64                `gorm:"column:last_price" json:"last_price" form:"last_price"`
19
 	DrugWarehouseInfo []*SpDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
20
 	DrugWarehouseInfo []*SpDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug_warehouse_info"`
20
 }
21
 }
21
 
22
 
31
 	Manufacturer      int64              `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
32
 	Manufacturer      int64              `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
32
 	OrgId             int64              `gorm:"column:org_id" json:"org_id" form:"org_id"`
33
 	OrgId             int64              `gorm:"column:org_id" json:"org_id" form:"org_id"`
33
 	GoodName          string             `gorm:"column:good_name" json:"good_name" form:"good_name"`
34
 	GoodName          string             `gorm:"column:good_name" json:"good_name" form:"good_name"`
35
+	PackingUnit       string             `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
36
+	BuyPrice          float64            `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
34
 	GoodWarehouseInfo []*SpWarehouseInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_warehouse_info"`
37
 	GoodWarehouseInfo []*SpWarehouseInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_warehouse_info"`
35
 }
38
 }
36
 
39
 
108
 	SupplyTotal             string  `gorm:"column:supply_total" json:"supply_total" form:"supply_total"`
111
 	SupplyTotal             string  `gorm:"column:supply_total" json:"supply_total" form:"supply_total"`
109
 	SupplyManufacturer      string  `gorm:"column:supply_manufacturer" json:"supply_manufacturer" form:"supply_manufacturer"`
112
 	SupplyManufacturer      string  `gorm:"column:supply_manufacturer" json:"supply_manufacturer" form:"supply_manufacturer"`
110
 	Name                    string  `gorm:"column:name" json:"name" form:"name"`
113
 	Name                    string  `gorm:"column:name" json:"name" form:"name"`
114
+	SupplyUnit              string  `gorm:"column:supply_unit" json:"supply_unit" form:"supply_unit"`
111
 }
115
 }
112
 
116
 
113
 func (SupplierWarehousingInfoOrder) TableName() string {
117
 func (SupplierWarehousingInfoOrder) TableName() string {

+ 1 - 1
service/gobal_config_service.go Ver fichero

809
 		db = db.Where("x.warehouse_out_id = ?", id)
809
 		db = db.Where("x.warehouse_out_id = ?", id)
810
 	}
810
 	}
811
 
811
 
812
-	err = db.Select("x.id,x.warehouse_out_id,x.drug_id,sum(x.count) as count,x.count_unit,x.price,x.total_price,x.product_date,x.expiry_date,x.remark,x.is_cancel,x.warehouse_out_order_number,x.type,x.dealer,t.manufacturer,x.is_sys,x.sys_record_time,x.retail_price,x.retail_total_price,t.drug_name,t.drug_type,t.max_unit,t.min_unit,t.min_number,x.number,x.batch_number,t.dose,t.dose_unit,t.last_price,t.min_price,t.medical_insurance_number,x.warehouse_info_id").Joins("left join xt_base_drug as t on t.id = x.drug_id").Group("x.drug_id").Scan(&info).Error
812
+	err = db.Select("x.id,x.warehouse_out_id,x.drug_id,sum(x.count) as count,x.count_unit,x.price,x.product_date,x.expiry_date,x.remark,x.is_cancel,x.warehouse_out_order_number,x.type,x.dealer,t.manufacturer,x.is_sys,x.sys_record_time,x.retail_price as total_price,x.retail_total_price,t.drug_name,t.drug_type,t.max_unit,t.min_unit,t.min_number,x.number,x.batch_number,t.dose,t.dose_unit,t.last_price,t.min_price,t.medical_insurance_number,t.retail_price ,x.warehouse_info_id").Joins("left join xt_base_drug as t on t.id = x.drug_id").Group("x.drug_id").Scan(&info).Error
813
 	return info, err
813
 	return info, err
814
 }
814
 }
815
 
815
 

+ 1 - 1
service/stock_service.go Ver fichero

3852
 		db = db.Where("x.org_id = ?", orgid)
3852
 		db = db.Where("x.org_id = ?", orgid)
3853
 	}
3853
 	}
3854
 
3854
 
3855
-	err = db.Select("x.id,x.warehouse_out_id,x.good_id,sum(x.count) as count,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.warehouse_out_order_number,x.type,x.dealer,t.manufacturer,t.social_security_directory_code,x.is_sys,x.sys_record_time,x.number,x.remark,x.license_number,t.good_name,t.good_type_id,t.specification_name,t.min_number,t.packing_unit,t.min_unit").Joins("left join xt_good_information as t on t.id=x.good_id").Group("x.warehouse_out_id,x.good_id").Order("x.ctime desc").Scan(&out).Error
3855
+	err = db.Select("x.id,x.warehouse_out_id,x.good_id,sum(x.count) as count,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.warehouse_out_order_number,x.type,x.dealer,t.manufacturer,t.social_security_directory_code,x.is_sys,x.sys_record_time,x.number,x.remark,x.license_number,t.good_name,t.good_type_id,t.specification_name,t.min_number,t.packing_unit,t.min_unit,t.packing_price").Joins("left join xt_good_information as t on t.id=x.good_id").Group("x.warehouse_out_id,x.good_id").Order("x.ctime desc").Scan(&out).Error
3856
 	return out, err
3856
 	return out, err
3857
 }
3857
 }
3858
 
3858
 

+ 19 - 3
service/supply_service.go Ver fichero

1
 package service
1
 package service
2
 
2
 
3
-import "XT_New/models"
3
+import (
4
+	"XT_New/models"
5
+	"time"
6
+)
4
 
7
 
5
 func GetSupplyDrugList(orgid int64) (drug []*models.SpBaseDrug, err error) {
8
 func GetSupplyDrugList(orgid int64) (drug []*models.SpBaseDrug, err error) {
6
 
9
 
90
 
93
 
91
 func ModefySupplyWarehouseInfo(id int64, info models.SupplierWarehouseInfo) error {
94
 func ModefySupplyWarehouseInfo(id int64, info models.SupplierWarehouseInfo) error {
92
 
95
 
93
-	err := XTWriteDB().Where("id = ? and status = 1", id).Updates(map[string]interface{}{"rate_of_concession": info.RateOfConcession, "discount_amount": info.DiscountAmount, "document_date": info.DocumentDate, "delivery_date": info.DeliveryDate, "supplier_id": info.SupplierId}).Error
96
+	err := XTWriteDB().Model(&models.SupplierWarehouseInfo{}).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"rate_of_concession": info.RateOfConcession, "discount_amount": info.DiscountAmount, "document_date": info.DocumentDate, "delivery_date": info.DeliveryDate, "supplier_id": info.SupplierId}).Error
94
 	return err
97
 	return err
95
 }
98
 }
96
 
99
 
97
 func ModifySupplyWarehouseOrder(order *models.SupplierWarehousingInfoOrder) error {
100
 func ModifySupplyWarehouseOrder(order *models.SupplierWarehousingInfoOrder) error {
98
 
101
 
99
-	err := XTWriteDB().Model(&order).Where("id = ? and status = 1", order.ID).Updates(map[string]interface{}{}).Updates(map[string]interface{}{"is_source": order.IsSource, "count": order.Count, "price": order.Price, "amount": order.Amount, "remark": order.Remark, "project_id": order.ProjectId, "supply_license_number": order.SupplyLicenseNumber, "supply_type": order.SupplyType, "supply_specification_name": order.SupplySpecificationName, "supply_total": order.SupplyTotal, "supply_manufacturer": order.SupplyManufacturer, "name": order.Name}).Error
102
+	err := XTWriteDB().Model(&models.SupplierWarehousingInfoOrder{}).Where("id = ? and status = 1", order.ID).Updates(map[string]interface{}{}).Updates(map[string]interface{}{"is_source": order.IsSource, "count": order.Count, "price": order.Price, "amount": order.Amount, "remark": order.Remark, "project_id": order.ProjectId, "supply_license_number": order.SupplyLicenseNumber, "supply_type": order.SupplyType, "supply_specification_name": order.SupplySpecificationName, "supply_total": order.SupplyTotal, "supply_manufacturer": order.SupplyManufacturer, "name": order.Name, "supply_unit": order.SupplyUnit}).Error
100
 	return err
103
 	return err
101
 }
104
 }
105
+
106
+func UpdateSupplyWaresing(id int64, info models.SupplierWarehouseInfo) error {
107
+
108
+	err := XTWriteDB().Model(&models.SupplierWarehouseInfo{}).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"is_check": info.IsCheck, "checker": info.Checker, "check_time": info.CheckTime, "mtime": time.Now().Unix()}).Error
109
+	return err
110
+}
111
+
112
+func GetPurchaseOrderDetail(id int64) (models.SupplierWarehouseInfo, error) {
113
+
114
+	info := models.SupplierWarehouseInfo{}
115
+	err := XTReadDB().Model(&info).Where("id =? and status =1", id).Find(&info).Error
116
+	return info, err
117
+}