浏览代码

已签回通知

xiexiaoyuan 2 年之前
父节点
当前提交
3525a02956
共有 2 个文件被更改,包括 14 次插入17 次删除
  1. 13 16
      services/seal/seal.go
  2. 1 1
      services/wechat_send_msg.go

+ 13 - 16
services/seal/seal.go

@@ -459,7 +459,7 @@ func UploadCheckBackFileByFile(sealId int, ext string, fileMulti multipart.File,
 		err = errors.New("文件保存失败,Err:" + err.Error())
 		return
 	}
-	oldStatus := sealInfo.Status
+
 	sealInfo.CheckBackFileUrl = resourceUrl
 	sealInfo.Status = "已签回"
 	sealInfo.ModifyTime = time.Now()
@@ -469,13 +469,11 @@ func UploadCheckBackFileByFile(sealId int, ext string, fileMulti multipart.File,
 		return
 	}
 
-	// TODO 发送模版消息
-	if oldStatus == "已审批" {
-		sellerInfo, tErr := admin.GetAdminById(sealInfo.UserId)
-		if tErr == nil {
-			if sellerInfo.Mobile != "" {
-				go services.SendSealFinishedWxTemplateMsg(sellerInfo.Mobile, sealInfo.CompanyName, sealInfo.SealId)
-			}
+	// 发送模版消息
+	sellerInfo, tErr := admin.GetAdminById(sealInfo.UserId)
+	if tErr == nil {
+		if sellerInfo.Mobile != "" {
+			go services.SendSealFinishedWxTemplateMsg(sellerInfo.Mobile, sealInfo.CompanyName, sealInfo.SealId)
 		}
 	}
 	return
@@ -494,7 +492,7 @@ func UploadCheckBackFile(sealId int, fileUrl string, opUser *custom.AdminWx) (se
 		err = errors.New("用印状态异常,不允许上传签回用印附件,当前用印状态:" + sealInfo.Status)
 		return
 	}
-	oldStatus := sealInfo.Status
+
 	sealInfo.CheckBackFileUrl = fileUrl
 	sealInfo.Status = "已签回"
 	sealInfo.ModifyTime = time.Now()
@@ -503,15 +501,14 @@ func UploadCheckBackFile(sealId int, fileUrl string, opUser *custom.AdminWx) (se
 	if err != nil {
 		return
 	}
-	// TODO 发送模版消息
-	if oldStatus == "已审批" {
-		sellerInfo, tErr := admin.GetAdminById(sealInfo.UserId)
-		if tErr == nil {
-			if sellerInfo.Mobile != "" {
-				go services.SendSealFinishedWxTemplateMsg(sellerInfo.Mobile, sealInfo.CompanyName, sealInfo.SealId)
-			}
+	// 发送模版消息
+	sellerInfo, tErr := admin.GetAdminById(sealInfo.UserId)
+	if tErr == nil {
+		if sellerInfo.Mobile != "" {
+			go services.SendSealFinishedWxTemplateMsg(sellerInfo.Mobile, sealInfo.CompanyName, sealInfo.SealId)
 		}
 	}
+
 	return
 }
 

+ 1 - 1
services/wechat_send_msg.go

@@ -448,7 +448,7 @@ func SendSealFinishedWxTemplateMsg(mobile string, companyName string, sealId int
 		sendMap["data"] = sendData
 
 		// TODO 随手办公小程序的跳转地址
-		wxAppPath := fmt.Sprintf("pages-approve/seal/detail?id=%d", sealId)
+		wxAppPath := fmt.Sprintf("pages-approve/seal/detail?SealId=%d", sealId)
 		sendMap["miniprogram"] = map[string]interface{}{"appid": utils.WxAppId2, "pagepath": wxAppPath}
 		err = sendTemplateMsg(sendUrl, sendMap, openIdList)
 	}