Esempio n. 1
0
        public PushRespose Reject(string caseNum)
        {
            string hatsHost = ConfigurationManager.AppSettings["hats_host"];

            if (hatsHost.IsNullOrEmpty())
            {
                throw new Exception("缺少hats_host配置节");
            }

            var rejectCase = new PublicMortgageDto()
            {
                CaseNum = caseNum,
                Status  = 2
            };

            var resquestBody = new PushRequest()
            {
                RequestData = rejectCase.ToHatsString()
            };


            var request = new HttpItem()
            {
                URL          = string.Format("{0}/api/BaseAuditPush/AddBaseAuditByPublic", hatsHost),
                Method       = "post",
                ContentType  = "application/json;charset=utf-8",
                Postdata     = resquestBody.ToJson(),
                Accept       = "text/json",
                PostEncoding = Encoding.UTF8
            };

            var httpResult = new HttpHelper().GetHtml(request);

            return(Newtonsoft.Json.JsonConvert.DeserializeObject <PushRespose>(httpResult.Html));
        }
Esempio n. 2
0
        /// <summary>
        /// 确认签约要件
        /// </summary>
        /// <param name="caseid">案件ID,并非案件号</param>
        /// <returns></returns>
        public async Task <bool> ConfrimPublic(string id, string createUser, string description)
        {
            var         audit = _baseAuditDal.Get(id);
            MortgageDAL mort  = new MortgageDAL();

            if (audit == null)
            {
                return(false);
            }
            var morimodel = mort.GetPublic(id);

            if (morimodel == null)
            {
                return(false);
            }
            audit.Description = description;

            AuditHelp ah = new AuditHelp();
            var       publicMortgageDto = new PublicMortgageDto();

            Infrastructure.ExtendTools.ObjectExtend.CopyTo(morimodel, publicMortgageDto);
            publicMortgageDto.LenderName  = audit.LenderName;
            publicMortgageDto.CaseNum     = audit.NewCaseNum;
            publicMortgageDto.OpeningBank = audit.OpeningBank;
            publicMortgageDto.OpeningSite = audit.OpeningSite;
            publicMortgageDto.BankCard    = audit.BankCard;
            if (audit.IntroducerAudits != null && audit.IntroducerAudits.Any())
            {
                foreach (var r in audit.IntroducerAudits)
                {
                    var newIntro = new IntroducerAudit();
                    Infrastructure.ExtendTools.ObjectExtend.CopyTo(r, newIntro);
                    publicMortgageDto.Introducer.Add(newIntro);
                }
            }

            UserDAL ud    = new UserDAL();
            var     contr = await ud.FindById(morimodel.ContractPerson);

            publicMortgageDto.ContractPersonText = contr.DisplayName;
            MortgagePush _mortgagePush = new MortgagePush();
            var          pushResult    = _mortgagePush.PushToHats(publicMortgageDto);

            if (!pushResult.IsSuccess)
            {
                return(false);
            }
            var newid = ah.CopyBaseAudit(audit, createUser, CaseStatus.Lending, false);

            _mortgageDal.CopyPublic(morimodel, newid, createUser);
            //pub.ID = newid;
            //pub.CreateUser = createUser;
            //_mortgageDal.Add(pub);
            _mortgageDal.AcceptAllChange();
            return(true);
        }