浏览代码

新增模板消息

tuoling805 2 年之前
父节点
当前提交
5d6a85489a
共有 2 个文件被更改,包括 16 次插入1 次删除
  1. 1 1
      controllers/business_trip/business_apply.go
  2. 15 0
      controllers/business_trip/business_approve.go

+ 1 - 1
controllers/business_trip/business_apply.go

@@ -198,7 +198,7 @@ func (this *BusinessTrip) ApplyAdd() {
 
 	//模板消息
 	{
-		wxAppPath := ""
+		wxAppPath := "pages-approve/businessTrip/detail?id=" + strconv.Itoa(int(applyId))
 		first := "您好,有新的申请待处理"
 		keyword1 := sysUser.RealName
 		keyword2 := sysUser.Mobile

+ 15 - 0
controllers/business_trip/business_approve.go

@@ -3,9 +3,11 @@ package business_trip
 import (
 	"encoding/json"
 	"github.com/rdlucklib/rdluck_tools/paging"
+	"hongze/hongze_mobile_admin/models/tables/admin"
 	"hongze/hongze_mobile_admin/models/tables/business_trip"
 	"hongze/hongze_mobile_admin/services"
 	"hongze/hongze_mobile_admin/utils"
+	"strconv"
 	"time"
 )
 
@@ -146,5 +148,18 @@ func (this *BusinessTrip) ApplyApprove() {
 		go services.AddCompanyApprovalMessage(sysUserId, businessApplyItem.ApplyAdminId, 0, businessApplyItem.BusinessApplyId, 1, sourceType, 2, "", content, content, "", "")
 	}
 
+	//模板消息
+	{
+		applyItem, _ := admin.GetAdminById(businessApplyItem.ApplyAdminId)
+		wxAppPath := "pages-approve/businessTrip/detail?id=" + strconv.Itoa(req.BusinessApplyId)
+		first := "您的出差申请已被审批"
+		keyword1 := businessApplyItem.Reason + "出差申请" + status
+		keyword2 := status
+		var remark string
+		if status == "已驳回" {
+			remark = req.RefuseReason
+		}
+		go services.SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppPath, applyItem.Mobile)
+	}
 	this.OkWithMessage("审批成功")
 }