Browse Source

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

yuanrf 2 months ago
parent
commit
928b338989

+ 3 - 0
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -218,6 +218,9 @@ namespace OASystem.API.Controllers
                 {
                     sql = string.Format($"{sql} And di.TeamName Like '%{dto.TeamName}%'");
                 }
+                //去重
+                sql = $"{sql} GROUP BY di.Id,di.TeamName,di.TourCode,di.ClientName,di.VisitCountry,di.VisitStartDate,di.VisitEndDate,di.VisitDays,di.VisitPNumber,di.CreateTime";
+
 
                 RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
                 var data = await _groupRep._sqlSugar.SqlQueryable<GroupListByCTableAndUserIdView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, total); //ToPageAsync

+ 26 - 17
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -5279,27 +5279,27 @@ FROM
             {
                 if (dto.DiId < 1)
                 {
-                    return Ok(JsonView(false, "请传入有效的DiId参数;"));
+                    return Ok(JsonView(400, "请传入有效的DiId参数;", ""));
                 }
 
                 if (dto.ExportType < 1)
                 {
-                    return Ok(JsonView(false, "请传入有效的ExportType参数; 1 明细表 2 表格"));
+                    return Ok(JsonView(400, "请传入有效的ExportType参数; 1 明细表 2 表格", ""));
                 }
 
                 if (dto.SubTypeId < 1)
                 {
-                    return Ok(JsonView(false, @"请传入有效的SubTypeId参数; 
+                    return Ok(JsonView(400, @"请传入有效的SubTypeId参数; 
                                                 1 明细表 --> 1005(默认明细表) 1006(因公出国(境)经费测算明细表) 1007(四川省商务厅出国经费财政先行审核表)  
                                                 2 表格 --> 1008(派员单位出(境)任务和预算审批意见表) 1009(省级单位出(境)经费报销单)
-                                                3 团组成员名单 1 团组成员名单"));
+                                                3 团组成员名单 1 团组成员名单", ""));
                 }
 
                 var _EnterExitCosts = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).First();
                 var _DayAndCosts = _sqlSugar.Queryable<Grp_DayAndCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).ToList();
                 if (_EnterExitCosts == null)
                 {
-                    return Ok(JsonView(false, "该团组未填写出入境费用;"));
+                    return Ok(JsonView(400, "该团组未填写出入境费用;",""));
                 }
 
                 //数据源
@@ -5426,7 +5426,6 @@ FROM
                             airPriceStr += $" {_EnterExitCosts.AirTD.ToString("#0.00")} 元/人(头等舱)";
                         }
 
-
                         dic.Add("AirTotalStr", airTotalStr);
                         dic.Add("AirPriceStr", airPriceStr);
                         dic.Add("CityTranffic", _EnterExitCosts.CityTranffic.ToString("#0.00"));
@@ -5671,8 +5670,9 @@ FROM
                         AsposeHelper.removewatermark_v2180();
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
 
+                        if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2 ) return Ok(JsonView(true, "成功", url));
                     }
                     else if (dto.SubTypeId == 1006)//1006(因公出国(境)经费测算明细表)
                     {
@@ -5836,7 +5836,6 @@ FROM
                             table1.Rows.RemoveAt(i - 1);
                         }
 
-
                         dic.Add("CityTranffic", _EnterExitCosts.CityTranffic.ToString("#0.00"));
 
                         string otherFeeStr = "";
@@ -5895,8 +5894,9 @@ FROM
                         string strFileName = $"{_DelegationInfo.TeamName}因公出国(境)经费测算明细表{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.docx";
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
 
