public ActionResult BorrowBill(string BillNo = null, string Mode = null, string IsCopy = null) { FeeBillModelRef model = new FeeBillModelRef(); if (!string.IsNullOrEmpty(BillNo)) { //草稿箱功能(暂时还没有) if (BillNo.Contains("CJ")) { //暂时没处理 } //编辑功能 else if (BillNo.Contains("JS")) { BorrowBill BB_Bl = new BLL.BorrowBill(); BorrowBillModel BorrowModel = BB_Bl.GetBillModel(BillNo); model.ModelString = Public.JsonSerializeHelper.SerializeToJson(BorrowModel); model.BillNo = BorrowModel.BillNo; model.PersonInfo = new PersonInfo() { Company = BorrowModel.PersonInfo.Company, CompanyCode = BorrowModel.PersonInfo.CompanyCode, CostCenter = BorrowModel.PersonInfo.CostCenter, Department = BorrowModel.PersonInfo.Department, DepartmentCode = BorrowModel.PersonInfo.DepartmentCode, IsHeadOffice = BorrowModel.PersonInfo.IsHeadOffice, Shop = BorrowModel.PersonInfo.Shop, ShopCode = BorrowModel.PersonInfo.ShopCode }; model.Owner = BorrowModel.Owner; model.WorkNumber = BorrowModel.WorkNumber; model.Remark = BorrowModel.Remark; model.TransactionDate = BorrowModel.TransactionDate; if (!string.IsNullOrEmpty(IsCopy)) { model.IsCopy = 1; //复制即累加次数 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CopyCount", (model.CopyCount + 1).ToString()); var status = BB_Bl.PublicEditMethod(model.BillNo, dic); } } } model.PageName = "Borrow"; model.CommitType = CommitType.借款单; return(View(model)); }
public ActionResult NoticeBill(string BillNo = null, string Mode = null, string IsCopy = null) { NoticeBill NB_Bl = new NoticeBill(); List <NoticeBillModel> modellist = NB_Bl.FindSuitableData("良"); FeeBillModelRef model = new FeeBillModelRef(); if (!string.IsNullOrEmpty(BillNo)) { //草稿箱功能(暂时还没有) if (BillNo.Contains("CK")) { //暂时没处理 } //编辑功能 else if (BillNo.Contains("FT")) { NoticeBillModel NoticeModel = NB_Bl.GetBillModel(BillNo); model.ModelString = Public.JsonSerializeHelper.SerializeToJson(NoticeModel); model.BillNo = NoticeModel.BillNo; model.PersonInfo = NoticeModel.PersonInfo; model.Owner = NoticeModel.Owner; model.WorkNumber = NoticeModel.WorkNumber; model.Remark = NoticeModel.Remark; model.TransactionDate = NoticeModel.TransactionDate; if (!string.IsNullOrEmpty(IsCopy)) { model.IsCopy = 1; //复制即累加次数 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CopyCount", (model.CopyCount + 1).ToString()); var status = NB_Bl.PublicEditMethod(model.BillNo, dic); } } } model.PageName = "Notice"; model.CommitType = CommitType.付款通知书; return(View(model)); }
public ActionResult FeeBill(string BillNo = null, string Mode = null, string IsCopy = null) { FeeBillModelRef model = new FeeBillModelRef(); if (!string.IsNullOrEmpty(BillNo)) { //草稿箱功能 if (BillNo.Contains("CG")) { FeeBillModel FeeModel = new DraftBox().GetBillModel(BillNo); model = FeeModel.MapTo <FeeBillModel, FeeBillModelRef>(); model.StringTime = (model.CreateTime.ToString("yyyy-MM-dd")); model.DeleteDraftNo = BillNo; //提交之后需要删除草稿箱 model.ModelString = Public.JsonSerializeHelper.SerializeToJson(model); } //编辑功能 else if (BillNo.Contains("FB")) { FeeBill FB_Bl = new BLL.FeeBill(); FeeBillModel FeeModel = FB_Bl.GetBillModel(BillNo); model = FeeModel.MapTo <FeeBillModel, FeeBillModelRef>(); model.StringTime = (model.CreateTime.ToString("yyyy-MM-dd")); if (!string.IsNullOrEmpty(IsCopy)) { model.IsCopy = 1; //复制即累加次数 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CopyCount", (model.CopyCount + 1).ToString()); var status = FB_Bl.PublicEditMethod(model.BillNo, dic); } model.ModelString = Public.JsonSerializeHelper.SerializeToJson(model); } } model.PageName = "FeeBill"; model.CommitType = CommitType.费用报销单; return(View(model)); }
/// <summary> /// 还款界面 /// </summary> /// <param name="BorrowNo">借款单号</param> /// <param name="RefundType">还款类型</param> /// <returns></returns> public ActionResult RefundOperate(string BorrowNo = "", string RefundType = "", string BillNo = "", string Mode = "", string IsCopy = null) { RefundBill RB_Bl = new BLL.RefundBill(); RefundBillModel oldModel = new RefundBillModel(); if (string.IsNullOrEmpty(BorrowNo) && !string.IsNullOrEmpty(BillNo)) { oldModel = RB_Bl.GetBillModel(BillNo); BorrowNo = oldModel.BorrowBillNo; } var BorrowModel = new BorrowBill().GetBillModel(BorrowNo); FeeBillModelRef model = new FeeBillModelRef(); model.PageName = "Refund"; model.CommitType = CommitType.还款单; model.RefundType = RefundType; model.SurplusMoney = BorrowModel.SurplusMoney; model.Owner = BorrowModel.Owner; model.WorkNumber = BorrowModel.WorkNumber; model.BorrowBillNo = BorrowModel.BillNo; model.Currency = BorrowModel.Currency; model.PersonInfo = new PersonInfo() { Company = BorrowModel.PersonInfo.Company, CompanyCode = BorrowModel.PersonInfo.CompanyCode, Department = BorrowModel.PersonInfo.Department, DepartmentCode = BorrowModel.PersonInfo.DepartmentCode, IsHeadOffice = BorrowModel.PersonInfo.IsHeadOffice, CostCenter = BorrowModel.PersonInfo.CostCenter, Shop = BorrowModel.PersonInfo.Shop, ShopCode = BorrowModel.PersonInfo.ShopCode }; model.ModelString = Public.JsonSerializeHelper.SerializeToJson(model); if (!string.IsNullOrEmpty(BillNo)) { model.BillNo = BillNo; model.BillsItems = oldModel.BillsItems; model.PersonInfo.Brand = oldModel.PersonInfo.Brand; model.SpecialAttribute = oldModel.SpecialAttribute; model.Remark = oldModel.Remark; model.CountTime = oldModel.CountTime; model.Photos = oldModel.Photos; model.RefundType = oldModel.RefundType; model.TransactionDate = oldModel.TransactionDate; if (!string.IsNullOrEmpty(IsCopy)) { model.IsCopy = 1; //复制即累加次数 Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("CopyCount", (model.CopyCount + 1).ToString()); var status = RB_Bl.PublicEditMethod(model.BillNo, dic); } model.ModelString = Public.JsonSerializeHelper.SerializeToJson(oldModel); } return(View(model)); }
private FeeBillModelRef ConvertData(string wkID) { FeeBillModelRef model = new FeeBillModelRef(); var FeeModel = new FeeBill().GetModelFromWorkFlowID(wkID); if (FeeModel != null) { model = FeeModel.MapTo <FeeBillModel, FeeBillModelRef>(); model.PageName = "FeeBill"; return(model); } var NotcieModel = new NoticeBill().GetModelFromWorkFlowID(wkID); if (NotcieModel != null) { model.BillNo = NotcieModel.BillNo; model.PersonInfo = NotcieModel.PersonInfo; model.TotalMoney = NotcieModel.TotalMoney; model.CreateTime = NotcieModel.CreateTime; model.TransactionDate = NotcieModel.TransactionDate; model.ApprovalTime = NotcieModel.ApprovalTime; model.ApprovalStatus = NotcieModel.ApprovalStatus; model.ApprovalPost = NotcieModel.ApprovalPost; model.Remark = NotcieModel.Remark; model.ProviderName = NotcieModel.ProviderInfo.ProviderName; model.Owner = NotcieModel.Owner; model.Creator = NotcieModel.Creator; model.SpecialAttribute = new SpecialAttribute(); model.SpecialAttribute.Funds = NotcieModel.SpecialAttribute.Funds; model.SpecialAttribute.Agent = NotcieModel.SpecialAttribute.Agent; model.SpecialAttribute.Check = NotcieModel.SpecialAttribute.Check; model.Items = NotcieModel.Items; model.Currency = NotcieModel.Currency; model.WorkNumber = NotcieModel.WorkNumber; model.ProviderCode = NotcieModel.ProviderInfo.ProviderCode; model.Owner = NotcieModel.Owner; model.MissBill = NotcieModel.MissBill; model.WorkFlowID = NotcieModel.WorkFlowID; model.CountTime = new CountTime(); model.Status = NotcieModel.Status; model.PageName = "NoticeBill"; return(model); } var BorrowModel = new BorrowBill().GetModelFromWorkFlowID(wkID); if (BorrowModel != null) { model.BillNo = BorrowModel.BillNo; model.PageName = "BorrowBill"; model.PersonInfo = BorrowModel.PersonInfo; model.TotalMoney = BorrowModel.TotalMoney; model.CreateTime = BorrowModel.CreateTime; model.TransactionDate = BorrowModel.TransactionDate; model.ApprovalTime = BorrowModel.ApprovalTime; model.ApprovalStatus = BorrowModel.ApprovalStatus; model.ApprovalPost = BorrowModel.ApprovalPost; model.Remark = BorrowModel.Remark; model.Owner = BorrowModel.Owner; model.Creator = BorrowModel.Creator; model.SpecialAttribute = BorrowModel.SpecialAttribute; model.Items = BorrowModel.Items; model.Currency = BorrowModel.Currency; model.WorkNumber = BorrowModel.WorkNumber; model.Owner = BorrowModel.Owner; model.WorkFlowID = BorrowModel.WorkFlowID; model.CollectionInfo = BorrowModel.CollectionInfo; model.CountTime = new CountTime(); model.Status = BorrowModel.Status; return(model); } var RefundModel = new RefundBill().GetModelFromWorkFlowID(wkID); if (RefundModel != null) { model = RefundModel.MapTo <RefundBillModel, FeeBillModelRef>(); model.PageName = "RefundBill"; return(model); } return(model); }
/// <summary> /// 获取未办结单据 /// </summary> /// <param name="?"></param> /// <returns></returns> public List <FeeBillModelRef> GetNotFinishBill(string EmployeeNo) { List <FeeBillModelRef> Temp = new List <FeeBillModelRef>(); var FeeModel = new FeeBill().GetNotFinishBill(EmployeeNo); if (FeeModel != null && FeeModel.Count > 0) { foreach (var item in FeeModel) { var model = new FeeBillModelRef() { BillNo = item.BillNo, TotalMoney = item.TotalMoney, Owner = item.Owner }; model.PageName = "费用报销单"; Temp.Add(model); } } var NoticeModel = new NoticeBill().GetNotFinishBill(EmployeeNo); if (NoticeModel != null && NoticeModel.Count > 0) { foreach (var item in NoticeModel) { var model = new FeeBillModelRef() { BillNo = item.BillNo, TotalMoney = item.TotalMoney, Owner = item.Owner }; model.PageName = "付款通知书"; Temp.Add(model); } } var BorrowModel = new BorrowBill().GetNotFinishBill(EmployeeNo); if (BorrowModel != null && BorrowModel.Count > 0) { foreach (var item in BorrowModel) { var model = new FeeBillModelRef() { BillNo = item.BillNo, TotalMoney = item.TotalMoney, Owner = item.Owner }; model.PageName = "借款单"; Temp.Add(model); } } var RefundModel = new RefundBill().GetNotFinishBill(EmployeeNo); if (RefundModel != null && RefundModel.Count > 0) { foreach (var item in RefundModel) { var model = new FeeBillModelRef() { BillNo = item.BillNo, TotalMoney = item.RealRefundMoney, Owner = item.Owner }; model.PageName = "还款单"; Temp.Add(model); } } return(Temp); }
public string GetReportData(int billType, int Time, int departmentID, string operation, string StartTime = "", string EndTime = "") { var employee = Marisfrolg.Public.Common.GetEmployeeInfo(); //我搁置的单 if (operation == "1") { List <FeeBillModelRef> AllModel = new List <FeeBillModelRef>(); var Temp1 = new FeeBill().ReturnShelveNo(employee.EmployeeName); var Temp2 = new NoticeBill().ReturnShelveNo(employee.EmployeeNo); var Temp3 = new BorrowBill().ReturnShelveNo(employee.EmployeeNo); var Temp4 = new RefundBill().ReturnShelveNo(employee.EmployeeNo); foreach (var item1 in Temp1) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item1.BillNo, PageName = "费用报销单", Creator = item1.Creator, Owner = item1.Owner, TotalMoney = item1.TotalMoney, StringTime = item1.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item1.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item1.PersonInfo.DepartmentCode, Department = item1.PersonInfo.Department } }; AllModel.Add(TempModel); } foreach (var item2 in Temp2) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item2.BillNo, PageName = "付款通知书", Creator = item2.Creator, Owner = item2.Owner, TotalMoney = item2.TotalMoney, StringTime = item2.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item2.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item2.PersonInfo.DepartmentCode, Department = item2.PersonInfo.Department } }; AllModel.Add(TempModel); } foreach (var item3 in Temp3) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item3.BillNo, PageName = "借款单", Creator = item3.Creator, Owner = item3.Owner, TotalMoney = item3.TotalMoney, StringTime = item3.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item3.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item3.PersonInfo.DepartmentCode, Department = item3.PersonInfo.Department } }; AllModel.Add(TempModel); } foreach (var item4 in Temp4) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item4.BillNo, PageName = item4.RefundType.ToUpper() == "CASH" ? "现金还款" : "费用单还款", Creator = item4.Creator, Owner = item4.Owner, TotalMoney = item4.RealRefundMoney, StringTime = item4.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item4.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item4.PersonInfo.DepartmentCode, Department = item4.PersonInfo.Department } }; AllModel.Add(TempModel); } switch (billType) { case 0: break; case 1: AllModel.RemoveAll(c => c.PageName.Contains("付款") || c.PageName.Contains("借款") || c.PageName.Contains("还款")); break; case 2: AllModel.RemoveAll(c => c.PageName.Contains("费用报销") || c.PageName.Contains("借款") || c.PageName.Contains("还款")); break; case 3: AllModel.RemoveAll(c => c.PageName.Contains("付款") || c.PageName.Contains("费用报销") || c.PageName.Contains("还款")); break; case 4: AllModel.RemoveAll(c => c.PageName.Contains("付款") || c.PageName.Contains("借款") || c.PageName.Contains("费用报销")); break; default: break; } if (AllModel.Count > 0) { var temp = TransformData(AllModel, 0); MemoryCachingClient M = new MemoryCachingClient(); M.Remove(employee.EmployeeNo); M.Add(employee.EmployeeNo, temp); return(JsonSerializeHelper.SerializeToJson(temp)); } return("{}"); } object data = GetApprovalData(billType, Time, employee.EmployeeNo, departmentID.ToString(), StartTime, EndTime); if (data != null) { var temp = TransformData(data, billType); MemoryCachingClient M = new MemoryCachingClient(); M.Remove(employee.EmployeeNo); M.Add(employee.EmployeeNo, temp); return(JsonSerializeHelper.SerializeToJson(temp)); } return("{}"); //ReportHelper helper = new ReportHelper(); //DataTable dt = helper.GetDataTable(@"select ID,NO,NAME,SHOPCODE,CREATOR,CHANGER,AVAILABLE,LEAVE,PASSWORD,DEPID from Employee where (DEPID=" + departmentID + " or 0=" + departmentID + ") and length(NO)>4 and ROWNUM<100"); //foreach (DataColumn item in dt.Columns) //{ // if (item.ColumnName == "NAME") // { // item.ColumnName = "姓名"; // } // if (item.ColumnName == "NO") // { // item.ColumnName = "工号"; // } //} //var temp = ReportHelper.ConvertDataTable(dt); //return JsonSerializeHelper.SerializeToJson(temp); }
/// <summary> /// 获取我审批过的单据 /// </summary> /// <param name="Type">单据类型</param> /// <param name="Time">时间</param> /// <param name="EmployeeNo">工号</param> /// <returns></returns> public object GetApprovalData(int Type, int Time, string EmployeeNo, string departmentID, string StartTime, string EndTime) { try { var TempTime1 = DateTime.Now.Date; var TempTime2 = DateTime.Now.Date; if (Time == 6) { TempTime1 = StartTime == "" ? new DateTime(1999, 1, 1) : Convert.ToDateTime(StartTime); TempTime2 = EndTime == "" ? new DateTime(2999, 1, 1) : Convert.ToDateTime(EndTime); } WorkFlowProxy.WorkFlowProxy proxy = new WorkFlowProxy.WorkFlowProxy(); List <WorkFlowInstance> dic = new List <WorkFlowInstance>(); string objectID = proxy.GetWorkFlowListByUserId(EmployeeNo, TempTime1, TempTime2, ref dic); if (!string.IsNullOrEmpty(objectID) && dic.Count > 0) { List <TempTime> Mylist = new List <TempTime>(); foreach (var item in dic) { TempTime Tmp = new TempTime(); Tmp.Id = item._id; if (item.Assignments == null) { item.Assignments = new List <Assignment>(); } var model = item.Assignments.Where(c => (c.Keyword == 12002 || c.Keyword == 12003 || c.Keyword == 12005) && c.UserCode == EmployeeNo).ToList(); if (model != null && model.Count > 0) { Tmp.Time = model.Select(c => c.updatetime).LastOrDefault(); Mylist.Add(Tmp); } } List <string> WorkFlowList = new List <string>(); foreach (var item in Mylist) { WorkFlowList.Add(item.Id.ToString()); } switch (Type) { //获取所有单据(不分类型) case 0: List <FeeBillModelRef> AllModel = new List <FeeBillModelRef>(); var Temp1 = new Marisfrolg.Fee.BLL.FeeBill().GetMyProcess(EmployeeNo, WorkFlowList); var Temp2 = new Marisfrolg.Fee.BLL.NoticeBill().GetMyProcess(EmployeeNo, WorkFlowList); var Temp3 = new Marisfrolg.Fee.BLL.BorrowBill().GetMyProcess(EmployeeNo, WorkFlowList); var Temp4 = new Marisfrolg.Fee.BLL.RefundBill().GetMyProcess(EmployeeNo, WorkFlowList); foreach (var item1 in Temp1) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item1.BillNo, PageName = "费用报销单", Creator = item1.Creator, Owner = item1.Owner, TotalMoney = item1.TotalMoney, StringTime = item1.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item1.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item1.PersonInfo.DepartmentCode, Department = item1.PersonInfo.Department } }; var Id = MongoDB.Bson.ObjectId.Parse(item1.WorkFlowID); TempModel.ExamineTime = Mylist.Where(c => c.Id == Id).Select(x => x.Time).FirstOrDefault(); AllModel.Add(TempModel); } foreach (var item2 in Temp2) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item2.BillNo, PageName = "付款通知书", Creator = item2.Creator, Owner = item2.Owner, TotalMoney = item2.TotalMoney, StringTime = item2.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item2.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item2.PersonInfo.DepartmentCode, Department = item2.PersonInfo.Department } }; var Id = MongoDB.Bson.ObjectId.Parse(item2.WorkFlowID); TempModel.ExamineTime = Mylist.Where(c => c.Id == Id).Select(x => x.Time).FirstOrDefault(); AllModel.Add(TempModel); } foreach (var item3 in Temp3) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item3.BillNo, PageName = "借款单", Creator = item3.Creator, Owner = item3.Owner, TotalMoney = item3.TotalMoney, StringTime = item3.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item3.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item3.PersonInfo.DepartmentCode, Department = item3.PersonInfo.Department } }; var Id = MongoDB.Bson.ObjectId.Parse(item3.WorkFlowID); TempModel.ExamineTime = Mylist.Where(c => c.Id == Id).Select(x => x.Time).FirstOrDefault(); AllModel.Add(TempModel); } foreach (var item4 in Temp4) { FeeBillModelRef TempModel = new FeeBillModelRef() { BillNo = item4.BillNo, PageName = item4.RefundType.ToUpper() == "CASH" ? "现金还款" : "费用单还款", Creator = item4.Creator, Owner = item4.Owner, TotalMoney = item4.RealRefundMoney, StringTime = item4.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item4.CreateTime, PersonInfo = new PersonInfo() { DepartmentCode = item4.PersonInfo.DepartmentCode, Department = item4.PersonInfo.Department } }; var Id = MongoDB.Bson.ObjectId.Parse(item4.WorkFlowID); TempModel.ExamineTime = Mylist.Where(c => c.Id == Id).Select(x => x.Time).FirstOrDefault(); AllModel.Add(TempModel); } if (departmentID == "0") { AllModel = AllModel.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2).ToList(); } else { AllModel = AllModel.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2 && c.PersonInfo.DepartmentCode == departmentID).ToList(); } return(AllModel.OrderByDescending(c => c.ExamineTime).ToList()); //未审批的费用报销单 case 1: var FeeModel = new Marisfrolg.Fee.BLL.FeeBill().GetMyProcess(EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.FeeBillModelRef> RefList = new List <Models.FeeBillModelRef>(); foreach (var item in FeeModel) { Marisfrolg.Fee.Models.FeeBillModelRef RefModel = new Models.FeeBillModelRef(); RefModel = item.MapTo <FeeBillModel, FeeBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "费用报销单"; RefModel.ExamineTime = Mylist.Where(c => c.Id == id).Select(x => x.Time).FirstOrDefault(); RefList.Add(RefModel); } if (departmentID == "0") { RefList = RefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2).ToList(); } else { RefList = RefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2 && c.PersonInfo.DepartmentCode == departmentID).ToList(); } return(RefList.OrderByDescending(c => c.ExamineTime).ToList()); //未审批的付款通知书 case 2: var NoticeModel = new Marisfrolg.Fee.BLL.NoticeBill().GetMyProcess(EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.NoticeBillModelRef> NoticeRefList = new List <Models.NoticeBillModelRef>(); foreach (var item in NoticeModel) { Marisfrolg.Fee.Models.NoticeBillModelRef RefModel = new Models.NoticeBillModelRef(); RefModel = item.MapTo <NoticeBillModel, NoticeBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "付款通知书"; RefModel.ExamineTime = Mylist.Where(c => c.Id == id).Select(x => x.Time).FirstOrDefault(); NoticeRefList.Add(RefModel); } if (departmentID == "0") { NoticeRefList = NoticeRefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2).ToList(); } else { NoticeRefList = NoticeRefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2 && c.PersonInfo.DepartmentCode == departmentID).ToList(); } return(NoticeRefList.OrderByDescending(c => c.ExamineTime).ToList()); //未审批的借款单 case 3: var BorrowModel = new Marisfrolg.Fee.BLL.BorrowBill().GetMyProcess(EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.BorrowBillModelRef> BorrowRefList = new List <Models.BorrowBillModelRef>(); foreach (var item in BorrowModel) { Marisfrolg.Fee.Models.BorrowBillModelRef RefModel = new Models.BorrowBillModelRef(); RefModel = item.MapTo <BorrowBillModel, BorrowBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "借款单"; RefModel.ExamineTime = Mylist.Where(c => c.Id == id).Select(x => x.Time).FirstOrDefault(); BorrowRefList.Add(RefModel); } if (departmentID == "0") { BorrowRefList = BorrowRefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2).ToList(); } else { BorrowRefList = BorrowRefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2 && c.PersonInfo.DepartmentCode == departmentID).ToList(); } return(BorrowRefList.OrderByDescending(c => c.ExamineTime).ToList()); //未审批的借款单 case 4: var RefundModel = new Marisfrolg.Fee.BLL.RefundBill().GetMyProcess(EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.RefundBillModelRef> RefundRefList = new List <Models.RefundBillModelRef>(); foreach (var item in RefundModel) { Marisfrolg.Fee.Models.RefundBillModelRef RefModel = new Models.RefundBillModelRef(); RefModel = item.MapTo <RefundBillModel, RefundBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.TotalMoney = RefModel.RealRefundMoney; RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = RefModel.RefundType.ToUpper() == "CASH" ? "现金还款" : "费用单还款"; RefModel.ExamineTime = Mylist.Where(c => c.Id == id).Select(x => x.Time).FirstOrDefault(); RefundRefList.Add(RefModel); } if (departmentID == "0") { RefundRefList = RefundRefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2).ToList(); } else { RefundRefList = RefundRefList.Where(c => c.ExamineTime.Date >= TempTime1 && c.ExamineTime.Date <= TempTime2 && c.PersonInfo.DepartmentCode == departmentID).ToList(); } return(RefundRefList.OrderBy(c => c.ExamineTime).ToList()); default: break; } } } catch (Exception ex) { Logger.Write("获取我审批过的单据失败:" + ex.ToString() + "," + System.Reflection.MethodBase.GetCurrentMethod().Name); } return(null); }
public string GetRelationBill(string itemName, string DepartmentCode, string ShopCode, DateTime CreateTime, string ProviderName, int IsHeadOffice, string BillNo) { if (string.IsNullOrEmpty(ShopCode) || ShopCode == "null") { ShopCode = null; } int FindDadaType = 0; if (BillNo.ToUpper().Contains("FT")) { FindDadaType = 1; } else if (BillNo.ToUpper().Contains("JS")) { FindDadaType = 2; } //取CreateTime时间,然后往前推三个月 CreateTime = CreateTime.AddMonths(-3); List <FeeBillModelRef> DataList = new List <FeeBillModelRef>(); if (FindDadaType == 0) { var FeeModel = new FeeBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime); if (FeeModel.Count > 0) { foreach (var item in FeeModel) { try { FeeBillModelRef model = new FeeBillModelRef() { BillNo = item.BillNo, BillsType = "FeeBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo { Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop }, Items = item.Items, TotalMoney = item.TotalMoney, Creator = item.Creator, Owner = item.Owner }; DataList.Add(model); } catch (Exception) { continue; } } } } if (FindDadaType == 0 || FindDadaType == 1) { var NoticeModel = new NoticeBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime, ProviderName, IsHeadOffice, FindDadaType); if (NoticeModel.Count > 0) { foreach (var item in NoticeModel) { try { FeeBillModelRef model = new FeeBillModelRef() { BillNo = item.BillNo, BillsType = "NoticeBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo { Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop }, Items = item.Items, TotalMoney = item.TotalMoney, Creator = item.Creator, Owner = item.Owner }; DataList.Add(model); } catch (Exception) { continue; } } } } if (FindDadaType == 0 || FindDadaType == 2) { var BorrowModel = new BorrowBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime); if (BorrowModel.Count > 0) { foreach (var item in BorrowModel) { try { FeeBillModelRef model = new FeeBillModelRef() { BillNo = item.BillNo, BillsType = "BorrowBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo { Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop }, Items = item.Items, TotalMoney = item.TotalMoney, Creator = item.Creator, Owner = item.Owner }; DataList.Add(model); } catch (Exception) { continue; } } } } if (FindDadaType == 0) { var RefundModel = new RefundBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime); if (RefundModel.Count > 0) { foreach (var item in RefundModel) { try { FeeBillModelRef model = new FeeBillModelRef() { BillNo = item.BillNo, BillsType = "RefundBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo { Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop }, Items = item.Items, TotalMoney = item.RealRefundMoney, Creator = item.Creator, Owner = item.Owner }; DataList.Add(model); } catch (Exception) { continue; } } } } if (DataList.Count > 0) { DataList = DataList.OrderByDescending(c => c.CreateTime).ToList(); } return(Public.JsonSerializeHelper.SerializeToJson(DataList)); }
public string GetMyProcess(int Type, int Time, string TimeValue1 = "", string TimeValue2 = "") { DateTime startTime = new DateTime(1999, 1, 1); DateTime endTime = new DateTime(2999, 1, 1); //创建日期 switch (Time) { //全部 case 1: break; //当天 case 2: startTime = DateTime.Now.Date; break; //本周 case 3: startTime = DateTime.Now.Date.AddDays(1 - Convert.ToInt32(DateTime.Now.Date.DayOfWeek.ToString("d"))); endTime = DateTime.Now.Date.AddDays(1 - Convert.ToInt32(DateTime.Now.Date.DayOfWeek.ToString("d"))).AddDays(7); break; //本月 case 4: startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); endTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1); break; //上月 case 5: startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(-1); endTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); break; //自定义 case 6: startTime = TimeValue1 == "" ? startTime : Convert.ToDateTime(TimeValue1); endTime = TimeValue2 == "" ? endTime : Convert.ToDateTime(TimeValue2); break; default: break; } try { var employee = Marisfrolg.Public.Common.GetEmployeeInfo(); WorkFlowProxy.WorkFlowProxy proxy = new WorkFlowProxy.WorkFlowProxy(); Dictionary <string, WorkFlowEngine.WorkFlowInstance> dic = new Dictionary <string, WorkFlowEngine.WorkFlowInstance>(); string result = proxy.GetWorkFlowTaskList(employee.EmployeeNo, "", ref dic); if (!string.IsNullOrEmpty(result) && dic.Count > 0) { List <MongoDB.Bson.ObjectId> Mylist = dic.Select(c => c.Value).Select(c => c._id).ToList(); List <string> WorkFlowList = new List <string>(); foreach (var item in Mylist) { WorkFlowList.Add(item.ToString()); } switch (Type) { case 0: List <FeeBillModelRef> TempData = new List <FeeBillModelRef>(); var list1 = new Marisfrolg.Fee.BLL.FeeBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); foreach (var item in list1) { FeeBillModelRef Temp = new FeeBillModelRef() { PersonInfo = new PersonInfo() { Department = item.PersonInfo.Department, Brand = item.PersonInfo.Brand, Shop = item.PersonInfo.Shop }, BillNo = item.BillNo, PageName = "FeeBill", Owner = item.Owner, TotalMoney = item.TotalMoney, StringTime = item.CreateTime.ToString("yyyy-MM-dd"), ApprovalTime = item.ApprovalTime, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, CreateTime = item.CreateTime, Creator = item.Creator, PostString = item.PostString }; MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(item.WorkFlowID); Temp.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); if (Temp.PostString != null) { Temp.AuditTime = Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? Temp.CreateTime : Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; Temp.CostTime = Math.Round((DateTime.Now - Temp.AuditTime).TotalDays, 2); } TempData.Add(Temp); } var list2 = new Marisfrolg.Fee.BLL.NoticeBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); foreach (var item in list2) { FeeBillModelRef Temp = new FeeBillModelRef() { PersonInfo = new PersonInfo() { Department = item.PersonInfo.Department, Brand = item.PersonInfo.Brand, Shop = item.PersonInfo.Shop }, BillNo = item.BillNo, PageName = "NoticeBill", Owner = item.Owner, TotalMoney = item.TotalMoney, StringTime = item.CreateTime.ToString("yyyy-MM-dd"), ApprovalTime = item.ApprovalTime, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, CreateTime = item.CreateTime, Creator = item.Creator, PostString = item.PostString }; MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(item.WorkFlowID); Temp.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); if (Temp.PostString != null) { Temp.AuditTime = Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? Temp.CreateTime : Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; Temp.CostTime = Math.Round((DateTime.Now - Temp.AuditTime).TotalDays, 2); } TempData.Add(Temp); } var list3 = new Marisfrolg.Fee.BLL.BorrowBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); foreach (var item in list3) { FeeBillModelRef Temp = new FeeBillModelRef() { PersonInfo = new PersonInfo() { Department = item.PersonInfo.Department, Brand = item.PersonInfo.Brand, Shop = item.PersonInfo.Shop }, BillNo = item.BillNo, PageName = "BorrowBill", Owner = item.Owner, TotalMoney = item.TotalMoney, StringTime = item.CreateTime.ToString("yyyy-MM-dd"), ApprovalTime = item.ApprovalTime, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, CreateTime = item.CreateTime, Creator = item.Creator, PostString = item.PostString }; MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(item.WorkFlowID); Temp.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); if (Temp.PostString != null) { Temp.AuditTime = Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? Temp.CreateTime : Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; Temp.CostTime = Math.Round((DateTime.Now - Temp.AuditTime).TotalDays, 2); } TempData.Add(Temp); } var list4 = new Marisfrolg.Fee.BLL.RefundBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); foreach (var item in list4) { FeeBillModelRef Temp = new FeeBillModelRef() { PersonInfo = new PersonInfo() { Department = item.PersonInfo.Department, Brand = item.PersonInfo.Brand, Shop = item.PersonInfo.Shop }, BillNo = item.BillNo, PageName = "RefundBill", Owner = item.Owner, TotalMoney = item.RealRefundMoney, StringTime = item.CreateTime.ToString("yyyy-MM-dd"), ApprovalTime = item.ApprovalTime, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, CreateTime = item.CreateTime, Creator = item.Creator, PostString = item.PostString }; MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(item.WorkFlowID); Temp.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); if (Temp.PostString != null) { Temp.AuditTime = Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? Temp.CreateTime : Temp.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; Temp.CostTime = Math.Round((DateTime.Now - Temp.AuditTime).TotalDays, 2); } TempData.Add(Temp); } TempData = TempData.Where(c => c.CreateTime.Date >= startTime.Date && c.CreateTime.Date <= endTime.Date).OrderByDescending(c => c.CreateTime).ToList(); return(Public.JsonSerializeHelper.SerializeToJson(TempData)); //未审批的费用报销单 case 1: var FeeModel = new Marisfrolg.Fee.BLL.FeeBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.FeeBillModelRef> RefList = new List <Models.FeeBillModelRef>(); foreach (var item in FeeModel) { Marisfrolg.Fee.Models.FeeBillModelRef RefModel = new Models.FeeBillModelRef(); RefModel = item.MapTo <FeeBillModel, FeeBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "FeeBill"; if (RefModel.PostString != null) { RefModel.AuditTime = RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? RefModel.CreateTime : RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; RefModel.CostTime = Math.Round((DateTime.Now - RefModel.AuditTime).TotalDays, 2); } RefList.Add(RefModel); } RefList = RefList.Where(c => c.CreateTime.Date >= startTime.Date && c.CreateTime.Date <= endTime.Date).OrderByDescending(c => c.CreateTime).ToList(); return(Public.JsonSerializeHelper.SerializeToJson(RefList)); //未审批的付款通知书 case 2: var NoticeModel = new Marisfrolg.Fee.BLL.NoticeBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.NoticeBillModelRef> NoticeRefList = new List <Models.NoticeBillModelRef>(); foreach (var item in NoticeModel) { Marisfrolg.Fee.Models.NoticeBillModelRef RefModel = new Models.NoticeBillModelRef(); RefModel = item.MapTo <NoticeBillModel, NoticeBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "NoticeBill"; if (RefModel.PostString != null) { RefModel.AuditTime = RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? RefModel.CreateTime : RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; RefModel.CostTime = Math.Round((DateTime.Now - RefModel.AuditTime).TotalDays, 2); } NoticeRefList.Add(RefModel); } NoticeRefList = NoticeRefList.Where(c => c.CreateTime >= startTime && c.CreateTime < endTime).OrderByDescending(c => c.CreateTime).ToList(); return(Public.JsonSerializeHelper.SerializeToJson(NoticeRefList)); //未审批的借款单 case 3: var BorrowModel = new Marisfrolg.Fee.BLL.BorrowBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.BorrowBillModelRef> BorrowRefList = new List <Models.BorrowBillModelRef>(); foreach (var item in BorrowModel) { Marisfrolg.Fee.Models.BorrowBillModelRef RefModel = new Models.BorrowBillModelRef(); RefModel = item.MapTo <BorrowBillModel, BorrowBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "BorrowBill"; if (RefModel.PostString != null) { RefModel.AuditTime = RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? RefModel.CreateTime : RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; RefModel.CostTime = Math.Round((DateTime.Now - RefModel.AuditTime).TotalDays, 2); } BorrowRefList.Add(RefModel); } BorrowRefList = BorrowRefList.Where(c => c.CreateTime.Date >= startTime.Date && c.CreateTime.Date <= endTime.Date).OrderByDescending(c => c.CreateTime).ToList(); return(Public.JsonSerializeHelper.SerializeToJson(BorrowRefList)); //未审批的借款单 case 4: var RefundModel = new Marisfrolg.Fee.BLL.RefundBill().GetMyProcess(employee.EmployeeNo, WorkFlowList); List <Marisfrolg.Fee.Models.RefundBillModelRef> RefundRefList = new List <Models.RefundBillModelRef>(); foreach (var item in RefundModel) { Marisfrolg.Fee.Models.RefundBillModelRef RefModel = new Models.RefundBillModelRef(); RefModel = item.MapTo <RefundBillModel, RefundBillModelRef>(); MongoDB.Bson.ObjectId id = MongoDB.Bson.ObjectId.Parse(RefModel.WorkFlowID); RefModel.AssignmentID = dic.Where(c => c.Value._id == id).Select(c => c.Key).FirstOrDefault(); RefModel.TotalMoney = RefModel.RealRefundMoney; RefModel.StringTime = RefModel.CreateTime.ToString("yyyy-MM-dd"); RefModel.PageName = "RefundBill"; if (RefModel.PostString != null) { RefModel.AuditTime = RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault() == null ? RefModel.CreateTime : RefModel.PostString.Where(c => !string.IsNullOrEmpty(c.JobNumber)).LastOrDefault().Time; RefModel.CostTime = Math.Round((DateTime.Now - RefModel.AuditTime).TotalDays, 2); } RefundRefList.Add(RefModel); } RefundRefList = RefundRefList.Where(c => c.CreateTime.Date >= startTime.Date && c.CreateTime.Date <= endTime.Date).OrderByDescending(c => c.CreateTime).ToList(); return(Public.JsonSerializeHelper.SerializeToJson(RefundRefList)); default: break; } } return("[]"); } catch (Exception ex) { Logger.Write("获取未办结单据列表数据失败:" + ex.ToString() + "," + System.Reflection.MethodBase.GetCurrentMethod().Name); } return("[]"); }