Beispiel #1
0
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            var filter = baseFilter as RelativeDaySearchDunFilter;

            if (filter == null)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            DataSet dsResult = Singleton <RelativeDayDunSearchDAL <RelativeDaySearchDunViewData> >
                               .Instance.SearchDataToSet(baseFilter);

            if (dsResult == null || dsResult.Tables == null || dsResult.Tables.Count < 2)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                var responseResult = new ResponseListResult <RelativeDaySearchDunViewData>();
                responseResult.TotalCount = dsResult.Tables[1].Rows[0][0].ToString().ToInt();
                responseResult.LstResult  = CreateDunExtendList(responseEntity.UserId,
                                                                dsResult.Tables[0].ConvertToList <RelativeDaySearchDunViewData>(), filter);

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 根据条件查询数据
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public virtual void SearchData(BusinessGuaranteeFilter filter
                                       , ResponseEntity responseEntity)
        {
            var lstBus = Singleton <GuarLitigationEditDAL <BusinessViewData> >
                         .Instance.SearchData(filter);

            if (lstBus == null || lstBus.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
                return;
            }

            // 查询关帐日
            DateTime stopDate = Singleton <GuarLitigationEditDAL <BusinessViewData> > .Instance.GetCloseBillDate();

            foreach (var bus in lstBus)
            {
                bus.StopDate = stopDate;
            }

            var responseResult = new ResponseListResult <BusinessViewData>();

            responseResult.TotalCount = lstBus.Count;
            responseResult.LstResult  = lstBus;


            ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
            responseEntity.Results = responseResult;
        }
        /// <summary>
        /// 获取关账日信息
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        /// <returns></returns>
        public void GetCloseBillTime(TimeLineInitFilter filter, ResponseEntity responseEntity)
        {
            List <string> companyKeys = new List <string>();

            if (!string.IsNullOrEmpty(filter.CompanyKeys))
            {
                companyKeys = filter.CompanyKeys.Split(WebServiceConst.Separater_Comma.ToArray()).ToList();
            }

            // 获取关账日信息
            List <CloseBillTimeViewData> listTime = GetCloseBillTime(filter, companyKeys);

            // 获取序列(21/28/12)
            for (int i = 2; i > -10; i--)
            {
                listTime.AddRange(GetTimeLine(DateTime.Now.AddMonths(i), filter.UserId, companyKeys));
            }

            var responseResult = new ResponseListResult <CloseBillTimeViewData>();

            responseResult.LstResult = listTime;

            ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
            responseEntity.Results = responseResult;
        }
        /// <summary>
        /// 根据条件查询数据
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public virtual void Search(EveryDueReportFilter filter
                                   , ResponseEntity responseEntity)
        {
            if (filter == null)
            {
                return;
            }

            var reportDetailList = Singleton <EveryDueReportSearchDAL <EveryDueReportViewData> >
                                   .Instance.SearchData(filter);

            int count = Singleton <EveryDueReportSearchDAL <EveryDueReportViewData> >
                        .Instance.GetCount(filter);

            if (reportDetailList == null || reportDetailList.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
            }
            else
            {
                var responseResult = new ResponseListResult <EveryDueReportViewData>();
                responseResult.TotalCount = count;
                responseResult.LstResult  = reportDetailList;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
Beispiel #5
0
        /// <summary>
        /// 根据条件查询数据
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public virtual void SearchData(SavingCardChangeFilter filter
                                       , ResponseEntity responseEntity)
        {
            if (filter == null)
            {
                return;
            }

            var reportDetailList = Singleton <GetSavingCardChangeHistoryDAL <SavingCardChangeHistoryViewData> >
                                   .Instance.SearchData(filter);

            if (reportDetailList == null || reportDetailList.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
            }
            else
            {
                SetBranchName(reportDetailList);
                var responseResult = new ResponseListResult <SavingCardChangeHistoryViewData>();
                responseResult.TotalCount = reportDetailList.Count;
                responseResult.LstResult  = reportDetailList;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 执行服务查询方法
        /// </summary>
        /// <param name="requestEntity">请求实体</param>
        /// <param name="responseEntity">返回实体</param>
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            IDictionary <string, string> paraDict = requestEntity.Parameters;

            if (!paraDict.ContainsKey("UserId"))
            {
                responseEntity.ResponseStatus  = (int)EnumResponseState.RequestCommandError;
                responseEntity.ResponseMessage = "入参校验错误,缺少UserId";
                return;
            }
            int userId;

            if (!int.TryParse(paraDict["UserId"], out userId))
            {
                responseEntity.ResponseStatus  = (int)EnumResponseState.RequestCommandError;
                responseEntity.ResponseMessage = "入参校验错误,UserId不是数字";
                return;
            }

            IEnumerable <Enumeration> companyData = Singleton <CompanyCache> .Instance.GetCompanyEnumeration(userId);

            List <Enumeration> companyDataList      = companyData.ToList();
            ResponseListResult <Enumeration> result = new ResponseListResult <Enumeration>();

            result.TotalCount             = companyDataList.Count;
            result.LstResult              = companyDataList;
            responseEntity.ResponseStatus = (int)EnumResponseState.Success;
            responseEntity.Results        = result;
        }
Beispiel #7
0
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            var filter = baseFilter as SearchBusinessListFilter;

            if (filter == null)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            // 获取件数
            int totalCount = Singleton <DunAdaptationCardDAL <AdaptationCardDetailData> > .Instance.GetCount(baseFilter);

            if (totalCount <= 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
                return;
            }

            if (filter.PageNo < 1)
            {
                filter.PageNo = 1;
            }

            int fromIndex = (filter.PageNo - 1) * filter.PageSize;
            int toIndex   = filter.PageNo * filter.PageSize;

            if (toIndex > totalCount)
            {
                toIndex = totalCount;
            }

            filter.FromIndex = fromIndex;
            filter.ToIndex   = toIndex;

            var lstResult = Singleton <DunAdaptationCardDAL <AdaptationCardDetailData> > .Instance.SearchData(filter);

            if (lstResult == null || lstResult.Count < 2)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                lstResult.ForEach(p =>
                {
                    p.AdaBankName = Singleton <RedisEnumOperatorBLL> .Instance.GetRedisData(RedisEnumOperatorBLL.HashId_BankList_8, p.AdaBankName).Name;
                });

                var responseResult = new ResponseListResult <AdaptationCardDetailData>();
                responseResult.TotalCount = totalCount;
                responseResult.LstResult  = lstResult;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SaveData(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            var filter = baseFilter as ClearLoanReasonSaveFilter;

            if (filter == null)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            var searchFilter = new ClearLoanReasonSearchFilter();

            searchFilter.ContractNo = filter.ContractNo;

            var lstResult = Singleton <ClearLoanReasonSearchDAL <ClearLoanReasonSearchViewData> >
                            .Instance.SearchData(searchFilter);

            if (lstResult == null || lstResult.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Others, "内部异常");
                m_Logger.Info("内部异常。");
                return;
            }
            else
            {
                var business = lstResult[0];

                if (business.ClearLoanType == filter.ClearLoanType &&
                    business.ClearLoanRemark == filter.ClearLoanRemark)
                {
                    ServiceUtility.SetResponseStatus(responseEntity
                                                     , EnumResponseState.Others, "未更改原因,请更改原因后保存。");
                    m_Logger.Info("未更改原因,请更改原因后保存。");
                    return;
                }

                filter.BusinessId = business.BusinessID;
                int ret = Singleton <ClearLoanReasonSaveDAL> .Instance.Update(filter);

                if (ret > 0)
                {
                    var responseResult = new ResponseListResult <ClearLoanReasonSearchViewData>();
                    responseResult.TotalCount = 1;
                    responseResult.LstResult  = lstResult;

                    ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                    responseEntity.Results = responseResult;
                }
                else
                {
                    ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Others, "更新失败。");
                }
            }
        }
Beispiel #9
0
        /// <summary>
        /// 批量转担保
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public void BatchConvertGurantee(BusinessGuaranteeFilter filter
                                         , ResponseEntity responseEntity)
        {
            var lstBus = Singleton <GuarLitigationInBatchNumDAL <Business> > .Instance.SearchData(filter);

            if (lstBus == null || lstBus.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.BusinessError, "查询不到订单。");
                m_Logger.Info("查询不到订单。");
                return;
            }
            string errorMessage = "";
            var    lstBids      = new List <int>();

            foreach (var bus in lstBus)
            {
                if (!string.IsNullOrEmpty(bus.GuaranteeNum))
                {
                    errorMessage = string.Format("错误,订单号[{0}]已存在担保批次号[{1}]", bus.BusinessID, bus.GuaranteeNum);
                    break;
                }
                else if (bus.BusinessStatus == (byte)EnumBusinessStatus.Normal)
                {
                    errorMessage = string.Format("错误,订单号[{0}]尚未担保,不允许输入担保批次号[{1}]", bus.BusinessID, bus.GuaranteeNum);
                    break;
                }
                else if (bus.LendingSideKey == SysConst.COMPANY_DWJM_LENDING)
                {
                    errorMessage = string.Format("错误,订单号[{0}]是外贸订单,不支持手动录入担保批次号", bus.BusinessID);
                    break;
                }
                else if (bus.BusinessStatus == (byte)EnumBusinessStatus.Guarantee)
                {
                    lstBids.Add(bus.BusinessID);
                }
            }

            if (!string.IsNullOrEmpty(errorMessage))
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.BusinessError, errorMessage);
                m_Logger.Info(errorMessage);
            }
            else if (lstBids != null && lstBids.Count != 0)
            {
                int resultCount = Singleton <GuarLitigationInBatchNumDAL <Business> >
                                  .Instance.UpdateBatchNum(string.Join(WebServiceConst.Separater_Comma, lstBids.ToArray()), filter.GuaranteeNum);

                var responseResult = new ResponseListResult <BusinessViewData>();
                responseResult.TotalCount = resultCount;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
Beispiel #10
0
        /// <summary>
        /// 查询入担保的订单信息
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public void QueryGuarBusiness(BaseFilter filter, ResponseEntity responseEntity)
        {
            var guarBusList = Singleton <GuarBusinessSearchDAL> .Instance.SearchData(filter);

            var responseResult = new ResponseListResult <GuarBusinessViewData>();

            responseResult.LstResult = guarBusList;

            responseEntity.ResponseStatus = (int)EnumResponseState.Success;
            responseEntity.Results        = responseResult;
        }
Beispiel #11
0
        /// <summary>
        /// 程序执行主入口
        /// </summary>
        /// <param name="requestEntity"></param>
        /// <param name="responseEntity"></param>
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            //传递的参数
            IDictionary <string, string> dicParamteters = requestEntity.Parameters;

            string errorMessage = "";

            // 记录执行时间类
            using (StopWatcherAuto auto = new StopWatcherAuto())
            {
                try
                {
                    // 定义接收客户端参数的变量
                    IDictionary <string, string> paraDict = requestEntity.Parameters;
                    BadTransferFilter            filter   = LogicUtility.ConvertToFilterFromDict <BadTransferFilter>(paraDict);

                    // 根据检索条件获取坏账清贷信息
                    var result = Singleton <BadTransferDal> .Instance.GetBadTransferInfor(
                        filter.BusinessID, filter.ContractNo, filter.CustomerName, filter.IdenNo);

                    if (result == null || result.Count == 0)
                    {
                        responseEntity.ResponseStatus  = (int)EnumResponseState.NoResult;
                        responseEntity.ResponseMessage = "无申请记录";
                        m_Logger.Info("无申请记录。");
                    }
                    else
                    {
                        var responseResult = new ResponseListResult <BadTransferSearchData>();
                        responseResult.LstResult = result;

                        responseEntity.ResponseStatus = (int)EnumResponseState.Success;
                        responseEntity.Results        = responseResult;
                    }
                }
                catch (Exception ex)
                {
                    errorMessage = "";
                    responseEntity.ResponseStatus  = (int)EnumResponseState.Others;
                    responseEntity.ResponseMessage = "检索申请记录失败。" + ex.Message.ToString();
                    m_Logger.Error("检索申请记录失败:" + ex.Message.ToString());
                    m_Logger.Error("检索申请记录失败:" + ex.StackTrace.ToString());
                }
                finally
                {
                    if (errorMessage.Length > 0)
                    {
                        responseEntity.ResponseStatus  = (int)EnumResponseState.Others;
                        responseEntity.ResponseMessage = errorMessage;
                    }
                }
            }
        }
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            var filter = baseFilter as ClearLoanReasonSearchFilter;

            if (filter == null)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            var lstResult = Singleton <ClearLoanReasonSearchDAL <ClearLoanReasonSearchViewData> >
                            .Instance.SearchData(baseFilter);

            if (lstResult == null || lstResult.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                var business = lstResult[0];
                filter.BusinessIds = business.BusinessID.ToString();
                var lstBills = Singleton <ClearLoanBillDetailDAL <Bill> > .Instance.SearchData(filter);

                var lstBillItems = Singleton <ClearLoanBillItemDetailDAL <BillItem> > .Instance.SearchData(filter);

                ConvertToBills(lstBills, lstBillItems, null);

                foreach (var bus in lstResult)
                {
                    bus.LoanKind = Singleton <RedisEnumOperatorBLL> .Instance.GetRedisData(
                        RedisEnumOperatorBLL.HashId_LoanKind_6, bus.LoanKind).Name;

                    bus.StrBusinessStatus = Singleton <RedisEnumOperatorBLL> .Instance.GetRedisData(
                        RedisEnumOperatorBLL.HashId_BusinessStatus_10, bus.BusinessStatus.ToString()).Name;

                    bus.StrCloanStatus = Singleton <RedisEnumOperatorBLL> .Instance.GetRedisData(
                        RedisEnumOperatorBLL.HashId_CLoanStatus_11, bus.CLoanStatus.ToString()).Name;

                    //bus.ClearLoanTime = bus.LoanTime.AddMonths(bus.LoanPeriod);
                    bus.RepayedPeriods
                        = CalculateRepayedPeriods(lstBills.Where(x => x.BusinessID == bus.BusinessID));
                }

                var responseResult = new ResponseListResult <ClearLoanReasonSearchViewData>();
                responseResult.TotalCount = 1;
                responseResult.LstResult  = lstResult;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            IDictionary <string, string> paraDict          = requestEntity.Parameters;
            SearchBusinessListFilter     filter            = LogicUtility.ConvertToFilterFromDict <SearchBusinessListFilter>(paraDict);
            List <MongoBusiness>         mongoBusinessList = Singleton <BusinessInfo> .Instance.GetBusinessList(filter);

            ResponseListResult <MongoBusiness> result = new ResponseListResult <MongoBusiness>();

            result.TotalCount             = (int)filter.RecordCount;
            result.LstResult              = mongoBusinessList;
            responseEntity.ResponseStatus = (int)EnumResponseState.Success;
            responseEntity.Results        = result;
        }
