Переглянути джерело

新增商邀费用、资料表,及查询方法

wangh 1 рік тому
батько
коміт
e8c34c6819

+ 3 - 1
OASystem/EntitySync/Program.cs

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

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

@@ -34,11 +34,13 @@ namespace OASystem.API.Controllers
         private readonly TaskAssignmentRepository _taskAssignmentRep;
         private readonly AirTicketResRepository _airTicketResRep;
         private readonly DecreasePaymentsRepository _decreasePaymentsRep;
+        private readonly InvitationOfficialActivitiesRepository _InvitationOfficialActivitiesRep;
         private readonly SqlSugarClient _sqlSugar;
         private string url;
         private string path;
         public GroupsController(IMapper mapper, SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository,
-            TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep)
+            TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep,
+            InvitationOfficialActivitiesRepository InvitationOfficialActivitiesRep)
         {
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
@@ -53,6 +55,7 @@ namespace OASystem.API.Controllers
                 System.IO.Directory.CreateDirectory(path);//不存在就创建文件夹
             }
             _decreasePaymentsRep = decreasePaymentsRep;
+            _InvitationOfficialActivitiesRep = InvitationOfficialActivitiesRep;
         }
 
         #region 流程管控
@@ -1703,5 +1706,59 @@ 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> InvitationOfficialActivitiesList(InvitationOfficialActivitiesListDto dto)
+        {
+            try
+            {
+                Result groupData = await _InvitationOfficialActivitiesRep.InvitationOfficialActivitiesList(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查询C表和商邀费用数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> InvitationOfficialActivitiesById(InvitationOfficialActivitiesByIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _InvitationOfficialActivitiesRep.InvitationOfficialActivitiesById(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
+
     }
 }

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

@@ -12,6 +12,7 @@ namespace OASystem.Domain.Dtos.Groups
     public class DecreasePaymentsDto
     {
         public int UserId { get; set; }
+        public int CTId { get; set; }
     }
     public class DecreasePaymentsListDto
     {

+ 26 - 0
OASystem/OASystem.Domain/Dtos/Groups/InvitationOfficialActivitiesListDto.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    /// <summary>
+    /// 根据团组id查询费用
+    /// </summary>
+    public class InvitationOfficialActivitiesListDto
+    {
+        public int DiId { get; set; }
+        public string Inviter { get; set; }
+        public string StartInviteTime { get; set; }
+        public string EndInviteTime { get; set; }
+    }
+    /// <summary>
+    /// 根据id查询C表数据和商邀费用数据
+    /// </summary>
+    public class InvitationOfficialActivitiesByIdDto
+    {
+        public int Id { get; set; }
+    }
+}

+ 68 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_InvitationOfficialActivities.cs

@@ -0,0 +1,68 @@
+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_InvitationOfficialActivities")]
+    public class Grp_InvitationOfficialActivities:EntityBase
+    {
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 邀请方地区
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
+        public string InviterArea { get; set; }
+
+        /// <summary>
+        /// 邀请方
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
+        public string Inviter { get; set; }
+
+        /// <summary>
+        /// 邀请时间
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
+        public DateTime InviteTime { get; set; }
+
+        /// <summary>
+        /// 附件
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
+        public string Attachment { get; set; }
+
+        /// <summary>
+        /// 邀请费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal InviteCosts { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 快递费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SendCost { get; set; }
+
+        /// <summary>
+        /// 公务标识
+        /// </summary>
+        public int IsGoOfficaiaBussiness { get; set; }
+    }
+}

+ 112 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_InvitationOfficialActivityData.cs

@@ -0,0 +1,112 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Metrics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Resource
+{
+    /// <summary>
+    /// 商邀资料
+    /// </summary>
+    [SugarTable("Res_InvitationOfficialActivityData")]
+    public class Res_InvitationOfficialActivityData:EntityBase
+    {
+        /// <summary>
+        /// 邀请方国家
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="varchar(150)")]
+        public string Country { get; set; }
+        /// <summary>
+        /// 城市
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(150)")]
+        public string City { get; set; }
+        /// <summary>
+        /// 邀请方名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string UnitName { get; set; }
+        /// <summary>
+        ///邀请方官网
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string UnitWeb { get; set; }
+        /// <summary>
+        /// 涉及领域
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(150)")]
+        public string Field { get; set; }
+        /// <summary>
+        /// 邀请方地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
+        public string Address { get; set; }
+        /// <summary>
+        /// 邀请方信息
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string UnitInfo { get; set; }
+        /// <summary>
+        /// 联系人
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Contact { get; set; }
+        /// <summary>
+        /// 职务
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Job { get; set; }
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Tel { get; set; }
+        /// <summary>
+        /// 电子邮箱
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Email { get; set; }
+        /// <summary>
+        /// 微信
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string WeChat { get; set; }
+        /// <summary>
+        /// fb
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string FaceBook { get; set; }
+        /// <summary>
+        /// ins
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Ins { get; set; }
+        /// <summary>
+        /// 团名
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Delegation { get; set; }
+        /// <summary>
+        /// 文件地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string FilePath { get; set; }
+        /// <summary>
+        /// 修改版文件地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string SndFilePath { get; set; }
+        /// <summary>
+        /// 其他信息
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string OtherInformation { get; set; }
+        /// <summary>
+        /// 传真号码
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Fax { get; set; }
+    }
+}

