Browse Source

历史排班

28169 1 year ago
parent
commit
2cb0864595
3 changed files with 69 additions and 55 deletions
  1. 9 11
      controllers/patient_dataconfig_api_controller.go
  2. 59 44
      models/stock_models.go
  3. 1 0
      service/stock_service.go

+ 9 - 11
controllers/patient_dataconfig_api_controller.go View File

@@ -1276,11 +1276,9 @@ func (this *PatientDataConfigAPIController) SaveSiteMap() {
1276 1276
 
1277 1277
 	err = service.CreateDeviceValsualMap(deviceValsualMap)
1278 1278
 
1279
-	if err != nil {
1280
-		this.ServeSuccessJSON(map[string]interface{}{
1281
-			"deviceValsualMap": deviceValsualMap,
1282
-		})
1283
-	}
1279
+	this.ServeSuccessJSON(map[string]interface{}{
1280
+		"deviceValsualMap": deviceValsualMap,
1281
+	})
1284 1282
 
1285 1283
 }
1286 1284
 
@@ -1290,12 +1288,12 @@ func (this *PatientDataConfigAPIController) GetPatientSitemap() {
1290 1288
 
1291 1289
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1292 1290
 
1293
-	sitemap, err := service.GetPatientSitemap(patient_id, orgId)
1294
-	if err != nil {
1295
-		this.ServeSuccessJSON(map[string]interface{}{
1296
-			"sitemap": sitemap,
1297
-		})
1298
-	}
1291
+	sitemap, _ := service.GetPatientSitemap(patient_id, orgId)
1292
+
1293
+	this.ServeSuccessJSON(map[string]interface{}{
1294
+		"sitemap": sitemap,
1295
+	})
1296
+
1299 1297
 }
1300 1298
 
