28169 1 miesiąc temu
rodzic
commit
729fa149f6

+ 1 - 1
controllers/manager_center_api_controller.go Wyświetl plik

@@ -1846,7 +1846,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1846 1846
 	}
1847 1847
 	err, goodInfos := service.ModifyGoodInfo(&goodInfo)
1848 1848
 
1849
-	if adminUserInfo.CurrentOrgId != 10653 && adminUserInfo.CurrentOrgId != 10644 {
1849
+	if adminUserInfo.CurrentOrgId == 10598 {
1850 1850
 		list, _ := service.GetHisPrescripionProjectList(good_id, adminUserInfo.CurrentOrgId)
1851 1851
 		if len(list) > 0 {
1852 1852
 			for _, item := range list {

+ 26 - 12
controllers/self_drug_api_congtroller.go Wyświetl plik

@@ -2975,10 +2975,13 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
2975 2975
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取查询信息失败")
2976 2976
 		return
2977 2977
 	}
2978
-
2978
+	var medicalInsuranceLevel = "医保等级"
2979
+	medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
2980
+	medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, orgId)
2979 2981
 	this.ServeSuccessJSON(map[string]interface{}{
2980
-		"total":     total,
2981
-		"stockList": stockList,
2982
+		"total":                     total,
2983
+		"stockList":                 stockList,
2984
+		"medicalInsuranceLevelList": medicalInsuranceLevelList,
2982 2985
 	})
2983 2986
 }
2984 2987
 
@@ -3641,10 +3644,15 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
3641 3644
 	drugTypeParent, _ := service.GetDrugDataConfig(0, drugType)
3642 3645
 	drugTypeList, _ := service.GetParentDataConfig(drugTypeParent.ID, orgId)
3643 3646
 
3647
+	var medicalInsuranceLevel = "医保等级"
3648
+	medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
3649
+	medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, orgId)
3650
+
3644 3651
 	this.ServeSuccessJSON(map[string]interface{}{
3645
-		"total":        total,
3646
-		"drugTypeList": drugTypeList,
3647
-		"countList":    countList,
3652
+		"total":                     total,
3653
+		"drugTypeList":              drugTypeList,
3654
+		"countList":                 countList,
3655
+		"medicalInsuranceLevelList": medicalInsuranceLevelList,
3648 3656
 	})
3649 3657
 }
3650 3658
 
@@ -3884,6 +3892,10 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3884 3892
 
3885 3893
 	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
3886 3894
 
3895
+	var medicalInsuranceLevel = "医保等级"
3896
+	medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
3897
+	medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, orgId)
3898
+
3887 3899
 	if orgId == 10265 {
3888 3900
 		//storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3889 3901
 
@@ -3947,9 +3959,10 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3947 3959
 		}
3948 3960
 
3949 3961
 		this.ServeSuccessJSON(map[string]interface{}{
3950
-			"list":             list,
3951
-			"manufacturerList": manufacturerList,
3952
-			"total":            total,
3962
+			"list":                      list,
3963
+			"manufacturerList":          manufacturerList,
3964
+			"total":                     total,
3965
+			"medicalInsuranceLevelList": medicalInsuranceLevelList,
3953 3966
 		})
3954 3967
 	}
3955 3968
 
@@ -4046,9 +4059,10 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
4046 4059
 		}
4047 4060
 
4048 4061
 		this.ServeSuccessJSON(map[string]interface{}{
4049
-			"list":             list,
4050
-			"manufacturerList": manufacturerList,
4051
-			"total":            total,
4062
+			"list":                      list,
4063
+			"manufacturerList":          manufacturerList,
4064
+			"total":                     total,
4065
+			"medicalInsuranceLevelList": medicalInsuranceLevelList,
4052 4066
 		})
4053 4067
 	}
4054 4068
 

+ 17 - 0
controllers/stock_in_api_controller.go Wyświetl plik

@@ -7006,6 +7006,7 @@ func (this *StockManagerApiController) SaveStockInventoryList() {
7006 7006
 				ProductDate:       product_date,
7007 7007
 				StorehouseId:      storehouse_id,
7008 7008
 				MaxUnit:           warehousing_unit,
7009
+				Status:            1,
7009 7010
 			}
7010 7011
 
7011 7012
 			//查询今日该耗材是否有记录
@@ -7025,6 +7026,10 @@ func (this *StockManagerApiController) SaveStockInventoryList() {
7025 7026
 
7026 7027
 		}
7027 7028
 	}
7029
+
7030
+	this.ServeSuccessJSON(map[string]interface{}{
7031
+		"msg": "保存成功!",
7032
+	})
7028 7033
 }
7029 7034
 