+ 52 - 0
OASystem/OASystem.Domain/ViewModels/Groups/InvitationOfficialActivitiesView.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    public class InvitationOfficialActivitiesView
+    {
+        /// <summary>
+        /// 主键Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+        /// <summary>
+        /// 邀请方地区
+        /// </summary>
+        public string InviterArea { get; set; }
+        /// <summary>
+        /// 邀请方
+        /// </summary>
+        public string Inviter { get; set; }
+        /// <summary>
+        /// 邀请时间
+        /// </summary>
+        public DateTime InviteTime { get; set; }
+        /// <summary>
+        /// 费用
+        /// </summary>
+        public decimal InviteCosts { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        public string Currency { get; set; }
+        /// <summary>
+        /// 是否到场
+        /// </summary>
+        public int IsGoOfficaiaBussiness { get; set; }
+        /// <summary>
+        /// 文件地址
+        /// </summary>
+        public string Attachment { get; set; }
+        /// <summary>
+        /// 是否审核
+        /// </summary>
+        public int isAudit { get; set; }
+    }
+}

+ 4 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -368,7 +368,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 grp_CreditCard.IsAuditGM = 3;//3 为自动审核
                                 grp_CreditCard.AuditGMOperate = 0;
                                 grp_CreditCard.AuditGMDate = DateTime.Now;
-                                grp_CreditCard.IsPay = 1;
+                                grp_CreditCard.IsPay = 0;
                             }
                             else
                             {
@@ -378,7 +378,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 grp_CreditCard.IsAuditGM = 0;//3 为自动审核
                                 grp_CreditCard.AuditGMOperate = 21;
                                 grp_CreditCard.AuditGMDate = new DateTime();
-                                grp_CreditCard.IsPay = 1;
+                                grp_CreditCard.IsPay = 0;
                             }
 
                         }
@@ -390,7 +390,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 grp_CreditCard.IsAuditGM = 3;//3 为自动审核
                                 grp_CreditCard.AuditGMOperate = 21;
                                 grp_CreditCard.AuditGMDate = DateTime.Now;
-                                grp_CreditCard.IsPay = 1;
+                                grp_CreditCard.IsPay = 0;
                             }
                             else
                             {
@@ -400,7 +400,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 grp_CreditCard.IsAuditGM = 0;//3 为自动审核
                                 grp_CreditCard.AuditGMOperate = 21;
                                 grp_CreditCard.AuditGMDate = new DateTime();
-                                grp_CreditCard.IsPay = 1;
+                                grp_CreditCard.IsPay = 0;
                             }
                         }
 

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -59,7 +59,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 #region 团组下拉框
 
 
-                List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 98).ToList();
+                List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == a.CTId).ToList();
 
                 string DiId = "";
                 foreach (var item in grp_GroupsTaskAssignment)

+ 86 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/InvitationOfficialActivitiesRepository.cs

