Exemplo n.º 1
0
        public string CommentRequirement(DtoCommentRequirement model)//(long id, string OperatorUserid, long FarmerUserId, string commentString, int score,SourceType)
        {
            //验证参数
            var validateRes = ValidateParamModel();

            if (validateRes != null)
            {
                return(JsonHelper.ToJsJson(validateRes));
            }

            SetJsonHeader();
            var content = GetPostParameters();
            var result  = string.Empty;
            //证书的路径
            var certification = GetCertificationFilePath();
            //证书的密码
            var certificationPwd = GetCertificationPwd();

            //先锋帮用户
            //E田调用时,model.SourceType.ToString()=="0" 的值永远为0,可能是请求头格式的问题
            try
            {
                string sourcetype = content["SourceType"].ToString();
                if (sourcetype == "0")
                {
                    result = HttpAsynchronousTool.CustomHttpWebRequestPost(GetCurrentUrl(this), content, certification, certificationPwd);
                    #region 调用E田接口,更新订单状态
                    //ResponseResult<T_FARMER_DEMAND_RESPONSE_RELATION> farmerrequirement = JsonHelper.FromJsonTo<ResponseResult<T_FARMER_DEMAND_RESPONSE_RELATION>>(result);
                    //if (farmerrequirement.IsSuccess == true && farmerrequirement.Entity != null)
                    //{
                    //    //评价大农户订单
                    //    Task taskasync = new Task(() => CommentOrder(farmerrequirement.Entity));
                    //    taskasync.Start();

                    //}
                    #endregion
                }
                else //E田
                {
                    string logErrstring = DateTime.Now.ToString("\r\n---------MM/dd/yyyy HH:mm:ss,fff---------\r\n") + "靠谱作业的农机手评价先锋帮大农户";
                    string parmeters    = null;
                    foreach (var item in content)
                    {
                        parmeters += item.Key + ":" + item.Value + "\r\n";
                    }
                    IOHelper.WriteLogToFile(logErrstring + "\r\n" + parmeters, RelativePath() + @"\DuPontRequestEtLog");
                    //靠谱作业的农机手评价先锋帮大农户
                    string Apiurl = ConfigHelper.GetAppSetting(DataKey.RemoteApiForRelease);
                    string url    = Apiurl + "api" + "/Operator/EtCommentRequirement";
                    result = HttpAsynchronousTool.CustomHttpWebRequestPost(url, content, certification, certificationPwd);
                }
            }
            catch (Exception ex) {
                return(ex.Message);
            }

            return(result);
        }
Exemplo n.º 2
0
        public string CommentRequirement(DtoCommentRequirement model)
        {
            SetJsonHeader();

            var content = GetPostParameters();
            //证书的路径
            var certification = GetCertificationFilePath();
            //证书的密码
            var certificationPwd = GetCertificationPwd();

            var result = HttpAsynchronousTool.CustomHttpWebRequestPost(GetCurrentUrl(this), content, certification, certificationPwd);

            return(result);
        }
Exemplo n.º 3
0
        public string CommentRequirement(DtoCommentRequirement model)//(long id, long executeUserId, long userid, string commentString, int score)
        {
            //验证参数
            var validateRes = ValidateParamModel();

            if (validateRes != null)
            {
                return(JsonHelper.ToJsJson(validateRes));
            }

            SetJsonHeader();
            var content = GetPostParameters();

            //证书的路径
            var certification = GetCertificationFilePath();
            //证书的密码
            var certificationPwd = GetCertificationPwd();


            var result = HttpAsynchronousTool.CustomHttpWebRequestPost(GetCurrentUrl(this), content, certification, certificationPwd);

            return(result);
        }
Exemplo n.º 4
0
        public string CommentRequirementForOperator(DtoCommentRequirement model)//(long id, long executeUserId, long userid, string commentString, int score)
        {
            //验证参数
            var validateRes = ValidateParamModel();

            if (validateRes != null)
            {
                return(JsonHelper.ToJsJson(validateRes));
            }

            SetJsonHeader();
            var content = GetPostParameters();

            //证书的路径
            var certification = GetCertificationFilePath();
            //证书的密码
            var certificationPwd = GetCertificationPwd();

            var result = HttpAsynchronousTool.CustomHttpWebRequestPost(GetCurrentUrl(this), content, certification, certificationPwd);

            #region 调用E田接口,评价靠谱作业的农机手
            //ResponseResult<T_FARMER_DEMAND_RESPONSE_RELATION> farmerrequirement = JsonHelper.FromJsonTo<ResponseResult<T_FARMER_DEMAND_RESPONSE_RELATION>>(result);
            //if (farmerrequirement.IsSuccess == true && farmerrequirement.Entity != null)
            //{
            //    //靠谱作业农机手接的单
            //    if (farmerrequirement.Entity.SourceType == (int)DuPont.Entity.Enum.SourceType.JeRei)
            //    {
            //        //大农户评价靠谱作业农机手
            //        Task taskasync = new Task(() => CommentOrderForOperator(farmerrequirement.Entity));
            //        taskasync.Start();
            //    }

            //}
            #endregion
            return(result);
        }