Browse Source

新增团组增减款项表,view,查询方法及dto

wangh 1 year ago
parent
commit
7526afd87b

+ 2 - 1
OASystem/EntitySync/Program.cs

@@ -95,6 +95,7 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Grp_GroupsTaskAssignment)
     //typeof(Grp_GroupsTaskAssignment)
     //typeof(Grp_AirTicketReservations)
     //typeof(Grp_AirTicketReservations)
     //typeof(Grp_GroupCostParameter)
     //typeof(Grp_GroupCostParameter)
-    typeof(Grp_TeamRate)
+    //typeof(Grp_TeamRate)
+    typeof(Grp_DecreasePayments)
 });
 });
 Console.WriteLine("数据库结构同步完成!");
 Console.WriteLine("数据库结构同步完成!");

+ 62 - 3
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -32,10 +32,12 @@ namespace OASystem.API.Controllers
         private readonly DelegationInfoRepository _groupRepository;
         private readonly DelegationInfoRepository _groupRepository;
         private readonly TaskAssignmentRepository _taskAssignmentRep;
         private readonly TaskAssignmentRepository _taskAssignmentRep;
         private readonly AirTicketResRepository _airTicketResRep;
         private readonly AirTicketResRepository _airTicketResRep;
+        private readonly DecreasePaymentsRepository _decreasePaymentsRep;
         private readonly SqlSugarClient _sqlSugar;
         private readonly SqlSugarClient _sqlSugar;
         private string url;
         private string url;
         private string path;
         private string path;
-        public GroupsController(IMapper mapper,SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository, TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep)
+        public GroupsController(IMapper mapper,SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository,
+            TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep)
         {
         {
             _mapper = mapper;
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
             _grpScheduleRep = grpScheduleRep;
@@ -49,6 +51,7 @@ namespace OASystem.API.Controllers
             {
             {
                 System.IO.Directory.CreateDirectory(path);//不存在就创建文件夹
                 System.IO.Directory.CreateDirectory(path);//不存在就创建文件夹
             }
             }
+            _decreasePaymentsRep = decreasePaymentsRep;
         }
         }
 
 
         #region 流程管控
         #region 流程管控
@@ -1056,7 +1059,9 @@ namespace OASystem.API.Controllers
                                     Paragraph p = new Paragraph(doc);
                                     Paragraph p = new Paragraph(doc);
                                     string s = value;
                                     string s = value;
                                     p.AppendChild(new Run(doc, s));
                                     p.AppendChild(new Run(doc, s));
+                                    p.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
                                     ishcel0.AppendChild(p);
                                     ishcel0.AppendChild(p);
+                                    ishcel0.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;//垂直居中对齐
                                     index++;
                                     index++;
                                 }
                                 }
                                 row++;
                                 row++;
@@ -1113,12 +1118,12 @@ namespace OASystem.API.Controllers
                             {
                             {
                                 if (!name.Contains(clientName))
                                 if (!name.Contains(clientName))
                                 {
                                 {
-                                    name = name + "," + clientName;
+                                    name+=clientName+",";
                                 }
                                 }
                             }
                             }
                             if (!string.IsNullOrWhiteSpace(name))
                             if (!string.IsNullOrWhiteSpace(name))
                             {
                             {
-                                table.Range.Bookmarks["ClientName"].Text = name;
+                                table.Range.Bookmarks["ClientName"].Text = name.Substring(0,name.Length-1);
                             }
                             }
                             else
                             else
                             {
                             {
@@ -1376,7 +1381,10 @@ namespace OASystem.API.Controllers
                                     Paragraph p = new Paragraph(doc);
                                     Paragraph p = new Paragraph(doc);
                                     string s = value;
                                     string s = value;
                                     p.AppendChild(new Run(doc, s));
                                     p.AppendChild(new Run(doc, s));
+                                    p.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
                                     ishcel0.AppendChild(p);
                                     ishcel0.AppendChild(p);
+                                    ishcel0.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;//垂直居中对齐
+                                    //ishcel0.CellFormat.VerticalAlignment=
                                     index++;
                                     index++;
                                 }
                                 }
                                 row++;
                                 row++;
@@ -1487,5 +1495,56 @@ namespace OASystem.API.Controllers
             }
             }
         }
         }
         #endregion
         #endregion
+
+        #region 团组增减款项
+        /// <summary>
+        /// 团组增减款项下拉框绑定
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DecreasePaymentsSelect(DecreasePaymentsDto dto)
+        {
+            try
+            {
+                Result groupData = await _decreasePaymentsRep.DecreasePaymentsSelect(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 根据团组Id查询团组增减款项
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DecreasePaymentsList(DecreasePaymentsListDto dto)
+        {
+            try
+            {
+                Result groupData = await _decreasePaymentsRep.DecreasePaymentsList(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        #endregion
     }
     }
 }
 }

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

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    /// <summary>
+    /// 团组增减款项Dto
+    /// </summary>
+    public class DecreasePaymentsDto
+    {
+        public int UserId { get; set; }
+    }
+    public class DecreasePaymentsListDto
+    {
+        public int DiId { get; set; }
+    }
+}

+ 42 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DecreasePayments.cs

@@ -0,0 +1,42 @@
+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_DecreasePayments")]
+    public class Grp_DecreasePayments: EntityBase
+    {
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int DiId { get; set; }
+        /// <summary>
+        /// 费用名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
+        public string PriceName { get; set; }
+        /// <summary>
+        /// 费用金额
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Price { get; set; }
+
+        /// <summary>
+        /// 费用币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+        /// <summary>
+        /// 附件地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string FilePath { get; set; }
+    }
+}

