[qyweixin]

This commit is contained in:
jiangyong27 2025-01-10 20:00:54 +08:00
parent c566fcd3f1
commit 0f0c63972f
4 changed files with 29 additions and 3 deletions

View File

@ -23,7 +23,21 @@ addr="127.0.0.1:6379"
db=0
password=""
[qyweixin]
corpid = "ww43c49db2e88a17f8"
hr_agent = "3010185"
hr_secret = "Ko2UQWZPbdM9N1snukp_1CT_3J7CcReyPAzl3ww2xoo"
enterprise_agent = "1000009"
enterprise_secret = "oMB24UhKe50-XPTg7vhnwoTuhEXaq5XeiHPAUtF4hOs"
approve_secret = "xJOClC5V2pPon1azgrAzf5kq1TB72xZ3ScR7O5G3lQo"
approve_agent = "3010040"
checkin_agent = "3010011"
checkin_secret = "6ljYNGt4DonZLmr9SCtgkTlOvtqmsOchBrTWwGl_GpU"
checkin_group = "1,2"
checkin_pay_thresold = 11
checkin_onduty_pay_day = ""
pay_secret = "JCGsxntR4E7wrEEQvWGr8_wdKtRlw48n-W6zd8lbwc4"
pay_agent = "3010046"
[wxpay]
pay_key_pem = "conf/wxpay/apiclient_key.pem"

View File

@ -83,6 +83,9 @@ func (a *Approve) handleApprovalChange(msg *message.MixMessage) {
log.Errorf("get spn detail error :%s", err.Error())
return
}
if detail == nil {
}
log.Infof("spno: %s detail: %s", spNo, goutil.EncodeJSON(detail))
if templateId == a.corpConfig.TplIdRefund {

View File

@ -14,8 +14,16 @@ import (
)
type Checkin struct {
corp *model.Corp
corpConfig *model.CorpConfig
}
func NewCheckin(corp *model.Corp) *Checkin {
return &Checkin{
corp: corp,
corpConfig: corp.GetConfig(),
}
}
func (c *Checkin) SyncCheckinMonth(month string) error {
if month == "" {
month = time.Now().AddDate(0, -1, 0).Format("200601")

View File

@ -8,10 +8,12 @@ import (
)
func Init() error {
corp, _ := dao.NewCorpDao().Get(1000)
timezone, _ := time.LoadLocation("Asia/Shanghai")
cron := gocron.NewScheduler(timezone)
staff := new(Staff)
checkIn := new(Checkin)
checkIn := NewCheckin(corp)
// 每天同步企业人事信息
cron.Every(1).Day().At("01:00").Do(func() {
@ -34,7 +36,6 @@ func Init() error {
lastMonth := time.Now().AddDate(0, -1, 0).Format("200601")
checkIn.SyncCheckinMonth("")
corp, _ := dao.NewCorpDao().Get(1000)
approve := NewApproval(corp)
approve.Sync(lastMonth, model.ApprovalTypeCheckin)
approve.Sync(lastMonth, model.ApprovalTypeVacation)