Пример #1
0
        public ResultModel <object> GetOrderRecords(ParaModel <GetStatusPM_OpenApi> paramodel)
        {
            LogHelper.LogWriter("获取订单信息:", new { paramodel = paramodel });
            List <OrderRecordsLog> orderRecords = new OrderProvider().GetOrderRecords(paramodel.fields.order_no, paramodel.group).ToList();

            return(ResultModel <object> .Conclude(OrderApiStatusType.Success, orderRecords));
        }
Пример #2
0
        /// <summary>
        /// 设置信息
        /// </summary>
        /// <param name="model"></param>
        public void SetMessage(ParaModel model)
        {
            RangeValueInput_NDD input = null;
            RangeValue          value = null;

            S_RotateSpeed_TB.Text = model.S_RotateSpeed.ToString();

            if (model.S_InjectionTime > 0)
            {
                //模拟点击,选取了喷油次数规则
                ARuleContainer_MouseLeftButtonUp(Add_S_InjectionTime_Button, null);
                ((TextBox)S_InjectionTimeContainer.Children[2]).Text = model.S_InjectionTime.ToString();
            }

            if (model.R_InjectionQuantity != null)
            {
                //模拟点击
                ARuleContainer_MouseLeftButtonUp(Add_R_InjectionQuantity_Button, null);


                input = ((RangeValueInput_NDD)R_InjectionQuantityContainer.Children[2]);
                value = model.R_InjectionQuantity;

                //设置参数
                if (value.IsInfinity())
                {
                    input.SetRangeValue_Infinity(value.GetMin().ToString());
                }
                else
                {
                    input.SetRangeValue(value.GetMax().ToString(), value.GetMin().ToString());
                }
            }

            if (model.R_RackTravel != null)
            {
                //模拟点击
                ARuleContainer_MouseLeftButtonUp(Add_R_RackTravel_Button, null);

                input = ((RangeValueInput_NDD)R_RackTravelContainer.Children[2]);
                value = model.R_RackTravel;

                //设置参数
                if (value.IsInfinity())
                {
                    input.SetRangeValue_Infinity(value.GetMin().ToString());
                }
                else
                {
                    input.SetRangeValue(value.GetMax().ToString(), value.GetMin().ToString());
                }
            }

            if (model.R_Asymmetry > 0)
            {
                //模拟点击
                ARuleContainer_MouseLeftButtonUp(Add_R_Asymmetry_Button, null);
                ((TextBox)R_AsymmetryContainer.Children[2]).Text = model.R_Asymmetry.ToString();
            }
        }
Пример #3
0
 public ResultModel <object> ChangeStatus(ParaModel <ChangeStatusPM_OpenApi> paramodel)
 {
     paramodel.fields.groupid   = paramodel.group;
     paramodel.fields.remark    = "取消订单";          //TODO 第三方调用该接口时根据实际目标状态处理
     paramodel.fields.orderfrom = paramodel.group; //设置订单来源,其实就是订单对应的集团是什么
     return(new OrderProvider().UpdateOrderStatus_Other(paramodel.fields));
 }
Пример #4
0
    /// <summary>
    /// 取得異常時間、提醒訊息
    /// </summary>
    /// <returns></returns>
    private bool getPunchPara(out ParaModel paraData, out MsgParaModel paraMsgData)
    {
        bool result = false;
        var  msg    = "";

        paraData    = new ParaModel();
        paraMsgData = new MsgParaModel();

        var datas    = new PunchParaBean();
        var viewData = new PunchParaModel()
        {
            CompID = UserInfo.getUserInfo().CompID,
        };

        result = Punch.GetPunchPara(viewData, out datas, out msg);
        if (result && datas != null)
        {
            paraData    = Punch.paraFormat(datas.Para);
            paraMsgData = Punch.paraMsgFormat(datas.MsgPara);
        }
        else
        {
            throw new Exception("".Equals(msg) ? "查無資料" : msg);
        }
        return(result);
    }
