|
@@ -699,8 +699,14 @@ func (this *BusinessTrip) ApplyDetail() {
|
|
|
this.FailWithMessage("获取数据失败", "获取数据失败:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
if item.ApproveId == sysUserId {
|
|
|
item.IsApprove = true
|
|
|
+ item.IsClose = true
|
|
|
+ }
|
|
|
+ if sysUserId == item.BusinessApplyId {
|
|
|
+ item.IsClose = true
|
|
|
}
|
|
|
this.OkDetailed(item, "获取成功")
|
|
|
}
|
|
@@ -734,9 +740,18 @@ func (this *BusinessTrip) Close() {
|
|
|
this.FailWithMessage("获取数据失败!", "获取数据失败!GetBusinessApplyById:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
+ if sysUser.AdminId != businessApplyItem.BusinessApplyId && sysUser.AdminId != businessApplyItem.ApproveId {
|
|
|
+ this.FailWithMessage("无权操作", "无权操作")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ isApply := false
|
|
|
+ if sysUser.AdminId == businessApplyItem.ApplyAdminId {
|
|
|
+ isApply = true
|
|
|
+ }
|
|
|
|
|
|
- fmt.Println(req.BusinessApplyId)
|
|
|
- fmt.Println(req.CloseReason)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
whereParams := make(map[string]interface{})
|
|
|
updateParams := make(map[string]interface{})
|
|
@@ -767,23 +782,33 @@ func (this *BusinessTrip) Close() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ receiveUserId := businessApplyItem.ApplyAdminId
|
|
|
+ if isApply {
|
|
|
+ receiveUserId = businessApplyItem.ApproveId
|
|
|
+ }
|
|
|
{
|
|
|
|
|
|
sourceType := 10
|
|
|
content := businessApplyItem.ApplyRealName + " " + businessApplyItem.Province + businessApplyItem.City + businessApplyItem.Reason + "出差申请已关闭"
|
|
|
- go services.AddCompanyApprovalMessage(sysUserId, businessApplyItem.ApplyAdminId, 0, businessApplyItem.BusinessApplyId, 1, sourceType, 1, "", content, content, "", "")
|
|
|
+ go services.AddCompanyApprovalMessage(sysUserId, receiveUserId, 0, businessApplyItem.BusinessApplyId, 1, sourceType, 1, "", content, content, "", "")
|
|
|
}
|
|
|
|
|
|
|
|
|
{
|
|
|
status := "已关闭"
|
|
|
- applyItem, _ := admin.GetAdminById(businessApplyItem.ApplyAdminId)
|
|
|
+ receiver, _ := admin.GetAdminById(receiveUserId)
|
|
|
+
|
|
|
wxAppPath := "pages-approve/businessTrip/detail?id=" + strconv.Itoa(req.BusinessApplyId)
|
|
|
first := "您的出差申请已被关闭"
|
|
|
+ if isApply {
|
|
|
+ first = fmt.Sprintf("%s的出差申请已关闭", businessApplyItem.ApplyRealName)
|
|
|
+ }
|
|
|
keyword1 := businessApplyItem.Reason + "出差申请" + status
|
|
|
keyword2 := status
|
|
|
var remark string
|
|
|
- go services.SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppPath, applyItem.Mobile)
|
|
|
+ go services.SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppPath, receiver.Mobile)
|
|
|
}
|
|
|
this.OkWithMessage("关闭成功")
|
|
|
}
|