Browse Source

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

jiangjc 1 year ago
parent
commit
6edb85e0a4

+ 76 - 1
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -11,6 +11,8 @@ using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Business;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Business;
+using OASystem.Infrastructure.Repositories.Groups;
+using OASystem.Infrastructure.Repositories.System;
 using Org.BouncyCastle.Asn1.Mozilla;
 
 namespace OASystem.API.Controllers
@@ -23,12 +25,85 @@ namespace OASystem.API.Controllers
     {
         private readonly IMapper _mapper;
         private readonly CommonBusRepository _busRep;
-        public BusinessController(IMapper mapper, CommonBusRepository busRep)
+        private readonly SetDataRepository _setDataRep;
+        private readonly DelegationInfoRepository _groupRep;
+        public BusinessController(IMapper mapper, CommonBusRepository busRep, SetDataRepository setDataRep, DelegationInfoRepository groupRep)
         {
             _mapper = mapper;
             _busRep = busRep;
+            _setDataRep = setDataRep;
+            _groupRep = groupRep;
         }
 
+        #region 团组信息 团组详情
+        /// <summary>
+        ///  团组信息 团组详情
+        /// </summary>
+        /// <param name="dto">团组info请求dto</param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostShareGroupInfo(ShareGroupInfoDto dto)
+        {
+            var groupData = await _groupRep.PostShareGroupInfo(dto);
+            if (groupData.Code != 0)
+            {
+                return Ok(JsonView(false, groupData.Msg));
+            }
+
+            return Ok(JsonView(groupData.Data));
+        }
+
+        /// <summary>
+        /// 团组信息 团组名称 List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetGroupNameList(GroupNameDto dto)
+        {
+            var groupData = await _groupRep.GetGroupNameList(dto);
+            if (groupData.Code != 0)
+            {
+                return Ok(JsonView(false, groupData.Msg));
+            }
+
+            return Ok(JsonView(groupData.Data, groupData.Data.Count));
+        }
+
+        #endregion
+
+        #region 币种 List
+        /// <summary>
+        /// 币种 List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostCurrencyList()
+        {
+            try
+            {
+                Result setData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种类型
+                if (setData.Code == 0)
+                {
+                    return Ok(JsonView(true, "查询成功", setData.Data));
+                }
+                else
+                {
+                    return Ok(JsonView(false, setData.Msg));
+                }
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        #endregion
+
         #region 会务物料单
 
         /// <summary>

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

@@ -397,10 +397,11 @@ namespace OASystem.API.Controllers
 
         #endregion
 
-        #region 对外收款账单
+        #region 对外收款账单 关联已收款项
 
         /// <summary>
         /// 对外收款账单 Select数据源(团组名,币种,汇款方式)
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -423,10 +424,11 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
-        
+
         /// <summary>
         /// 对外收款账单 
         /// 账单详情
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -450,10 +452,10 @@ namespace OASystem.API.Controllers
             }
         }
 
-
         /// <summary>
         /// 对外收款账单 
         /// 账单 删除
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -480,6 +482,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 对外收款账单 
         /// 添加 And 更新
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -506,6 +509,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 已收款项 
         /// 账单 删除
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -532,6 +536,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 已收款项 
         /// 添加 And 更新
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -558,6 +563,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 财务 已收款项
         /// 分配已收款项至 应收项下
+        /// 关联已收款项
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -581,6 +587,71 @@ namespace OASystem.API.Controllers
             }
         }
 
+        ///// <summary>
+        ///// 财务 收款账单
+        ///// 导出Word(北京,四川)
+        ///// </summary>
+        ///// <param name="dto"></param>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> PostAccountReceivableWordExport(AccountReceivableWordExportDto dto)
+        //{
+        //    try
+        //    {
+        //        //模板处理
+        //        string typeName = string.Empty;
+        //        if (dto.TemplateType == 1) //四川
+        //        {
+        //            typeName = "四川";
+        //        }
+        //        else if (dto.TemplateType == 2) //北京 
+        //        {
+        //            typeName = "北京";
+        //        }
+        //        else return Ok(JsonView(false,"请选择正确的模板类型!"));
+
+        //        string wordTempName = string.Format("收款账单({0})模板.doc", typeName);
+
+
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        return Ok(JsonView(false, ex.Message));
+        //    }
+        //}
+        #endregion
+
+        #region 对外收款账单
+
+
+        /// <summary>
+        /// 对外收款账单 
+        /// 账单详情
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostGroupReceivablesInfoByDiId(ForForeignReceivablesInfoDto dto)
+        {
+            try
+            {
+                Result ffrData = await _ForForeignReceivablesRep.GetGroupReceivablesInfoByDiId(dto);
+                if (ffrData.Code != 0)
+                {
+                    return Ok(JsonView(false, ffrData.Msg));
+                }
+                return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+                throw;
+            }
+        }
+
+
         #endregion
     }
 }

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