+                        if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2 ) return Ok(JsonView(true, "成功", url));
                     }
                     else if (dto.SubTypeId == 1007) //1007(四川省商务厅出国经费财政先行审核表)
                     {
@@ -6136,7 +6136,8 @@ FROM
                         string strFileName = $"{_DelegationInfo.TeamName}-四川省商务厅出国经费财政先行审核表{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
                         designer.Workbook.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
+                        if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
                     }
                     else if (dto.SubTypeId == 1066) //成都市因公临时出国任务和预算审批意见表(外专培训团专用)
                     {
@@ -6316,7 +6317,9 @@ FROM
                         string strFileName = $"{_DelegationInfo.TeamName}-成都市因公临时出国任务和预算审批意见表(外专培训团专用).docx";
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
+
+                        if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
                     }
                 }
                 else if (dto.ExportType == 2) //表格
@@ -6398,7 +6401,9 @@ FROM
                         string strFileName = $"派员单位出(境)任务和预算审批意见表.docx";
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
+
+                        if (dto.PortType == 1) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2 || dto.PortType == 3) return Ok(JsonView(true, "成功", url));
 
                     }
                     else if (dto.SubTypeId == 1009)//1009(省级单位出(境)经费报销单)
@@ -6561,7 +6566,9 @@ FROM
                         string strFileName = $"省级单位出(境)经费报销单{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.docx";
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
+
+                        if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
                     }
                 }
                 else if (dto.ExportType == 3)
@@ -6570,7 +6577,7 @@ FROM
                     {
                         if (DeleClientList.Count < 1)
                         {
-                            return Ok(JsonView(false, "团组成员暂未录入!!!"));
+                            return Ok(JsonView(false, "团组成员暂未录入!!!",""));
                         }
 
                         //获取模板
@@ -6619,15 +6626,17 @@ FROM
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
 
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
-                        return Ok(JsonView(true, "成功", new { Url = url }));
+
+                        if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
+                        else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
                     }
                 }
 
-                return Ok(JsonView(false, "操作失败!"));
+                return Ok(JsonView(400, "操作失败!", ""));
             }
             catch (Exception ex)
             {
-                return Ok(JsonView(false, ex.Message));
+                return Ok(JsonView(400, ex.Message, ""));
             }
         }
 

+ 428 - 44
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -2,12 +2,15 @@
 using EyeSoft.Extensions;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
+using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Dtos.PersonnelModule;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
 using Org.BouncyCastle.Utilities.Encoders;
+using System.Data;
 using static OASystem.API.OAMethodLib.JWTHelper;
 
 namespace OASystem.API.Controllers
@@ -2596,24 +2599,16 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryAskData(QueryAskDataDto dto)
         {
-            try
-            {
-                Result groupData = await _askDataRep.QueryAskData(dto);
-                if (groupData.Code != 0)
-                {
-                    return Ok(JsonView(false, groupData.Msg));
-                }
-                return Ok(JsonView(true, groupData.Msg, groupData.Data));
-            }
-            catch (Exception ex)
+            Result groupData = await _askDataRep.QueryAskData(dto);
+            if (groupData.Code != 0)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(false, groupData.Msg));
             }
+            return Ok(JsonView(true, groupData.Msg, groupData.Data));
         }
 
         /// <summary>
-        /// 根据Id查询请示数据库单数据
+        /// 根据Id查询请示数据库单条数据
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -2621,20 +2616,12 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryAskDataById(QueryAskDataByIdDto dto)
         {
-            try
-            {
-                Res_AskData _AskData = await _sqlSugar.Queryable<Res_AskData>().FirstAsync(a => a.IsDel == 0 && a.Id == dto.id);
-                if (_AskData == null)
-                {
-                    return Ok(JsonView(true, "暂无数据!", _AskData));
-                }
-                return Ok(JsonView(true, "查询成功!", _AskData));
-            }
-            catch (Exception ex)
+            Res_AskData _AskData = await _sqlSugar.Queryable<Res_AskData>().FirstAsync(a => a.IsDel == 0 && a.Id == dto.id);
+            if (_AskData == null)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(true, "暂无数据!", _AskData));
             }
+            return Ok(JsonView(true, "查询成功!", _AskData));
         }
         /// <summary>
         /// 请示数据库操作(Status:1.新增,2.修改)
