templateid

This commit is contained in:
jiangyong 2024-01-07 23:23:37 +08:00
parent 598b205052
commit c67818f644
4 changed files with 11 additions and 7 deletions

View File

@ -27,7 +27,7 @@ func main22() {
global.InitGlobal() global.InitGlobal()
//cfg := config.GetConfig() //cfg := config.GetConfig()
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
new(worker.Approval).Sync(time.Now().AddDate(0, 0-i, 0).Format("200601"), model.ApprovalTypeVacation) new(worker.Approval).Sync(time.Now().AddDate(0, 0-i, 0).Format("200601"), model.ApprovalTypeRefund)
} }
} }

View File

@ -6,6 +6,10 @@ var (
ApprovalTypeRefund = "refund" ApprovalTypeRefund = "refund"
ApprovalTypeCheckin = "checkin" ApprovalTypeCheckin = "checkin"
ApprovalTypeVacation = "vacation" ApprovalTypeVacation = "vacation"
ApprovalTpIdCheckin = "C4UCJS891Afmu1rE1Ws6cvph7YHqebWtt7KRFqh8c"
ApprovalTpIdRefund = "C4UE6NT3ZE7XzER9TBk2ynHEeqA11NE2GGCuBq5yH"
ApprovalTpIdVacation = "3WLJF6naF5jhnXvwisuPmE85wVMYcy1S1ZvYibkw"
) )
type ApprovalRefund struct { type ApprovalRefund struct {

View File

@ -64,11 +64,11 @@ 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 templateId == model.ApprovalTypeRefund { if templateId == model.ApprovalTpIdRefund {
a.handleRefund(detail) a.handleRefund(detail)
} else if templateId == model.ApprovalTypeVacation { } else if templateId == model.ApprovalTpIdVacation {
a.handleVacation(detail) a.handleVacation(detail)
} else if templateId == model.ApprovalTypeCheckin { } else if templateId == model.ApprovalTpIdCheckin {
a.handleCheckin(detail) a.handleCheckin(detail)
} }
} }

View File

@ -14,11 +14,11 @@ type Approval struct {
func (s *Approval) getTemplateId(tp string) string { func (s *Approval) getTemplateId(tp string) string {
if tp == model.ApprovalTypeCheckin { if tp == model.ApprovalTypeCheckin {
return "C4UCJS891Afmu1rE1Ws6cvph7YHqebWtt7KRFqh8c" return model.ApprovalTpIdCheckin
} else if tp == model.ApprovalTypeRefund { } else if tp == model.ApprovalTypeRefund {
return "C4UE6NT3ZE7XzER9TBk2ynHEeqA11NE2GGCuBq5yH" return model.ApprovalTpIdRefund
} else if tp == model.ApprovalTypeVacation { } else if tp == model.ApprovalTypeVacation {
return "3WLJF6naF5jhnXvwisuPmE85wVMYcy1S1ZvYibkw" return model.ApprovalTpIdVacation
} }
return "" return ""
} }