浏览代码

财务模块 日付申请 付款申请 已收款项
调整

leiy 1 年之前
父节点
当前提交
957e35f45e

+ 4 - 1
OASystem/EntitySync/Program.cs

@@ -101,6 +101,9 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Fin_OtherPrice),            // 其他款项
     //typeof(Res_OfficialActivities)     //公务出访
     //typeof(Res_AskData),//请示数据库
-    //typeof(Grp_DelegationEnData)
+    //typeof(Grp_DelegationEnData),
+    //typeof(Grp_EnterExitCost),
+    //typeof(Grp_DayAndCost), 
+    typeof(Grp_NationalTravelFee)
 });
 Console.WriteLine("数据库结构同步完成!");

+ 2 - 0
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -90,6 +90,8 @@ namespace OASystem.API.Controllers
                 view.Token = GeneralMethod.GetToken(_config, dto.Number, createZebraTime);
                 TimeSpan ts = view.Expires.AddMinutes(-1) - createZebraTime; //设置redis 过期时间 比 jwt 时间 快一分钟
                 await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync<string>(authorId, view.Token, ts);//string 存
+
+
             }
 
 

+ 26 - 2
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -555,8 +555,32 @@ namespace OASystem.API.Controllers
             }
         }
 
-        
-        
+        /// <summary>
+        /// 财务 已收款项
+        /// 分配已收款项至 应收项下
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostAllocateAmountReceived(AllocateAmountReceivedDto dto)
+        {
+            try
+            {
+                Result ffrData = await _proceedsReceivedRep.PostAllocateAmountReceived(dto);
+                if (ffrData.Code != 0)
+                {
+                    return Ok(JsonView(false, ffrData.Msg));
+                }
+                return Ok(JsonView(true));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+                throw;
+            }
+        }
+
         #endregion
     }
 }

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

@@ -57,7 +57,6 @@ namespace OASystem.Domain.Dtos.Financial
         /// </summary>
         public int Id { get; set; }
 
-
         /// <summary>
         /// 到款时间
         /// </summary>
@@ -104,4 +103,25 @@ namespace OASystem.Domain.Dtos.Financial
         public string? Remark { get; set; }
 
     }
+
+    /// <summary>
+    /// 分配已收款项 dto
+    /// </summary>
+    public class AllocateAmountReceivedDto:PortDtoBase
+    {
+        /// <summary>
+        /// 用户Id
+        /// </summary>
+        public int UserId { get; set; }
+
+        /// <summary>
+        /// 应收款项Id
+        /// </summary>
+        public int ParentId { get; set; }
+
+        /// <summary>
+        /// 子 Id
+        /// </summary>
+        public List<int>? SubIds { get; set; }
+    }
 }

+ 1 - 1
OASystem/OASystem.Domain/Dtos/UserDto/LoginDto.cs

@@ -6,7 +6,7 @@ namespace OASystem.Domain.Dtos.UserDto;
 /// 用户登录
 /// 提交DTO
 /// </summary>
-public class LoginDto:DtoBase
+public class LoginDto:PortDtoBase
 {
     /// <summary>
     /// 登录账号

+ 58 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DayAndCost.cs

@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 团组 - 出入境费用 - 子项
+    /// </summary>
+    [SugarTable("Grp_DayAndCost")]
+    public class Grp_DayAndCost : EntityBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 类型:1为住宿费;2为伙食费;3为公杂费;4培训费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Type { get; set; }
+
+        /// <summary>
+        /// 天数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Days { get; set; }
+
+        /// <summary>
+        /// 地名
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string? Place { get; set; }
+
+        /// <summary>
+        /// 费用标准
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Cost { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// Sys_SetData STid = 66
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 小计
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SubTotal { get; set; }
+    }
+}

+ 215 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCost.cs

