예제 #1
0
        /// <summary>
        /// 获取复估列表
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="index"></param>
        /// <param name="rows"></param>
        /// <returns></returns>
        public JsonResult GetConsultList(ConsultCondition condition, int index, int rows)
        {
            int total;
            var result = RevaluationService.GetConsultList(condition, index, rows, out total, UserHelper.GetCurrentUser().Id);

            return(Json(new
            {
                rows = result.Select(x => new
                {
                    x.TId,
                    x.ProjectNo,
                    x.PledgeAddress,
                    x.EvalType,
                    x.PropertyType,
                    InitialEstimateValue = x.InitialEstimateValue.ToString("F2"),
                    x.RevaluationValue,
                    x.RevaluationDifference,
                    x.RevaluationIncrease,
                    RevaluationTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", x.RevaluationTime),
                    IsApprove = x.IsApprove.HasValue ? x.IsApprove.Value ? "是" : "否" : "",
                    IsCancelConsult = x.IsCancelConsult.HasValue && x.IsCancelConsult.Value ? "是" : "否"
                }),
                total
            }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ResponseResult GetConsultList(string userKeyId, int scanType)
        {
            LogHelper.Error(string.Format("调用公司复估认可列表API,userKeyId:{0},scanType:{1}", userKeyId, scanType), null);
            var responseResult = new ResponseResult();

            try
            {
                var user        = UserService.GetUserByKeyId(userKeyId);
                int total       = 0;
                var projectList = RevaluationService.GetConsultList(new ConsultCondition()
                {
                    ScanType = scanType
                }, 0, int.MaxValue, out total, user.Id);
                responseResult.Code    = 0;
                responseResult.Message = "success";
                responseResult.Data    = projectList.Select(x => new
                {
                    x.TId,
                    x.BusinessId,
                    x.RevaluationId,
                    x.OperationOrganization,
                    x.BorrowerName,
                    x.CreditBalance,
                    x.FiveCategories,
                    x.ContractExpirationDate,
                    x.PropertyType,
                    x.PledgeAddress,
                    x.InitialEstimateValue,
                    x.InitialEstimateOrganization,
                    x.InitialEstimateTime,
                    x.CustomerAccountManager,
                    x.ContactNumber,
                    x.ProtocolNumber,
                    x.CustomerNumber,
                    x.ProjectNo,
                    x.RevaluationTime,
                    x.RevaluationValue,
                    x.ChangeDescription,
                    x.Remark,
                    x.RevaluationDifference,
                    x.RevaluationIncrease,
                    x.IsConsult,
                    x.IsCancelConsult,
                    x.IsApprove,
                    x.ConsultReply,
                    x.CreateTime
                });
                IList <long> idList = projectList.Where(x => !x.IsScan.HasValue && !x.ScanTime.HasValue).Select(x => x.TId).ToList();
                if (idList.Any())
                {
                    RevaluationService.SaveScanProjectResult(idList);
                }
            }
            catch (Exception ex)
            {
                responseResult.Code    = 1;
                responseResult.Message = ex.Message;
                LogHelper.Error("调用公司复估认可列表API错误日志:", ex);
            }
            return(responseResult);
        }