diff --git a/common/config/config.go b/common/config/config.go index ea672d7..384b6f8 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -36,20 +36,9 @@ type Redis struct { } type QyWeixin struct { - Corpid string `toml:"corpid"` - - CheckinAgent string `toml:"checkin_agent"` - CheckinSecret string `toml:"checkin_secret"` - CheckinGroup string `toml:"checkin_group"` - CheckinPayThresold float64 `toml:"checkin_pay_thresold"` - CheckinOndutyPayDay string `toml:"checkin_onduty_pay_day"` - + Corpid string `toml:"corpid"` EnterpriseAgent string `toml:"enterprise_agent"` EnterpriseSecret string `toml:"enterprise_secret"` - HrAgent string `toml:"hr_agent"` - HrSecret string `toml:"hr_secret"` - PaySecret string `toml:"pay_secret"` - PayAgent string `toml:"pay_agent"` ApproveAgent string `toml:"approve_agent"` ApproveSecret string `toml:"approve_secret"` } diff --git a/server/controller/qyweixin.go b/server/controller/qyweixin.go index 631a40e..2227767 100644 --- a/server/controller/qyweixin.go +++ b/server/controller/qyweixin.go @@ -46,8 +46,8 @@ func (q *QyWeixin) Pay(ctx *gin.Context) { // 获取openid approve := qyweixin.NewAppApprove(&qyweixin.AppConfig{ Corpid: config.GetConfig().QyWeixin.Corpid, - Secret: config.GetConfig().QyWeixin.ApproveSecret, - Agent: config.GetConfig().QyWeixin.ApproveAgent, + Secret: config.GetConfig().QyWeixin.EnterpriseSecret, + Agent: config.GetConfig().QyWeixin.EnterpriseAgent, }) openid, err := approve.GetOpenid(userid) if err != nil { @@ -62,8 +62,8 @@ func (q *QyWeixin) Pay(ctx *gin.Context) { req.TotalAmount = amount qyPay := qyweixin.NewAppPay(&qyweixin.PayConfig{ Corpid: config.GetConfig().QyWeixin.Corpid, - Secret: config.GetConfig().QyWeixin.PaySecret, - Agent: config.GetConfig().QyWeixin.PayAgent, + Secret: config.GetConfig().QyWeixin.EnterpriseSecret, + Agent: config.GetConfig().QyWeixin.EnterpriseAgent, SerialNumber: config.GetConfig().WxPay.PaySerialNumber, ApiKey: config.GetConfig().WxPay.PayApiKeyV2, MchId: config.GetConfig().WxPay.PayMchId, diff --git a/server/service/qyweixin_approve.go b/server/service/qyweixin_approve.go index ca71a01..b319b7b 100644 --- a/server/service/qyweixin_approve.go +++ b/server/service/qyweixin_approve.go @@ -162,8 +162,8 @@ func (a *Approve) handleRefund(detail *qyweixin.ApproveDetail) { req.TotalAmount = int64(100 * newData.RefundAmount) qyPay := qyweixin.NewAppPay(&qyweixin.PayConfig{ Corpid: config.GetConfig().QyWeixin.Corpid, - Secret: config.GetConfig().QyWeixin.PaySecret, - Agent: config.GetConfig().QyWeixin.PayAgent, + Secret: config.GetConfig().QyWeixin.EnterpriseSecret, + Agent: config.GetConfig().QyWeixin.EnterpriseAgent, SerialNumber: config.GetConfig().WxPay.PaySerialNumber, ApiKey: config.GetConfig().WxPay.PayApiKeyV2, MchId: config.GetConfig().WxPay.PayMchId, diff --git a/worker/checkin.go b/worker/checkin.go index 764c2ea..b034127 100644 --- a/worker/checkin.go +++ b/worker/checkin.go @@ -25,8 +25,8 @@ func (c *Checkin) SyncCheckinMonth(month string) error { qyw := qyweixin.NewAppCheckin(&qyweixin.AppConfig{ Corpid: cfg.QyWeixin.Corpid, - Secret: cfg.QyWeixin.CheckinSecret, - Agent: cfg.QyWeixin.CheckinAgent, + Secret: cfg.QyWeixin.EnterpriseSecret, + Agent: cfg.QyWeixin.EnterpriseAgent, }) users, err := qyw.GetCheckinEmployee(nil) if err != nil { @@ -48,8 +48,8 @@ func (c *Checkin) SyncCheckinDay(day string) { cfg := config.GetConfig() qyw := qyweixin.NewAppCheckin(&qyweixin.AppConfig{ Corpid: cfg.QyWeixin.Corpid, - Secret: cfg.QyWeixin.CheckinSecret, - Agent: cfg.QyWeixin.CheckinAgent, + Secret: cfg.QyWeixin.EnterpriseSecret, + Agent: cfg.QyWeixin.EnterpriseAgent, }) if day == "" { day = time.Now().AddDate(0, 0, -1).Format("2006-01-02") diff --git a/worker/staff.go b/worker/staff.go index 736c6d7..b421360 100644 --- a/worker/staff.go +++ b/worker/staff.go @@ -49,8 +49,8 @@ func (s *Staff) SyncStaffInfo() { cfg := config.GetConfig() hrAssiant := qyweixin.NewAppHr(&qyweixin.AppConfig{ Corpid: cfg.QyWeixin.Corpid, - Secret: cfg.QyWeixin.HrSecret, - Agent: cfg.QyWeixin.HrSecret, + Secret: cfg.QyWeixin.EnterpriseSecret, + Agent: cfg.QyWeixin.EnterpriseAgent, }) userConfigs, err := dao.NewUserConfigDao().Query(model.UserConfigStatusNormal)