@@ -2645,21 +2632,14 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OpAskData(OpAskDataDto dto)
         {
-            try
-            {
-                Result groupData = await _askDataRep.OpAskData(dto);
-                if (groupData.Code != 0)
-                {
-                    return Ok(JsonView(false, groupData.Msg));
-                }
-                return Ok(JsonView(true, groupData.Msg, groupData.Data));
-            }
-            catch (Exception ex)
+            Result groupData = await _askDataRep.OpAskData(dto);
+            if (groupData.Code != 0)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+                return Ok(JsonView(false, groupData.Msg));
             }
+            return Ok(JsonView(true, groupData.Msg, groupData.Data));
         }
+
         /// <summary>
         /// 删除请示资料信息
         /// </summary>
@@ -2669,22 +2649,426 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DelAskData(DelBaseDto dto)
         {
+            var res = await _askDataRep.SoftDeleteByIdAsync<Res_AskData>(dto.Id.ToString(), dto.DeleteUserId);
+            if (!res)
+            {
+                return Ok(JsonView(false, "删除失败"));
+            }
+            return Ok(JsonView(true, "删除成功!"));
+        }
+
+        /// <summary>
+        /// 请示资料信息 
+        /// 省外办下载
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> AskDataProvinceFile(AskDataProvinceFileDto dto)
+        {
+            if (dto.DataIdItem.Length < 1) return Ok(JsonView(false,$"请传入有效的数据Id集合!"));
+            if (dto.DiId < 1) return Ok(JsonView(false, $"请传入有效的数据DiId参数!"));
+
+            //大写数字序号
+            string[] num = { "一", "二", "三", "四", "五", "六", "七", "八", "九", "十" ,
+                             "十一","十二","十三","十四","十五","十六","十七","十八","十九","二十",
+                             "二十一","二十二","二十三","二十四","二十五","二十六","二十七","二十八","二十九","三十",
+                             "三十一","三十二","三十三","三十四","三十五","三十六","三十七","三十八","三十九","四十"};
+
+            //数据源
+            var idItem = dto.DataIdItem.OrderBy(x => x);
+            var askDatas = await _sqlSugar.Queryable<Res_AskData>().Where(x => x.IsDel == 0 && idItem.Contains(x.Id)).ToListAsync();
+            //团组信息
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0 && x.Id == dto.DiId).FirstAsync();
+
+            //书签名
+            string Area = "",
+                   Official = "";
+
+            //表格数据源
+            DataTable dt = new DataTable();
+            dt.Columns.Add("Country", typeof(string));
+            dt.Columns.Add("TalkCase", typeof(string));
+
+            int id = 0;
+            int TalkcaseOrder = 0;
+            int RowOrder = 0;
+            //填充数据
+            for (int i = 0; i < askDatas.Count; i++)
+            {
+                var ad = askDatas[i];
+
+                Area = Area + ad.Country + ad.Area + "、";
+                Official = Official + ad.UnitName + "、";
+
+                //填充表格数据源
+
+                DataRow dr = dt.NewRow();
+                if (i > 0)
+                {
+                    var adtemp = askDatas[i - 1];
+
+                    if (ad.Country == adtemp.Country)
+                    {
+                        TalkcaseOrder++;
+                        dt.Rows[RowOrder]["TalkCase"] = dt.Rows[RowOrder]["TalkCase"] + "\r\n" + (1 + TalkcaseOrder).ToString() + "、" + ad.TalkCase;
+                    }
+                    else
+                    {
+                        RowOrder++;
+                        dr = dt.NewRow();
+                        dr["Country"] = "(" + num[RowOrder] + ")" + ad.Country;
+                        dr["TalkCase"] = "1、" + ad.TalkCase;
+                        dt.Rows.Add(dr);
+                        TalkcaseOrder = 0;
+                    }
+                }
+                else
+                {
+                    dr["Country"] = "(" + num[i] + ")" + ad.Country;
+                    dr["TalkCase"] = "1、" + ad.TalkCase;
+                    dt.Rows.Add(dr);
+                }
+                id = ad.Id;
+            }
+
+            //模板路径
+            var tempPath =  AppSettingsHelper.Get("WordBasePath") + "Template/省外办出访请示模板.doc";
+            //载入模板
+            Aspose.Words.Document doc = new Aspose.Words.Document(tempPath);
+
+            #region 填充word内容
+
+            #region 填充请示内容
+            //利用DocumentBuilder处理表格或是书签
+            Aspose.Words.DocumentBuilder builder = new DocumentBuilder(doc);
+            string bookmark = "";
             try
             {
-                var res = await _askDataRep.SoftDeleteByIdAsync<Res_AskData>(dto.Id.ToString(), dto.DeleteUserId);
-                if (!res)
+                for (int i = 0; i < dt.Rows.Count; i++)
                 {
-                    return Ok(JsonView(false, "删除失败"));
+                    bookmark = bookmark
+                        + dt.Rows[i]["Country"].ToString() + "\r\n"
+                        + dt.Rows[i]["TalkCase"].ToString() + "\r\n";
                 }
-                return Ok(JsonView(true, "删除成功!"));
             }
