陈少旭 4 months ago
parent
commit
e7741b540f

+ 2 - 0
controllers/admin_api_controllers/admin_api_router_register.go View File

17
 	beego.Router("/admin/api/custom/edit", &CustomAPIController{}, "post:ModifyCustom")
17
 	beego.Router("/admin/api/custom/edit", &CustomAPIController{}, "post:ModifyCustom")
18
 	beego.Router("/admin/api/custom/list", &CustomAPIController{}, "get:GetCustomList")
18
 	beego.Router("/admin/api/custom/list", &CustomAPIController{}, "get:GetCustomList")
19
 	beego.Router("/admin/api/custom/get", &CustomAPIController{}, "get:GetCustom")
19
 	beego.Router("/admin/api/custom/get", &CustomAPIController{}, "get:GetCustom")
20
+	beego.Router("/admin/api/custom/check", &CustomAPIController{}, "post:CheckCustom")
21
+
20
 	//beego.Router("/admin/api/checkcustom/get", &CustomAPIController{}, "get:GetWaitCheckCustom")
22
 	//beego.Router("/admin/api/checkcustom/get", &CustomAPIController{}, "get:GetWaitCheckCustom")
21
 
23
 
22
 	beego.Router("/admin/api/paymentcollection/create", &CustomAPIController{}, "post:CreatePaymentCollection")
24
 	beego.Router("/admin/api/paymentcollection/create", &CustomAPIController{}, "post:CreatePaymentCollection")

+ 21 - 0
controllers/admin_api_controllers/custom_api_controller.go View File

12
 	AdminBaseAPIAuthController
12
 	AdminBaseAPIAuthController
13
 }
13
 }
14
 
14
 
15
+func (this *CustomAPIController) CheckCustom() {
16
+	id, _ := this.GetInt64("id")
17
+	ci, _ := service.FindCustomInfoByID(id)
18
+	if ci.ID == 0 {
19
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
20
+		return
21
+	}
22
+	ci.IsCheck = 1
23
+	ci.CheckPerson = this.GetAdminInfo().Name
24
+	err := service.SaveCustom(&ci)
25
+	if err != nil {
26
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
27
+		return
28
+	}
29
+	this.ServeSuccessJSON(map[string]interface{}{
30
+		"msg": "审核成功",
31
+	})
32
+
33
+}
34
+
15
 func (this *CustomAPIController) CreateCustom() {
35
 func (this *CustomAPIController) CreateCustom() {
16
 	name := this.GetString("name")
36
 	name := this.GetString("name")
17
 	//xtOrgID := this.GetString("xt_org_id")
37
 	//xtOrgID := this.GetString("xt_org_id")
621
 		Remark:        remark,
641
 		Remark:        remark,
622
 		Ctime:         ctime,
642
 		Ctime:         ctime,
623
 		Mtime:         mtime,
643
 		Mtime:         mtime,
644
+		Status:        1,
624
 	}
645
 	}
625
 	err := service.SaveChargeContract(&contract)
646
 	err := service.SaveChargeContract(&contract)
626
 	if err != nil {
647
 	if err != nil {

+ 2 - 0
models/custom.go View File

116
 	KyyChargeDemand               []*KyyChargeDemand            `gorm:"ForeignKey:ID;AssociationForeignKey:CustomId" json:"cd"`
116
 	KyyChargeDemand               []*KyyChargeDemand            `gorm:"ForeignKey:ID;AssociationForeignKey:CustomId" json:"cd"`
117
 	KyyChargeFollow               []*KyyChargeFollow            `gorm:"ForeignKey:ID;AssociationForeignKey:CustomId" json:"cf"`
117
 	KyyChargeFollow               []*KyyChargeFollow            `gorm:"ForeignKey:ID;AssociationForeignKey:CustomId" json:"cf"`
118
 	KyyChargeRenewal              []*KyyChargeRenewal           `gorm:"ForeignKey:ID;AssociationForeignKey:CustomId" json:"cr"`
118
 	KyyChargeRenewal              []*KyyChargeRenewal           `gorm:"ForeignKey:ID;AssociationForeignKey:CustomId" json:"cr"`
119
+	IsCheck                       int64                         `gorm:"column:is_check" json:"is_check" form:"is_check"`
120
+	CheckPerson                   string                        `gorm:"column:check_person" json:"check_person" form:"check_person"`
119
 }
121
 }