@@ -79,6 +79,7 @@ namespace OASystem.API.Controllers
             _message = message;
         }
 
+        
         #region 流程管控
 
         /// <summary>
@@ -366,23 +367,7 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(groupData.Data));
         }
 
-        /// <summary>
-        /// 获取团组名称 List
-        /// </summary>
-        /// <param name="dto"></param>
-        /// <returns></returns>
-        [HttpPost]
-        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GetGroupNameList(GroupNameDto dto)
-        {
-            var groupData = await _groupRepository.GetGroupNameList(dto);
-            if (groupData.Code != 0)
-            {
-                return Ok(JsonView(false, groupData.Msg));
-            }
-
-            return Ok(JsonView(groupData.Data, groupData.Data.Count));
-        }
+        
 
         /// <summary>
         /// 获取团组名称data  And 签证国别Data

+ 1 - 68
OASystem/OASystem.Api/appsettings.json

@@ -126,73 +126,6 @@
   "VisaProgressImageFtpPath": "Image/Visa/",
 
   "WageSheetExcelBaseUrl": "http://132.232.92.186:24/",
-  "WageSheetExcelFptPath": "C:/Server/File/OA2023/Office/WageSheetFile/",
-
-  //节假日
-  "HoliDayDataSource": [
-    {
-      "Year": "2023",
-      "Holidays": [
-        {
-          "HoliDate": "09-29",
-          "HoliName": "中秋"
-        },
-        {
-          "HoliDate": "09-30",
-          "HoliName": "中秋"
-        },
-        {
-          "HoliDate": "10-01",
-          "HoliName": "国庆"
-        },
-        {
-          "HoliDate": "10-02",
-          "HoliName": "国庆"
-        },
-        {
-          "HoliDate": "10-03",
-          "HoliName": "国庆"
-        },
-        {
-          "HoliDate": "10-04",
-          "HoliName": "国庆"
-        },
-        {
-          "HoliDate": "10-05",
-          "HoliName": "国庆"
-        },
-        {
-          "HoliDate": "10-06",
-          "HoliName": "国庆"
-        },
-        {
-          "HoliDate": "10-07",
-          "HoliName": "工作日"
-        },
-        {
-          "HoliDate": "10-08",
-          "HoliName": "工作日"
-        },
-        {
-          "HoliDate": "12-30",
-          "HoliName": "元旦"
-        },
-        {
-          "HoliDate": "12-31",
-          "HoliName": "元旦"
-        }
-      ]
-    },
-    {
-      "Year": "2024",
-      "Holidays": [
-        {
-          "HoliDate": "01-01",
-          "HoliName": "元旦"
-        }
-      ]
-    }
-
-  ]
+  "WageSheetExcelFptPath": "C:/Server/File/OA2023/Office/WageSheetFile/"
 
 }

+ 21 - 0
OASystem/OASystem.Domain/Dtos/Financial/ProceedsReceivedDto.cs

@@ -124,4 +124,25 @@ namespace OASystem.Domain.Dtos.Financial
         /// </summary>
         public List<int>? SubIds { get; set; }
     }
+    #region word Download
+
+    /// <summary>
+    /// 收款账单 word Download
+    /// </summary>
+    public class AccountReceivableWordExportDto
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 模板类型
+        /// 1 四川 2 北京
+        /// </summary>
+        public int TemplateType { get; set; }
+    }
+
+    #endregion
+
 }

+ 11 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs

@@ -22,6 +22,17 @@ namespace OASystem.Domain.Dtos.Groups
     {
     }
 
+    /// <summary>
+    /// 获取团组singe Share 请求实体类
+    /// </summary>
+    public class ShareGroupInfoDto : PortDtoBase
+    {
+        /// <summary>
+        /// 团组Id 
+        /// </summary>
+        public int Id { get; set; }
+    }
+
     /// <summary>
     /// 获取团组singe 请求实体类
     /// </summary>

+ 3 - 3
OASystem/OASystem.Domain/Entities/Groups/Grp_Ommission.cs

