csx преди 3 години
родител
ревизия
0992e88a25

+ 9 - 3
controllers/his_api_controller.go Целия файл

3189
 	if tempOrder.ID == 0 {
3189
 	if tempOrder.ID == 0 {
3190
 		if settle_accounts_type == 1 { //日结
3190
 		if settle_accounts_type == 1 { //日结
3191
 			fmt.Println(reg_type)
3191
 			fmt.Println(reg_type)
3192
-			if reg_type == 11 {
3193
-				fmt.Println(reg_type)
3192
+
3193
+			if reg_type == 11 || reg_type == 1111 || reg_type == 1112 {
3194
+
3194
 				prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
3195
 				prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
3195
 			} else {
3196
 			} else {
3196
 				prescriptions, _ = service.GetSettleHisPrescription(adminUser.CurrentOrgId, id, his_patient_id, recordDateTime, reg_type)
3197
 				prescriptions, _ = service.GetSettleHisPrescription(adminUser.CurrentOrgId, id, his_patient_id, recordDateTime, reg_type)
3197
 			}
3198
 			}
3198
 		} else { //月结
3199
 		} else { //月结
3200
+
3199
 			start_time_str := c.GetString("start_time")
3201
 			start_time_str := c.GetString("start_time")
3200
 			end_time_str := c.GetString("end_time")
3202
 			end_time_str := c.GetString("end_time")
3201
 			timeLayout := "2006-01-02"
3203
 			timeLayout := "2006-01-02"
3249
 			}
3251
 			}
3250
 		}
3252
 		}
3251
 
3253
 
3254
+		if reg_type == 1111 || reg_type == 1112 {
3255
+			reg_type = 11
3256
+		}
3257
+
3252
 		allTotal := fmt.Sprintf("%.4f", total)
3258
 		allTotal := fmt.Sprintf("%.4f", total)
3253
 		totals, _ := strconv.ParseFloat(allTotal, 64)
3259
 		totals, _ := strconv.ParseFloat(allTotal, 64)