@@ -0,0 +1,215 @@
+using OASystem.Domain.Enums;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 团组 - 出入境费用
+    /// </summary>
+    [SugarTable("Grp_EnterExitCost")]
+    public class Grp_EnterExitCost : EntityBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 境内费用(其他费用)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal InsidePay { get; set; }
+
+        #region 境内费用(其他费用)子项
+
+        /// <summary>
+        /// 签证费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Visa { get; set; }
+
+        /// <summary>
+        /// 签证费描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string? VisaRemark { get; set; }
+
+        /// <summary>
+        /// 疫苗费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal YiMiao { get; set; }
+
+        /// <summary>
+        /// 核酸检测费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HeSuan { get; set; }
+
+        /// <summary>
+        /// 服务费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Service { get; set; }
+
+        /// <summary>
+        /// 参展门票
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Ticket { get; set; }
+
+        /// <summary>
+        /// 保险费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Safe { get; set; }
+
+        #endregion
+
+
+        /// <summary>
+        /// 国际旅费合计(经济舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal OutsideJJPay { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计(公务舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal OutsaideGWPay { get; set; }
+
+        #region 国际旅费合计(经济舱\公务舱)
+
+        /// <summary>
+        ///  国际机票(经济舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal AirJJ { get; set; }
+
+        /// <summary>
+        ///  国际机票(公务舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal AirGW { get; set; }
+
+        /// <summary>
+        ///  国外城市间交通费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal CityTranffic { get; set; }
+
+
+        #region 汇率币种
+
+        /// <summary>
+        ///  美元
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateUSD { get; set; }
+
+        /// <summary>
+        ///  日元
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateJPY { get; set; }
+
+        /// <summary>
+        ///  欧元
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateEUR { get; set; }
+
+        /// <summary>
+        ///  英镑 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateGBP { get; set; }
+
+        /// <summary>
+        ///  港币 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateHKD { get; set; }
+
+
+        /// <summary>
+        ///  币种描述 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string? CurrencyRmark { get; set; }
+
+        #endregion
+
+        #endregion
+
+        #region 选择框状态
+
+        /// <summary>
+        ///  境内费用(其他费用)选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceOne { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceTwo { get; set; }
+
+        /// <summary>
+        ///  经济舱小计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SumJJCC { get; set; }
+
+        /// <summary>
+        ///  公务舱小计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SumGWC { get; set; }
+
+        /// <summary>
+        ///  住宿费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceThree { get; set; }
+
+        /// <summary>
+        ///  伙食费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceFour { get; set; }
+
+        /// <summary>
+        ///  公杂费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceFive { get; set; }
+
+        /// <summary>
+        ///  境内费用(其他费用)选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceSix { get; set; }
+
+        /// <summary>
+        /// 经济舱选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int AirJJC_Checked { get; set; }
+
+        /// <summary>
+        /// 公务舱选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int AirGWC_Checked { get; set; }
+
+        #endregion
+    }
+}

+ 72 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_NationalTravelFee.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 团组 - 国家出行费用
+    /// 适用于出入境模块
+    /// </summary>
+    [SugarTable("Grp_NationalTravelFee")]
+    public class Grp_NationalTravelFee : EntityBase
+    {
+        /// <summary>
+        /// 洲别
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? Continent { get; set; }
+
+        /// <summary>
+        /// 国家
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? Country { get; set; }
+
+        /// <summary>
+        /// 城市
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? City { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// Sys_SetData STid=66
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 住宿费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? RoomCost { get; set; }
+
+        /// <summary>
+        /// 伙食费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? FoodCost { get; set; }
+
+        /// <summary>
+        /// 公杂费 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? PublicCost { get; set; }
+
+        /// <summary>
+        /// 最后更新人 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int LastUpdateUserId { get; set; }
+
+        /// <summary>
+        /// 最后更新时间 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
+        public DateTime? LastUpdateTime { get; set; }
+
+    }
+}

