Procházet zdrojové kódy

团组相关
团组状态 Page列表 修改

leiy před 1 rokem
rodič
revize
3219c646c0

+ 3 - 2
OASystem/EntitySync/Program.cs

@@ -114,7 +114,8 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Grp_GroupCost) //成本数据信息
     //typeof(Grp_CostTypeHotelNumber)//分段房间数量
     //typeof(Grp_VisaInfo)
-    typeof(Grp_CarTouristGuideGroundReservations),
-    typeof(Grp_CarTouristGuideGroundReservationsContent)
+    //typeof(Grp_CarTouristGuideGroundReservations),
+    //typeof(Grp_CarTouristGuideGroundReservationsContent),//
+    typeof(Fin_PaymentRefundAndOtherMoney)
 });
 Console.WriteLine("数据库结构同步完成!");

+ 81 - 1
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -28,11 +28,14 @@ namespace OASystem.API.Controllers
         private readonly TeamRateRepository _teamRateRep;      //团组汇率仓库
         private readonly ForeignReceivablesRepository _ForForeignReceivablesRep;  //对外收款账单仓库
         private readonly ProceedsReceivedRepository _proceedsReceivedRep;  //已收款项仓库
+        private readonly PaymentRefundAndOtherMoneyRepository _paymentRefundAndOtherMoneyRep; //收款退还与其他款项 仓库
 
         /// <summary>
         /// 初始化
         /// </summary>
-        public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep, SqlSugarClient sqlSugar, SetDataTypeRepository setDataTypeRep, TeamRateRepository teamRateRep, ForeignReceivablesRepository ForForeignReceivablesRep, ProceedsReceivedRepository proceedsReceivedRep) 
+        public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep, SqlSugarClient sqlSugar, SetDataTypeRepository setDataTypeRep,
+            TeamRateRepository teamRateRep, ForeignReceivablesRepository ForForeignReceivablesRep, ProceedsReceivedRepository proceedsReceivedRep, 
+            PaymentRefundAndOtherMoneyRepository paymentRefundAndOtherMoneyRep) 
         {
             _mapper = mapper;
             _config = configuration;
@@ -42,6 +45,7 @@ namespace OASystem.API.Controllers
             _teamRateRep = teamRateRep;
             _ForForeignReceivablesRep = ForForeignReceivablesRep;
             _proceedsReceivedRep = proceedsReceivedRep;
+            _paymentRefundAndOtherMoneyRep = paymentRefundAndOtherMoneyRep;
         }
 
         #region 日付申请
@@ -875,6 +879,82 @@ namespace OASystem.API.Controllers
             }
         }
 
+        #endregion
+
+        #region 收款退还与其他款项 
+
+        /// <summary>
+        /// 收款退还与其他款项
+        /// 查询 根据团组Id
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostPaymentRefundAndOtherMoneyItemByDiId(PaymentRefundAndOtherMoneyItemByDiIdDto dto)
+        {
+            try
+            {
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "参数不能为空!"));
+                }
+
+                Result _result = await _paymentRefundAndOtherMoneyRep.PostItemByDiId(dto.DiId);
+
+                if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
+                {
+                    if (_result.Code != 0)
+                    {
+                        return Ok(JsonView(false, _result.Msg));
+                    }
+                }
+                else
+                {
+                    return Ok(JsonView(false, "请输入正确的端口号! 1 Web 2 Android 3 Ios;"));
+                }
+                return Ok(JsonView(true, "操作成功!", _result.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
+
+        /// <summary>
+        /// 收款退还与其他款项
+        /// 查询 根据团组Id
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostPaymentRefundAndOtherMoneyDel(PaymentRefundAndOtherMoneyDelDto dto)
+        {
+            try
+            {
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "参数不能为空!"));
+                }
+
+                Result _result = await _paymentRefundAndOtherMoneyRep._Del(dto);
+
+                if (_result.Code != 0)
+                {
+                    return Ok(JsonView(false, _result.Msg));
+                }
+
+                return Ok(JsonView(true, "操作成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
+
+
+
         #endregion
     }
 }

+ 1 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3996,7 +3996,7 @@ namespace OASystem.API.Controllers
                        tj, tj, tj, tj, tj);
                 }
 