+ 40 - 0
OASystem/OASystem.Domain/ViewModels/Groups/DecreasePaymentsView.cs

@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    /// <summary>
+    /// 团组增减款项返回视图
+    /// </summary>
+    public class DecreasePaymentsView
+    {
+        public int Id { get; set; }
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        public int DiId { get; set; }
+        /// <summary>
+        /// 费用名称
+        /// </summary>
+        public string PriceName { get; set; }
+        /// <summary>
+        /// 费用金额
+        /// </summary>
+        public decimal Price { get; set; }
+
+        /// <summary>
+        /// 费用币种
+        /// </summary>
+        public string Currency { get; set; }
+        /// <summary>
+        /// 附件地址
+        /// </summary>
+        public string FilePath { get; set; }
+        public string CreateUserName { get; set; }
+        public DateTime CreateTime { get; set; }
+        public int isAudit { get; set; }
+    }
+}

+ 97 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -0,0 +1,97 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.ViewModels.Groups;
+using OASystem.Infrastructure.Repositories.System;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Groups
+{
+    public class DecreasePaymentsRepository : BaseRepository<Grp_DecreasePayments, Grp_DecreasePayments>
+    {
+        private readonly IMapper _mapper;
+        public DecreasePaymentsRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            this._mapper = mapper;
+        }
+        /// <summary>
+        /// 根据团组Id查询数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> DecreasePaymentsList(DecreasePaymentsListDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                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) as 'isAudit' from Grp_DecreasePayments s where DIID={0} and IsDel=0 ", dto.DiId);
+                List<DecreasePaymentsView> _DecreasePayments = await _sqlSugar.SqlQueryable<DecreasePaymentsView>(sql).ToListAsync();
+                if (_DecreasePayments.Count != 0)
+                {
+                    result = new Result() { Code = 0, Msg = "查询成功!",Data=_DecreasePayments };
+                }
+                else
+                {
+                    result = new Result() { Code = 0, Msg = "暂无数据!", Data = _DecreasePayments };
+                }
+            }
+            catch (Exception ex)
+            {
+                result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
+        }
+
+        public async Task<Result> DecreasePaymentsSelect(DecreasePaymentsDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                #region 团组下拉框
+
+
+                List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 98).ToList();
+
+                string DiId = "";
+                foreach (var item in grp_GroupsTaskAssignment)
+                {
+                    DiId += item.DIId + ",";
+                }
+                DiId = DiId.Substring(0, DiId.Length - 1);
+                string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1}", DiId, 0);
+                List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
+                if (grp_Delegations.Count == 0)
+                {
+                    return result = new Result() { Code = -1, Msg = "查询失败!" };
+                }
+                #endregion
+
+                #region 其他下拉框查询
+               
+                //支付方式
+                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);
+                #endregion
+                var data = new
+                {
+                    Payment = _Payment,
+                    GroupName = grp_Delegations,
+                };
+                return result = new Result() { Code = 0, Msg = "查询成功!", Data = data };
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误" };
+                throw;
+            }
+        }
+    }
+}

+ 3 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/AirTicketResRepository.cs

@@ -912,6 +912,9 @@ namespace OASystem.Infrastructure.Repositories.Resource
             }
             }
 
 
         }
         }
+
+       
+
         public class TranslateResult
         public class TranslateResult
         {
         {
             public string Query { get; set; }
             public string Query { get; set; }

+ 40 - 2
OASystem/_Doc/OA2023数据字典.docx

@@ -3115,6 +3115,44 @@ Null
 启用标识
 启用标识
 0否1是
 0否1是
 
 
+16) 团组增减款项表:Grp_DecreasePayments
+                                   字段名
+                                 类型长度
+                                 字段属性
+                                 字段约束
+                                 字段描述
+                                    备注
+DiId
+Int
+Null
+
+团组外键编号
+Grp_DelegationInfo.id
+PriceName
+varchar(225)
+Null
+
+ 费用名称
+
+Price
+decimal(10,2)
+Null
+
+费用金额
+
+Currency
+int
+Null
+
+费用币种
+
+FilePath
+varchar(MAX)
+Null
+
+附件地址
+
+
 1. 资源板块
 1. 资源板块
 1) 酒店数据表:Res_HotelData(挪用)
 1) 酒店数据表:Res_HotelData(挪用)
                                    字段名
                                    字段名
@@ -3665,5 +3703,5 @@ Null
                             0:未完成 1:完成
                             0:未完成 1:完成
 
 
 
 
-
-
+ 
+