Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 11 months ago
parent
commit
b7160ff8a3

+ 265 - 3
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -2798,7 +2798,8 @@ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostGroupExtraCost_Detail(Fin_GroupExtraCostDto_Detail dto)
         {
-            if (dto.Id < 1) { 
+            if (dto.Id < 1)
+            {
                 return Ok(JsonView(false, "查询失败"));
             }
 
@@ -2812,7 +2813,8 @@ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId
                                                 Where f.IsDel=0 And c.CTable = 1015 
 												And f.Id = {0} ", dto.Id);
             Fin_GroupExtraCostDetailView detailView = await _sqlSugar.SqlQueryable<Fin_GroupExtraCostDetailView>(sql).FirstAsync();
-            if (detailView == null) {
+            if (detailView == null)
+            {
                 return Ok(JsonView(false, "查询失败"));
             }
 
@@ -2887,7 +2889,8 @@ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId
                         }
                     }
 
-                    if (item.PriceDetailType > 0) {
+                    if (item.PriceDetailType > 0)
+                    {
                         if (dic_setData.ContainsKey(item.PriceDetailType))
                         {
                             item.PriceTypeStr = item.PriceTypeStr + " - " + dic_setData[item.PriceDetailType];
@@ -2984,6 +2987,265 @@ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId
             return Ok(JsonView(true, "", data));
         }
 
+        /// <summary>
+        /// 超支费用
+        /// 导出团组超支费用Excel
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostGroupExtraCost_OutputExcel(Fin_GroupExtraCostExcelDto dto)
+        {
+            string sqlGroup = string.Format(@" Select * From Grp_DelegationInfo WIth(Nolock) where Id = {0} ", dto.diId);
+            Grp_DelegationInfo grp_DelegationInfo = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sqlGroup).FirstAsync();
+            if (grp_DelegationInfo == null)
+            {
+                return Ok(JsonView(false, "导出失败,未查询到团组"));
+            }
+
+            Workbook workbook = new Workbook();
+            Worksheet sheet = workbook.Worksheets[0];
+            Cells cells = sheet.Cells;
+
+            //sheet.Protect(Aspose.Cells.ProtectionType.All, "123123", "");//保护工作表
+            //sheet.Protection.IsSelectingLockedCellsAllowed = true;//设置只能选择解锁单元格
+            //sheet.Protection.IsFormattingColumnsAllowed = true;//设置可以调整列
+            //sheet.Protection.IsFormattingRowsAllowed = true;//设置可以调整行
+
+            #region 数据源
+
+            string sqlData = string.Format(@" Select f.PriceType,REPLACE(s2.[Name],'超支费用','') as PriceTypeStr,'('+REPLACE(s3.[Name],'n','')+')' as PriceDetailTypeStr, PriceDt,PriceName,
+Price,PriceCount,s.[Name] as Currency,PriceSum,f.Remark
+From Fin_GroupExtraCost as f With(Nolock)
+Inner Join Grp_CreditCardPayment as c With(Nolock) On f.Id = c.CId
+Inner Join Sys_SetData as s With(Nolock) On f.PriceCurrency = s.Id
+Inner Join Sys_SetData as s2 With(Nolock) On f.PriceType = s2.Id
+Inner Join Sys_SetData as s3 With(Nolock) On f.PriceDetailType = s3.Id
+Where f.DiId = {0} And f.IsDel=0 And c.CTable=1015
+Order by PriceType ASC,PriceDt ASC ", dto.diId);
+
+            string sqlDataCount = string.Format(@" Select f.PriceType,COUNT(f.PriceType) as DataCount
+From Fin_GroupExtraCost as f With(Nolock)
+Inner Join Grp_CreditCardPayment as c With(Nolock) On f.Id = c.CId
+Where f.DiId = {0} And f.IsDel=0 And c.CTable=1015
+Group by PriceType ", dto.diId);
+
+
+
+            List<Fin_GroupExtraCost_ExcelView> dataList = await _sqlSugar.SqlQueryable<Fin_GroupExtraCost_ExcelView>(sqlData).ToListAsync();
+            List<Fin_GroupExtraCost_ExcelCountView> countList = await _sqlSugar.SqlQueryable<Fin_GroupExtraCost_ExcelCountView>(sqlDataCount).ToListAsync();
+
+            if (dataList.Count < 1 || countList.Count < 1)
+            {
+                return Ok(JsonView(false, "导出失败,未查询到数据"));
+            }
+
+            #endregion
+
+            #region 标题
+
+
+            string cellValue_Header = grp_DelegationInfo.TeamName;
+
+            //Aspose.Cells.Style style1 = workbook.Styles[workbook.Styles.Add()];//新增样式
+            Aspose.Cells.Style style_Header = workbook.CreateStyle();
+            style_Header.HorizontalAlignment = TextAlignmentType.Center;//文字居中
+            style_Header.VerticalAlignment = TextAlignmentType.Center;
+            style_Header.Font.Name = "微软雅黑";//文字字体
+            style_Header.Font.Size = 18;//文字大小
+            style_Header.IsLocked = false;//单元格解锁
+            style_Header.Font.IsBold = false;//粗体
+            style_Header.Font.Color = Color.FromArgb(255, 0, 0);
+            //style1.ForegroundColor = Color.FromArgb(0x99, 0xcc, 0xff);//设置背景色
+            //style1.Pattern = BackgroundType.Solid; //设置背景样式
+            //style1.IsTextWrapped = true;//单元格内容自动换行
+            style_Header.Borders[Aspose.Cells.BorderType.LeftBorder].LineStyle = CellBorderType.Thin; //应用边界线 左边界线
+            style_Header.Borders[Aspose.Cells.BorderType.RightBorder].LineStyle = CellBorderType.Thin; //应用边界线 右边界线
+            style_Header.Borders[Aspose.Cells.BorderType.TopBorder].LineStyle = CellBorderType.Thin; //应用边界线 上边界线
+            style_Header.Borders[Aspose.Cells.BorderType.BottomBorder].LineStyle = CellBorderType.Thin; //应用边界线 下边界线
+
+            cells.Merge(1, 1, 1, 10);
+            Aspose.Cells.Range range_header = cells.CreateRange(1, 1, 1, 10);
+            range_header.PutValue(cellValue_Header, false, false);
+            range_header.SetStyle(style_Header);
+            cells.SetRowHeight(1, 35);
+            #endregion
+
+            #region 列名
+
+            Aspose.Cells.Style style_colName = workbook.CreateStyle();
+            style_colName.Name = "colName";
+            style_colName.HorizontalAlignment = TextAlignmentType.Center;//文字居中
+            style_colName.VerticalAlignment = TextAlignmentType.Center;
+            style_colName.Font.Name = "微软雅黑";//文字字体
+            style_colName.Font.Size = 12;//文字大小
+            style_colName.IsLocked = false;//单元格解锁
+            style_colName.Font.IsBold = true;//粗体
+            style_colName.Font.Color = Color.FromArgb(0, 0, 0);
+            style_colName.Borders[Aspose.Cells.BorderType.LeftBorder].LineStyle = CellBorderType.Thin; //应用边界线 左边界线
+            style_colName.Borders[Aspose.Cells.BorderType.RightBorder].LineStyle = CellBorderType.Thin; //应用边界线 右边界线
+            style_colName.Borders[Aspose.Cells.BorderType.TopBorder].LineStyle = CellBorderType.Thin; //应用边界线 上边界线
+            style_colName.Borders[Aspose.Cells.BorderType.BottomBorder].LineStyle = CellBorderType.Thin; //应用边界线 下边界线
+
+            List<Fin_GroupExtraCostExcelColumnSetting> colNameSettingList = new List<Fin_GroupExtraCostExcelColumnSetting>()
+            {
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 1, columnName="类型", columnWidth= 25},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 2, columnName="时间", columnWidth= 16},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 3, columnName="内容", columnWidth= 35},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 4, columnName="单价", columnWidth= 12},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 5, columnName="数量", columnWidth= 12},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 6, columnName="货币", columnWidth= 12},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 7, columnName="费用", columnWidth= 12},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 8, columnName="汇率", columnWidth= 12},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 9, columnName="人民币", columnWidth= 12},
+                new Fin_GroupExtraCostExcelColumnSetting(){ columnIndex = 10, columnName="备注信息", columnWidth= 24}
+            };
+
+            foreach (var col in colNameSettingList)
+            {
+                cells[2, col.columnIndex].PutValue(col.columnName);
+                cells[2, col.columnIndex].SetStyle(style_colName);
+                cells.SetColumnWidth(col.columnIndex, col.columnWidth);
+            }
+            cells.SetRowHeight(2, 25);
+            #endregion
+
+            #region 数据填充
+            Aspose.Cells.Style style_dataCol = workbook.GetNamedStyle("colName");
+            style_dataCol.Font.IsBold = false;
+            style_dataCol.Name = "dataCol";
+
+            Aspose.Cells.Style style_dataBlue = workbook.CreateStyle();
+            style_dataBlue.HorizontalAlignment = TextAlignmentType.Center;//文字居中
+            style_dataBlue.VerticalAlignment = TextAlignmentType.Center;
+            style_dataBlue.Font.Name = "微软雅黑";//文字字体
+            style_dataBlue.Font.Size = 12;//文字大小
+            style_dataBlue.IsLocked = false;//单元格解锁
+            style_dataBlue.Font.IsBold = false;//粗体
+            style_dataBlue.ForegroundColor = Color.FromArgb(189, 215, 238);
+            style_dataBlue.Pattern = BackgroundType.Solid;
+            style_dataBlue.Font.Color = Color.FromArgb(0, 0, 0);
+            style_dataBlue.Borders[Aspose.Cells.BorderType.LeftBorder].LineStyle = CellBorderType.Thin; //应用边界线 左边界线
+            style_dataBlue.Borders[Aspose.Cells.BorderType.RightBorder].LineStyle = CellBorderType.Thin; //应用边界线 右边界线
+            style_dataBlue.Borders[Aspose.Cells.BorderType.TopBorder].LineStyle = CellBorderType.Thin; //应用边界线 上边界线
+            style_dataBlue.Borders[Aspose.Cells.BorderType.BottomBorder].LineStyle = CellBorderType.Thin; //应用边界线 下边界线
+
+            Aspose.Cells.Style style_dataYellow = workbook.CreateStyle();
+            style_dataYellow.HorizontalAlignment = TextAlignmentType.Center;//文字居中
+            style_dataYellow.VerticalAlignment = TextAlignmentType.Center;
+            style_dataYellow.Font.Name = "微软雅黑";//文字字体
+            style_dataYellow.Font.Size = 12;//文字大小
+            style_dataYellow.IsLocked = false;//单元格解锁
+            style_dataYellow.Font.IsBold = false;//粗体
+            style_dataYellow.ForegroundColor = Color.FromArgb(255, 242, 204);
+            style_dataYellow.Pattern = BackgroundType.Solid;
+            style_dataYellow.Font.Color = Color.FromArgb(0, 0, 0);
+            style_dataYellow.Borders[Aspose.Cells.BorderType.LeftBorder].LineStyle = CellBorderType.Thin; //应用边界线 左边界线
+            style_dataYellow.Borders[Aspose.Cells.BorderType.RightBorder].LineStyle = CellBorderType.Thin; //应用边界线 右边界线
+            style_dataYellow.Borders[Aspose.Cells.BorderType.TopBorder].LineStyle = CellBorderType.Thin; //应用边界线 上边界线
+            style_dataYellow.Borders[Aspose.Cells.BorderType.BottomBorder].LineStyle = CellBorderType.Thin; //应用边界线 下边界线
+
+
+
+
+            int rowIndex = 4;
+            foreach (var d in dataList)
+            {
+
+
+                //内容
+                string typeStr = d.PriceDetailTypeStr + d.PriceName;
+                cells["B" + rowIndex.ToString()].PutValue(d.PriceTypeStr);
+                cells["C" + rowIndex.ToString()].PutValue(d.PriceDtStr);
+                cells["D" + rowIndex.ToString()].PutValue(typeStr);
+                cells["E" + rowIndex.ToString()].PutValue(d.Price.ToString("#0.00"));
+                cells["F" + rowIndex.ToString()].PutValue(d.PriceCount);
+                cells["G" + rowIndex.ToString()].PutValue(d.Currency);
+                cells["H" + rowIndex.ToString()].PutValue(d.PriceSum.ToString("#0.00"));
+                cells["K" + rowIndex.ToString()].PutValue(d.Remark);
+
+                //样式
+                cells["B" + rowIndex.ToString()].SetStyle(style_dataCol);
+                cells["C" + rowIndex.ToString()].SetStyle(style_dataCol);
+                cells["D" + rowIndex.ToString()].SetStyle(style_dataCol);
+                cells["E" + rowIndex.ToString()].SetStyle(style_dataBlue);
+                cells["F" + rowIndex.ToString()].SetStyle(style_dataBlue);
+                cells["G" + rowIndex.ToString()].SetStyle(style_dataBlue);
+                cells["H" + rowIndex.ToString()].SetStyle(style_dataBlue);
+                cells["I" + rowIndex.ToString()].SetStyle(style_dataBlue);
+                cells["J" + rowIndex.ToString()].SetStyle(style_dataBlue);
+                cells["K" + rowIndex.ToString()].SetStyle(style_dataYellow);
+
+                //公式
+                cells["H" + rowIndex.ToString()].Formula = string.Format(@"E{0}*F{0}", rowIndex);
+                cells["J" + rowIndex.ToString()].Formula = string.Format(@"H{0}*I{0}", rowIndex);
+
+                cells.SetRowHeight(rowIndex - 1, 25);
+                rowIndex++;
+            }
+
+            cells["B" + rowIndex.ToString()].SetStyle(style_dataCol);
+            cells["C" + rowIndex.ToString()].SetStyle(style_dataCol);
+            cells["D" + rowIndex.ToString()].SetStyle(style_dataCol);
+            cells["E" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["F" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["G" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["H" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["I" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["J" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["K" + rowIndex.ToString()].SetStyle(style_dataYellow);
+            rowIndex++;
+            cells["B" + rowIndex.ToString()].SetStyle(style_dataCol);
+            cells["C" + rowIndex.ToString()].SetStyle(style_dataCol);
+            cells["D" + rowIndex.ToString()].SetStyle(style_dataCol);
+            cells["E" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["F" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["G" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["H" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["I" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["J" + rowIndex.ToString()].SetStyle(style_dataBlue);
+            cells["K" + rowIndex.ToString()].SetStyle(style_dataYellow);
+
+            rowIndex = 3;
+            int tempPriceType = 0;
+            foreach (var c in dataList)
+            {
+                if (tempPriceType == c.PriceType)
+                {
+                    continue;
+                }
+                tempPriceType = c.PriceType;
+                int _rowCount = countList.First(s => s.PriceType == tempPriceType).DataCount;
+                cells.Merge(rowIndex, 1, _rowCount, 1);
+                Aspose.Cells.Range tempRange = cells.CreateRange(rowIndex, 1, _rowCount, 1);
+                rowIndex += _rowCount;
+            }
+
+            rowIndex = 4 + dataList.Count;
+            cells["D" + rowIndex.ToString()].PutValue("合计");
+            cells["J" + rowIndex.ToString()].Formula = string.Format(@"SUM(J4,J{0})", rowIndex - 1);
+            cells.SetRowHeight(rowIndex - 1, 25);
+
+            rowIndex++;
+            cells["D" + rowIndex.ToString()].PutValue("服务费10%开票税金8%");
+            cells["J" + rowIndex.ToString()].Formula = string.Format(@"J{0}*1.1*1.08", rowIndex - 1);
+            cells.SetRowHeight(rowIndex - 1, 25);
+            #endregion
+
+            #region IO
+
+            System.IO.MemoryStream ms = workbook.SaveToStream();//生成数据流
+            string fileName = ("GroupExtraCost/超支费用(" + cellValue_Header + ").xlsx");
+            byte[] bt = ms.ToArray();
+            workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + fileName);
+            #endregion
+
+            string rst = AppSettingsHelper.Get("ExcelBaseUrl") + AppSettingsHelper.Get("ExcelFtpPath") + fileName;
+            return Ok(JsonView(true, "成功", new { url = rst }));
+        }
+
+
         #endregion
     }
 }

+ 74 - 31
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -347,11 +347,11 @@ namespace OASystem.API.Controllers
 					                              ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,
 					                              VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure,gdi.CreateTime
 					                              From  Grp_DelegationInfo gdi
-					                              Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
-					                              Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
+					                              Left Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
+					                              Left Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
 					                              Left Join Sys_Users su On gdi.JietuanOperator = su.Id
-					                              Where gdi.IsDel = 0  {0}
-				                              ) temp  ", sqlWhere);
+					                              Where gdi.IsDel = 0 {0}
+				                              ) temp", sqlWhere);
 
                 RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
                 var _DelegationList = await _sqlSugar.SqlQueryable<DelegationListView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);//ToPageAsync
@@ -2680,17 +2680,35 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                Result groupData = await _decreasePaymentsRep.DecreasePaymentsSelect(dto);
-                if (groupData.Code != 0)
+                #region 参数验证
+
+                if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
+                if (dto.CTId < 1) return Ok(JsonView(false, "请传入有效的CTId参数!"));
+
+                #endregion
+
+                //var groupData = await GeneralMethod.PostOperationAuthReturnGroupInfosAsync(dto.UserId, dto.CTId);
+                ////支付方式
+                //List<Sys_SetData> Payment = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 14 && a.IsDel == 0).ToList();
+                //List<SetDataInfoView> _Payment = _mapper.Map<List<SetDataInfoView>>(Payment);
+
+                //var data = new
+                //{
+                //    Payment = _Payment,
+                //    GroupName = groupData,
+                //};
+
+                var res = await _decreasePaymentsRep.DecreasePaymentsSelect(dto);
+                if (res.Code != 0)
                 {
-                    return Ok(JsonView(false, groupData.Msg));
+                    return Ok(JsonView(false, res.Msg));
                 }
-                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+
+                return Ok(JsonView(true, "操作成功!", res.Data));
             }
             catch (Exception ex)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(false, ex.Message));
             }
         }
         /// <summary>