Пример #5
0
        /// <summary>
        /// 设置信息
        /// </summary>
        /// <param name="model"></param>
        public void SetMessage(ParaModel model)
        {
            if (model != null)
            {
                S_RotateSpeed_TB.Text = model.S_RotateSpeed.ToString();

                if (model.S_InjectionTime > 0)
                {
                    S_InjectionTime_TB.Text = model.S_InjectionTime.ToString();
                    ((Grid)S_InjectionTime_TB.Parent).Visibility = Visibility.Visible;
                }

                if (model.R_InjectionQuantity != null)
                {
                    R_InjectionQuantity_TB.Text = model.R_InjectionQuantity.GetDisplayString();
                    ((Grid)R_InjectionQuantity_TB.Parent).Visibility = Visibility.Visible;
                }

                if (model.R_RackTravel != null)
                {
                    R_RackTravel_TB.Text = model.R_RackTravel.GetDisplayString();
                    ((Grid)R_RackTravel_TB.Parent).Visibility = Visibility.Visible;
                }

                if (model.R_Asymmetry > 0)
                {
                    R_Asymmetry_TB.Text = Math.Round(model.R_Asymmetry, PathStaticCollection.Round_Number).ToString();
                    ((Grid)R_Asymmetry_TB.Parent).Visibility = Visibility.Visible;
                }
            }
        }
Пример #6
0
        /// <summary>
        /// 首旅对接同步订单状态 caoheyang  20150527
        /// </summary>
        /// <param name="paramodel"></param>
        /// <returns></returns>
        public OrderApiStatusType AsyncStatus(ParaModel <AsyncStatusPM_OpenApi> paramodel)
        {
            int    status  = 0; //第三方订单状态物流状态,1代表已发货,2代表已签收
            string message = "";

            switch (paramodel.fields.status)
            {
            case OrderConst.OrderStatus1:
                status  = 1;    //订单已完成(已送达)
                message = "订单已完成";
                break;

            case OrderConst.OrderStatus2:
                status  = 2;    //订单已接单(已抢单)
                message = "订单已接单";
                break;

            case OrderConst.OrderStatus3:
                status  = 4;    //订单已取消
                message = "订单已取消";
                break;

            default:
                return(OrderApiStatusType.OtherError);
            }

            var paras = new
            {
                method  = "takenotify",
                app_key = app_key,
                fields  = new object[] { new
                                         {
                                             order_id     = paramodel.fields.OriginalOrderNo,
                                             order_status = status,
                                             message      = message,
                                             dis_name     = paramodel.fields.ClienterTrueName,
                                             dis_phone    = paramodel.fields.ClienterPhoneNo
                                         } }
            };
            string url = ConfigSettings.Instance.TourismAsyncStatusUrl;

            if (url == null)
            {
                return(OrderApiStatusType.SystemError);
            }
            string jsonss = JsonHelper.ToJson(paras);

            string json = new HttpClient().PostAsJsonAsync(url, paras).Result.Content.ReadAsStringAsync().Result;

            if (string.IsNullOrWhiteSpace(json))
            {
                return(OrderApiStatusType.ParaError);
            }
            JObject jobject = JObject.Parse(json);
            int     result  = jobject.Value <int>("Status"); //接口调用状态 区分大小写

            return(result == 0 ? OrderApiStatusType.Success : OrderApiStatusType.SystemError);
        }
Пример #7
0
        [OpenApiActionError] //异常过滤器 add by caoheyang 一旦发生异常,客户端返回系统内部错误提示
        public ResultModel <object> GetStatus(ParaModel <GetStatusPM_OpenApi> paramodel)
        {
            paramodel.fields.orderfrom = paramodel.group; //设置订单来源,其实就是订单对应的集团是什么
            int status = new OrderProvider().GetStatus(paramodel.fields.order_no, paramodel.fields.orderfrom);

            return(status < 0 ?
                   ResultModel <object> .Conclude(OrderApiStatusType.ParaError) : //订单不存在返回参数错误提示
                   ResultModel <object> .Conclude(OrderApiStatusType.Success, new { order_status = status }));
        }
