tuoling805 2 年之前
父節點
當前提交
2ae3303787
共有 1 個文件被更改,包括 24 次插入0 次删除
  1. 24 0
      controllers/business_trip/business_apply.go

+ 24 - 0
controllers/business_trip/business_apply.go

@@ -581,6 +581,13 @@ func (this *BusinessTrip) Delete() {
 		this.FailWithMessage("删除失败!", "删除失败!DeleteBusinessApply:"+err.Error())
 		return
 	}
+	if businessApplyItem.PeerPeopleId != "" {
+		err = business_trip.DeleteBusinessApplyPeer(businessApplyItem.BusinessApplyId)
+		if err != nil {
+			this.FailWithMessage("删除失败!", "删除失败!DeleteBusinessApplyPeer:"+err.Error())
+			return
+		}
+	}
 	//删除系统消息
 	go company_approval_message.DeleteCompanyApprovalMessage(req.BusinessApplyId, 10)
 	this.OkWithMessage("删除成功")
@@ -645,6 +652,23 @@ func (this *BusinessTrip) Back() {
 		return
 	}
 
+	if businessApplyItem.PeerPeopleId != "" {
+		peerWhereParams := make(map[string]interface{})
+		peerUpdateParams := make(map[string]interface{})
+
+		whereParams["business_apply_id"] = req.BusinessApplyId
+
+		peerUpdateParams["status"] = "已撤回"
+		peerUpdateParams["modify_time"] = time.Now()
+
+		err = business_trip.UpdateBusinessApplyPeer(peerWhereParams, peerUpdateParams)
+
+		if err != nil {
+			this.FailWithMessage("撤回失败", "撤回失败!UpdateBusinessApplyPeer:"+err.Error())
+			return
+		}
+	}
+
 	//删除系统消息
 	go company_approval_message.DeleteCompanyApprovalMessage(req.BusinessApplyId, 10)