1301 1299
 func (this *PatientDataConfigAPIController) UpdateSiteMap() {

+ 59 - 44
models/stock_models.go View File

@@ -229,50 +229,51 @@ func (WarehouseOut) TableName() string {
229 229
 }
230 230
 
231 231
 type WarehouseOutInfo struct {
232
-	ID                      int64           `gorm:"column:id" json:"id"`
233
-	WarehouseOutId          int64           `gorm:"column:warehouse_out_id" json:"warehouse_out_id"`
234
-	WarehouseInfotId        int64           `gorm:"column:warehouse_info_id" json:"warehouse_info_id"`
235
-	GoodId                  int64           `gorm:"column:good_id" json:"good_id"`
236
-	GoodTypeId              int64           `gorm:"column:good_type_id" json:"good_type_id"`
237
-	WarehousingOutTarget    int64           `gorm:"column:warehousing_out_target" json:"warehousing_out_target"`
238
-	Count                   int64           `gorm:"column:count" json:"count"`
239
-	Price                   float64         `gorm:"column:price" json:"price"`
240
-	TotalPrice              float64         `gorm:"column:total_price" json:"total_price"`
241
-	ProductDate             int64           `gorm:"column:product_date" json:"product_date"`
242
-	ExpiryDate              int64           `gorm:"column:expiry_date" json:"expiry_date"`
243
-	Mtime                   int64           `gorm:"column:mtime" json:"mtime"`
244
-	Ctime                   int64           `gorm:"column:ctime" json:"ctime"`
245
-	Status                  int64           `gorm:"column:status" json:"status"`
246
-	OrgId                   int64           `gorm:"column:org_id" json:"org_id"`
247
-	Remark                  string          `gorm:"column:remark" json:"remark"`
248
-	IsCancel                int64           `gorm:"column:is_cancel" json:"is_cancel"`
249
-	WarehouseOut            WarehouseOut    `ForeignKey:WarehouseOutId json:"WarehouseOut"`
250
-	WarehouseOutOrderNumber string          `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number"`
251
-	GoodInfo                GoodInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:GoodId" `
252
-	Type                    int64           `gorm:"column:type" json:"type"`
253
-	Dealer                  int64           `gorm:"column:dealer" json:"dealer"`
254
-	Manufacturer            int64           `gorm:"column:manufacturer" json:"manufacturer"`
255
-	IsSys                   int64           `gorm:"column:is_sys" json:"is_sys"`
256
-	SysRecordTime           int64           `gorm:"column:sys_record_time" json:"sys_record_time"`
257
-	PatientId               int64           `gorm:"column:patient_id" json:"patient_id"`
258
-	Number                  string          `gorm:"column:number" json:"number" form:"number"`
259
-	LicenseNumber           string          `gorm:"column:license_number" json:"license_number" form:"license_number"`
260
-	ConsumableType          int64           `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
261
-	ProjectId               int64           `gorm:"column:project_id" json:"project_id" form:"project_id"`
262
-	SupplyCancelOutId       int64           `gorm:"column:supply_cancel_out_id" json:"supply_cancel_out_id" form:"supply_cancel_out_id"`
263
-	SupplyWarehouseId       int64           `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
264
-	IsSource                int64           `gorm:"column:is_source" json:"is_source" form:"is_source"`
265
-	StorehouseId            int64           `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
266
-	SecondWarehouseInfoId   int64           `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
267
-	AdminUserId             int64           `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
268
-	BuyPrice                float64         `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
269
-	StockCount              string          `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
270
-	IsCheck                 int64           `gorm:"column:is_check" json:"is_check" form:"is_check"`
271
-	RegisterNumber          string          `gorm:"column:register_number" json:"register_number" form:"register_number"`
272
-	WarehousingInfo         WarehousingInfo `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfotId" `
273
-	VmStockFlow             VmStockFlow     `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseOutDetailId" json:"stock_flow"`
274
-	OverCount               int64           `gorm:"column:over_count" json:"over_count" form:"over_count"`
275
-	OrderId                 int64           `gorm:"column:order_id" json:"order_id" form:"order_id"`
232
+	ID                      int64                `gorm:"column:id" json:"id"`
233
+	WarehouseOutId          int64                `gorm:"column:warehouse_out_id" json:"warehouse_out_id"`
234
+	WarehouseInfotId        int64                `gorm:"column:warehouse_info_id" json:"warehouse_info_id"`
235
+	GoodId                  int64                `gorm:"column:good_id" json:"good_id"`
236
+	GoodTypeId              int64                `gorm:"column:good_type_id" json:"good_type_id"`
237
+	WarehousingOutTarget    int64                `gorm:"column:warehousing_out_target" json:"warehousing_out_target"`
238
+	Count                   int64                `gorm:"column:count" json:"count"`
239
+	Price                   float64              `gorm:"column:price" json:"price"`
240
+	TotalPrice              float64              `gorm:"column:total_price" json:"total_price"`
241
+	ProductDate             int64                `gorm:"column:product_date" json:"product_date"`
242
+	ExpiryDate              int64                `gorm:"column:expiry_date" json:"expiry_date"`
243
+	Mtime                   int64                `gorm:"column:mtime" json:"mtime"`
244
+	Ctime                   int64                `gorm:"column:ctime" json:"ctime"`
245
+	Status                  int64                `gorm:"column:status" json:"status"`
246
+	OrgId                   int64                `gorm:"column:org_id" json:"org_id"`
247
+	Remark                  string               `gorm:"column:remark" json:"remark"`
248
+	IsCancel                int64                `gorm:"column:is_cancel" json:"is_cancel"`
249
+	WarehouseOut            WarehouseOut         `ForeignKey:WarehouseOutId json:"WarehouseOut"`
250
+	WarehouseOutOrderNumber string               `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number"`
251
+	GoodInfo                GoodInfo             `gorm:"ForeignKey:ID;AssociationForeignKey:GoodId" `
252
+	Type                    int64                `gorm:"column:type" json:"type"`
253
+	Dealer                  int64                `gorm:"column:dealer" json:"dealer"`
254
+	Manufacturer            int64                `gorm:"column:manufacturer" json:"manufacturer"`
255
+	IsSys                   int64                `gorm:"column:is_sys" json:"is_sys"`
256
+	SysRecordTime           int64                `gorm:"column:sys_record_time" json:"sys_record_time"`
257
+	PatientId               int64                `gorm:"column:patient_id" json:"patient_id"`
258
+	Number                  string               `gorm:"column:number" json:"number" form:"number"`
259
+	LicenseNumber           string               `gorm:"column:license_number" json:"license_number" form:"license_number"`
260
+	ConsumableType          int64                `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
261
+	ProjectId               int64                `gorm:"column:project_id" json:"project_id" form:"project_id"`
262
+	SupplyCancelOutId       int64                `gorm:"column:supply_cancel_out_id" json:"supply_cancel_out_id" form:"supply_cancel_out_id"`
263
+	SupplyWarehouseId       int64                `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
264
+	IsSource                int64                `gorm:"column:is_source" json:"is_source" form:"is_source"`
265
+	StorehouseId            int64                `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
266
+	SecondWarehouseInfoId   int64                `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
267
+	AdminUserId             int64                `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
268
+	BuyPrice                float64              `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
269
+	StockCount              string               `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
270
+	IsCheck                 int64                `gorm:"column:is_check" json:"is_check" form:"is_check"`
271
+	RegisterNumber          string               `gorm:"column:register_number" json:"register_number" form:"register_number"`
272
+	WarehousingInfo         WarehousingInfo      `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfotId" `
273
+	VmStockFlow             VmStockFlow          `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseOutDetailId" json:"stock_flow"`
274
+	OverCount               int64                `gorm:"column:over_count" json:"over_count" form:"over_count"`
275
+	OrderId                 int64                `gorm:"column:order_id" json:"order_id" form:"order_id"`
276
+	WarehousingInfoNight    WarehousingInfoNight `gorm:"ForeignKey:ID;AssociationForeignKey:WarehouseInfotId"`
276 277
 }
277 278
 
278 279
 func (WarehouseOutInfo) TableName() string {
@@ -1657,3 +1658,17 @@ type NewWarehousingInfo struct {
1657 1658
 func (NewWarehousingInfo) TableName() string {
1658 1659
 	return "xt_warehouse_info"
1659 1660
 }
1661
+
1662
+type WarehousingInfoNight struct {
1663
+	ID              int64   `gorm:"column:id" json:"id"`
1664
+	StockCount      int64   `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1665
+	StorehouseId    int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
1666
+	WarehouseInfoId int64   `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1667
+	PackingPrice    float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1668
+	Price           float64 `gorm:"column:price" json:"price"`
1669
+	Number          string  `gorm:"column:number" json:"number"`
1670
+}
1671
+
1672
+func (WarehousingInfoNight) TableName() string {
1673
+	return "xt_warehouse_info"
1674
+}

+ 1 - 0
service/stock_service.go View File

@@ -2939,6 +2939,7 @@ func FindStockOutDetailList(orgId int64, page int64, limit int64, startTime int6
2939 2939
 	}
2940 2940
 
2941 2941
 	db = db.Preload("WarehouseOut", "status = 1 AND org_id = ?", orgId)
2942
+	db = db.Preload("WarehousingInfoNight", "status=1 and org_id = ?", orgId)
2942 2943
 	db = db.Preload("GoodInfo", "status = 1 AND org_id = ?", orgId)
2943 2944
 	db = db.Count(&total)
2944 2945
 	offset := (page - 1) * limit