7030 7035
 func (this *StockManagerApiController) GetDamageDetailByGoodId() {
@@ -8387,6 +8392,7 @@ func (this *StockManagerApiController) GetStockInventoryModePrintList() {
8387 8392
 		startTime = theTime.Unix()
8388 8393
 
8389 8394
 	}
8395
+
8390 8396
 	var endTime int64
8391 8397
 	if len(end_time) > 0 {
8392 8398
 		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
@@ -8416,6 +8422,14 @@ func (this *StockManagerApiController) GetStockInventoryModePrintList() {
8416 8422
 
8417 8423
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
8418 8424
 
8425
+	//获取期初结余数量
8426
+	warehouseinfo, _ := service.GetLastMonthCount(startTime, orgId)
8427
+
8428
+	//期出结余出库数量
8429
+	warehouseOutInfo, _ := service.GetLastMonthOverCount(startTime, orgId)
8430
+
8431
+	cancelInfo, _ := service.GetLastCancelMonthCount(startTime, orgId)
8432
+
8419 8433
 	this.ServeSuccessJSON(map[string]interface{}{
8420 8434
 		"list":             list,
8421 8435
 		"infoList":         infoList,
@@ -8424,6 +8438,9 @@ func (this *StockManagerApiController) GetStockInventoryModePrintList() {
8424 8438
 		"flowNoProList":    flowNoProList,
8425 8439
 		"manufacturerList": manufacturerList,
8426 8440
 		"goodInfo":         goodInfo,
8441
+		"warehouseinfo":    warehouseinfo,
8442
+		"warehouseOutInfo": warehouseOutInfo,
8443
+		"cancelInfo":       cancelInfo,
8427 8444
 	})
8428 8445
 
8429 8446
 }

+ 2 - 0
models/new_stock_models.go Wyświetl plik

@@ -173,6 +173,7 @@ type NewBaseDrugOne struct {
173 173
 	Dealer                 int64                  `gorm:"column:dealer" json:"dealer" form:"dealer"`
174 174
 	MedicalInsuranceNumber string                 `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
175 175
 	DrugType               int64                  `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
176
+	MedicalInsuranceLevel  int64                  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
176 177
 }
177 178
 
178 179
 func (NewBaseDrugOne) TableName() string {
@@ -279,6 +280,7 @@ type GoodInfoTwenty struct {
279 280
 	PackingPrice                float64                 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
280 281
 	GoodNumber                  string                  `gorm:"column:good_number" json:"good_number" form:"good_number"`
281 282
 	SocialSecurityDirectoryCode string                  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
283
+	MedicalInsuranceLevel       int64                   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
282 284
 	StWarehousingInfo           []*StWarehousingInfo    `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
283 285
 	WarehousingInfoOne          []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
284 286
 	WarehousingInfoStart        []*StartWarehousingInfo `gorm:"json:"warehouse_info_start"`

+ 6 - 0
service/self_drug_service.go Wyświetl plik

@@ -2852,6 +2852,9 @@ func GetGoodNewPurchaseStockQuery(good_type int64, keyword string, page int64, l
2852 2852
 func GetGoodNewPurchaseStockQueryOne(good_type int64, keyword string, page int64, limit int64, orgid int64, ids []int64, goodIds []int64) (goodinfo []*models.GoodInfoTwenty, total int64, err error) {
2853 2853
 
2854 2854
 	db := XTReadDB().Model(&goodinfo).Where("status = 1")
2855
+	if orgid == 10697 {
2856
+		db = db.Where("find_in_set('停用',good_status) = 0")
2857
+	}
2855 2858
 	offset := (page - 1) * limit
2856 2859
 	likeKey := "%" + keyword + "%"
2857 2860
 	if good_type > 0 {
@@ -2906,6 +2909,9 @@ func GetDrugNewPurchaseStockQuery(good_type int64, keyword string, page int64, l
2906 2909
 	if good_type > 0 {
2907 2910
 		db = db.Where("drug_type = ?", good_type)
2908 2911
 	}
2912
+	if orgid == 10697 {
2913
+		db = db.Where("find_in_set('停用',drug_status) = 0")
2914
+	}
2909 2915
 
2910 2916
 	if orgid > 0 {
2911 2917
 		db = db.Where("org_id = ?", orgid)

+ 45 - 0
service/stock_service.go Wyświetl plik

@@ -9673,6 +9673,51 @@ func GetGoodStockFlowNoProList(startTime int64, endTime int64, orgId int64) (flo
9673 9673
 	return flow, err
9674 9674
 }
9675 9675
 
9676
+func GetLastMonthCount(startTime int64, orgId int64) (flow []*models.VmStockFlow, err error) {
9677
+
9678
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type = 1 or consumable_type = 10)")
9679
+
9680
+	if startTime > 0 {
9681
+		db = db.Where("ctime <?", startTime)
9682
+	}
9683
+	if orgId > 0 {
9684
+		db = db.Where("user_org_id = ?", orgId)
9685
+	}
9686
+	err = db.Find(&flow).Error
9687
+
9688
+	return flow, err
9689
+}
9690
+
9691
+func GetLastMonthOverCount(startTime int64, orgId int64) (flow []*models.VmStockFlow, err error) {
9692
+
9693
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type = 2 or consumable_type=3 or consumable_type=11)")
9694
+
9695
+	if startTime > 0 {
9696
+		db = db.Where("ctime <?", startTime)
9697
+	}
9698
+	if orgId > 0 {
9699
+		db = db.Where("user_org_id = ?", orgId)
9700
+	}
9701
+	err = db.Find(&flow).Error
9702
+
9703
+	return flow, err
9704
+}
9705
+
9706
+func GetLastCancelMonthCount(startTime int64, orgId int64) (flow []*models.VmStockFlow, err error) {
9707
+
9708
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type = 7)")
9709
+
9710
+	if startTime > 0 {
9711
+		db = db.Where("ctime <?", startTime)
9712
+	}
9713
+	if orgId > 0 {
9714
+		db = db.Where("user_org_id = ?", orgId)
9715
+	}
9716
+	err = db.Find(&flow).Error
9717
+
9718
+	return flow, err
9719
+}
9720
+
9676 9721
 func GetDrugCodeOpen(user_org_id int64) (models.XtDrugCodeOpen, error) {
9677 9722
 
9678 9723
 	drugCodeOpen := models.XtDrugCodeOpen{}