Пример #8
0
        /// <summary>
        /// 回调回家吃饭同步订单状态
        /// 徐鹏程
        /// 2015-04-23
        /// </summary>
        /// <param name="paramodel"></param>
        /// <returns></returns>
        public OrderApiStatusType AsyncStatus(ParaModel <AsyncStatusPM_OpenApi> paramodel)
        {
            int status = 0; //第三方订单状态物流状态,1代表已发货,2代表已签收

            LogHelper.LogWriter(System.DateTime.Now.ToString() + "回调-第三方订单状态:" + paramodel.fields.status);
            switch (paramodel.fields.status)
            {
            case OrderConst.OrderStatus1:
                status = 2;     //订单已完成(已送达)
                break;

            case OrderConst.OrderStatus2:
                status = 1;     //订单已接单(已抢单)
                break;

            case OrderConst.OrderStatus3:
                status = 3;     //订单已取消
                break;

            default:
                return(OrderApiStatusType.OtherError);
            }
            string ts  = DateTime.Now.ToString();
            string url = ConfigurationManager.AppSettings["HomeForDinnerAsyncStatus"];

            if (url == null)
            {
                return(OrderApiStatusType.SystemError);
            }
            ///order_id	string	Y	订单ID ,根据订单ID改变对应的订单物流状态,一个订单只能修改一次,修改过再修改会报错。
            ///status	int	Y	物流状态,1代表已发货,2代表已签收
            ///send_phone	string	Y/N	配送员电话,物流状态传参是(ststus=1)的时候,配送员电话必须写,如果为(ststus=2)的时候可以不写。
            ///send_name	string	Y/N	配送员姓名,物流状态传参是(ststus=1)的时候,配送员姓名必须写,如果为(ststus=2)的时候可以不写。
            string strPostData = "app_key=" + app_key + "&sign=" + GetSign(ts) + "&updatetime=" + ts + "&order_id=" + paramodel.fields.OriginalOrderNo + "&status=" + status + "&dm_name=" + paramodel.fields.ClienterTrueName
                                 + "&dm_mobile=" + paramodel.fields.ClienterPhoneNo;
            string json = HTTPHelper.HttpPost(url, strPostData);

            LogHelper.LogWriter(System.DateTime.Now.ToString() + "回调-第三方url:" + url);
            LogHelper.LogWriter(System.DateTime.Now.ToString() + "回调-第三方strPostData:" + strPostData);
            if (string.IsNullOrWhiteSpace(json))
            {
                LogHelper.LogWriter(System.DateTime.Now.ToString() + "回调-结果:ParaError");
                return(OrderApiStatusType.ParaError);
            }
            else if (json == "null")
            {
                LogHelper.LogWriter(System.DateTime.Now.ToString() + "回调-结果:SystemError");
                return(OrderApiStatusType.SystemError);
            }
            JObject jobject = JObject.Parse(json);
            int     result  = jobject.Value <int>("status"); //接口调用状态 区分大小写

            LogHelper.LogWriter(System.DateTime.Now.ToString() + "回调-结果:status=" + result);
            return(result == 1 ? OrderApiStatusType.Success : OrderApiStatusType.SystemError);
        }
Пример #9
0
    /// <summary>
    /// 將Json資料解析
    /// </summary>
    /// <param name="dbDataList">DB資料</param>
    /// <returns>格式化後資料</returns>
    public static ParaModel paraFormat(string jsonStr)
    {
        JArray    jsAry    = JsonConvert.DeserializeObject <JArray>(jsonStr);
        ParaModel paraData = new ParaModel();

        paraData.DutyInBT   = jsAry[0]["DutyInBT"].ToString();
        paraData.DutyOutBT  = jsAry[0]["DutyOutBT"].ToString();
        paraData.PunchInBT  = jsAry[0]["PunchInBT"].ToString();
        paraData.PunchOutBT = jsAry[0]["PunchOutBT"].ToString();
        //paraData.VisitOVBT = jsAry[0]["VisitOVBT"].ToString();
        return(paraData);
    }
