Example #1
0
        public string GetRecordListNum([FromUri] BillRequestModel billRequest)
        {
            if (billRequest == null || billRequest.Uid == 0)
            {
                return(DCHelper.ErrorMessage("用户id为空!"));
            }

            /*if (string.IsNullOrEmpty(billRequest.OrgCode))
             * {
             *  return DCHelper.ErrorMessage("组织编码为空!");
             * }*/
            if (billRequest.Orgid == 0)
            {
                return(DCHelper.ErrorMessage("组织id为空!"));
            }
            if (string.IsNullOrEmpty(billRequest.Year))
            {
                return(DCHelper.ErrorMessage("年度为空!"));
            }

            try
            {
                //获取审批所有类型
                List <QTSysSetModel> procTypes = QTSysSetService.GetProcTypes();
                if (procTypes != null && procTypes.Count > 0)
                {
                    //若是初次加载,则获取所有组织的审批信息
                    if (billRequest.IsFirst == 1)
                    {
                        //RELATID = 'lg' AND PARENTORG IS null
                        var orgRelatitems = this.OrgRelatitem2Service.Find(t => t.RelatId == "lg" && t.ParentOrgId == 0).Data;
                        if (orgRelatitems != null && orgRelatitems.Count == 1)
                        {
                            billRequest.Orgid = orgRelatitems[0].OrgId;
                        }
                    }
                    foreach (var sysSet in procTypes)
                    {
                        billRequest.BType     = sysSet.Value;
                        billRequest.Splx_Phid = sysSet.PhId;
                        int total = 0;
                        List <AppvalRecordVo> recordVos = GAppvalRecordService.GetDoneRecordList(billRequest, out total);
                        int total2 = 0;
                        List <AppvalRecordVo> recordVos2 = GAppvalRecordService.GetUnDoRecordList(billRequest, out total2);

                        sysSet.YNum = total;
                        sysSet.NNum = total2;
                    }
                }
                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    Data = procTypes
                }));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
Example #2
0
        public string GetAppvalProcList([FromUri] BillRequestModel billRequest)
        {
            if (billRequest == null || billRequest.Orgid == 0)
            {
                return(DCHelper.ErrorMessage("组织id为空!"));
            }
            if (string.IsNullOrEmpty(billRequest.BType))
            {
                return(DCHelper.ErrorMessage("单据类型为空!"));
            }

            try
            {
                List <GAppvalProcModel> procModels = new List <GAppvalProcModel>();
                //先判断这个审批流的类型还在不在
                var oldset = this.QTSysSetService.Find(t => t.DicType == "splx" && t.Value == billRequest.BType).Data;
                if (oldset != null && oldset.Count > 0)
                {
                    //throw new Exception("审批流类型配置不能重复!");
                    List <long> bPhids = JsonConvert.DeserializeObject <List <long> >(billRequest.BPhIds);

                    //procModels = GAppvalProcService.GetAppvalProcList(billRequest.Orgid, billRequest.BType, 0, bPhids);
                    procModels = GAppvalProcService.GetAppvalProcList(billRequest.Orgid, billRequest.BType, oldset[0].PhId, bPhids);
                }
                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    Data = procModels
                }));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
Example #3
0
        public string PostDoneRecordList([FromBody] BillRequestModel billRequest)
        {
            if (billRequest == null || billRequest.Uid == 0)
            {
                return(DCHelper.ErrorMessage("用户id为空!"));
            }

            /*if (string.IsNullOrEmpty(billRequest.OrgCode))
             * {
             *  return DCHelper.ErrorMessage("组织编码为空!");
             * }*/
            if (billRequest.Orgid == 0)
            {
                return(DCHelper.ErrorMessage("组织id为空!"));
            }
            if (string.IsNullOrEmpty(billRequest.Year))
            {
                return(DCHelper.ErrorMessage("年度为空!"));
            }
            if (billRequest.PageIndex == 0 || billRequest.PageSize == 0)
            {
                return(DCHelper.ErrorMessage("分页参数不正确!"));
            }
            if (string.IsNullOrEmpty(billRequest.BType))
            {
                return(DCHelper.ErrorMessage("单据类型为空!"));
            }
            if (billRequest.Splx_Phid == 0)
            {
                return(DCHelper.ErrorMessage("审批类型id为空!"));
            }
            try
            {
                int total = 0;
                //若是初次加载,则获取所有组织的审批信息
                if (billRequest.IsFirst == 1)
                {
                    //RELATID = 'lg' AND PARENTORG IS null
                    var orgRelatitems = this.OrgRelatitem2Service.Find(t => t.RelatId == "lg" && t.ParentOrgId == 0).Data;
                    if (orgRelatitems != null && orgRelatitems.Count == 1)
                    {
                        billRequest.Orgid = orgRelatitems[0].OrgId;
                    }
                }
                List <AppvalRecordVo> recordVos = GAppvalRecordService.GetDoneRecordList(billRequest, out total);
                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    Data = recordVos,
                    Total = total
                }));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