@@ -2704,6 +2722,13 @@ namespace OASystem.API.Controllers
         {
             try
             {
+                #region 参数验证
+
+                if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
+                if (dto.DiId < 1) return Ok(JsonView(false, "请传入有效的DiId参数!"));
+
+                #endregion
+
                 Result groupData = await _decreasePaymentsRep.DecreasePaymentsList(dto);
                 if (groupData.Code != 0)
                 {
@@ -2714,7 +2739,6 @@ namespace OASystem.API.Controllers
             catch (Exception ex)
             {
                 return Ok(JsonView(false, "程序错误!"));
-                throw;
             }
         }
         /// <summary>
@@ -4494,10 +4518,10 @@ namespace OASystem.API.Controllers
                 Stopwatch sw = new Stopwatch();
                 sw.Start();
                 string nationalTravelFeeSql = string.Format(@"Select ssd.Name as CurrencyCode, ssd.Remark as CurrencyName,su.CnName as LastUpdateUserName,gntf.* From Grp_NationalTravelFee gntf
-                                                                Left Join Sys_SetData ssd On ssd.STid = 66 And gntf.Currency = ssd.Id
-                                                                Left Join Sys_Users su On gntf.LastUpdateUserId = su.Id 
-                                                                Where gntf.Isdel = 0");
-                var nationalTravelFeeData = await _sqlSugar.SqlQueryable<NationalTravelFeeInfoView>(nationalTravelFeeSql).ToListAsync();
+                                                              Left Join Sys_SetData ssd On ssd.STid = 66 And gntf.Currency = ssd.Id
+                                                              Left Join Sys_Users su On gntf.LastUpdateUserId = su.Id 
+                                                              Where gntf.Isdel = 0");
+                var nationalTravelFeeData = _sqlSugar.SqlQueryable<NationalTravelFeeInfoView>(nationalTravelFeeSql).ToList();
 
                 //var nationalTravel = nationalTravelFeeData.GroupBy(it => it.Country).Select(it1 => it1.FirstOrDefault());
 
@@ -4512,8 +4536,6 @@ namespace OASystem.API.Controllers
                 //        cityData.Remove(otherData);
                 //        cityData.Add(otherData);
                 //    }
-
-
                 //    nationalTravelFeeData1.Add(new
                 //    {
                 //        Country = item.Country,
@@ -6721,12 +6743,12 @@ namespace OASystem.API.Controllers
 
                 if (_GroupCostParameters.Count <= 0)
                 {
-                    return Ok(JsonView(true, "暂无该团组成本信息!", new List<dynamic>()));
+                    return Ok(JsonView(false, "暂无该团组成本信息!", new List<dynamic>()));
                 }
 
                 if (_GroupCostParameters[0].IsShare == 0)
                 {
-                    return Ok(JsonView(true, "该团组成本未完成!", new List<dynamic>()));
+                    return Ok(JsonView(false, "该团组成本未完成!", new List<dynamic>()));
                 }
                 var _GroupCosts = _usersRep._sqlSugar.Queryable<Grp_GroupCost>().Where(it => it.IsDel == 0 && it.Diid == dto.DiId).ToList();
 
@@ -6747,10 +6769,27 @@ namespace OASystem.API.Controllers
                 
                 GroupCostModulePromptView _view = new GroupCostModulePromptView();
 ;
-                List<GroupCostModulePromptInfo> _ModulePromptInfos = new List<GroupCostModulePromptInfo>();
-                foreach (var item in _GroupCostParameters)
+                List<GroupCostModulePromptInfo> _ModulePromptInfos = new List<GroupCostModulePromptInfo>(); //机票存储多段
+
+                //op,酒店单段模式存储
+                GroupCostModulePromptInfo _ModulePromptInfo = new GroupCostModulePromptInfo() 
                 {
+                    CurrencyCode = _GroupCostParameters[0].Currency,
+                    Rate = _GroupCostParameters[0].Rate,
+                    CostType = _GroupCostParameters[0].CostType,
+                    CostTypeStartTime = Convert.ToDateTime(_GroupCostParameters[0].CostTypeStartTime).ToString("yyyy-MM-dd"),
+                    CostTypeEndTime = Convert.ToDateTime(_GroupCostParameters[0].CostTypeendTime).ToString("yyyy-MM-dd"),
+                    CostTypeNumber = _GroupCostParameters[0].CostTypenumber
+                };
 
+                List<dynamic> _ModuleSubPromptInfo = new List<dynamic>(); // 存储CTbale != 85 的动态数据
+                if (_GroupCostParameters.Count == 2)
+                {
+                    _ModulePromptInfo.CostTypeEndTime = Convert.ToDateTime(_GroupCostParameters[1].CostTypeendTime).ToString("yyyy-MM-dd");
+                }
+
+                foreach (var item in _GroupCostParameters)
+                {
                     decimal _rate = item.Rate;
                     decimal _scale = 0.95M;
                     #region 处理地接价格比例 总经理 国交部经理 主管 不下调 其他人 下调 5% 
@@ -6767,8 +6806,6 @@ namespace OASystem.API.Controllers
                     }
                     #endregion
 
-                  
-
                     GroupCostModulePromptInfo modulePromptInfo = new GroupCostModulePromptInfo()
                     {
                         CurrencyCode = item.Currency,
@@ -6788,7 +6825,7 @@ namespace OASystem.API.Controllers
                         modulePromptInfo.CostTypeNumber = item.LYJRS;
                     }
 
-                    if (dto.CTable == 79)
+                    if (dto.CTable == 79)//
                     {
                         modulePromptInfo.IndividualCost = item.DJCB / modulePromptInfo.CostTypeNumber;
                         modulePromptInfo.TotalCost = item.DJCB;
@@ -6809,8 +6846,6 @@ namespace OASystem.API.Controllers
                                                                       Convert.ToDateTime(it.Date) <= Convert.ToDateTime(item.CostTypeendTime)).ToList();
                     }
 
-                    //var _GroupCostsTypeData = _GroupCosts.Where(it => it.Date)
-                    List<dynamic> datas = new List<dynamic>();
                     /*
                      *  76	酒店预订
                      *  77	行程
@@ -6827,7 +6862,7 @@ namespace OASystem.API.Controllers
                     switch (dto.CTable)
                     {
                         case 76: // 酒店预订
-                            datas.AddRange(
+                            _ModuleSubPromptInfo.AddRange(
                                 _GroupCostsTypeData.Select(it => new
                                 {
                                     it.DAY,
@@ -6843,7 +6878,7 @@ namespace OASystem.API.Controllers
                             break;
                         case 79: // 车/导游地接
 
-                            datas.AddRange(
+                            _ModuleSubPromptInfo.AddRange(
                                 _GroupCostsTypeData.Select(it => new
                                 {
                                     Date = it.Date,
@@ -6864,6 +6899,8 @@ namespace OASystem.API.Controllers
 
                             break;
                         case 85: // 机票
+
+                            List<dynamic> datas = new List<dynamic>();
                             datas.Add(
                                 new
                                 {
@@ -6883,16 +6920,22 @@ namespace OASystem.API.Controllers
                                 }
                             );
 
+                            modulePromptInfo.Data = datas;
+                            _ModulePromptInfos.Add(modulePromptInfo);
+
                             break;
                         default:
                             break;
                     }
+                }
 
 
-                    modulePromptInfo.Data = datas;
-                    _ModulePromptInfos.Add(modulePromptInfo);
-
+                if (dto.CTable != 85)
+                {
+                    _ModulePromptInfo.Data = _ModuleSubPromptInfo;
+                    _ModulePromptInfos.Add(_ModulePromptInfo);
                 }
+                
                 _view.ModulePromptInfos = _ModulePromptInfos;
 
                 return Ok(JsonView(true,"操作成功!", _view));

+ 26 - 3
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -11,6 +11,7 @@ using OASystem.Domain.Entities.District;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
+using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.JuHeExchangeRate;
 using OASystem.Infrastructure.Repositories.CRM;
 using OASystem.Infrastructure.Repositories.Groups;
@@ -298,7 +299,7 @@ namespace OASystem.API.OAMethodLib
 
         /// <summary>
         /// 业务模块 团组操作权限
-        /// 验证
+        /// 验证 并返回可操作的团
         /// </summary>
         /// <param name="diId">团组Id</param>
         /// <param name="userId">用户Id</param>
@@ -313,7 +314,7 @@ namespace OASystem.API.OAMethodLib
                 return _result;
             }
 
-            var data = await _dirRep._sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(it => it.DIId == diId && it.UId == userId && it.CTId == CTable && it.IsDel == 0).FirstAsync();
+            var data = _dirRep._sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(it => it.DIId == diId && it.UId == userId && it.CTId == CTable && it.IsDel == 0).First();
 
             if (data == null)
             {
@@ -323,11 +324,33 @@ namespace OASystem.API.OAMethodLib
             {
                 _result.Code = 0;
             }
-
             return _result;
         }
 
 
+        /// <summary>
+        /// 业务模块 团组操作权限
+        /// 返回可操作的团
+        /// </summary>
+        /// <param name="diId">团组Id</param>
+        /// <param name="userId">用户Id</param>
+        /// <param name="CTable">业务模块Id</param>
+        /// <returns></returns>
+        public static async Task<List<Web_ShareGroupInfoView>> PostOperationAuthReturnGroupInfosAsync(int userId, int CTable)
+        {
+            List<Web_ShareGroupInfoView> _ShareGroupInfoViews = new List<Web_ShareGroupInfoView>();
+            var taskDatas = _dirRep._sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(it => it.UId == userId && it.CTId == CTable && it.IsDel == 0).ToList();
+
+            if (taskDatas.Count < 1) return _ShareGroupInfoViews;
+
+            string diIds = string.Join(",", taskDatas.Select(it => it.DIId).ToList());
+            string sql = string.Format(@"Select Id,TeamName,TourCode,ClientName,VisitCountry,VisitStartDate,VisitEndDate,VisitDays,VisitPNumber 
+                                            From Grp_DelegationInfo Where Id In({0}) And IsDel = 0 Order By Id Desc", diIds);
+            _ShareGroupInfoViews = await _dirRep._sqlSugar.SqlQueryable<Web_ShareGroupInfoView>(sql).ToListAsync();
+                
+            return _ShareGroupInfoViews;
+        }
+
         #endregion
 
         #region 团组相关 

+ 16 - 2
OASystem/OASystem.Domain/Dtos/Financial/Fin_GroupExtraCostDto.cs

@@ -97,12 +97,26 @@ namespace OASystem.Domain.Dtos.Financial
     {
         public int diId { get; set; }
     }
-    
-    public class Fin_GroupExtraCostDto_Detail: PortDtoBase {
+
+    public class Fin_GroupExtraCostDto_Detail : PortDtoBase
+    {
         public int Id { get; set; }
     }
 
     public class Fin_GroupExtraCostDto_DataListInit : PortDtoBase
     {
     }
+
+    public class Fin_GroupExtraCostExcelDto : PortDtoBase
+    {
+        public int diId { get; set; }
+    }
+
+    public class Fin_GroupExtraCostExcelColumnSetting
+    {
+        public int columnIndex { get; set; }
+        public string columnName { get; set; }
+        public double columnWidth { get; set; }
+        public int rowCount { get; set; } = 1;
+    }
 }

+ 1 - 0
OASystem/OASystem.Domain/Dtos/Groups/DecreasePaymentsDto.cs

@@ -18,6 +18,7 @@ namespace OASystem.Domain.Dtos.Groups
     }
     public class DecreasePaymentsListDto
     {
+        public int UserId { get; set; }
         public int DiId { get; set; }
     }
     /// <summary>

+ 28 - 1
OASystem/OASystem.Domain/ViewModels/Financial/Fin_GroupExtraCostView.cs

@@ -24,7 +24,7 @@ namespace OASystem.Domain.ViewModels.Financial
         public string PriceDt { get; set; }
         public int IsAuditGM { get; set; }
         public string IsAuditGMStr { get; set; }
-        
+
     }
 
     public class Fin_GroupExtraCostDetailView
@@ -56,4 +56,31 @@ namespace OASystem.Domain.ViewModels.Financial
     {
 
     }
+
+    public class Fin_GroupExtraCost_ExcelCountView {
+        public int PriceType { get; set; }
+        public int DataCount { get; set; }
+    }
+
+    public class Fin_GroupExtraCost_ExcelView
+    {
+        public int PriceType { get; set; }
+        public string PriceTypeStr { get; set; }
+        public string PriceDetailTypeStr { get; set; }
+        public DateTime PriceDt { get; set; }
+        public string PriceDtStr
+        {
+            get
+            {
+                return this.PriceDt.ToString("yyyy-MM-dd");
+            }
+        }
+
+        public string PriceName { get; set; }
+        public decimal Price { get; set; }
+        public int PriceCount { get; set; }
+        public string Currency { get; set; }
+        public decimal PriceSum { get; set; }
+        public string Remark { get; set; }
+    }
 }

+ 8 - 17
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -38,24 +38,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
             Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
-                string UserId = "";
-                List<Grp_GroupsTaskAssignment> gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiId && a.IsDel == 0 && a.CTId == 98).ToList();
-                foreach (Grp_GroupsTaskAssignment gta in gtaUIdList)
-                    UserId += gta.UId + ",";
+                //string UserId = "0";
+                //List<Grp_GroupsTaskAssignment> gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiId && a.IsDel == 0 && a.CTId == 98).ToList();
+                //UserId = string.Join(",", gtaUIdList.Select(it => it.UId).ToList());
 
-                if (!string.IsNullOrWhiteSpace(UserId))
-                {
-                    UserId = UserId.Substring(0, UserId.Length - 1);
-                }
-                else
-                {
-                    UserId = "0";
-                }
                 string sql = string.Format(@"select Id,DiId,PriceName,Price,(select name from Sys_SetData where id=s.Currency) as Currency,FilePath,
                                             (select CnName from Sys_Users where Id=s.CreateUserId) as 'CreateUserName',CreateTime,(select IsAuditGM from 
-                                            Grp_CreditCardPayment where CTable=98 and CId=s.Id and IsDel=0) as 'isAudit' from Grp_DecreasePayments s where DIID={0} and IsDel=0 and s.CreateUserId in ({1}) ", dto.DiId,UserId);
+                                            Grp_CreditCardPayment where CTable=98 and CId=s.Id and IsDel=0) as 'isAudit' from Grp_DecreasePayments s 
+                                            where DIID={0} and IsDel=0  and s.CreateUserId in ({1}) ", dto.DiId, dto.UserId);
                 List<DecreasePaymentsView> _DecreasePayments = await _sqlSugar.SqlQueryable<DecreasePaymentsView>(sql).ToListAsync();
-                if (_DecreasePayments.Count != 0)
+                if (_DecreasePayments.Count > 0)
                 {
                     result = new Result() { Code = 0, Msg = "查询成功!", Data = _DecreasePayments };
                 }
@@ -66,7 +58,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             catch (Exception ex)
             {
-                result = new Result() { Code = -2, Msg = "未知错误" };
+                result = new Result() { Code = -2, Msg = ex.Message };
             }
             return result;
         }
@@ -78,7 +70,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             {
                 #region 团组下拉框
 
-
                 List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == dto.CTId).ToList();
 
                 string DiId = "0";
@@ -90,7 +81,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     DiId = DiId.Substring(0, DiId.Length - 1);
                 }
-                string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1}", DiId, 0);
+                string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1} Order By CreateTime Desc", DiId, 0);
                 List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
                 
                 if (grp_Delegations.Count == 0)

+ 11 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -50,6 +50,17 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 {
                     if (dto.PageSize == 0 && dto.PageIndex == 0)
                     {
+                        foreach (var temp in OfficialActivities)
+                        {
+                            //2024年4月1日 11:55:44  -蒋金辰 -日期处理
+                            DateTime dt;
+                            bool b_dt = DateTime.TryParse(temp.Date, out dt);
+                            if (b_dt)
+                            {
+                                temp.Date = dt.ToString("yyyy-MM-dd HH:mm");
+                            }
+                        }
+
                         result = new Result() { Code = 0, Msg = "查询成功!", Data = OfficialActivities };
                     }
                     else