Пример #10
0
        /// <summary>
        /// 回调万达接口同步订单状态  add by caoheyang 20150326
        /// </summary>
        /// <param name="paramodel"></param>
        /// <returns></returns>
        public OrderApiStatusType AsyncStatus(ParaModel <AsyncStatusPM_OpenApi> paramodel)
        {
            string status     = null; //第三方订单状态
            string statusDesc = null; //事件状态描述

            switch (paramodel.fields.status)
            {
            case OrderConst.OrderStatus1:
                status     = "complete";
                statusDesc = "订单已完成";
                break;

            case OrderConst.OrderStatus2:
                status     = "agree";
                statusDesc = string.Format("{0}已确认可配送,{1}配送,{2}", paramodel.fields.ClienterTrueName,
                                           paramodel.fields.ClienterTrueName, paramodel.fields.ClienterPhoneNo);
                break;

            case OrderConst.OrderStatus3:
                status     = "refused";
                statusDesc = string.Format("{0}拒绝配送该订单", paramodel.fields.BusinessName);
                break;

            default:
                return(OrderApiStatusType.SystemError);
            }
            //配送员姓名
            string clienterName = paramodel.fields.ClienterTrueName == null ? "匿名" : paramodel.fields.ClienterTrueName;
            string ts           = TimeHelper.GetTimeStamp();
            string url          = ConfigurationManager.AppSettings["WanDaAsyncStatus"];

            if (url == null)
            {
                return(OrderApiStatusType.SystemError);
            }
            string json = HTTPHelper.HttpPost(url, "app_key=" + app_key + "&sign=" + GetSign(ts) + "&method=POST&ts=" + ts + "&orderId=" + paramodel.fields.OriginalOrderNo + "&status=" + status + "&statusDesc=" + statusDesc +
                                              "&syncTime=" + ts + "&operatorId=9999&operator=" + clienterName + "&logisticsNo=" +
                                              paramodel.fields.order_no + "&action=takeoutsync");

            if (string.IsNullOrWhiteSpace(json))
            {
                return(OrderApiStatusType.ParaError);
            }
            else if (json == "null")
            {
                return(OrderApiStatusType.SystemError);
            }
            JObject jobject = JObject.Parse(json);
            int     x       = jobject.Value <int>("status"); //接口调用状态 区分大小写

            return(x == 200 ? OrderApiStatusType.Success : OrderApiStatusType.SystemError);
        }
Пример #11
0
        public ResultModel <object> AsyncStatus(ParaModel <AsyncStatusPM_OpenApi> paramodel)
        {
            //paramodel.group 签名信息中取到  即 那个集团调用的该接口
            IGroupProviderOpenApi groupProvider = OpenApiGroupFactory.Create(paramodel.group);

            if (groupProvider == null)
            {
                ResultModel <object> .Conclude(OrderApiStatusType.Success);  //无集团信息,不需要同步返回成功,实际应该不会该情况
            }
            OrderApiStatusType statusType = groupProvider.AsyncStatus(paramodel);

            return(ResultModel <object> .Conclude(statusType));
        }
Пример #12
0
        public ResultModel <object> CanOrder(ParaModel <GetStatusPM_OpenApi> paramodel)
        {
            LogHelper.LogWriter("取消订单信息:", new { paramodel = paramodel });
            string kk = new OrderProvider().CanOrder(paramodel.fields.order_no, paramodel.group);

            if (kk == "1")
            {
                return(ResultModel <object> .Conclude(OrderApiStatusType.Success));
            }
            else
            {
                return(ResultModel <object> .Conclude(OrderApiStatusType.OrderIsJoin, new { Remark = kk }));
            }
        }