Example #4
0
 public IHttpActionResult CheckIfLinesExisted([FromBody] BillRequestModel billRequestModel)
 {
     //checks if 1 or more of this line didnt existed at that date
     for (int i = 0; i < billRequestModel.Lines.Count; i++)
     {
         if (!linesManager.LineExistedAtDate(billRequestModel.Lines[i], billRequestModel.Date))
         {
             return(Ok(false));
         }
     }
     return(Ok(true));
 }
Example #5
0
        public string GetPaymentList4Zjbf2([FromUri] Parameter parameters)
        {
            if (parameters == null || string.IsNullOrEmpty(parameters.uid))
            {
                return(DCHelper.ErrorMessage("用户id为空!"));
            }
            if (string.IsNullOrEmpty(parameters.orgid))
            {
                return(DCHelper.ErrorMessage("组织编码为空!"));
            }
            if (string.IsNullOrEmpty(parameters.Ryear))
            {
                return(DCHelper.ErrorMessage("年度为空!"));
            }
            if (parameters.pageindex < 0 || parameters.pagesize == 0)
            {
                return(DCHelper.ErrorMessage("分页参数不正确!"));
            }

            string[] sorts = parameters.sort;
            if (sorts == null || sorts.Length < 1)
            {
                sorts = new string[] { "NgInsertDt desc" };
            }

            try
            {
                Dictionary <string, object> dicWhere = DataConverterHelper.ConvertToDic(parameters.queryfilter ?? "");

                //二次处理dic
                DCHelper.ConvertDic <GKPaymentMstModel>(dicWhere);

                BillRequestModel billRequest = new BillRequestModel();
                billRequest.Year  = parameters.Ryear;
                billRequest.Uid   = long.Parse(parameters.uid);
                billRequest.BType = "002";
                billRequest.Orgid = long.Parse(parameters.orgid);

                var result = GKPaymentMstService.GetPaymentList4Zjbf2(billRequest, parameters.pageindex, parameters.pagesize, dicWhere, sorts);
                IList <GKPayment4ZjbfModel> list = new List <GKPayment4ZjbfModel>();
                if (result != null && result.Results != null)
                {
                    list = result.Results;
                }


                return(DCHelper.ModelListToJson <GKPayment4ZjbfModel>(list, result.TotalItems, parameters.pageindex, parameters.pagesize));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
        private void Calculate(object obj)
        {
            List <string> Checkedlines = new List <string>();

            foreach (var item in cbObjects)
            {
                if (item.IsSelected)
                {
                    Checkedlines.Add(item.ObjectData.Number);
                }
            }
            YearAndMonth     selectedDate               = new YearAndMonth(SelectedYear, SelectedMonth);
            BillRequestModel billRequestModel           = new BillRequestModel(currentClient.ID, Checkedlines, selectedDate);
            Tuple <object, HttpStatusCode> returnTuple1 = httpClient.PostRequest(ApiConfigs.CheckIfLineExistedRoute, billRequestModel);

            if (returnTuple1.Item2 == HttpStatusCode.OK)
            {
                if ((bool)returnTuple1.Item1)
                {
                    Tuple <object, HttpStatusCode> returnTuple = httpClient.PostRequest(ApiConfigs.GetSpecficLinesBillRoute, billRequestModel);
                    if (returnTuple.Item2 == HttpStatusCode.OK)
                    {
                        JObject jObject = new JObject();
                        jObject = (JObject)returnTuple.Item1;
                        ClientBill clientBill = jObject.ToObject <ClientBill>();
                        BillWindow billWindow = new BillWindow(clientBill, selectedDate);
                        billWindow.Show();
                        CloseThisWindow();
                    }
                }
                else
                {
                    logger.Print("One or more of the selected lines didnt exist in the selected date");
                }
            }
            else
            {
                logger.Print(returnTuple1.Item2.ToString());
            }
        }
Example #7
0
 public string PostNewAppvalProcList([FromBody] BillRequestModel billRequest)
 {
     if (billRequest == null || string.IsNullOrEmpty(billRequest.OrgCode))
     {
         return(DCHelper.ErrorMessage("组织id为空!"));
     }
     if (string.IsNullOrEmpty(billRequest.BType))
     {
         return(DCHelper.ErrorMessage("单据类型为空!"));
     }
     try
     {
         //根据组织code获取组织id
         OrganizeModel organize = this.BudgetMstService.GetOrganizeByCode(billRequest.OrgCode);
         if (organize == null)
         {
             return(DCHelper.ErrorMessage("组织查询失败!"));
         }
         List <GAppvalProcModel> procModels = GAppvalProcService.GetAppvalProc(organize.PhId, billRequest.BType, 0);
         if (procModels != null && procModels.Count == 1)
         {
             return(DataConverterHelper.SerializeObject(new
             {
                 Status = "success",
                 Data = procModels
             }));
         }
         else
         {
             return(DCHelper.ErrorMessage("您所选的单据的审批流程不唯一,不能进行批量筛选!"));
         }
     }
     catch (Exception e)
     {
         return(DCHelper.ErrorMessage(e.Message));
     }
 }
Example #8
0
        public string GetAppvalProc([FromUri] BillRequestModel billRequest)
        {
            if (billRequest == null || billRequest.Orgid == 0)
            {
                return(DCHelper.ErrorMessage("组织id为空!"));
            }
            if (string.IsNullOrEmpty(billRequest.BType))
            {
                return(DCHelper.ErrorMessage("单据类型为空!"));
            }

            try
            {
                List <GAppvalProcModel> procModels = GAppvalProcService.GetAppvalProc(billRequest.Orgid, billRequest.BType, 0);
                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    Data = procModels
                }));
            }
            catch (Exception e) {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }
Example #9
0
 public IHttpActionResult GetSpecficLinesBiil([FromBody] BillRequestModel billRequestModel)
 {
     //returns the bill for the specific lines chosen
     return(Ok(linesManager.GetBillForSpecificLines(billRequestModel.ClientID, billRequestModel.Date, billRequestModel.Lines)));
 }
        /// <summary>
        /// 获取所有审批种类对应的审批单据的总数量
        /// </summary>
        /// <returns>返回Json串</returns>
        public string GetRecordListNum()
        {
            long   Uid   = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["Uid"]);
            long   Orgid = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["Orgid"]);
            string Year  = System.Web.HttpContext.Current.Request.Params["Year"];

            if (Uid == 0)
            {
                return(DCHelper.ErrorMessage("用户id为空!"));
            }
            if (Orgid == 0)
            {
                return(DCHelper.ErrorMessage("组织id为空!"));
            }
            if (string.IsNullOrEmpty(Year))
            {
                return(DCHelper.ErrorMessage("年度为空!"));
            }

            //设置当前数据库连接信息
            ConnectionInfoService.SetCallContextConnectString(NG3.AppInfoBase.UserConnectString);
            MultiDelegatingDbProvider.CurrentDbProviderName = NG3.AppInfoBase.DbName;

            BillRequestModel billRequest = new BillRequestModel();

            billRequest.Uid   = Uid;
            billRequest.Orgid = Orgid;
            billRequest.Year  = Year;
            var YNum = 0; //已审数量
            var NNum = 0; //待审数量

            try
            {
                //获取审批所有类型
                List <QTSysSetModel> procTypes = QTSysSetService.GetProcTypes();
                if (procTypes != null && procTypes.Count > 0)
                {
                    foreach (var sysSet in procTypes)
                    {
                        billRequest.BType     = sysSet.Value;
                        billRequest.Splx_Phid = sysSet.PhId;
                        int total = 0;
                        List <AppvalRecordVo> recordVos = GAppvalRecordService.GetDoneRecordList(billRequest, out total);
                        int total2 = 0;
                        List <AppvalRecordVo> recordVos2 = GAppvalRecordService.GetUnDoRecordList(billRequest, out total2);

                        YNum += total;
                        NNum += total2;
                    }
                }
                var dic = new Dictionary <string, object>();
                new CreateCriteria(dic).Add(ORMRestrictions <Int64> .NotEq("PhId", 0));
                new CreateCriteria(dic).Add(ORMRestrictions <List <Int32> > .In("FState", new List <int>()
                {
                    2, 0
                }));
                new CreateCriteria(dic).Add(ORMRestrictions <Int64> .Eq("OrgPhid", Orgid));
                new CreateCriteria(dic).Add(ORMRestrictions <string> .Eq("FYear", Year));
                //var Query = GKPaymentMstService.GetPaymentFailure(dic);
                var Query = GKPaymentMstService.Find(dic).Data;
                return(DataConverterHelper.SerializeObject(new
                {
                    Status = "success",
                    YNum = YNum,
                    NNum = NNum,
                    PaymentState = Query.Count//【待支付】信息提醒需求
                }));
            }
            catch (Exception e)
            {
                return(DCHelper.ErrorMessage(e.Message));
            }
        }