@@ -26,12 +26,12 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 团组结束时间,即团组最后一天
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string GroupDate { get; set; }
         /// <summary>
         /// 团组级别
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string GroupLvl { get; set; }
         /// <summary>
         /// 提成明细
@@ -46,7 +46,7 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 提成发放至工资的月份
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string WageYearMonth { get; set; }
         /// <summary>
         /// 造成损失标识

+ 49 - 1
OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs

@@ -15,7 +15,55 @@ namespace OASystem.Domain.ViewModels.Groups
     /// 返回视图
     /// </summary>
     public class DelegationInfoView : Grp_DelegationInfo { }
-    
+
+    /// <summary>
+    /// 接团信息详情 共享
+    /// 返回视图
+    /// </summary>
+    public class ShareGroupInfoView
+    {
+        /// <summary>
+        /// 主键Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 团号
+        /// </summary>
+        public string? TourCode { get; set; }
+       
+        /// <summary>
+        /// 客户名称
+        /// </summary>
+        public string? ClientName { get; set; }
+
+        /// <summary>
+        /// 出访国家
+        /// </summary>
+        public string? VisitCountry { get; set; }
+
+        /// <summary>
+        /// 出团开始日期 
+        /// </summary>
+        public DateTime VisitStartDate { get; set; }
+
+        /// <summary>
+        /// 出团结束日期 
+        /// </summary>
+        public DateTime VisitEndDate { get; set; }
+
+        /// <summary>
+        /// 出行天数
+        /// </summary>
+        public int VisitDays { get; set; }
+
+        /// <summary>
+        /// 出行人数
+        /// </summary>
+        public int VisitPNumber { get; set; }
+
+    }
+
     /// <summary>
     /// 接团信息详情
     /// 返回视图

+ 15 - 10
OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs

@@ -36,6 +36,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
             _setDataRep = setDataRep;
         }
 
+        #region 关联已收款项
+
         /// <summary>
         /// 收款账单 数据源
         /// </summary>
@@ -45,13 +47,14 @@ namespace OASystem.Infrastructure.Repositories.Financial
             Result result = new() { Code = -2 };
 
             var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
-            var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep,66); //币种
+            var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种
             var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
 
             result.Code = 0;
             result.Msg = "成功!";
-            result.Data = new {
-                GroupNameData= groupNameData.Data,
+            result.Data = new
+            {
+                GroupNameData = groupNameData.Data,
                 CurrencyData = currencyData.Data,
                 RemittanceMethodData = remittanceMethodData.Data
             };
@@ -79,14 +82,14 @@ namespace OASystem.Infrastructure.Repositories.Financial
             var groupProceedsReceivedList = await _sqlSugar.SqlQueryable<ProceedsReceivedView>(groupProceedsReceivedSql).ToListAsync();
 
             List<ProceedsReceivedView> NotFIDData = new List<ProceedsReceivedView>();
-            if (dto.PortType == 1 )
+            if (dto.PortType == 1)
             {
                 foreach (var item in groupReceivedList)
                 {
                     item._ProceedsReceivedDatas = groupProceedsReceivedList.Where(s => s.FID == item.Id).ToList();
                 }
 
-                NotFIDData = groupProceedsReceivedList.Where(s =>! groupReceivedList.Any(e => s.FID == e.Id)).ToList();
+                NotFIDData = groupProceedsReceivedList.Where(s => !groupReceivedList.Any(e => s.FID == e.Id)).ToList();
 
             }
 
@@ -158,11 +161,11 @@ namespace OASystem.Infrastructure.Repositories.Financial
             catch (Exception ex)
             {
                 _sqlSugar.RollbackTran();
-                result.Msg= ex.Message;
+                result.Msg = ex.Message;
                 return result;
             }
 
-            
+
 
             return result;
         }
@@ -209,7 +212,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 }
                 if (_ForeignReceivables.Count > 0)
                 {
-                    var x =  _sqlSugar.Storageable(_ForeignReceivables).ToStorage();
+                    var x = _sqlSugar.Storageable(_ForeignReceivables).ToStorage();
                     addCount = x.AsInsertable.ExecuteCommand();        //不存在插入
                     updateCount = x.AsUpdateable.ExecuteCommand();    //存在更新
                 }
@@ -254,7 +257,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
             //string sql = string.Format(@"Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0}", diids);
 
             var groupReceivedList = await _sqlSugar.Queryable<Fin_ForeignReceivables>()