-            catch (Exception ex)
+            catch
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
             }
+
+
+            #endregion
+
+            //#region 填充word模板书签内容
+           
+            ////接团客户名单实例
+            //List<DeleClient> clientList = new DeleClientService().GetAll(Convert.ToInt32(ddlTourCode.SelectedValue));
+            ////机票代码实例
+            //DataTable airTable = PublicCode.GetTableByBlackCode(Convert.ToInt32(ddlTourCode.SelectedValue));
+            ////三字码dal
+            //ThreeCodeServices ts = new ThreeCodeServices();
+
+            ////团名
+            //if (doc.Range.Bookmarks["TeamName"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["TeamName"];
+            //    mark.Text = groupInfo.TeamName;
+            //}
+
+            ////团长名
+            //if (doc.Range.Bookmarks["ClientName2"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["ClientName2"];
+            //    if (clientList == null || clientList.Count == 0)
+            //    {
+            //        mark.Text = "【本团尚未录入客户名单,请联系主管!】";
+            //    }
+            //    else
+            //    {
+            //        mark.Text = clientList[0].Company + clientList[0].Job + clientList[0].LastName + clientList[0].Name;
+            //    }
+            //}
+            //if (doc.Range.Bookmarks["ClientName"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["ClientName"];
+            //    if (clientList == null || clientList.Count == 0)
+            //    {
+            //        mark.Text = "【本团尚未录入客户名单,请联系主管!】";
+            //    }
+            //    else
+            //    {
+            //        mark.Text = clientList[0].Company + clientList[0].Job + clientList[0].LastName + clientList[0].Name;
+            //    }
+            //}
+
+            ////跟团人数
+            //if (doc.Range.Bookmarks["ClientNumber2"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["ClientNumber2"];
+            //    mark.Text = di.VisitPNumber.ToString();
+            //}
+            //if (doc.Range.Bookmarks["ClientNumber"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["ClientNumber"];
+            //    mark.Text = di.VisitPNumber.ToString();
+            //}
+
+            ////地区
+            //if (doc.Range.Bookmarks["Area"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Area"];
+            //    mark.Text = Area.TrimEnd('、');
+            //}
+            //if (doc.Range.Bookmarks["Area2"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Area2"];
+            //    mark.Text = Area.TrimEnd('、');
+            //}
+
+            ////出访目的
+            //if (doc.Range.Bookmarks["Destination2"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Destination2"];
+            //    mark.Text = di.VisitPurpose;
+            //}
+            //if (doc.Range.Bookmarks["Destination"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Destination"];
+            //    mark.Text = di.VisitPurpose;
+            //}
+
+            ////邀请方
+            //if (doc.Range.Bookmarks["Official"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Official"];
+            //    mark.Text = Official.TrimEnd('、');
+            //}
+
+            ////出访日期
+            //if (doc.Range.Bookmarks["VisitDate"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["VisitDate"];
+            //    mark.Text = mark.Text = di.VisitStartDate.Split('-')[0] + "年"
+            //              + di.VisitStartDate.Split('-')[1] + "月"
+            //              + di.VisitStartDate.Split('-')[2] + "日"
+            //              + "至"
+            //              + di.VisitEndDate.Split('-')[1] + "月"
+            //              + di.VisitEndDate.Split('-')[2] + "日";
+            //}
+
+            ////请示范例
+            //if (doc.Range.Bookmarks["Temp"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Temp"];
+            //    mark.Text = bookmark;
+            //}
+
+            ////出访起止日期
+            //if (doc.Range.Bookmarks["Duration"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Duration"];
+            //    mark.Text = di.VisitStartDate.Split('-')[0] + "年"
+            //              + di.VisitStartDate.Split('-')[1] + "月"
+            //              + di.VisitStartDate.Split('-')[2] + "日"
+            //              + "至"
+            //              + di.VisitEndDate.Split('-')[1] + "月"
+            //              + di.VisitEndDate.Split('-')[2] + "日";
+            //}
+
+            ////出访天数
+            //if (doc.Range.Bookmarks["Durationdays"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Durationdays"];
+            //    mark.Text = di.VisitDays.ToString();
+            //}
+            //if (doc.Range.Bookmarks["Durationdays2"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Durationdays2"];
+            //    mark.Text = di.VisitDays.ToString();
+            //}
+            //#region 根据黑屏代码获取国家呆的天数;获取路线
+            //string result_CountryAndDay = "", result_Air = "";
+
+            //if (airTable.Rows[airTable.Rows.Count - 1]["Day"].ToString() == "")
+            //{
+            //    result_CountryAndDay = airTable.Rows[airTable.Rows.Count - 1]["Fliagtcode"].ToString();
+            //    result_Air = result_CountryAndDay;
+            //}
+            //else
+            //{
+            //    string place_start, place_end;
+            //    DateTime time_start, time_end;
+            //    ThreeCode three = null;
+            //    for (int i = 0; i < airTable.Rows.Count; i++)
+            //    {
+            //        //三字码实例
+            //        three = ts.getByThree(airTable.Rows[i]["Three"].ToString().Substring(0, 3));
+            //        if (three == null)
+            //        {
+            //            place_start = "【未收录三字码" + airTable.Rows[i]["Three"].ToString().Substring(0, 3) + ",请联系机票同事】";
+            //        }
+            //        else
+            //        {
+            //            if (three.Country == "" || string.IsNullOrEmpty(three.Country))
+            //            {
+            //                place_start = "【本三字码" + airTable.Rows[i]["Three"].ToString().Substring(0, 3) + "未录入国家信息,请联系机票同事】";
+            //            }
+            //            else
+            //            {
+            //                place_start = three.City;
+            //            }
+            //        }
+
+            //        three = ts.getByThree(airTable.Rows[i]["Three"].ToString().Substring(3, 3));
+            //        if (three == null)
+            //        {
+            //            place_end = "【未收录" + airTable.Rows[i]["Three"].ToString().Substring(0, 3) + ",请联系机票同事】";
+            //        }
+            //        else
+            //        {
+            //            if (three.Country == "" || string.IsNullOrEmpty(three.Country))
+            //            {
+            //                place_end = "【本三字码" + airTable.Rows[i]["Three"].ToString().Substring(0, 3) + "未录入国家信息,请联系机票同事】";
+            //            }
+            //            else
+            //            {
+            //                place_end = three.City;
+            //            }
+            //        }
+            //        result_Air += place_start + "一" + place_end + "一";
+
+
+            //        //获取国家和呆的天数
+            //        if (i > 0 && i < airTable.Rows.Count - 1)
+            //        {
+            //            time_start = Convert.ToDateTime(airTable.Rows[i - 1]["Day"]);
+            //            time_end = Convert.ToDateTime(airTable.Rows[i]["Day"]);
+            //            TimeSpan daycount = time_end.Subtract(time_start);
+            //            result_CountryAndDay += place_start + daycount.Days + "天" + ",";
+            //        }
+
+
+            //    }
+            //}
+            //#endregion
+
+            ////每个国家呆的天数
+            //if (doc.Range.Bookmarks["CountryAndDay"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["CountryAndDay"];
+            //    mark.Text = result_CountryAndDay.TrimEnd(',');
+
+            //}
+
+            //#region 出访路线城市字符串去重
+            //result_Air = result_Air.TrimEnd('一');
+            //string[] airTemp = result_Air.Split('一');
+            //airTemp = airTemp.Distinct().ToArray();
+            //result_Air = "";
+            //foreach (string str in airTemp)
+            //{
+            //    result_Air += str + "一";
+            //}
+            //result_Air = result_Air + airTemp[0];
+            //#endregion
+
+            ////出访路线
+            //if (doc.Range.Bookmarks["Air"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Air"];
+            //    mark.Text = result_Air;
+            //}
+            //#endregion
+
+            //#region 客户名单
+
+            //NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
+            //Aspose.Words.Tables.Table tableClient = allTables[0] as Aspose.Words.Tables.Table;
+
+            //if (clientList == null || clientList.Count == 0)
+            //{
+            //    builder.MoveToCell(0, 1, 0, 0);
+            //    builder.Write("【本团尚未录入客户名单,请联系主管!】");
+            //}
+            //else
+            //{
+            //    for (int i = 0; i < clientList.Count(); i++)
+            //    {
+            //        builder.MoveToCell(0, i + 1, 0, 0);
+            //        builder.Write((i + 1).ToString());
+
+            //        builder.MoveToCell(0, i + 1, 1, 0);
+            //        builder.Write(clientList[i].LastName.ToString() + clientList[i].Name.ToString());
+
+            //        builder.MoveToCell(0, i + 1, 2, 0);
+            //        builder.Write(clientList[i].Sex.ToString());
+
+            //        builder.MoveToCell(0, i + 1, 3, 0);
+            //        builder.Write(clientList[i].Birthday.ToString());
+
+            //        builder.MoveToCell(0, i + 1, 4, 0);
+            //        builder.Write(clientList[i].Company.ToString() + clientList[i].Job.ToString());
+
+            //    }
+            //}
+
+            //while (tableClient.Rows.Count > clientList.Count + 1)
+            //{
+            //    tableClient.Rows.RemoveAt(clientList.Count + 1);
+            //}
+            //#endregion
+
+            //#region 商邀行程
+            //string content = "", temp1 = "", temp2 = "";
+
+            ////获取数据,放到datatable
+            //List<ApprovalTravel> listapt = new ApprovalTravelService().GetByDiid(di.Id);
+
+            //if (listapt == null || listapt.Count == 0)
+            //{
+            //    content = "尚未生成商邀行程";
+            //}
+            //else
+            //{
+            //    for (int i = 0; i < listapt.Count; i++)
+            //    {
+            //        content = content + " " + listapt[i].Date + "\r\n";
+            //        temp1 = listapt[i].Time;
+            //        temp2 = listapt[i].Detail;
+            //        if (temp1 != "")
+            //        {
+            //            string[] str = temp1.Replace("\r\n", " ").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+            //            string[] str2 = temp2.Replace("\r\n", " ").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+            //            for (int j = 0; j < str.Count(); j++)
+            //            {
+            //                content = content + " " + str[j] + str2[j] + "\r\n";
+            //            }
+            //        }
+            //    }
+            //}
+
+            //if (doc.Range.Bookmarks["Content"] != null)
+            //{
+            //    Bookmark mark = doc.Range.Bookmarks["Content"];
+            //    mark.Text = content;
+            //}
+
+            //while (tableClient.Rows.Count > 1 + clientList.Count)
+            //{
+            //    tableClient.Rows.RemoveAt(1 + clientList.Count);
+            //}
+            //#endregion
+
+            #endregion
+
+
+            return Ok(JsonView(false));
         }
 
