Browse Source

耗材参数

XMLWAN 3 years ago
parent
commit
7803aa9c11

+ 1 - 1
conf/app.conf View File

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3 3
 runmode = dev
4 4
 
5 5
 #

+ 2 - 2
controllers/drug_stock_api_contorller.go View File

@@ -3049,8 +3049,8 @@ func (c *StockDrugApiController) GetDrugOutOrderPrint() {
3049 3049
 	adminUserInfo := c.GetAdminUserInfo()
3050 3050
 	orgId := adminUserInfo.CurrentOrgId
3051 3051
 	if order_type == 2 {
3052
-		//list, err := service.GetDrugOutOrderPrint(startTime, endTime, orgId)
3053
-		list, err := service.GetDrugOutOrderPrintList(startTime, endTime, orgId)
3052
+		list, err := service.GetDrugOutOrderInfoPrintList(startTime, endTime, orgId)
3053
+		//list, err := service.GetDrugOutOrderPrintList(startTime, endTime, orgId)
3054 3054
 		if err == nil {
3055 3055
 			c.ServeSuccessJSON(map[string]interface{}{
3056 3056
 				"list": list,

+ 5 - 2
controllers/gobal_config_api_controller.go View File

@@ -2098,8 +2098,10 @@ func (c *GobalConfigApiController) GetDrugOutOrderPrint() {
2098 2098
 	ids := strings.Split(id, ",")
2099 2099
 	admin := c.GetAdminUserInfo()
2100 2100
 	info, _ := service.FindeDrugWarehouseOutOrder(ids, admin.CurrentOrgId)
2101
+	//info, _ := service.GetExportOutOrderDrugListOne(ids)
2101 2102
 	manufacturerList, _ := service.GetAllManufacturerList(admin.CurrentOrgId)
2102
-	warehousing, _ := service.FindeDrugWarehouseOutDetail(ids, admin.CurrentOrgId)
2103
+	//warehousing, _ := service.FindeDrugWarehouseOutDetail(ids, admin.CurrentOrgId)
2104
+	warehousing, _ := service.GetExportOutOrderDrugListOne(ids)
2103 2105
 	c.ServeSuccessJSON(map[string]interface{}{
2104 2106
 		"info":             info,
2105 2107
 		"warehousing":      warehousing,
@@ -2137,7 +2139,8 @@ func (c *GobalConfigApiController) GetExportOutOrderDrugList() {
2137 2139
 	orderId := c.GetString("order_id")
2138 2140
 	ids := strings.Split(orderId, ",")
2139 2141
 	orgId := c.GetAdminUserInfo().CurrentOrgId
2140
-	list, _ := service.GetExportOutOrderDrugList(ids)
2142
+	//list, _ := service.GetExportOutOrderDrugList(ids)
2143
+	list, _ := service.GetExportOutOrderDrugListOne(ids)
2141 2144
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
2142 2145
 	dealerList, _ := service.GetAllDealerList(orgId)
2143 2146
 	c.ServeSuccessJSON(map[string]interface{}{

+ 11 - 1
controllers/print_data_api_controller.go View File

@@ -207,7 +207,8 @@ func (this *PrintDataAPIController) GetGoodDetailPrintList() {
207 207
 
208 208
 	//出库详情
209 209
 	if types == 2 {
210
-		list, err := service.GetWarehouseOutInfoGoodDetailPrintList(adminUserInfo.CurrentOrgId, startTime, endTime, limit, page)
210
+		//list, err := service.GetWarehouseOutInfoGoodDetailPrintList(adminUserInfo.CurrentOrgId, startTime, endTime, limit, page)
211
+		list, _ := service.GetWarehouseOutInfoPrintList(adminUserInfo.CurrentOrgId, startTime, endTime)
211 212
 		stockTotal, err := service.GetOutStockTotalCountTwo(startTime, endTime, adminUserInfo.CurrentOrgId)
212 213
 		if err != nil {
213 214
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -219,4 +220,13 @@ func (this *PrintDataAPIController) GetGoodDetailPrintList() {
219 220
 		})
220 221
 	}
221 222
 
223
+	//退库详情
224
+	if types == 4 {
225
+
226
+		list, _ := service.GetWarehouseCancelPrintList(adminUserInfo.CurrentOrgId, startTime, endTime)
227
+		this.ServeSuccessJSON(map[string]interface{}{
228
+			"list": list,
229
+		})
230
+	}
231
+
222 232
 }

+ 15 - 7
controllers/stock_in_api_controller.go View File

@@ -5297,7 +5297,9 @@ func (this *StockManagerApiController) SaveCheckDamage() {
5297 5297
 
5298 5298
 	if errcodes == gorm.ErrRecordNotFound {
5299 5299
 		service.AddSigleWarehouseOut(&warehouseOut)
5300
+
5300 5301
 	}
5302
+	out, _ := service.GetLastGoodWarehouseOut(adminUserInfo.CurrentOrgId)
5301 5303
 	manufacturerList, _ := service.GetAllManufacturerList(adminUserInfo.CurrentOrgId)
5302 5304
 	dealerList, _ := service.GetAllDealerList(adminUserInfo.CurrentOrgId)
5303 5305
 	var manufacturer_id int64
@@ -5314,10 +5316,11 @@ func (this *StockManagerApiController) SaveCheckDamage() {
5314 5316
 				dealer_id = its.ID
5315 5317
 			}
5316 5318
 		}
5319
+		goodinfo, _ := service.GetGoodInformationByGoodId(item.GoodId)
5317 5320
 		//插入出库单
5318 5321
 		warehouseOutInfo := &models.WarehouseOutInfo{
5319
-			WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
5320
-			WarehouseOutId:          warehouseOut.ID,
5322
+			WarehouseOutOrderNumber: out.WarehouseOutOrderNumber,
5323
+			WarehouseOutId:          out.ID,
5321 5324
 			GoodId:                  item.GoodId,
5322 5325
 			Count:                   item.Count,
5323 5326
 			Price:                   item.PackingPrice,
@@ -5332,6 +5335,7 @@ func (this *StockManagerApiController) SaveCheckDamage() {
5332 5335
 			ProductDate:             item.ProductDate,
5333 5336
 			Dealer:                  dealer_id,
5334 5337
 			LicenseNumber:           item.LicenseNumber,
5338
+			GoodTypeId:              goodinfo.GoodTypeId,
5335 5339
 		}
5336 5340
 		errOne := service.AddSigleWarehouseOutInfo(warehouseOutInfo)
5337 5341
 		fmt.Println("99999999999999", errOne)
@@ -5356,7 +5360,7 @@ func (this *StockManagerApiController) SaveCheckDamage() {
5356 5360
 			ConsumableType:          5,
5357 5361
 			IsSys:                   0,
5358 5362
 			WarehousingOrder:        "",
5359
-			WarehouseOutId:          warehouseOutInfo.ID,
5363
+			WarehouseOutId:          out.ID,
5360 5364
 			WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
5361 5365
 			IsEdit:                  0,
5362 5366
 			CancelStockId:           0,
@@ -5681,6 +5685,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5681 5685
 
5682 5686
 		//查询该耗材最后1条批次
5683 5687
 		info, _ := service.GetLastWarehouseInfo(item.GoodId)
5688
+		good, _ := service.GetGoodInformationByGoodId(item.GoodId)
5684 5689
 		fmt.Println("总共", item.Count)
5685 5690
 		fmt.Println("数据", list.StockCount)
5686 5691
 		//盘点盘点库存和et实际库存的大小
@@ -5729,6 +5734,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5729 5734
 				Dealer:           dealer_id,
5730 5735
 				LicenseNumber:    info.LicenseNumber,
5731 5736
 				WarehouseInfoId:  item.WarehousingInfoId,
5737
+				GoodTypeId:       good.GoodTypeId,
5732 5738
 			}
5733 5739
 
5734 5740
 			flow := models.VmStockFlow{
@@ -5785,9 +5791,10 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5785 5791
 			}
5786 5792
 			err = service.CreateWarehouseOut(warehouseOut)
5787 5793
 			fmt.Println(err)
5794
+			out, _ := service.GetLastGoodWarehouseOut(adminUserInfo.CurrentOrgId)
5788 5795
 			warehouseOutInfo := &models.WarehouseOutInfo{
5789
-				WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
5790
-				WarehouseOutId:          warehouseOut.ID,
5796
+				WarehouseOutOrderNumber: out.WarehouseOutOrderNumber,
5797
+				WarehouseOutId:          out.ID,
5791 5798
 				GoodId:                  warehouseInfo.GoodId,
5792 5799
 				Count:                   list.StockCount - item.Count,
5793 5800
 				Price:                   warehouseInfo.Price,
@@ -5802,6 +5809,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5802 5809
 				ProductDate:             warehouseInfo.ProductDate,
5803 5810
 				Dealer:                  dealer_id,
5804 5811
 				LicenseNumber:           warehouseInfo.LicenseNumber,
5812
+				GoodTypeId:              good.GoodTypeId,
5805 5813
 			}
5806 5814
 
5807 5815
 			stockFlow := models.VmStockFlow{
@@ -5816,7 +5824,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5816 5824
 				ConsumableType:          2,
5817 5825
 				IsSys:                   2,
5818 5826
 				WarehousingOrder:        "",
5819
-				WarehouseOutId:          warehouseOut.ID,
5827
+				WarehouseOutId:          out.ID,
5820 5828
 				WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
5821 5829
 				IsEdit:                  1,
5822 5830
 				CancelStockId:           0,
@@ -5830,7 +5838,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
5830 5838
 				Mtime:                   0,
5831 5839
 				Price:                   warehouseInfo.Price,
5832 5840
 				WarehousingDetailId:     0,
5833
-				WarehouseOutDetailId:    warehouseOutInfo.ID,
5841
+				WarehouseOutDetailId:    out.ID,
5834 5842
 				CancelOutDetailId:       0,
5835 5843
 				ProductDate:             warehouseInfo.ProductDate,
5836 5844
 				ExpireDate:              warehouseInfo.ExpiryDate,

+ 36 - 0
models/self_drug_models.go View File

@@ -843,3 +843,39 @@ type VmDrugInventory struct {
843 843
 	ProductDate       int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
844 844
 	DrugOriginPlace   string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
845 845
 }
846
+
847
+type SgjDrugWarehouseOutInfo struct {
848
+	ID                      int64      `gorm:"column:id" json:"id" form:"id"`
849
+	WarehouseOutId          int64      `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
850
+	DrugId                  int64      `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
851
+	WarehousingOutTarget    int64      `gorm:"column:warehousing_out_target" json:"warehousing_out_target" form:"warehousing_out_target"`
852
+	Count                   int64      `gorm:"column:count" json:"count" form:"count"`
853
+	CountUnit               string     `gorm:"column:count_unit" json:"count_unit" form:"count_unit"`
854
+	Price                   float64    `gorm:"column:price" json:"price" form:"price"`
855
+	TotalPrice              float64    `gorm:"column:total_price" json:"total_price" form:"total_price"`
856
+	ProductDate             int64      `gorm:"column:product_date" json:"product_date" form:"product_date"`
857
+	ExpiryDate              int64      `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
858
+	Mtime                   int64      `gorm:"column:mtime" json:"mtime" form:"mtime"`
859
+	Ctime                   int64      `gorm:"column:ctime" json:"ctime" form:"ctime"`
860
+	Status                  int64      `gorm:"column:status" json:"status" form:"status"`
861
+	OrgId                   int64      `gorm:"column:org_id" json:"org_id" form:"org_id"`
862
+	Remark                  string     `gorm:"column:remark" json:"remark" form:"remark"`
863
+	IsCancel                int64      `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
864
+	WarehouseOutOrderNumber string     `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
865
+	Type                    int64      `gorm:"column:type" json:"type" form:"type"`
866
+	Dealer                  int64      `gorm:"column:dealer" json:"dealer" form:"dealer"`
867
+	Manufacturer            int64      `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
868
+	IsSys                   int64      `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
869
+	SysRecordTime           int64      `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
870
+	RetailPrice             float64    `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
871
+	RetailTotalPrice        float64    `gorm:"column:retail_total_price" json:"retail_total_price" form:"retail_total_price"`
872
+	WarehouseInfoId         int64      `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
873
+	Number                  string     `gorm:"column:number" json:"number" form:"number"`
874
+	BatchNumber             string     `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
875
+	PatientId               int64      `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
876
+	XtBaseDrug              XtBaseDrug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" `
877
+}
878
+
879
+func (SgjDrugWarehouseOutInfo) TableName() string {
880
+	return "xt_drug_warehouse_out_info"
881
+}

+ 64 - 0
models/stock_models.go View File

@@ -1040,3 +1040,67 @@ type XtStockCorrectRecord struct {
1040 1040
 func (XtStockCorrectRecord) TableName() string {
1041 1041
 	return "xt_stock_correct_record"
1042 1042
 }
1043
+
1044
+type SgjWarehouseOutInfo struct {
1045
+	ID                      int64   `gorm:"column:id" json:"id" form:"id"`
1046
+	WarehouseOutId          int64   `gorm:"column:warehouse_out_id" json:"warehouse_out_id" form:"warehouse_out_id"`
1047
+	WarehouseInfoId         int64   `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1048
+	GoodId                  int64   `gorm:"column:good_id" json:"good_id" form:"good_id"`
1049
+	GoodTypeId              int64   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
1050
+	WarehousingOutTarget    int64   `gorm:"column:warehousing_out_target" json:"warehousing_out_target" form:"warehousing_out_target"`
1051
+	Count                   int64   `gorm:"column:count" json:"count" form:"count"`
1052
+	Price                   float64 `gorm:"column:price" json:"price" form:"price"`
1053
+	TotalPrice              float64 `gorm:"column:total_price" json:"total_price" form:"total_price"`
1054
+	ProductDate             int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
1055
+	ExpiryDate              int64   `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
1056
+	Mtime                   int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1057
+	Ctime                   int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1058
+	Status                  int64   `gorm:"column:status" json:"status" form:"status"`
1059
+	OrgId                   int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
1060
+	Remark                  string  `gorm:"column:remark" json:"remark" form:"remark"`
1061
+	IsCancel                int64   `gorm:"column:is_cancel" json:"is_cancel" form:"is_cancel"`
1062
+	WarehouseOutOrderNumber string  `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number" form:"warehouse_out_order_number"`
1063
+	Type                    int64   `gorm:"column:type" json:"type" form:"type"`
1064
+	Dealer                  int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
1065
+	Manufacturer            int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
1066
+	IsSys                   int64   `gorm:"column:is_sys" json:"is_sys" form:"is_sys"`
1067
+	SysRecordTime           int64   `gorm:"column:sys_record_time" json:"sys_record_time" form:"sys_record_time"`
1068
+	PatientId               int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1069
+	Number                  string  `gorm:"column:number" json:"number" form:"number"`
1070
+	LicenseNumber           string  `gorm:"column:license_number" json:"license_number" form:"license_number"`
1071
+	ConsumableType          int64   `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
1072
+	GoodName                string  `gorm:"column:good_name" json:"good_name"`
1073
+	SpecificationName       string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1074
+	PackingUnit             string  `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
1075
+	RetailPrice             float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
1076
+	PackingPrice            float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1077
+}
1078
+
1079
+type SgjCancelStockInfo struct {
1080
+	ID                int64   `gorm:"column:id" json:"id" form:"id"`
1081
+	GoodId            int64   `gorm:"column:good_id" json:"good_id" form:"good_id"`
1082
+	CancelStockId     int64   `gorm:"column:cancel_stock_id" json:"cancel_stock_id" form:"cancel_stock_id"`
1083
+	GoodTypeId        int64   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
1084
+	Count             int64   `gorm:"column:count" json:"count" form:"count"`
1085
+	Price             float64 `gorm:"column:price" json:"price" form:"price"`
1086
+	Total             float64 `gorm:"column:total" json:"total" form:"total"`
1087
+	ProductDate       int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
1088
+	ExpiryDate        int64   `gorm:"column:expiry_date" json:"expiry_date" form:"expiry_date"`
1089
+	Ctime             int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1090
+	Mtime             int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1091
+	Status            int64   `gorm:"column:status" json:"status" form:"status"`
1092
+	OrgId             int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
1093
+	OrderNumber       string  `gorm:"column:order_number" json:"order_number" form:"order_number"`
1094
+	Type              int64   `gorm:"column:type" json:"type" form:"type"`
1095
+	Dealer            string  `gorm:"column:dealer" json:"dealer" form:"dealer"`
1096
+	Manufacturer      string  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
1097
+	Number            string  `gorm:"column:number" json:"number" form:"number"`
1098
+	RegisterAccount   string  `gorm:"column:register_account" json:"register_account" form:"register_account"`
1099
+	Remark            string  `gorm:"column:remark" json:"remark" form:"remark"`
1100
+	WarehouseInfoId   int64   `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1101
+	GoodName          string  `gorm:"column:good_name" json:"good_name"`
1102
+	SpecificationName string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1103
+	PackingUnit       string  `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
1104
+	RetailPrice       float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
1105
+	PackingPrice      float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1106
+}

+ 1 - 1
routers/router.go View File

@@ -11,7 +11,7 @@ import (
11 11
 func init() {
12 12
 	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
13 13
 		// AllowAllOrigins:  true,
14
-		AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9531", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com"},
14
+		AllowOrigins: []string{"https://xt.kuyicloud.com", "https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9531", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com"},
15 15
 		//AllowOrigins:     []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://xt.test.shengws.com","https://xt.test.shengws.com", "http://xt.test.sgjyun.com","https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com","https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com","http://mobile.sgjyun.com","http://mobile.kuyicloud.com"},
16 16
 		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
17 17
 		AllowHeaders:     []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "X-XSRF-TOKEN", "Permission"},

+ 16 - 0
service/drug_stock_service.go View File

@@ -260,3 +260,19 @@ func GetDrugOutOrderPrintList(startime int64, endtime int64, orgid int64) (list
260 260
 	err = db.Preload("XtBaseDrug", "status = 1 and org_id = ?", orgid).Find(&list).Error
261 261
 	return list, err
262 262
 }
263
+
264
+func GetDrugOutOrderInfoPrintList(startime int64, endtime int64, orgid int64) (list []*models.SgjDrugWarehouseOutInfo, err error) {
265
+
266
+	db := XTReadDB().Table("xt_drug_warehouse_out_info").Where("status = 1")
267
+	if startime > 0 {
268
+		db = db.Where("ctime >=?", startime)
269
+	}
270
+	if endtime > 0 {
271
+		db = db.Where("ctime<=?", endtime)
272
+	}
273
+	if orgid > 0 {
274
+		db = db.Where("org_id = ?", orgid)
275
+	}
276
+	err = db.Preload("XtBaseDrug", "status = 1 and org_id = ?", orgid).Find(&list).Error
277
+	return list, err
278
+}

+ 36 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go View File

@@ -253,3 +253,39 @@ func GetWarehouseOutInfoGoodDetailPrintList(orgid int64, startime int64, endtime
253 253
 	return auto, err
254 254
 
255 255
 }
256
+
257
+func GetWarehouseOutInfoPrintList(orgid int64, startime int64, endtime int64) (out []*models.SgjWarehouseOutInfo, err error) {
258
+
259
+	db := p_service.XTReadDB().Table("xt_warehouse_out_info as x").Where("x.status = 1")
260
+	table := p_service.XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
261
+	fmt.Println(table)
262
+	if orgid > 0 {
263
+		db = db.Where("x.org_id = ?", orgid)
264
+	}
265
+	if startime > 0 {
266
+		db = db.Where("x.ctime >= ?", startime)
267
+	}
268
+	if endtime > 0 {
269
+		db = db.Where("x.ctime<=?", endtime)
270
+	}
271
+	err = db.Select("x.patient_id,x.sys_record_time,x.good_id,sum(x.count) as count,t.good_name,t.specification_name,t.packing_unit,t.retail_price,t.packing_price").Joins("left join xt_good_information as t on t.id = x.good_id").Group("x.good_id").Scan(&out).Error
272
+	return out, err
273
+}
274
+
275
+func GetWarehouseCancelPrintList(orgid int64, startime int64, endtime int64) (cancel []*models.SgjCancelStockInfo, err error) {
276
+
277
+	db := p_service.XTReadDB().Table("xt_cancel_stock_info as x").Where("x.status = 1")
278
+	table := p_service.XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
279
+	fmt.Println(table)
280
+	if orgid > 0 {
281
+		db = db.Where("x.org_id = ?", orgid)
282
+	}
283
+	if startime > 0 {
284
+		db = db.Where("x.ctime >= ?", startime)
285
+	}
286
+	if endtime > 0 {
287
+		db = db.Where("x.ctime<=?", endtime)
288
+	}
289
+	err = db.Select("x.ctime,x.good_id,sum(x.count) as count,t.good_name,t.specification_name,t.packing_unit,t.retail_price,t.packing_price").Joins("left join xt_good_information as t on t.id = x.good_id").Group("x.good_id").Scan(&cancel).Error
290
+	return cancel, err
291
+}

+ 17 - 0
service/stock_service.go View File

@@ -3922,6 +3922,17 @@ func GetExportOutOrderDrugList(warehouse_out_id []string) (out []*models.StDrugW
3922 3922
 	return out, err
3923 3923
 }
3924 3924
 
3925
+func GetExportOutOrderDrugListOne(warehouse_out_id []string) (out []*models.StDrugWarehouseOutInfo, err error) {
3926
+	db := XTReadDB().Table("xt_drug_flow as x").Where("x.status = 1")
3927
+	table := XTReadDB().Table("xt_base_drug as b").Where("b.status = 1")
3928
+	fmt.Println("table", table)
3929
+	if len(warehouse_out_id) > 0 {
3930
+		db = db.Where("x.warehouse_out_id in(?)", warehouse_out_id)
3931
+	}
3932
+	err = db.Select("x.id,x.warehouse_out_id,x.drug_id,x.count,x.max_unit as count_unit,x.price,x.product_date,x.expire_date as expire_date,x.warehouse_out_order_number,x.dealer,x.manufacturer,x.is_sys,x.number,x.batch_number,x.patient_id,b.dose,b.dose_unit,b.min_number,b.min_unit,b.max_unit,b.drug_name,b.drug_type,b.min_price").Joins("left join xt_base_drug as b on b.id = x.drug_id").Scan(&out).Error
3933
+	return out, err
3934
+}
3935
+
3925 3936
 func GetLastGoodInformationByGoodId(goodid int64, warehouse_info_id int64, orgid int64) (models.WarehouseOutInfo, error) {
3926 3937
 
3927 3938
 	info := models.WarehouseOutInfo{}
@@ -4351,6 +4362,12 @@ func CreateWarehouseOut(out models.WarehouseOut) error {
4351 4362
 	return err
4352 4363
 }
4353 4364
 
4365
+func GetLastGoodWarehouseOut(orgid int64) (models.WarehouseOut, error) {
4366
+	out := models.WarehouseOut{}
4367
+	err := XTReadDB().Where("org_id = ? and status = 1", orgid).Find(&out).Error
4368
+	return out, err
4369
+}
4370
+
4354 4371
 func CreateWarehouseInfo(info models.WarehousingInfo) error {
4355 4372
 
4356 4373
 	err := XTReadDB().Create(&info).Error