3254
 		order := &models.HisOrder{
3260
 		order := &models.HisOrder{
5014
 
5020
 
5015
 	if settle_accounts_type == 1 { //日结
5021
 	if settle_accounts_type == 1 { //日结
5016
 
5022
 
5017
-		if reg_type == 11 {
5023
+		if reg_type == 11 || reg_type == 1111 || reg_type == 1112 {
5018
 
5024
 
5019
 			prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
5025
 			prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
5020
 		} else {
5026
 		} else {

+ 5 - 0
controllers/manager_center_api_controller.go Целия файл

1440
 func (c *ManagerCenterApiController) CreateGoodInfo() {
1440
 func (c *ManagerCenterApiController) CreateGoodInfo() {
1441
 	good_id, _ := c.GetInt64("good_id", 0)
1441
 	good_id, _ := c.GetInt64("good_id", 0)
1442
 	specification_name := c.GetString("specification_name")
1442
 	specification_name := c.GetString("specification_name")
1443
+	register_number := c.GetString("register_number")
1444
+
1443
 	good_unit, _ := c.GetInt64("good_unit", -1)
1445
 	good_unit, _ := c.GetInt64("good_unit", -1)
1444
 	buy_price, _ := c.GetFloat("buy_price", 0)
1446
 	buy_price, _ := c.GetFloat("buy_price", 0)
1445
 	sell_price, _ := c.GetFloat("sell_price", 0)
1447
 	sell_price, _ := c.GetFloat("sell_price", 0)
1540
 		PackingPrice:                packing_price,
1542
 		PackingPrice:                packing_price,
1541
 		DefaultCountUnit:            default_count_unit,
1543
 		DefaultCountUnit:            default_count_unit,
1542
 		MinUnit:                     min_unit,
1544
 		MinUnit:                     min_unit,
1545
+		RegisterNumber:              register_number,
1543
 	}
1546
 	}
1544
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1547
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1545
 	if err == nil {
1548
 	if err == nil {
1601
 	default_count_unit := c.GetString("default_count_unit")
1604
 	default_count_unit := c.GetString("default_count_unit")
1602
 	min_unit := c.GetString("min_unit")
1605
 	min_unit := c.GetString("min_unit")
1603
 	total, _ := c.GetFloat("total")
1606
 	total, _ := c.GetFloat("total")
1607
+	register_number := c.GetString("register_number")
1604
 
1608
 
1605
 	adminUserInfo := c.GetAdminUserInfo()
1609
 	adminUserInfo := c.GetAdminUserInfo()
1606
 
1610
 
1652
 		DefaultCountUnit:            default_count_unit,
1656
 		DefaultCountUnit:            default_count_unit,
1653
 		MinUnit:                     min_unit,
1657
 		MinUnit:                     min_unit,
1654
 		Total:                       total,
1658
 		Total:                       total,
1659
+		RegisterNumber:              register_number,
1655
 	}
1660
 	}
1656
 
1661
 
1657
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)
1662
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

+ 1 - 0
models/good_models.go Целия файл

80
 	StWarehousingInfo           []*StWarehousingInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
80
 	StWarehousingInfo           []*StWarehousingInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
81
 	CancelStockInfo             []*CancelStockInfo   `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"cancel_stock_info"`
81
 	CancelStockInfo             []*CancelStockInfo   `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"cancel_stock_info"`
82
 	GoodSotckInfo               []*GoodSotckInfo     `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_stock_in"`
82
 	GoodSotckInfo               []*GoodSotckInfo     `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"good_stock_in"`
83
+	RegisterNumber              string               `gorm:"column:register_number" json:"register_number" form:"register_number"`
83
 }
84
 }
84
 
85
 
85
 func (GoodInfo) TableName() string {
86
 func (GoodInfo) TableName() string {

+ 1 - 0
models/his_charge_models.go Целия файл

172
 	GoodName           string `gorm:"column:good_name" json:"good_name" form:"good_name"`
172
 	GoodName           string `gorm:"column:good_name" json:"good_name" form:"good_name"`
173
 	GoodUnit           int64  `gorm:"column:good_unit" json:"good_unit"`
173
 	GoodUnit           int64  `gorm:"column:good_unit" json:"good_unit"`
174
 	SpecificationnName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
174
 	SpecificationnName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
175
+	RegisterNumber     string `gorm:"column:register_number" json:"register_number" form:"register_number"`
175
 }
176
 }
176
 
177
 
177
 func (HisChargeGoodInfo) TableName() string {
178
 func (HisChargeGoodInfo) TableName() string {

+ 3 - 3
models/his_models.go Целия файл

467
 	Creator               int64     `gorm:"column:creator" json:"creator" form:"creator"`
467
 	Creator               int64     `gorm:"column:creator" json:"creator" form:"creator"`
468
 	PType                 int64     `gorm:"column:p_type" json:"p_type" form:"p_type"`
468
 	PType                 int64     `gorm:"column:p_type" json:"p_type" form:"p_type"`
469
 	AccountPrice          float64   `gorm:"column:account_price" json:"account_price" form:"account_price"`
469
 	AccountPrice          float64   `gorm:"column:account_price" json:"account_price" form:"account_price"`
470
-
471
-	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
472
-	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
470
+	FaPiaoCode            string    `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
471
+	FaPiaoNumber          string    `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
473
 
472
 
474
 	AdminUser AdminUser `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
473
 	AdminUser AdminUser `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
475
 
474
 
508
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
507
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
509
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
508
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
510
 	HisPrescriptionInfo    HisPrescriptionInfo       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
509
 	HisPrescriptionInfo    HisPrescriptionInfo       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
510
+	HisOrder               HisOrder                  `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
511
 	Total                  string                    `gorm:"-" json:"total" form:"total"`
511
 	Total                  string                    `gorm:"-" json:"total" form:"total"`
512
 	PType                  int64                     `gorm:"column:p_type" json:"p_type" form:"p_type"`
512
 	PType                  int64                     `gorm:"column:p_type" json:"p_type" form:"p_type"`
513
 	MedType                string                    `gorm:"column:med_type" json:"med_type" form:"med_type"`
513
 	MedType                string                    `gorm:"column:med_type" json:"med_type" form:"med_type"`

+ 1 - 0
models/stock_models.go Целия файл

317
 	Dealers           Dealer       `gorm:"ForeignKey:Dealer;AssociationForeignKey:ID" json:"dealers"`
317
 	Dealers           Dealer       `gorm:"ForeignKey:Dealer;AssociationForeignKey:ID" json:"dealers"`
318
 	BuyPrice          float64      `gorm:"column:buy_price" json:"buy_price"`
318
 	BuyPrice          float64      `gorm:"column:buy_price" json:"buy_price"`
319
 	Total             float64      `gorm:"column:total" json:"total" form:"total"`
319
 	Total             float64      `gorm:"column:total" json:"total" form:"total"`
320
+	RegisterNumber    string       `gorm:"column:register_number" json:"register_number" form:"register_number"`
320
 }
321
 }
321
 
322
 
322
 func (WarehousingGoodInfo) TableName() string {
323
 func (WarehousingGoodInfo) TableName() string {

+ 1 - 0
models/stock_query_models.go Целия файл

14
 	QueryWarehouseOutInfo []QueryWarehouseOutInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_warehouseout_info"`
14
 	QueryWarehouseOutInfo []QueryWarehouseOutInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_warehouseout_info"`
15
 	QueryCancelStockInfo  []QueryCancelStockInfo  `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_cancel_stock_info"`
15
 	QueryCancelStockInfo  []QueryCancelStockInfo  `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_cancel_stock_info"`
16
 	GoodsType             GoodsType               `gorm:"ForeignKey:GoodTypeId;AssociationForeignKey:ID" json:"type"`
16
 	GoodsType             GoodsType               `gorm:"ForeignKey:GoodTypeId;AssociationForeignKey:ID" json:"type"`
17
+	RegisterNumber        string                  `gorm:"column:register_number" json:"register_number" form:"register_number"`
17
 }
18
 }
18
 
19
 
19
 func (StockInfo) TableName() string {
20
 func (StockInfo) TableName() string {

+ 1 - 0
service/stock_service.go Целия файл

246
 		"packing_price":                  goodInfo.PackingPrice,
246
 		"packing_price":                  goodInfo.PackingPrice,
247
 		"default_count_unit":             goodInfo.DefaultCountUnit,
247
 		"default_count_unit":             goodInfo.DefaultCountUnit,
248
 		"min_unit":                       goodInfo.MinUnit,
248
 		"min_unit":                       goodInfo.MinUnit,
249
+		"register_number":                goodInfo.RegisterNumber,
249
 	}).Error
250
 	}).Error
250
 
251
 
251
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})
252
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})