+
+
+
         #endregion
 
         #region 机票黑屏代码

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

@@ -619,6 +619,7 @@ namespace OASystem.API.OAMethodLib
              * 98  其他款项  --> 总经办部门 总经理 岗位/国交部门(ALL) 岗位/财务部门(ALL) 岗位/策划部门(ALL) 岗位/人事部门 采购 岗位
              * 1015 超支费用,69 收款退还  --> 财务部门(ALL)岗位
              * 1015 超支费用  --> 国交部(ALL)岗位
+             * 1081	文档下载  -->  国交部门 酒店,主管 岗位
              */
             var groupsTaskAssignments = new List<Grp_GroupsTaskAssignment>();
             // 76  酒店预订  --> 国交部门(7) 酒店(25)、主管(22) 岗位 
@@ -785,7 +786,8 @@ namespace OASystem.API.OAMethodLib
                   UId = it.Id,
                   CreateUserId = userId
               }).ToList()
-          );
+            );
+
 
             if (groupsTaskAssignments.Count > 0)
             {

+ 6 - 0
OASystem/OASystem.Domain/Dtos/DtoBase.cs

@@ -74,6 +74,12 @@ namespace OASystem.Domain.Dtos
         public string Remark { get; set; }
     }
 
+    public class AskDataProvinceFileDto {
+
+        public int[] DataIdItem { get; set; }
+        public int DiId { get; set; }
+    }
+
     /// <summary>
     /// 员工页面操作功能权限
     /// </summary>