Beispiel #14
0
        /// <summary>
        /// 服务执行
        /// </summary>
        /// <param name="requestEntity">请求数据</param>
        /// <param name="responseEntity">返回数据</param>
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            IDictionary <string, string> paraDict         = requestEntity.Parameters;
            CancelRefundFilter           filter           = ServiceUtility.ConvertToFilterFromDict <CancelRefundFilter>(paraDict);
            List <CancelRefundViewData>  cancelRefundList = Singleton <CancelRefundDal> .Instance.GetCancelRefund(filter);

            ResponseListResult <CancelRefundViewData> result = new ResponseListResult <CancelRefundViewData>();

            result.TotalCount             = filter.RecordCount;
            result.LstResult              = cancelRefundList;
            responseEntity.ResponseStatus = (int)EnumResponseState.Success;
            responseEntity.Results        = result;
        }
        /// <summary>
        /// 服务执行
        /// </summary>
        /// <param name="requestEntity">请求数据</param>
        /// <param name="responseEntity">返回数据</param>
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            IDictionary <string, string>        paraDict = requestEntity.Parameters;
            GuaranteeBatchFilter                filter   = ServiceUtility.ConvertToFilterFromDict <GuaranteeBatchFilter>(paraDict);
            List <GuaranteeObligaBatchViewData> guaranteeObligaBatchList = Singleton <GuaranteeObligaBatchDal> .Instance.GetGuaranteeObligationBatch(filter);

            ResponseListResult <GuaranteeObligaBatchViewData> result = new ResponseListResult <GuaranteeObligaBatchViewData>();

            result.TotalCount             = (int)filter.RecordCount;
            result.LstResult              = guaranteeObligaBatchList;
            responseEntity.ResponseStatus = (int)EnumResponseState.Success;
            responseEntity.Results        = result;
        }
