[qyweixin]
This commit is contained in:
parent
c566fcd3f1
commit
0f0c63972f
|
@ -23,7 +23,21 @@ addr="127.0.0.1:6379"
|
||||||
db=0
|
db=0
|
||||||
password=""
|
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]
|
[wxpay]
|
||||||
pay_key_pem = "conf/wxpay/apiclient_key.pem"
|
pay_key_pem = "conf/wxpay/apiclient_key.pem"
|
||||||
|
|
|
@ -83,6 +83,9 @@ func (a *Approve) handleApprovalChange(msg *message.MixMessage) {
|
||||||
log.Errorf("get spn detail error :%s", err.Error())
|
log.Errorf("get spn detail error :%s", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if detail == nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
log.Infof("spno: %s detail: %s", spNo, goutil.EncodeJSON(detail))
|
log.Infof("spno: %s detail: %s", spNo, goutil.EncodeJSON(detail))
|
||||||
if templateId == a.corpConfig.TplIdRefund {
|
if templateId == a.corpConfig.TplIdRefund {
|
||||||
|
|
|
@ -14,8 +14,16 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Checkin struct {
|
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 {
|
func (c *Checkin) SyncCheckinMonth(month string) error {
|
||||||
if month == "" {
|
if month == "" {
|
||||||
month = time.Now().AddDate(0, -1, 0).Format("200601")
|
month = time.Now().AddDate(0, -1, 0).Format("200601")
|
||||||
|
|
|
@ -8,10 +8,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Init() error {
|
func Init() error {
|
||||||
|
|
||||||
|
corp, _ := dao.NewCorpDao().Get(1000)
|
||||||
timezone, _ := time.LoadLocation("Asia/Shanghai")
|
timezone, _ := time.LoadLocation("Asia/Shanghai")
|
||||||
cron := gocron.NewScheduler(timezone)
|
cron := gocron.NewScheduler(timezone)
|
||||||
staff := new(Staff)
|
staff := new(Staff)
|
||||||
checkIn := new(Checkin)
|
checkIn := NewCheckin(corp)
|
||||||
|
|
||||||
// 每天同步企业人事信息
|
// 每天同步企业人事信息
|
||||||
cron.Every(1).Day().At("01:00").Do(func() {
|
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")
|
lastMonth := time.Now().AddDate(0, -1, 0).Format("200601")
|
||||||
checkIn.SyncCheckinMonth("")
|
checkIn.SyncCheckinMonth("")
|
||||||
|
|
||||||
corp, _ := dao.NewCorpDao().Get(1000)
|
|
||||||
approve := NewApproval(corp)
|
approve := NewApproval(corp)
|
||||||
approve.Sync(lastMonth, model.ApprovalTypeCheckin)
|
approve.Sync(lastMonth, model.ApprovalTypeCheckin)
|
||||||
approve.Sync(lastMonth, model.ApprovalTypeVacation)
|
approve.Sync(lastMonth, model.ApprovalTypeVacation)
|
||||||
|
|
Loading…
Reference in New Issue