-                .Where(pr =>  pr.IsDel == 0 && diids.Contains(pr.Diid)).ToListAsync();
+                .Where(pr => pr.IsDel == 0 && diids.Contains(pr.Diid)).ToListAsync();
 
             result.Code = 0;
             result.Msg = "查询成功!";
@@ -264,7 +267,9 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
         }
 
+        #endregion
+
+
 
-       
     }
 }

+ 66 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -39,6 +39,72 @@ namespace OASystem.Infrastructure.Repositories.Groups
             _taskAssignmentRep = taskAssignmentRep;
         }
 
+        #region 团组信息 团组详情共享Api
+
+        /// <summary>
+        /// 团组信息 团组详情共享Api
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> PostShareGroupInfo(ShareGroupInfoDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+
+            if (dto.PortType == 1 || dto.PortType == 2) //Web Or Android
+            {
+                string sql = string.Format(@"Select Id,TourCode,ClientName,VisitCountry,VisitStartDate,VisitEndDate,VisitDays,VisitPNumber 
+                                             From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
+
+                var _DelegationInfo = await _sqlSugar.SqlQueryable<ShareGroupInfoView>(sql).FirstAsync();
+                if (_DelegationInfo != null)
+                {
+                    if (_DelegationInfo.VisitCountry.Contains("|"))
+                    {
+                        _DelegationInfo.VisitCountry = _DelegationInfo.VisitCountry.Replace("|", "、");
+                    }
+
+                    result.Code = 0;
+                    result.Msg = "成功!";
+                    result.Data = _DelegationInfo;
+                }
+                else result.Msg = "暂无该团组信息";
+            }
+
+            return result;
+
+        }
+
+        #endregion
+        /// <summary>
+        /// 获取接团信息Info
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> PostGroupInfo(GroupInfoDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+
+            if (dto.PortType == 1 || dto.PortType == 2) //Web Or Android
+            {
+                string sql = string.Format(@"Select Id,SalesQuoteNo,TourCode,JietuanOperator,TeamLevSId,TeamDid,TeamName,ClientName,
+	                                                ClientUnit,VisitCountry,VisitDate,VisitDays,VisitPNumber,TontractTime,
+	                                                PayDay,PaymentMoney,VisitPurpose,SpecialNeeds,OtherNeeds,CGRWSPBMMC,CGRWSPWH,
+	                                                ZZSCBMMC,ZZSCSPWH,Remark,TellPhone
+                                             From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
+
+                var _DelegationInfo = await _sqlSugar.SqlQueryable<DelegationInfoWebView>(sql).FirstAsync();
+                if (_DelegationInfo != null)
+                {
+                    result.Code = 0;
+                    result.Msg = "成功!";
+                    result.Data = _DelegationInfo;
+                }
+                else result.Msg = "暂无该团组信息";
+            }
+
+            return result;
+
+        }
         #region 团组
 
         /// <summary>

+ 26 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -222,9 +222,33 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             if (dto.PortType == 1) //web
             {
+
                 var _nationalTravelFee = _sqlSugar.Storageable<Grp_NationalTravelFee>(nationalTravelFee).ToStorage();
-                _nationalTravelFee.AsInsertable.ExecuteCommand();   //不存在插入
-                _nationalTravelFee.AsUpdateable.IgnoreColumns(it => new { it.CreateUserId, it.CreateTime, it.IsDel }).ExecuteCommand();   //存在更新
+                if (dto.Id != 0) //新增
+                {
+                    string selectSql = string.Format(@"Select * From Grp_NationalTravelFee 
+                                                   Where IsDel = 0 
+                                                   And Continent = '{0}' 
+                                                   And Country = '{1}'
+                                                   And City = '{2}'", dto.Continent, dto.Country, dto.City);
+                    Grp_NationalTravelFee nationalTravelFee1 = new Grp_NationalTravelFee();
+                    nationalTravelFee1 = await _sqlSugar.SqlQueryable<Grp_NationalTravelFee>(selectSql).FirstAsync();
+                    if (nationalTravelFee1 != null)
+                    {
+                        result.Msg = "该国家 城市已存在,请勿重复添加!";
+                        return result;
+                    }
+
+                    _nationalTravelFee.AsInsertable.ExecuteCommand();   //不存在插入
+                }
+                else
+                {
+                    _nationalTravelFee.AsUpdateable
+                    .IgnoreColumns(it => new { it.CreateUserId, it.CreateTime, it.IsDel })
+                    .WhereColumns(it => it.Id)
+                    .ExecuteCommand();   //存在更新
+                }
+
                 result.Code = 0;
             }
             else if (dto.PortType == 2) //Android