-                string sql = string.Format(@"Select Row_Number,SalesQuoteNo,TourCode,TeamTypeId, TeamType,
+                string sql = string.Format(@"Select Row_Number,Id,SalesQuoteNo,TourCode,TeamTypeId, TeamType,
 					                              TeamLevId,TeamLev,TeamName,ClientName,ClientUnit,
 					                              VisitDate,VisitDays,VisitPNumber,JietuanOperator,IsSure,CreateTime
 					                              From (

+ 35 - 0
OASystem/OASystem.Domain/Dtos/Financial/PaymentRefundAndOtherMoneyDto.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Financial
+{
+    /// <summary>
+    /// 收款退还与其他款项
+    /// </summary>
+    public class PaymentRefundAndOtherMoneyItemByDiIdDto:PortDtoBase
+    {
+        /// <summary>
+        /// 团组Id 
+        /// </summary>
+        public int DiId { get; set; }
+    }
+
+    /// <summary>
+    /// 收款退还与其他款项
+    /// </summary>
+    public class PaymentRefundAndOtherMoneyDelDto
+    {
+        /// <summary>
+        /// Id 
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 用户Id
+        /// </summary>
+        public int UserId { get; set; }
+    }
+}

+ 54 - 0
OASystem/OASystem.Domain/Entities/Financial/Fin_PaymentRefundAndOtherMoney.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Financial
+{
+    /// <summary>
+    /// 收款退还与其他款项
+    /// </summary>
+    [SugarTable("Fin_PaymentRefundAndOtherMoney")]
+    public class Fin_PaymentRefundAndOtherMoney : EntityBase
+    {
+        /// <summary>
+        /// 团组id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 费用名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string? PriceName { get; set; }
+
+        /// <summary>
+        /// 费用金额
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal Price { get; set; }
+
+        /// <summary>
+        /// 费用币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int CurrencyId { get; set; }
+
+        /// <summary>
+        /// 付款类型??? 
+        /// 0 1
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
+        public string PayType { get; set; }
+
+        /// <summary>
+        /// 退款表识 
+        /// 0 未退 1 已退
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int PriceType { get; set; }
+
+    }
+}

+ 58 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_PaymentRefundAndOtherMoneyView.cs

@@ -0,0 +1,58 @@
+using OASystem.Domain.Entities.Financial;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Financial
+{
+    /// <summary>
+    /// 收款退还与其他款项
+    /// </summary>
+    public class Fin_PaymentRefundAndOtherMoneyView: Fin_PaymentRefundAndOtherMoney
+    {
+    }
+
+    /// <summary>
+    /// 收款退还与其他款项
+    /// ItemView
+    /// </summary>
+    public class Fin_PaymentRefundAndOtherMoneyItemView 
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 费用名称
+        /// </summary>
+        public string? PriceName { get; set; }
+
+        /// <summary>
+        /// 费用
+        /// </summary>
+        public decimal Price { get; set; }
+
+        /// <summary>
+        /// 币种Name
+        /// </summary>
+        public string? CurrencyName { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string? Remark { get; set; }
+
+        /// <summary>
+        /// 创建人
+        /// </summary>
+        public string? CreateUserName { get; set; }
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        public DateTime CreateTime { get; set; }
+    }
+}

+ 94 - 0
OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs

@@ -0,0 +1,94 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Financial;
+using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.ViewModels.Financial;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Financial
+{
+    /// <summary>
+    /// 财务 - 收款退还与其他款项
+    /// </summary>
+    public class PaymentRefundAndOtherMoneyRepository:BaseRepository<Fin_PaymentRefundAndOtherMoney, Fin_PaymentRefundAndOtherMoneyView>
+    {
+        private readonly IMapper _mapper;
+        private readonly Result _result;
+
+        /// <summary>
+        /// 初始化
+        /// </summary>
+        /// <param name="sqlSugar"></param>
+        /// <param name="mapper"></param>
+        public PaymentRefundAndOtherMoneyRepository(SqlSugarClient sqlSugar, IMapper mapper)
+            : base(sqlSugar)
+        {
+            _mapper = mapper;
+            _result = new Result() { Code = -2 };
+        }
+
+        /// <summary>
+        /// 根据团组ID 查询
+        /// </summary>
+        /// <param name="diId"></param>
+        /// <returns></returns>
+        public async Task<Result> PostItemByDiId(int diId)
+        {
+            
+            
+                string sql = string.Format(@"Select prom.Id,prom.PriceName,prom.Price,sd.Name As CurrencyName,prom.Remark,u.CnName As CreateUserName,prom.CreateTime 
+				                         From Fin_PaymentRefundAndOtherMoney prom
+				                         Left Join Sys_Users u On u.Id = prom.CreateUserId 
+				                         Left Join Sys_SetData sd On prom.CurrencyId = sd.Id
+				                         Where prom.IsDel = 0  And prom.DiId={0}", diId);
+
+                var groupReceivablesList = await _sqlSugar.SqlQueryable<Fin_PaymentRefundAndOtherMoneyItemView>(sql).ToListAsync();
+
+                _result.Data = groupReceivablesList;
+                _result.Code = 0;
+                _result.Msg = "查询成功!";
+           
+            
+
+           
+
+            return _result;
+
+        }
+
+        /// <summary>
+        /// 删除
+        /// </summary>
+        /// <param name="diId"></param>
+        /// <returns></returns>
+        public async Task<Result> _Del(PaymentRefundAndOtherMoneyDelDto dto)
+        {
+            Fin_PaymentRefundAndOtherMoney _PaymentRefundAndOtherMoney = new Fin_PaymentRefundAndOtherMoney() { 
+                Id = dto.Id,
+                DeleteUserId = dto.UserId,
+                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+                IsDel = 1
+            };
+
+            var del = await _sqlSugar.Updateable( _PaymentRefundAndOtherMoney )
+                                     .UpdateColumns(it => new { it.DeleteUserId,it.DeleteTime,it.IsDel })
+                                     .WhereColumns(it => new { it.Id})
+                                     .ExecuteCommandAsync();
+            if (del > 0 )
+            {
+                _result.Code = 0;
+                _result.Msg = "操作成功!";
+            }
+            else
+            {
+                _result.Msg = "操作失败!";
+
+            }
+            return _result;
+        }
+    }
+}