@@ -0,0 +1,86 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.ViewModels.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Groups
+{
+    public class InvitationOfficialActivitiesRepository : BaseRepository<Grp_InvitationOfficialActivities, InvitationOfficialActivitiesListDto>
+    {
+        private readonly IMapper _mapper;
+        public InvitationOfficialActivitiesRepository(SqlSugarClient sqlSugar, IMapper mapper) :
+            base(sqlSugar)
+        {
+            this._mapper = mapper;
+        }
+
+        public async Task<Result> InvitationOfficialActivitiesById(InvitationOfficialActivitiesByIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "程序错误" };
+            try
+            {
+                Grp_InvitationOfficialActivities grp_Invitation = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>().First(a => a.Id == dto.Id && a.IsDel == 0);
+                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0);
+                var data = new
+                {
+                    _Invitation = grp_Invitation,
+                    _CreditCard = grp_CreditCard,
+                };
+                result = new Result() { Code = 0, Msg = "查询成功!", Data = data };
+            }
+            catch (Exception)
+            {
+                result = new Result() { Code = -2, Msg = "程序错误" };
+                throw;
+            }
+            return result;
+        }
+
+        public async Task<Result> InvitationOfficialActivitiesList(InvitationOfficialActivitiesListDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string sqlWhere = string.Empty;
+                if (!string.IsNullOrWhiteSpace(dto.Inviter))
+                {
+                    sqlWhere += string.Format(@" And Inviter={0}", dto.Inviter);
+                }
+                if (!string.IsNullOrWhiteSpace(dto.StartInviteTime) && !string.IsNullOrWhiteSpace(dto.EndInviteTime))
+                {
+                    sqlWhere += string.Format(@" And i.InviteTime between '{0}' and '{1}'", dto.StartInviteTime,dto.EndInviteTime);
+                }
+                sqlWhere += string.Format(@" And i.DiId={0} And i.IsDel={1}",dto.DiId,0);
+
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                {
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                string sql = string.Format(@"select Id,DiId,InviterArea,Inviter,InviteTime,InviteCosts,(select name from Sys_SetData where id=i.Currency and IsDel={0}) 
+                                             as Currency,IsGoOfficaiaBussiness,(select IsAuditGM from Grp_CreditCardPayment where CTable=81 and CId=i.Id 
+                                             and IsDel={0}) as 'isAudit',Attachment from Grp_InvitationOfficialActivities i  {1}", 0, sqlWhere);
+                List<InvitationOfficialActivitiesView> _DecreasePayments = await _sqlSugar.SqlQueryable<InvitationOfficialActivitiesView>(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;
+        }
+    }
+}

+ 186 - 3
OASystem/_Doc/OA2023数据字典.docx

@@ -3132,7 +3132,7 @@ PriceName
 varchar(225)
 Null
 
- 费用名称
+费用名称
 
 Price
 decimal(10,2)
@@ -3153,6 +3153,68 @@ Null
 附件地址
 
 
+17) 商邀费用录入表:Grp_InvitationOfficialActivities
+                                   字段名
+                                 类型长度
+                                 字段属性
+                                 字段约束
+                                 字段描述
+                                    备注
+DiId
+Int
+Null
+
+团组外键编号
+Grp_DelegationInfo.id
+InviterArea
+varchar(225)
+Null
+
+邀请方地区
+
+Inviter
+varchar(225)
+Null
+
+邀请方
+
+InviteTime
+DateTime
+Null
+
+邀请时间
+
+Attachment
+varchar(225)
+Null
+
+附件
+
+InviteCosts
+decimal(10,2)
+Null
+
+邀请费用
+
+Currency
+int
+Null
+
+币种
+
+SendCost
+decimal(10,2)
+Null
+
+快递费用
+
+IsGoOfficaiaBussiness
+int
+Null
+
+公务标识
+
+
 1. 资源板块
 1) 酒店数据表:Res_HotelData(挪用)
                                    字段名
@@ -3403,9 +3465,130 @@ Null
 
 签证地址
 
-1. 机票板块
 
-2. 财务板块
+6) 商邀资料:Res_InvitationOfficialActivityData
+                                   字段名
+                                 类型长度
+                                 字段属性
+                                 字段约束
+                                 字段描述
+                                    备注
+Country
+varchar(150)
+Null
+
+邀请方国家
+
+City
+varchar(150)
+Null
+
+城市
+
+UnitName
+varchar(MAX)
+Null
+
+邀请方名称
+
+UnitWeb
+varchar(120)
+Null
+
+邀请方官网
+
+Field
+varchar(150)
+Null
+
+涉及领域
+
+Address
+varchar(225)
+Null
+
+邀请方地址
+
+UnitInfo
+varchar(MAX)
+Null
+
+邀请方信息
+
+Contact
+varchar(120)
+Null
+
+联系人
+
+Job
+varchar(120)
+Null
+
+职务
+
+Tel
+varchar(120)
+Null
+
+联系电话
+
+Email
+varchar(120)
+Null
+
+电子邮箱 
+
+WeChat
+varchar(120)
+Null
+
+微信
+
+FaceBook
+varchar(120)
+Null
+
+fb
+
+Ins
+varchar(120)
+Null
+
+ins
+
+Delegation
+varchar(120)
+Null
+
+团名
+
+FilePath
+varchar(120)
+Null
+
+文件地址
+
+SndFilePath
+varchar(120)
+Null
+
+修改版文件地址
+
+OtherInformation
+varchar(MAX)
+Null
+
+其他信息
+
+Fax
+varchar(120)
+Null
+
+传真号码
+
+
+1. 财务板块
 1) 团组成本表:Grp_GroupCostParameter(挪用)
                                    字段名
                                  类型长度