|
|
@@ -21,6 +21,7 @@ import (
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
+ "unicode/utf8"
|
|
|
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
|
|
|
@@ -1639,25 +1640,28 @@ func (this *OilSupplierCertController) SendingSMS() {
|
|
|
where := "b.InFlag = '1'"
|
|
|
svcsupp.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 0, 0, "Id", true, &list, where)
|
|
|
currenttime := time.Now()
|
|
|
-
|
|
|
+ loginName := "TimingTask"
|
|
|
+ if this.User != nil {
|
|
|
+ loginName = this.User.Username
|
|
|
+ }
|
|
|
for _, item := range list {
|
|
|
if currenttime.AddDate(0, 3, 0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
|
|
|
toMobile := item.Mobile
|
|
|
msg := "您的" + item.SupplierTypeName + "准入还有3个月到期"
|
|
|
msgService := msg2.GetMsgService(utils.DBE)
|
|
|
- msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), this.User.Username)
|
|
|
+ msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), loginName)
|
|
|
}
|
|
|
if currenttime.AddDate(0, 2, 0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
|
|
|
toMobile := item.Mobile
|
|
|
msg := "您的" + item.SupplierTypeName + "准入还有2个月到期"
|
|
|
msgService := msg2.GetMsgService(utils.DBE)
|
|
|
- msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), this.User.Username)
|
|
|
+ msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), loginName)
|
|
|
}
|
|
|
if currenttime.AddDate(0, 1, 0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
|
|
|
toMobile := item.Mobile
|
|
|
msg := "您的" + item.SupplierTypeName + "准入还有1个月到期"
|
|
|
msgService := msg2.GetMsgService(utils.DBE)
|
|
|
- msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), this.User.Username)
|
|
|
+ msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), loginName)
|
|
|
}
|
|
|
}
|
|
|
elapsed := time.Since(t)
|
|
|
@@ -1678,10 +1682,21 @@ func (this *OilSupplierCertController) SendingSMSSupplierFile() {
|
|
|
|
|
|
if err == nil {
|
|
|
for _, item := range expireFile {
|
|
|
+ fileName := ""
|
|
|
+ if utf8.RuneCountInString(item.NeedAllFile) > 50 {
|
|
|
+ fileName = item.NeedAllFile[0: 120]
|
|
|
+ fileName = fileName[0: strings.LastIndex(fileName, ";")] + "等资质"
|
|
|
+ } else {
|
|
|
+ fileName = item.NeedAllFile
|
|
|
+ }
|
|
|
toMobile := item.Mobile
|
|
|
- msg := "您的" + item.ExpireAllFile + "还有1个月到期"
|
|
|
+ msg := "您的" + fileName + "还有1个月到期"
|
|
|
msgService := msg2.GetMsgService(utils.DBE)
|
|
|
- msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), this.User.Username)
|
|
|
+ loginName := "TimingTask"
|
|
|
+ if this.User != nil {
|
|
|
+ loginName = this.User.Username
|
|
|
+ }
|
|
|
+ msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId), loginName)
|
|
|
}
|
|
|
}
|
|
|
elapsed := time.Since(t)
|