Пример #13
0
        public ResponseModel AddStudy([FromBody] AddStudyModel model, [FromQuery] ParaModel paraModel)
        {
            string s = Request.Query["version"];

            _logger.LogInformation("AddStudyModel参数:" + JsonConvert.SerializeObject(model));
            _logger.LogInformation("ParaModel参数:" + JsonConvert.SerializeObject(paraModel));
            ResponseModel responseModel = new ResponseModel()
            {
                isSuccess  = true,
                resultCode = "200",
                resultMsg  = "成功"
            };

            return(responseModel);
        }
Пример #14
0
        /// <summary>
        /// 回调万达接口同步订单状态  add by caoheyang 20150326
        /// </summary>
        /// <param name="paramodel"></param>
        /// <returns></returns>
        public OrderApiStatusType AsyncStatus(ParaModel <AsyncStatusPM_OpenApi> paramodel)
        {
            int status = 0; //第三方订单状态物流状态,1代表已发货,2代表已签收

            switch (paramodel.fields.status)
            {
            case OrderConst.OrderStatus1:
                status = 2;     //已签收
                break;

            case OrderConst.OrderStatus2:
                status = 1;     //已发货
                break;

            default:
                return(OrderApiStatusType.Success);
            }
            string ts  = DateTime.Now.ToString();
            string url = ConfigurationManager.AppSettings["FulltimeAsyncStatus"];

            if (url == null)
            {
                return(OrderApiStatusType.SystemError);
            }
            ///order_id	int	Y	订单ID ,根据订单ID改变对应的订单物流状态,一个订单只能修改一次,修改过再修改会报错。
            /// status	int	Y	物流状态,1代表已发货,2代表已签收
            ///send_phone	string	Y/N	配送员电话,物流状态传参是(ststus=1)的时候,配送员电话必须写,如果为(ststus=2)的时候可以不写。
            ///send_name	string	Y/N	配送员姓名,物流状态传参是(ststus=1)的时候,配送员姓名必须写,如果为(ststus=2)的时候可以不写。
            string json = HTTPHelper.HttpPost(url, "app_key=" + app_key + "&sign=" + GetSign(ts) + "&timestamp=" + ts + "&order_id=" + paramodel.fields.OriginalOrderNo + "&status=" + status + "&v=" + v + "&send_phone=" + paramodel.fields.ClienterPhoneNo
                                              + "&send_name=" + paramodel.fields.ClienterTrueName);

            if (string.IsNullOrWhiteSpace(json))
            {
                return(OrderApiStatusType.ParaError);
            }
            else if (json == "null")
            {
                return(OrderApiStatusType.SystemError);
            }
            JObject jobject = JObject.Parse(json);
            int     x       = jobject.Value <int>("status"); //接口调用状态 区分大小写

            return(x == 1 ? OrderApiStatusType.Success : OrderApiStatusType.SystemError);
        }
Пример #15
0
    /// <summary>
    /// 檢查打卡時間是否異常
    /// </summary>
    /// <param name="viewData"></param>
    /// <returns></returns>
    private string isPunchError(PunchModel viewData)
    {
        string       result   = "";
        bool         hasPara  = false;
        ParaModel    paraTime = new ParaModel();
        MsgParaModel paraMsg  = new MsgParaModel();

        try
        {
            hasPara = getPunchPara(out paraTime, out paraMsg);
            if (hasPara && paraMsg != null && paraTime != null)
            {
                int punchTime = Int32.Parse(viewData.PunchTime4Count);//要把時間:去掉,轉換格式,Model還要再多一個存取欄位
                //int punchTime = Int32.Parse("0630");
                int beginTime  = Int32.Parse(viewData.BeginTime);
                int endTime    = Int32.Parse(viewData.EndTime);
                int punchInBT  = Int32.Parse(paraTime.PunchInBT);
                int punchOutBT = Int32.Parse(paraTime.PunchOutBT);
                int regularIn  = beginTime - punchInBT;
                int regularOut = endTime + punchOutBT;

                if (punchTime < regularIn)
                {
                    result = "T";
                }
                if (punchTime > regularOut)
                {
                    result = "F";
                    if (punchTime >= 2200 && punchTime < 2400 || punchTime >= 0 && punchTime < 600)
                    {
                        result += "L";
                    }
                }
                _MsgParamodel = paraMsg;
            }
        }
        catch (Exception ex)
        {
            //Util.MsgBox(ex.Message);
            throw new Exception(ex.Message);
        }
        return(result);
    }