+ 24 - 19
OASystem/OASystem.Infrastructure/Repositories/Financial/DailyFeePaymentRepository.cs

@@ -423,29 +423,34 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
             #region 已审核过的日付申请不可编辑
 
-            Fin_DailyFeePayment _DailyFeePayment = await _sqlSugar.Queryable<Fin_DailyFeePayment>().Where(it => it.Id == dto.Id && it.IsDel == 0).FirstAsync();
+            var _DailyFeePayment = await _sqlSugar.Queryable<Fin_DailyFeePayment>().Where(it => it.Id == dto.Id && it.IsDel == 0).FirstAsync();
             if (_DailyFeePayment != null)
             {
-                //if (_DailyFeePayment.FAudit != 0 && _DailyFeePayment.MAudit != 0)
-                //{
-                //    result.Msg = "财务和总经理均已审核,不可修改!";
-                //    return result;
-                //}
-                //else if (_DailyFeePayment.FAudit != 0)
-                //{
-                //    result.Msg = "财务已审核,不可修改!";
-                //    return result;
-                //}
-                //else if (_DailyFeePayment.MAudit != 0)
-                //{
-                //    result.Msg = "总经理已审核,不可修改!";
-                //    return result;
-                //}
-
                 if (_DailyFeePayment.FAudit == 1 || _DailyFeePayment.MAudit == 1)
                 {
-                    result.Msg = "审核已通过,不可修改!";
-                    return result;
+                    var setData = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.Id == dto.PriceTypeId).FirstAsync();
+                    if (setData != null)
+                    {
+                        if (setData.STid == 90)
+                        {
+                            if (_DailyFeePayment.IsPay == 1)
+                            {
+                                result.Msg = "该笔费用已付款,不可修改!";
+                                return result;
+
+                            }
+                        }
+                        else
+                        {
+                            result.Msg = "审核已通过,不可修改!";
+                            return result;
+                        }
+                    }
+                    else
+                    {
+                        result.Msg = "审核已通过,不可修改!";
+                        return result;
+                    }
                 }
             }