Exemplo n.º 1
0
        /// <summary>
        /// 获取承保人职业列表
        /// </summary>
        /// <param name="oJobInfoResp"></param>
        /// <returns></returns>
        static public Object GetJobInfo()
        {
            string result   = string.Empty;
            string cacheKey = string.Empty;

            try
            {
                BaoxianDataBLL oBaoxianDataBLL = new BaoxianDataBLL();
                JobInfoReq     oJobInfoReq     = new JobInfoReq();

                string parentId = DNTRequest.GetString("parentId");
                cacheKey             = "jobCacheKey";
                oJobInfoReq.caseCode = DNTRequest.GetString("caseCode");
                oJobInfoReq.transNo  = DNTRequest.GetString("transNo");

                object      objJob       = CacheHelper.GetCache(cacheKey);
                JobInfoResp oJobInfoResp = new JobInfoResp();
                if (objJob != null)
                {
                    oJobInfoResp = (JobInfoResp)objJob;
                }
                else
                {
                    oJobInfoResp = oBaoxianDataBLL.GetJobInfo(oJobInfoReq);
                    CacheHelper.SetCache(cacheKey, oJobInfoResp, 10);
                }
                if (oJobInfoResp != null)
                {
                    List <InsureJobVo> jobList = oJobInfoResp.insureJobVos;
                    if (jobList.Count > 0)
                    {
                        int pid = 0;
                        if (!string.IsNullOrEmpty(parentId))
                        {
                            pid     = int.Parse(parentId);
                            jobList = jobList.Where(c => c.parentId == pid).ToList();
                        }
                        else
                        {
                            result = DNTRequest.GetResultJson(false, "ajax:GetJobInfo方法 ----parentId异常", null);
                            return(result);
                        }
                        object obj = new
                        {
                            result = true,
                            msg    = "",
                            data   = jobList,
                        };
                        result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
                    }
                }
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null);
                Log.WriteLog(" " + ex);
            }

            return(result);
        }
Exemplo n.º 2
0
        public JobInfoResp GetJobInfo(JobInfoReq model)
        {
            try
            {
                string methodName = "getProductJob";
                model.customkey = Customkey;
                string strJson   = SerializerHelper.ToJson(model);
                string sign      = UtilityHelper.Utils.MD5(VI + strJson);
                string url       = URLBaseMoFang + methodName + ".html?sign=" + sign;
                string retrunStr = UtilityHelper.HttpService.GetHttpWebResponseByRestSharp(url, strJson);

                string retrunStr22 = PostHttp(url, strJson, "application/json;charset=utf-8");
                // string retrunStr = UtilityHelper.HttpService.Post(url, strJson);
                JobInfoResp outModel = new JobInfoResp();
                outModel = SerializerHelper.FromJsonTo <JobInfoResp>(retrunStr);
                if (outModel.respstat != "0000")
                {
                    ReceivedLog(model.transNo, "GetJobInfo", outModel.respmsg);
                }
                return(outModel);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
                Log.WriteLog(" " + ex);
                return(null);
            }
        }