+ 17 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -232,6 +232,23 @@ namespace OASystem.Domain.ViewModels.Financial
         public List<Fin_DailyFeePaymentContentInfolView> FeeContents { get; set; }
     }
 
+    /// <summary>
+    /// android 详情
+    /// </summary>
+    public class Fin_DailyFeePaymentInfoAndroidlView
+    {
+        public int Id { get; set; }
+        public int CompanyId { get; set; }
+        public int TransferTypeId { get; set; }
+        public int PriceTypeId { get; set; }
+        public string Instructions { get; set; }
+        public decimal SumPrice { get; set; }
+
+        public int CreateUserId { get; set; }
+
+        public List<Fin_DailyFeePaymentContentInfolView> FeeContents { get; set; }
+    }
+
     /// <summary>
     /// 费用类型
     /// </summary>

+ 1 - 1
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ForeignReceivablesView.cs

@@ -82,7 +82,7 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 币种
         /// </summary>
-        public string? Currency { get; set; }
+        public int Currency { get; set; }
 
         /// <summary>
         /// 添加方式   

+ 4 - 4
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ProceedsReceivedView.cs

@@ -21,10 +21,10 @@ namespace OASystem.Domain.ViewModels.Financial
     {
         public int Id { get; set; }
 
-        /// <summary>
-        /// 团组Id
-        /// </summary>
-        public int Diid { get; set; }
+        ///// <summary>
+        ///// 团组Id
+        ///// </summary>
+        //public int Diid { get; set; }
 
         /// <summary>
         /// 到款时间

+ 45 - 2
OASystem/OASystem.Infrastructure/Repositories/Financial/DailyFeePaymentRepository.cs

@@ -263,9 +263,10 @@ namespace OASystem.Infrastructure.Repositories.Financial
         {
             Result result = new Result() { Code = -2 };
 
-            Fin_DailyFeePaymentInfolView feeData = new Fin_DailyFeePaymentInfolView();
-            if (dto.PortType == 1 || dto.PortType == 2) //web
+            if (dto.PortType == 1) //web
             {
+                Fin_DailyFeePaymentInfolView feeData = new Fin_DailyFeePaymentInfolView();
+
                 string feeSql = string.Format(@"Select * From Fin_DailyFeePayment 
                                                 Where IsDel=0 And Id = {0} ", dto.Id);
                 feeData = await _sqlSugar.SqlQueryable<Fin_DailyFeePaymentInfolView>(feeSql).FirstAsync();
@@ -277,6 +278,22 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 result.Msg = "查询成功!";
                 result.Data = feeData;
             }
+            else if (dto.PortType == 2 || dto.PortType == 3)  //android And ios
+            {
+
+                Fin_DailyFeePaymentInfoAndroidlView feeData = new Fin_DailyFeePaymentInfoAndroidlView();
+
+                string feeSql = string.Format(@"Select * From Fin_DailyFeePayment 
+                                                Where IsDel=0 And Id = {0} ", dto.Id);
+                feeData = await _sqlSugar.SqlQueryable<Fin_DailyFeePaymentInfoAndroidlView>(feeSql).FirstAsync();
+                string feeContentSql = string.Format(@"Select * From Fin_DailyFeePaymentContent 
+                                                        Where IsDel=0 And DFPId = {0} ", dto.Id);
+                feeData.FeeContents = await _sqlSugar.SqlQueryable<Fin_DailyFeePaymentContentInfolView>(feeContentSql).ToListAsync();
+
+                result.Code = 0;
+                result.Msg = "查询成功!";
+                result.Data = feeData;
+            }
 
             return result;
 
@@ -330,6 +347,32 @@ namespace OASystem.Infrastructure.Repositories.Financial
         public async Task<Result> Edit(EditDailyFeePaymentDto dto)
         {
             Result result = new Result() { Code = -2 };
+
+            #region 已审核过的日付申请不可编辑
+
+            Fin_DailyFeePayment _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;
+                }
+
+            }
+
+            #endregion
+
             _sqlSugar.BeginTran();
             try
             {

+ 42 - 14
OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs

@@ -26,6 +26,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
         private readonly IMapper _mapper;
         private readonly DelegationInfoRepository _delegationRep;
         private readonly SetDataRepository _setDataRep;
+        
 
         public ForeignReceivablesRepository(SqlSugarClient sqlSugar, IMapper mapper, DelegationInfoRepository delegationRep, SetDataRepository setDataRep)
             : base(sqlSugar)
@@ -44,7 +45,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
             Result result = new() { Code = -2 };
 
             var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
-            var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep,13); //币种
+            var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep,66); //币种
             var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
 
             result.Code = 0;
@@ -115,27 +116,54 @@ namespace OASystem.Infrastructure.Repositories.Financial
         {
             Result result = new Result() { Code = -1, Msg = "程序错误!" };
 
-
-            var res = await _sqlSugar.Updateable<Fin_ForeignReceivables>()
+            _sqlSugar.BeginTran();
+            try
+            {
+                var res = await _sqlSugar.Updateable<Fin_ForeignReceivables>()
                 .Where(it => it.Id == dto.Id)
                 .SetColumns(it => new Fin_ForeignReceivables()
-                 {
-                     IsDel = 1,
-                     DeleteUserId = dto.UserId,
-                     DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
-                 }
+                {
+                    IsDel = 1,
+                    DeleteUserId = dto.UserId,
+                    DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+                }
                 ).ExecuteCommandAsync();
 
-            if (res > 0)
-            {
-                result.Msg = "删除成功!";
-                result.Code = 0;
+                if (res > 0)
+                {
+
+                    await _sqlSugar.Updateable<Fin_ProceedsReceived>()
+                                      .Where(a => a.FID == dto.Id)
+                                      .SetColumns(a => new Fin_ProceedsReceived
+                                      {
+                                          IsDel = 1,
+                                          DeleteUserId = dto.UserId,
+                                          DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+                                      }).ExecuteCommandAsync();
+
+
+
+                    _sqlSugar.CommitTran();
+                    result.Msg = "删除成功!";
+                    result.Code = 0;
+                }
+                else
+                {
+                    _sqlSugar.RollbackTran();
+                    result.Msg = "删除失败!";
+                    return result;
+
+                }
             }
-            else
+            catch (Exception ex)
             {
-                result.Msg = "删除失败!";
+                _sqlSugar.RollbackTran();
+                result.Msg= ex.Message;
+                return result;
             }
 
+            
+
             return result;
         }
 

+ 39 - 0
OASystem/OASystem.Infrastructure/Repositories/Financial/ProceedsReceivedRepository.cs

@@ -157,5 +157,44 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
             return result;
         }
+
+
+        /// <summary>
+        /// 已收款项
+        /// 分配已收款项至 应收项下
+        /// </summary>
+        /// <param name="diid"></param>
+        /// <returns></returns>
+        public async Task<Result> PostAllocateAmountReceived(AllocateAmountReceivedDto dto)
+        {
+            Result result = new() { Code = -2 };
+
+            if (dto.SubIds.Count <= 0)
+            {
+                result.Msg = "请选择要添加的已收款项!";
+                return result;
+            }
+
+            if (dto.PortType == 1)
+            {
+
+                List<Fin_ProceedsReceived> _proceedsReceived = new List<Fin_ProceedsReceived>();
+
+                foreach (var id in dto.SubIds)
+                {
+                    _proceedsReceived.Add(new Fin_ProceedsReceived() { Id = id, FID = dto.ParentId });
+                }
+
+                var res = await _sqlSugar.Updateable(_proceedsReceived).
+                    WhereColumns(it => new { it.Id })
+                .UpdateColumns(it => new { it.FID })
+                .ExecuteCommandAsync();
+
+                result.Code = 0;
+
+            }
+
+            return result;
+        }
     }
 }