Пример #16
0
        /// <summary>
        /// 为当前集团参数实体生成sign签名信息 add by caoheyang 20150327
        /// </summary>
        /// <param name="groupId">参数实体必须有集团id </param>
        /// <returns></returns>
        public static ParaModel <AsyncStatusPM_OpenApi> GetSign(this ParaModel <AsyncStatusPM_OpenApi> paraModel)
        {
            GroupApiConfigDao dao   = new GroupApiConfigDao();
            GroupApiConfig    model = dao.GetGroupApiConfigByGroupID(paraModel.fields.orderfrom);//获取当前订单对应订单来源的 appkey 相关信息

            if (model == null)
            {
                return(null);
            }
            else
            {
                paraModel.app_key   = model.AppKey;
                paraModel.v         = model.AppVersion;
                paraModel.timestamp = TimeHelper.GetTimeStamp();
                paraModel.sign      = MD5.Encrypt(model.AppSecret + "app_key" + model.AppKey + "timestamp"
                                                  + paraModel.timestamp + "v" + model.AppVersion + model.AppSecret);
            }
            return(paraModel);
        }
Пример #17
0
        /// <summary>
        /// 回调美团接口同步订单状态  add by caoheyang 20150420
        /// </summary>
        /// <param name="paramodel">参数实体</param>
        /// <returns></returns>
        public OrderApiStatusType AsyncStatus(ParaModel <AsyncStatusPM_OpenApi> paramodel)
        {
            switch (paramodel.fields.status)
            {
            case OrderConst.OrderStatus1:     //已完成
                return(ArrivedAsyncStatus(paramodel.fields));

            case OrderConst.OrderStatus2:     //已接单
                return(DeliveringAsyncStatus(paramodel.fields));

            case OrderConst.OrderStatus3:     //已取消
                return(CancelAsyncStatus(paramodel.fields));

            case OrderConst.OrderStatus0:     //待确认
                return(ConfirmAsyncStatus(paramodel.fields));

            default:
                return(OrderApiStatusType.ParaError);
            }
        }
Пример #18
0
        static void Main(string[] args)
        {
            var calculateService = new CalculateService();

            string formulaTemple = "{{arg.a}}+{{arg.b}}";

            var arg = new ParaModel()
            {
                a = 1, b = 2
            };
            var arg2 = new ParaModel()
            {
                a = 1, b = 2
            };


            var result = calculateService.Calculate(formulaTemple, () => new { arg, arg2 });

            Console.WriteLine(result);
        }
Пример #19
0
        public ResultModel <object> GetBusinessStatus(ParaModel <BusinessModeltemp> paramodel)
        {
            LogHelper.LogWriter("获取商户状态:", new { Busi = paramodel });
            var busi = iBusiProvider.GetBusiness(paramodel.fields.B_OriginalBusiId, paramodel.group);

            if (busi == null)
            {
                return(ResultModel <object> .Conclude(BusiStatus.BusiNoRegiste));
            }
            else if (busi.Status == (byte)BusinessStatus.Status1.GetHashCode()) //1
            {
                return(ResultModel <object> .Conclude(BusiStatus.BusiPass));
            }
            else if (busi.Status == BusinessStatus.Status4.GetHashCode())//审核被拒绝
            {
                return(ResultModel <object> .Conclude(BusiStatus.BusiReject));
            }
            else
            {
                return(ResultModel <object> .Conclude(BusiStatus.BusiPassing));
            }
        }