120
 
122
 
121
 func (KyyChargeCustom) TableName() string {
123
 func (KyyChargeCustom) TableName() string {

+ 11 - 7
service/custom_service.go View File

12
 	return
12
 	return
13
 }
13
 }
14
 
14
 
15
+func SaveCustom(admin *models.KyyChargeCustom) (err error) {
16
+	err = ChargeWriteDB().Model(&models.KyyChargeCustom{}).Create(&admin).Error
17
+	return
18
+}
15
 func GetAllCustoms() (cus []*models.KyyChargeCustom, err error) {
19
 func GetAllCustoms() (cus []*models.KyyChargeCustom, err error) {
16
 	err = ChargeReadDB().Model(&models.KyyChargeCustomTwo{}).Where("status = 1").Find(&cus).Error
20
 	err = ChargeReadDB().Model(&models.KyyChargeCustomTwo{}).Where("status = 1").Find(&cus).Error
17
 	return
21
 	return
65
 }
69
 }
66
 
70
 
67
 func CreateChargePaymentCollection(cpc *models.KyyChargePaymentCollection) (err error) {
71
 func CreateChargePaymentCollection(cpc *models.KyyChargePaymentCollection) (err error) {
68
-	err = ChargeWriteDB().Save(cpc).Error
72
+	err = ChargeWriteDB().Save(&cpc).Error
69
 	return
73
 	return
70
 }
74
 }
71
 
75
 
72
 func SaveChargePaymentCollection(cpc *models.KyyChargePaymentCollection) (err error) {
76
 func SaveChargePaymentCollection(cpc *models.KyyChargePaymentCollection) (err error) {
73
-	err = ChargeWriteDB().Save(cpc).Error
77
+	err = ChargeWriteDB().Save(&cpc).Error
74
 	return
78
 	return
75
 }
79
 }
76
 
80
 
80
 }
84
 }
81
 
85
 
82
 func SaveChargeContact(chargeContact *models.KyyChargeContact) (err error) {
86
 func SaveChargeContact(chargeContact *models.KyyChargeContact) (err error) {
83
-	err = ChargeWriteDB().Save(chargeContact).Error
87
+	err = ChargeWriteDB().Save(&chargeContact).Error
84
 	return
88
 	return
85
 }
89
 }
86
 
90
 
90
 }
94
 }
91
 
95
 
92
 func SaveChargeContract(chargeContract *models.KyyChargeContract) (err error) {
96
 func SaveChargeContract(chargeContract *models.KyyChargeContract) (err error) {
93
-	err = ChargeWriteDB().Save(chargeContract).Error
97
+	err = ChargeWriteDB().Save(&chargeContract).Error
94
 	return
98
 	return
95
 }
99
 }
96
 
100
 
100
 }
104
 }
101
 
105
 
102
 func SaveChargeFollow(chargeFollow *models.KyyChargeFollow) (err error) {
106
 func SaveChargeFollow(chargeFollow *models.KyyChargeFollow) (err error) {
103
-	err = ChargeWriteDB().Save(chargeFollow).Error
107
+	err = ChargeWriteDB().Save(&chargeFollow).Error
104
 	return
108
 	return
105
 }
109
 }
106
 
110
 
110
 }
114
 }
111
 
115
 
112
 func SaveChargeDemand(cd *models.KyyChargeDemand) (err error) {
116
 func SaveChargeDemand(cd *models.KyyChargeDemand) (err error) {
113
-	err = ChargeWriteDB().Save(cd).Error
117
+	err = ChargeWriteDB().Save(&cd).Error
114
 	return
118
 	return
115
 }
119
 }
116
 
120
 
120
 }
124
 }
121
 
125
 
122
 func SaveChargeRenewal(chargeRenewal *models.KyyChargeRenewal) (err error) {
126
 func SaveChargeRenewal(chargeRenewal *models.KyyChargeRenewal) (err error) {
123
-	err = ChargeWriteDB().Save(chargeRenewal).Error
127
+	err = ChargeWriteDB().Save(&chargeRenewal).Error
124
 	return
128
 	return
125
 }
129
 }
126
 
130