Beispiel #16
0
        /// <summary>
        /// 设置返回的结果
        /// </summary>
        /// <param name="result"></param>
        /// <param name="responseEntity"></param>
        private void SetResult(LatestCloseTimeViewData result, ResponseEntity responseEntity)
        {
            // 返回数据
            var responseResult = new ResponseListResult <LatestCloseTimeViewData>();

            responseResult.TotalCount = 1;
            responseResult.LstResult  = new List <LatestCloseTimeViewData> {
                result
            };

            ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
            responseEntity.Results = responseResult;
        }
        /// <summary>
        /// 根据过滤条件,返回检索数据(分页)
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        /// <returns></returns>
        public virtual void SearchDataPagingByFilter(
            BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            BusinesssDataSearchDAL <BusinessExportViewData> dal = new BusinesssDataSearchDAL <BusinessExportViewData>();
            // 获取件数
            int totalCount = dal.GetCount(baseFilter);

            if (totalCount <= 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
                return;
            }

            if (baseFilter.PageNo < 1)
            {
                baseFilter.PageNo = 1;
            }

            int fromIndex = (baseFilter.PageNo - 1) * baseFilter.PageSize;
            int toIndex   = baseFilter.PageNo * baseFilter.PageSize;

            if (toIndex > totalCount)
            {
                toIndex = totalCount;
            }

            baseFilter.FromIndex = fromIndex;
            baseFilter.ToIndex   = toIndex;
            var result = dal.SearchData(baseFilter);

            if (result == null || result.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                CreateViewBusinessExtPivot(result);
                var responseResult = new ResponseListResult <BusinessExportViewData>();
                responseResult.LstResult  = result;
                responseResult.TotalCount = totalCount;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            IDictionary <string, string> paraDict = requestEntity.Parameters;

            if (!paraDict.ContainsKey("DistributeGuid"))
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            ResponseListResult <HandDeductDistribute> result = new ResponseListResult <HandDeductDistribute>();
            HandDeductDistribute handDeductDistribute        = new HandDeductDistribute();

            handDeductDistribute.Result = 1;
            handDeductDistribute.Status = 1;
            result.LstResult.Add(handDeductDistribute);
            ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
            responseEntity.Results = result;
        }
Beispiel #19
0
        /// <summary>
        /// 根据过滤条件,返回检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        /// <returns></returns>
        public virtual void SearchDataSet(
            BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            V       dal      = new V();
            DataSet dsResult = dal.SearchDataToSet(baseFilter);

            if (dsResult == null || dsResult.Tables == null || dsResult.Tables.Count < 2)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                var responseResult = new ResponseListResult <T>();
                responseResult.TotalCount = dsResult.Tables[1].Rows[0][0].ToString().ToInt();
                responseResult.LstResult  = dsResult.Tables[0].ConvertToList <T>();

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
Beispiel #20
0
        /// <summary>
        /// 根据过滤条件,返回检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        /// <returns></returns>
        public virtual void SearchData(
            BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            V        dal    = new V();
            List <T> result = result = dal.SearchData(baseFilter);

            if (result == null || result.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                var responseResult = new ResponseListResult <T>();
                responseResult.TotalCount = result.Count;
                responseResult.LstResult  = result;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(SearchBusinessListFilter baseFilter, ResponseEntity responseEntity)
        {
            if (baseFilter == null)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            List <string> companys = Singleton <RedisEnumOperatorBLL> .Instance.GetUserOwnCompanyKeys(responseEntity.UserId);

            baseFilter.BranchKey = string.Join("','", companys.ToArray());

            var businessDetail
                = Singleton <BusinessDetailDAL <BusinessDetailViewData> > .Instance.SearchData(baseFilter);

            if (businessDetail == null || businessDetail.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
            }
            else
            {
                foreach (var business in businessDetail)
                {
                    business.LoanKindName = Singleton <RedisEnumOperatorBLL> .Instance.GetRedisData(
                        RedisEnumOperatorBLL.HashId_LoanKind_6, business.LoanKind).Name;

                    business.RegionName = Singleton <RedisEnumOperatorBLL> .Instance.GetRedisData(
                        RedisEnumOperatorBLL.HashId_Region_9, business.Region).Name;
                }

                var responseResult = new ResponseListResult <BusinessDetailViewData>();
                responseResult.TotalCount = businessDetail.Count;
                responseResult.LstResult  = businessDetail;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 服务执行
        /// </summary>
        /// <param name="requestEntity">请求数据</param>
        /// <param name="responseEntity">返回数据</param>
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            IDictionary <string, string> paraDict             = requestEntity.Parameters;
            SearchBusinessListFilter     filter               = ServiceUtility.ConvertToFilterFromDict <SearchBusinessListFilter>(paraDict);
            List <BusinessViewData>      businessViewDataList = Singleton <BusinessDAL> .Instance.GetViewData(filter);

            if (filter.RecordCount <= 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
                return;
            }
            else
            {
                ResponseListResult <BusinessViewData> result = new ResponseListResult <BusinessViewData>();

                result.TotalCount             = (int)filter.RecordCount;
                result.LstResult              = businessViewDataList;
                responseEntity.ResponseStatus = (int)EnumResponseState.Success;
                responseEntity.Results        = result;
            }
        }
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            if (baseFilter == null)
            {
                return;
            }

            OverDueDetailFilter filter = baseFilter as OverDueDetailFilter;

            if (filter == null)
            {
                return;
            }

            string guid = Guid.NewGuid().ToString();

            // 保存业务号列表到数据库
            SaveBusinessIDsListToDataBase(guid, filter.BusinessIds);

            filter.Guid = guid;
            var reportDetailList = Singleton <GetOverDueReportDetailByBusinessIdsDAL <OverDueReportDetailViewData> >
                                   .Instance.SearchData(filter);

            if (reportDetailList == null || reportDetailList.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
            }
            else
            {
                var responseResult = new ResponseListResult <OverDueReportDetailViewData>();
                responseResult.TotalCount = reportDetailList.Count;
                responseResult.LstResult  = reportDetailList;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 根据条件查询数据
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public virtual void Search(BusinessGuaranteeFilter filter
                                   , ResponseEntity responseEntity)
        {
            var reportDetailList = Singleton <GuarLitigationSearchDAL <BusinessGuaranteeViewData> >
                                   .Instance.SearchData(filter);

            int count = Singleton <GuarLitigationSearchDAL <BusinessGuaranteeViewData> >
                        .Instance.GetCount(filter);

            if (reportDetailList == null || reportDetailList.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
            }
            else
            {
                foreach (var guarantee in reportDetailList)
                {
                    guarantee.LendingSideKeyName = Singleton <RedisEnumOperatorBLL> .Instance
                                                   .GetRedisData(RedisEnumOperatorBLL.HashId_LendingGroup_4, guarantee.LendingSideKey).Name;
                }

                var responseResult = new ResponseListResult <BusinessGuaranteeViewData>();
                if (filter.IsPage)
                {
                    responseResult.TotalCount = count;
                }
                else
                {
                    responseResult.TotalCount = 1;
                }
                responseResult.LstResult = reportDetailList;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
Beispiel #25
0
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(EveryDueRepayReportSearchFilter filter, ResponseEntity responseEntity)
        {
            if (filter == null)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.RequestCommandError);
                return;
            }

            var reportDetailList
                = Singleton <EveryDueRepayReportSearchDAL <EveryDueRepayDetailReportViewData> >
                  .Instance.SearchData(filter);

            if (reportDetailList == null || reportDetailList.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据!。");
            }
            else
            {
                ConvertUtil.ConvertEveryDueRepayDetailReportViewData(reportDetailList);

                IDictionary <string, object> outPutParam = filter.outParams;
                int totalCount = 0;
                if (!int.TryParse(outPutParam["@TotalCount"].ToString(), out totalCount))
                {
                    totalCount = reportDetailList.Count;
                }

                reportDetailList.ForEach(x => x.TotalCount = totalCount);
                var responseResult = new ResponseListResult <EveryDueRepayDetailReportViewData>();
                responseResult.TotalCount = totalCount;
                responseResult.LstResult  = reportDetailList;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 保存修改信息
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public virtual void Update(BusinessGuaranteeSaveFilter filter
                                   , ResponseEntity responseEntity)
        {
            string guid = "";

            if (filter.IsAddNewBill)
            {
                guid = Guid.NewGuid().ToString();
                Bill bill = CreateBill(filter, EnumBillKind.Litigation);
                bill.BillItems = new List <BillItem>();
                // 诉讼费
                bill.BillItems.Add(CreateBillItem(EnumCostSubject.Litigation, filter.LegalCost.ToDecimal(), filter.UserId));
                // 诉讼违约金
                bill.BillItems.Add(CreateBillItem(EnumCostSubject.LitigationLateFee, filter.LegalPenalty.ToDecimal(), filter.UserId));
                //未出账款项列表
                bill.BillItems.AddRange(NoCreateBillItem(filter));

                // 保存账单信息到数据库
                SaveBillToDataBase(guid, bill);
                // 保存账单明细到数据库
                SaveBillItemToDataBase(guid, bill.BillItems);
            }

            int count = Singleton <GuarLitigationSaveDAL> .Instance.UpdateBusiness(guid, filter);

            if (count <= 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Others, "更新失败。");
                m_Logger.Info("更新失败。");
            }
            else
            {
                var responseResult = new ResponseListResult <BusinessViewData>();
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
Beispiel #27
0
        /// <summary>
        /// 程序执行主入口
        /// </summary>
        /// <param name="requestEntity"></param>
        /// <param name="responseEntity"></param>
        protected override void DoExecute(RequestEntity requestEntity, ResponseEntity responseEntity)
        {
            string errorMessage = "";

            // 记录执行时间类
            using (StopWatcherAuto auto = new StopWatcherAuto())
            {
                try
                {
                    // 定义接收客户端参数的变量
                    IDictionary <string, string> paraDict = requestEntity.Parameters;
                    BadTransferFilter            filter   = LogicUtility.ConvertToFilterFromDict <BadTransferFilter>(paraDict);

                    // 获取坏账清贷欠费账单信息(欠费账单(当期+逾期))
                    var oweBills
                        = Singleton <BadTransferDal> .Instance.GetBadTransferOweBill(filter.CloanApplyID);

                    int    businessId    = 0;
                    string path          = "";
                    int    i             = 0;
                    var    detailResults = new List <BadTransferDetailResultData>();
                    if (oweBills != null && oweBills.Count > 0)
                    {
                        var data = oweBills[0];
                        businessId = data.BusinessID;
                        path       = data.Path;
                        var product  = ProductFactory.Instance.GetProduct(data.BusinessLogicID);
                        var dirItems = product.GetProductItems();
                        foreach (var item in dirItems)
                        {
                            var subj = item.Key.ValueToEnum <EnumCostSubject>();
                            m_Logger.Debug("费用科目:" + subj);
                            decimal tAmt = oweBills.Where(x => x.Subject == (byte)subj)
                                           .Sum(o => o.DueAmt - o.ReceivedAmt);
                            m_Logger.Debug("费用金额:" + tAmt);

                            var resultData = new BadTransferDetailResultData();
                            resultData.SubjectId    = (byte)subj;
                            resultData.SubjectName  = item.Value.Replace("月", string.Empty);
                            resultData.SubjectValue = tAmt;
                            resultData.SubjectType  = WebServiceConst.BadTransferFeeType_OweBill;
                            resultData.Order        = ++i;
                            resultData.Path         = path;
                            detailResults.Add(resultData);
                        }
                    }

                    if (businessId != 0)
                    {
                        // 获取坏账清贷欠费账单信息(其它费用)
                        var otherResult
                            = Singleton <BadTransferDal> .Instance.GetBadTransferOtherFee(businessId);

                        if (otherResult != null && otherResult.Count > 0)
                        {
                            foreach (BadTransferDetailOtherData data in otherResult)
                            {
                                var resultData = new BadTransferDetailResultData();
                                resultData.SubjectId    = (byte)EnumCostSubject.GuaranteeLateFee;
                                resultData.SubjectName  = EnumCostSubject.GuaranteeLateFee.ToDescription();
                                resultData.SubjectValue = data.GuaranteeLateFee;
                                resultData.SubjectType  = WebServiceConst.BadTransferFeeType_Other;
                                resultData.Order        = ++i;
                                detailResults.Add(resultData);

                                resultData              = new BadTransferDetailResultData();
                                resultData.SubjectId    = (byte)EnumCostSubject.Litigation;
                                resultData.SubjectName  = EnumCostSubject.Litigation.ToDescription();
                                resultData.SubjectValue = data.Litigation;
                                resultData.SubjectType  = WebServiceConst.BadTransferFeeType_Other;
                                resultData.Order        = ++i;
                                detailResults.Add(resultData);

                                resultData              = new BadTransferDetailResultData();
                                resultData.SubjectId    = (byte)EnumCostSubject.LitigationLateFee;
                                resultData.SubjectName  = EnumCostSubject.LitigationLateFee.ToDescription();
                                resultData.SubjectValue = data.LitigationLateFee;
                                resultData.SubjectType  = WebServiceConst.BadTransferFeeType_Other;
                                resultData.Order        = ++i;
                                detailResults.Add(resultData);
                            }
                        }
                    }

                    var responseResult = new ResponseListResult <BadTransferDetailResultData>();
                    responseResult.LstResult = detailResults;

                    responseEntity.ResponseStatus = (int)EnumResponseState.Success;
                    responseEntity.Results        = responseResult;
                }
                catch (Exception ex)
                {
                    errorMessage = "";
                    responseEntity.ResponseStatus  = (int)EnumResponseState.Others;
                    responseEntity.ResponseMessage = "获取坏账清贷详细信息失败。" + ex.Message.ToString();
                    m_Logger.Error("获取坏账清贷详细信息失败:" + ex.Message.ToString());
                    m_Logger.Error("获取坏账清贷详细信息失败:" + ex.StackTrace.ToString());
                }
                finally
                {
                    if (errorMessage.Length > 0)
                    {
                        responseEntity.ResponseStatus  = (int)EnumResponseState.Others;
                        responseEntity.ResponseMessage = errorMessage;
                    }
                }
            }
        }
Beispiel #28
0
        /// <summary>
        /// 根据过滤条件,返回检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        /// <returns></returns>
        public void SearchDataByFilter(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            BadTransferFilter filter = baseFilter as BadTransferFilter;

            if (filter == null)
            {
                return;
            }

            // 获取坏账清贷欠费账单信息(欠费账单(当期+逾期))
            var oweBills
                = Singleton <BadTransferDetailDAL> .Instance.GetBadTransferOweBill(filter.CloanApplyID);

            int    businessId    = 0;
            string path          = "";
            int    i             = 0;
            var    detailResults = new List <BadTransferDetailResultViewData>();

            if (oweBills != null && oweBills.Count > 0)
            {
                var data = oweBills[0];
                businessId = data.BusinessID;
                path       = data.Path;
                var product  = ProductFactory.Instance.GetProduct(data.BusinessLogicID);
                var dirItems = product.GetProductItems();
                foreach (var item in dirItems)
                {
                    var subj = item.Key.ValueToEnum <EnumCostSubject>();
                    m_Logger.Debug("费用科目:" + subj);
                    decimal tAmt = oweBills.Where(x => x.Subject == (byte)subj)
                                   .Sum(o => o.DueAmt - o.ReceivedAmt);
                    m_Logger.Debug("费用金额:" + tAmt);

                    var resultData = new BadTransferDetailResultViewData();
                    resultData.SubjectId    = (byte)subj;
                    resultData.SubjectName  = item.Value.Replace("月", string.Empty);
                    resultData.SubjectValue = tAmt;
                    resultData.SubjectType  = WebServiceConst.BadTransferFeeType_OweBill;
                    resultData.Order        = ++i;
                    resultData.Path         = path;
                    detailResults.Add(resultData);
                }
            }

            if (businessId != 0)
            {
                // 获取坏账清贷欠费账单信息(其它费用)
                var otherResult
                    = Singleton <BadTransferDetailDAL> .Instance.GetBadTransferOtherFee(businessId);

                if (otherResult != null && otherResult.Count > 0)
                {
                    foreach (BadTransferDetailOtherData data in otherResult)
                    {
                        var resultData = new BadTransferDetailResultViewData();
                        resultData.SubjectId    = (byte)EnumCostSubject.GuaranteeLateFee;
                        resultData.SubjectName  = EnumCostSubject.GuaranteeLateFee.ToDescription();
                        resultData.SubjectValue = data.GuaranteeLateFee;
                        resultData.SubjectType  = WebServiceConst.BadTransferFeeType_Other;
                        resultData.Order        = ++i;
                        detailResults.Add(resultData);

                        resultData              = new BadTransferDetailResultViewData();
                        resultData.SubjectId    = (byte)EnumCostSubject.Litigation;
                        resultData.SubjectName  = EnumCostSubject.Litigation.ToDescription();
                        resultData.SubjectValue = data.Litigation;
                        resultData.SubjectType  = WebServiceConst.BadTransferFeeType_Other;
                        resultData.Order        = ++i;
                        detailResults.Add(resultData);

                        resultData              = new BadTransferDetailResultViewData();
                        resultData.SubjectId    = (byte)EnumCostSubject.LitigationLateFee;
                        resultData.SubjectName  = EnumCostSubject.LitigationLateFee.ToDescription();
                        resultData.SubjectValue = data.LitigationLateFee;
                        resultData.SubjectType  = WebServiceConst.BadTransferFeeType_Other;
                        resultData.Order        = ++i;
                        detailResults.Add(resultData);
                    }
                }
            }

            var responseResult = new ResponseListResult <BadTransferDetailResultViewData>();

            responseResult.LstResult = detailResults;

            ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
            responseEntity.Results = responseResult;
        }
        /// <summary>
        /// 检索数据
        /// </summary>
        /// <param name="baseFilter"></param>
        /// <param name="responseEntity"></param>
        public void SearchData(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            if (baseFilter == null)
            {
                return;
            }

            TimeLineInitFilter filter = baseFilter as TimeLineInitFilter;

            if (filter == null)
            {
                return;
            }

            var lstCloseDays = Singleton <TimeLineCloseDayInitDAL> .Instance.SearchData(baseFilter);

            List <CloseBillTimeViewData> listTime = new List <CloseBillTimeViewData>();

            if (lstCloseDays != null &&
                lstCloseDays.Count > 0)
            {
                //var userPermissionDataList = Singleton<CompanyCache>.Instance.GetPermission(baseFilter.UserId);
                //List<int> CompanyIds = Singleton<CompanyCache>.Instance.CompanyIds(baseFilter.UserId);
                //foreach (var permission in userPermissionDataList)
                //{
                //    CompanyKeys.Add(permission.FullKey);
                //}
                List <string> companyKeys
                    = filter.CompanyKeys.Split(WebServiceConst.Separater_Comma.ToArray()).ToList();
                int order = 0;

                //判断是否有权修改
                foreach (var item in lstCloseDays)
                {
                    BankAccount company = Singleton <BankAccountsCache>
                                          .Instance.BankAccounts.FirstOrDefault(x => x.CompanyKey == item.CompanyKey);

                    if (company == null)
                    {
                        continue;
                    }

                    if (!companyKeys.Contains(company.CompanyKey))
                    {
                        continue;
                    }

                    listTime.Add(new CloseBillTimeViewData
                    {
                        CloseBillDayID = item.CloseBillDayID,
                        CompanyName    = company.AccountNumber,
                        LatestTime     = item.LatestTime.ToDateString(),
                        OriginalTime   = item.OriginalTime.ToDateString(),
                        OperatorID     = baseFilter.UserId,
                        Order          = ++order,
                        DataType       = WebServiceConst.TimeLineType_CloseDay
                    });
                }
            }

            if (listTime == null || listTime.Count == 0)
            {
                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                m_Logger.Info("未查询到数据。");
            }
            else
            {
                var responseResult = new ResponseListResult <CloseBillTimeViewData>();
                responseResult.LstResult = listTime;

                ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.Success);
                responseEntity.Results = responseResult;
            }
        }
        /// <summary>
        /// 查询枚举
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="responseEntity"></param>
        public void QueryEnumeration(BaseFilter baseFilter, ResponseEntity responseEntity)
        {
            QueryEnumerationFilter filter = baseFilter as QueryEnumerationFilter;

            if (null == filter)
            {
                responseEntity.ResponseStatus  = (int)EnumResponseState.RequestCommandError;
                responseEntity.ResponseMessage = "获取枚举失败,入参校验错误";
                return;
            }

            if (string.IsNullOrEmpty(filter.FullKey))
            {
                if (string.IsNullOrEmpty(filter.EnumID))
                {
                    responseEntity.ResponseStatus  = (int)EnumResponseState.RequestCommandError;
                    responseEntity.ResponseMessage = "获取枚举失败,FullKey和ID均无值";
                    return;
                }
            }
            else
            {
                //传入FullKey的话,优先使用FullKey作为查询条件
                filter.EnumID = string.Empty;

                // 获取所有的下拉框列表数据
                var lstEnumRedisDataEntity = Singleton <RedisEnumOperatorBLL> .Instance.GetEnumRedisDataEntitys <EnumRedisDataEntity>();

                var      list = new List <EnumerationViewData>();
                string[] keys = filter.FullKey.Split(
                    WebServiceConst.Separater_Comma.ToArray(), StringSplitOptions.RemoveEmptyEntries);
                foreach (var key in keys)
                {
                    if (key == SysConst.TEAM)
                    {
                        list.AddRange(GetTeamEnumerationViewData(key).ToArray());
                    }
                    else if (key == SysConst.REGION_STORE)
                    {
                        list.AddRange(GetRegionStoreEnumerationViewData(key).ToArray());
                    }
                    else if (key == SysConst.REGION)
                    {
                        list.AddRange(GetRegionEnumerationViewData(key).ToArray());
                    }
                    else if (key == SysConst.STORE)
                    {
                        list.AddRange(GetStoreEnumerationViewData(key).ToArray());
                    }
                    else
                    {
                        list.AddRange(GetEnumerationViewData(key, lstEnumRedisDataEntity).ToArray());
                    }
                }

                if (null != list &&
                    list.Count > 0)
                {
                    var responseResult = new ResponseListResult <EnumerationViewData>();
                    responseResult.TotalCount      = list.Count;
                    responseResult.LstResult       = list;
                    responseEntity.Results         = responseResult;
                    responseEntity.ResponseStatus  = (int)EnumResponseState.Success;
                    responseEntity.ResponseMessage = "处理成功";
                }
                else
                {
                    ServiceUtility.SetResponseStatus(responseEntity, EnumResponseState.NoResult);
                    m_Logger.Info("未查询到数据!。");
                    return;
                }
            }
        }