Пример #20
0
        /// <summary>
        /// 获取模型值
        /// </summary>
        /// <returns>null代表数据不正确</returns>
        public ParaModel GetModelValue()
        {
            ParaModel model = new ParaModel();

            //数据不正确返回为空
            if (!IsValueRight())
            {
                return(null);
            }
            //获取转速
            model.S_RotateSpeed = int.Parse(S_RotateSpeed_TB.Text);
            //获取组合数据
            for (int counter = 2; counter < TotalParasContainer.Children.Count; counter++)
            {
                String tag = ((Grid)TotalParasContainer.Children[counter]).Tag.ToString();

                switch (tag)
                {
                case "R_InjectionQuantity":
                    model.R_InjectionQuantity = ((RangeValueInput_NDD)(((Grid)TotalParasContainer.Children[counter]).Children[2])).GetRangeValue();
                    break;

                case "R_RackTravel":
                    model.R_RackTravel = ((RangeValueInput_NDD)(((Grid)TotalParasContainer.Children[counter]).Children[2])).GetRangeValue();
                    break;

                case "S_InjectionTime":
                    model.S_InjectionTime = int.Parse(((TextBox)(((Grid)TotalParasContainer.Children[counter]).Children[2])).Text.Trim());
                    break;

                case "R_Asymmetry":
                    model.R_Asymmetry = float.Parse(((TextBox)(((Grid)TotalParasContainer.Children[counter]).Children[2])).Text.Trim());
                    break;
                }
            }

            return(model);
        }
