Example #1
0
        /// <summary>
        /// 订单取消发送订单取消通知模板消息
        /// </summary>
        /// <param name="pinOrder"></param>
        public void SendTemplateMsg_PayCancel(PinGoodsOrder pinOrder)
        {
            PinStore store = PinStoreBLL.SingleModel.GetModelByAid_Id(pinOrder.aid, pinOrder.storeId);

            if (store == null && pinOrder.orderType == 0)
            {
                log4net.LogHelper.WriteError(GetType(), new Exception($"拼享惠发送订单取消模板消息失败,找不到店铺信息 aid:{pinOrder.aid}, storeid:{pinOrder.storeId}"));
                return;
            }

            //如果未支付,获取预支付码的formid是无效的,要取消
            if (pinOrder.payState == (int)PayState.未付款)
            {
                C_UserInfo userInfo = C_UserInfoBLL.SingleModel.GetModel(pinOrder.userId);
                if (userInfo == null)
                {
                    log4net.LogHelper.WriteError(GetType(), new Exception($"拼享惠发送订单取消模板消息失败,找不到用户信息 userid:{pinOrder.userId}"));
                    return;
                }
                TemplateMsg_UserParam userParam = TemplateMsg_UserParamBLL.SingleModel.GetModel($" Form_Id is not null and appId = '{userInfo.appId}'  and  Open_Id = '{userInfo.OpenId}' and State = 1 and LoseDateTime > now() and orderId={pinOrder.id} ");
                if (userParam != null)
                {
                    userParam.State = -1;
                    TemplateMsg_UserParamBLL.SingleModel.Update(userParam, "state");
                }
            }
            //发给用户通知
            object orderData = TemplateMsg_Miniapp.PinGetTemplateMessageData(SendTemplateMessageTypeEnum.拼享惠订单取消通知, order: pinOrder, store: store);

            TemplateMsg_Miniapp.SendTemplateMessage(pinOrder.userId, SendTemplateMessageTypeEnum.拼享惠订单取消通知, TmpType.拼享惠, orderData, $"pages/shopping/orderInfo/orderInfo?orderid={pinOrder.id}&storeid={pinOrder.storeId}");
        }
Example #2
0
        /// <summary>
        /// 订单配送通知模板消息
        /// </summary>
        /// <param name="pinOrder"></param>
        public void SendTemplateMsg_Send(PinGoodsOrder pinOrder)
        {
            PinStore store = PinStoreBLL.SingleModel.GetModelByAid_Id(pinOrder.aid, pinOrder.storeId);

            if (store == null && pinOrder.orderType == 0)
            {
                log4net.LogHelper.WriteError(GetType(), new Exception($"拼享惠订单配送模板消息失败,找不到店铺信息 aid:{pinOrder.aid}, storeid:{pinOrder.storeId}"));
                return;
            }
            //发给用户通知
            object orderData = TemplateMsg_Miniapp.PinGetTemplateMessageData(SendTemplateMessageTypeEnum.拼享惠订单配送通知, order: pinOrder, store: store);

            TemplateMsg_Miniapp.SendTemplateMessage(pinOrder.userId, SendTemplateMessageTypeEnum.拼享惠订单配送通知, TmpType.拼享惠, orderData, $"pages/shopping/orderInfo/orderInfo?orderid={pinOrder.id}&storeid={pinOrder.storeId}");
        }
Example #3
0
        public ActionResult SendComplaintResult(int aid, int id = 0, string resultMsg = "")
        {
            if (aid <= 0 || id <= 0)
            {
                result.msg = "参数错误";
                return(Json(result));
            }
            if (string.IsNullOrEmpty(resultMsg))
            {
                result.msg = "处理结果不能为空";
                return(Json(result));
            }
            if (resultMsg.Length > 100)
            {
                result.msg = "处理结果不能超过100字";
                return(Json(result));
            }

            PinComplaint complaint = PinComplaintBLL.SingleModel.GetModelByAid_Id(aid, id);

            if (complaint == null)
            {
                result.msg = "申诉不存在";
                return(Json(result));
            }
            complaint.state  = (int)ComplaintState.已处理;
            complaint.result = resultMsg;
            if (PinComplaintBLL.SingleModel.Update(complaint, "state,result"))
            {
                result.code = 1;

                //发给用户通知
                object orderData = TemplateMsg_Miniapp.PinGetTemplateMessageData(SendTemplateMessageTypeEnum.拼享惠发送申诉结果通知, complaint);
                TemplateMsg_Miniapp.SendTemplateMessage(complaint.userId, SendTemplateMessageTypeEnum.拼享惠发送申诉结果通知, TmpType.拼享惠, orderData);
                result.msg = "发送成功";
            }
            else
            {
                result.msg = "发送失败";
            }
            return(Json(result));
        }