Пример #21
0
        public ResultModel <object> RegisterBusiness(ParaModel <BusinessRegisterModel> paramodel)
        {
            LogHelper.LogWriter("商户注册:", new { Busi = paramodel });
            if (string.IsNullOrWhiteSpace(paramodel.fields.PhoneNo))   //手机号非空验证
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.PhoneNumberEmpty));
            }
            if (string.IsNullOrWhiteSpace(paramodel.fields.B_OriginalBusiId.ToString()))  //判断原平台商户Id不能为空
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.OriginalBusiIdEmpty));
            }
            if (string.IsNullOrWhiteSpace(paramodel.fields.B_City) || string.IsNullOrWhiteSpace(paramodel.fields.B_CityCode.ToString())) //城市以及城市编码非空验证
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.cityIdEmpty));
            }
            if (string.IsNullOrEmpty(paramodel.fields.B_Name.Trim())) //商户名称
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.BusiNameEmpty));
            }
            if (string.IsNullOrWhiteSpace(paramodel.fields.Address) || string.IsNullOrWhiteSpace(paramodel.fields.B_Province) || string.IsNullOrWhiteSpace(paramodel.fields.B_City) || string.IsNullOrWhiteSpace(paramodel.fields.B_Area) || string.IsNullOrWhiteSpace(paramodel.fields.B_AreaCode) || string.IsNullOrWhiteSpace(paramodel.fields.B_CityCode) || string.IsNullOrWhiteSpace(paramodel.fields.B_ProvinceCode))  //商户地址 省市区 不能为空
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.BusiAddressEmpty));
            }

            BusinessModel busi = iBusiProvider.CheckExistBusiness(paramodel.fields.B_OriginalBusiId, paramodel.group);

            if (busi != null)
            {
                //if(busi.Status == ConstValues.BUSINESS_NOADDRESS || busi.Status == ConstValues.BUSINESS_AUDITCANCEL )
                //{
                //   bool upresult = iBusiProvider.UpdateAuditStatus(busi.Id, ConstValues.BUSINESS_NOAUDIT);
                //    if (upresult)
                //    {
                //        return ResultModel<object>.Conclude(CustomerRegisterStatus.Success, busi.Id);
                //    }
                //    else
                //    {
                //        return ResultModel<object>.Conclude(CustomerRegisterStatus.Faild);
                //    }
                //}
                //else
                //{
                //    return ResultModel<object>.Conclude(CustomerRegisterStatus.Success, busi.Id);
                //}
                //if (busi.Status != ConstValues.BUSINESS_NOADDRESS && busi.Status == ConstValues.BUSINESS_AUDITCANCEL)
                //{
                LogHelper.LogWriter("商户注册---:", new { busid = busi.Id, BusiStatus = BusiStatus.BusiNoPass.GetHashCode() });

                bool upresult = iBusiProvider.UpdateAuditStatus(busi.Id, BusiStatus.BusiNoPass.GetHashCode(), paramodel.fields.Address);
                //}
                if (upresult)
                {
                    return(ResultModel <object> .Conclude(CustomerRegisterStatus.Success, busi.Id));
                }
                else
                {
                    return(ResultModel <object> .Conclude(CustomerRegisterStatus.Faild));
                }
            }
            //if (iBusiProvider.CheckExistBusiness(paramodel.fields.B_OriginalBusiId, paramodel.group))
            //    return ResultModel<object>.Conclude(CustomerRegisterStatus.OriginalBusiIdRepeat);

            paramodel.fields.B_Password = MD5Helper.MD5(string.IsNullOrEmpty(paramodel.fields.B_Password) ? "abc123" : paramodel.fields.B_Password);
            #region 转换省市区
            //转换省
            var _province = iAreaProvider.GetNationalAreaInfo(new Ets.Model.DomainModel.Area.AreaModelTranslate()
            {
                Name = paramodel.fields.B_Province, JiBie = 1
            });
            if (_province != null)
            {
                paramodel.fields.B_ProvinceCode = _province.NationalCode.ToString();
            }
            //转换市
            var _city = iAreaProvider.GetNationalAreaInfo(new Ets.Model.DomainModel.Area.AreaModelTranslate()
            {
                Name = paramodel.fields.B_City, JiBie = 2
            });
            if (_city != null)
            {
                paramodel.fields.B_CityCode = _city.NationalCode.ToString();
            }
            //转换区
            var _area = iAreaProvider.GetNationalAreaInfo(new Ets.Model.DomainModel.Area.AreaModelTranslate()
            {
                Name = paramodel.fields.B_Area, JiBie = 3
            });
            if (_area != null)
            {
                paramodel.fields.B_AreaCode = _area.NationalCode.ToString();
            }
            #endregion

            int addResult = iBusiProvider.AddThirdBusiness(paramodel);
            if (addResult > 0)
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.Success, addResult));
            }
            else
            {
                return(ResultModel <object> .Conclude(CustomerRegisterStatus.Faild));
            }
        }
Пример #22
0
 public void SetCameraPara(ParaModel Para)
 {
     ParaSetting = Para;
 }
Пример #23
0
        public JsonResult SearchUser(ParaModel data)
        {
            var result = WebApiHelper.InvokeAxApi <PageResult <IList <UserView> > >("User/SearchUser", data);

            return(result == null?Json(false, JsonRequestBehavior.AllowGet) : Json(new { result.PageSize, result.PageIndex, result.TotalIndex, result.TotalCount, result.Data }, JsonRequestBehavior.AllowGet));
        }
Пример #24
0
 public ResultModel <object> OrderDetail(ParaModel <OrderDetailPM_OpenApi> paramodel)
 {
     paramodel.fields.orderfrom = paramodel.group; //设置订单来源,其实就是订单对应的集团是什么
     return(new OrderProvider().OrderDetail(paramodel.fields));
 }
Пример #25
0
 public ResultModel <object> Create(ParaModel <CreatePM_OpenApi> paramodel)
 {
     paramodel.fields.store_info.group = paramodel.group; //设置集团信息到具体的门店上  在dao层会用到
     paramodel.fields.orderfrom        = paramodel.group; //设置订单来源,其实就是订单对应的集团是什么
     return(new OrderProvider().Create(paramodel.fields));
 }