瀏覽代碼

移动端逻辑API接口编写(基础数据接口(基础数据源、团组基础数据Data、币种基础数据Data、实时汇率Tips、、签证费用Tips、机票费用 Tips、出入境国家费用标准)、查询接口、操作接口(汇率、复选框、境内费用、国际旅费、住宿、伙食、公杂、培训、其他费用));

LEIYI 8 月之前
父節點
當前提交
5192ed2fdb

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

@@ -7,6 +7,7 @@ using EyeSoft.Collections.Generic;
 using EyeSoft.IO;
 using Microsoft.AspNetCore.SignalR;
 using MySqlX.XDevAPI.Relational;
+using NetUV.Core.Handles;
 using NPOI.HSSF.UserModel;
 using NPOI.POIFS.Crypt.Dsig;
 using NPOI.SS.Format;
@@ -7335,7 +7336,7 @@ FROM
         }
 
         /// <summary>
-        /// 团组模块 - 出入境国家费用标准 List
+        /// 团组模块 - 出入境国家费用标准-移动端  List
         /// </summary>
         /// <returns></returns>
         [HttpPost]
@@ -7375,12 +7376,12 @@ FROM
         }
 
         /// <summary>
-        /// 团组模块 - Info
+        /// 团组模块 - 出入境费用-移动端 - Info
         /// </summary>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostNationalTravelFeeMobileInfo(EnterExitCostInfobyDiIdDto dto)
+        public async Task<IActionResult> PostEnterExitCostMobileInfo(EnterExitCostInfobyDiIdDto dto)
         {
             if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
             if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
@@ -7388,9 +7389,292 @@ FROM
             var data = await _enterExitCostRep.GetEnterExitCostInfoByDiId(dto);
 
             return Ok(data);
+        }
+
+        #region op
 
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - OP --> 汇率
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostMobileOpRate(PostEnterExitCostMobileFeeRateOpDto dto)
+        {
+            if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+            if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
+            var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
+            int id = dto.Id;
+            if (id <= 0) //add 
+            {
+                var add = await _sqlSugar.Insertable(new Grp_EnterExitCost() { CurrencyRemark = currencyStr, CreateUserId = dto.CurrUserId }).ExecuteCommandAsync();
+
+                if (add > 0) return Ok(JsonView(true));
+            }
+            else //update
+            {
+                var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
+                if (upd > 0) return Ok(JsonView(true));
+            }
+            
+            return Ok(JsonView(false));
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - OP --> 复选框
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostMobileOpCheckbox(PostEnterExitCostMobileFeeOpCheckboxDto dto)
+        {
+            if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+            var checkboxInfo = _mapper.Map<Grp_EnterExitCost>(dto);
+
+            int id = dto.Id;
+            if (id <= 0) //add 
+            {
+                checkboxInfo.CreateUserId = dto.CurrUserId;
+                var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
+
+                if (add > 0) return Ok(JsonView(true));
+            }
+            else //update
+            {
+                var upd = await _sqlSugar.Updateable(checkboxInfo)
+                    .UpdateColumns(x => new { 
+                        x.ChoiceOne,
+                        x.ChoiceTwo,
+                        x.SumJJC,
+                        x.SumGWC,
+                        x.SumTDC,
+                        x.ChoiceThree,
+                        x.ChoiceFour,
+                        x.ChoiceFive,
+                        x.ChoiceSix,
+                        x.OtherExpenses_Checked
+                    })
+                    .Where(x => x.Id == id)
+                    .ExecuteCommandAsync();
+                if (upd > 0) return Ok(JsonView(true));
+            }
+
+            return Ok(JsonView(false));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - OP --> 境内费用 Step1
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostMobileOpStep1(PostEnterExitCostMobileOpStep1Dto dto)
+        {
+            if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+            var info = _mapper.Map<Grp_EnterExitCost>(dto);
+            info.InsidePay = dto.Visa + dto.Service + dto.Safe + dto.Ticket + dto.HeSuan + dto.YiMiao;
+
+            int id = dto.Id;
+            if (id <= 0) //add 
+            {
+                info.CreateUserId = dto.CurrUserId;
+                var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
+
+                if (add > 0) return Ok(JsonView(true));
+            }
+            else //update
+            {
+                var upd = await _sqlSugar.Updateable(info)
+                    .UpdateColumns(x => new {
+                        x.InsidePay,
+                        x.VisaRemark,
+                        x.Visa,
+                        x.Service,
+                        x.Safe,
+                        x.Ticket,
+                        x.HeSuan,
+                        x.YiMiao,
+                    })
+                    .Where(x => x.Id == id)
+                    .ExecuteCommandAsync();
+                if (upd > 0) return Ok(JsonView(true));
+            }
+
+            return Ok(JsonView(false));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - OP --> 国际旅费 Step2
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostMobileOpStep2(PostEnterExitCostMobileOpStep2Dto dto)
+        {
+            if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+            var info = _mapper.Map<Grp_EnterExitCost>(dto);
+
+            int id = dto.Id;
+            if (id <= 0) //add 
+            {
+                info.CreateUserId = dto.CurrUserId;
+                var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
+
+                if (add > 0) return Ok(JsonView(true));
+            }
+            else //update
+            {
+                var upd = await _sqlSugar.Updateable(info)
+                    .UpdateColumns(x => new {
+                        x.OutsideJJPay,
+                        x.OutsideGWPay,
+                        x.OutsideTDPay,
+                        x.AirJJ,
+                        x.AirGW,
+                        x.AirTD,
+                        x.CityTranffic
+                    })
+                    .Where(x => x.Id == id)
+                    .ExecuteCommandAsync();
+                if (upd > 0) return Ok(JsonView(true));
+            }
+
+            return Ok(JsonView(false));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - OP --> (住宿、伙食、公杂、培训) Step3-Step6
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostMobileOpStep3To6(PostEnterExitCostMobileOpStep3To6Dto dto)
+        {
+            if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+            if (dto.Infos.Length < 1) return Ok(JsonView(false, "请传入有效的费用信息!"));
+            var feeTypeIds = new List<int>() {1,2,3,4, };
+            if (!feeTypeIds.Contains(dto.FeeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
+
+            var infos1 = _mapper.Map<List<Grp_DayAndCost>>(dto.Infos);
+            var infos = infos1.Select(x => new Grp_DayAndCost
+                {
+                    Id = x.Id,
+                    DiId = dto.DiId,
+                    Type = dto.FeeType,
+                    Days = x.Days,
+                    NationalTravelFeeId = x.NationalTravelFeeId,
+                    Cost = x.Cost,
+                    Currency = x.Currency,
+                    SubTotal = x.SubTotal,
+                    CreateUserId = dto.CurrUserId
+                })
+                .ToList();
+
+            var adds = infos.Where(x => x.Id <= 0).ToList();
+            var upds = infos.Where(x => x.Id > 0).ToList();
+            var status = false;
+            if (adds.Count > 0)
+            {
+                var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
+                if (add > 0) status = true;
+            }
+            if (upds.Count > 0)
+            {
+                var upd = await _sqlSugar.Updateable(adds)
+                    .UpdateColumns(x => new
+                    {
+                        x.Days,
+                        x.NationalTravelFeeId,
+                        x.Cost,
+                        x.Currency,
+                        x.SubTotal
+                    })
+                    .WhereColumns(x => new { x.Id })
+                    .ExecuteCommandAsync();
+                if (upd > 0) status = true;
+            }
+
+            if (status)
+            {
+                return Ok(JsonView(true));
+            }
+
+            return Ok(JsonView(false));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - OP --> 其他费用 Step7
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostMobileOpStep7(PostEnterExitCostMobileOpStep7Dto dto)
+        {
+            if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+            var infos1 = _mapper.Map<List<Grp_DayOtherPrice>>(dto.Infos);
+            var infos = infos1.Select(x => new Grp_DayOtherPrice()
+            {
+                Id = x.Id,
+                Diid = dto.DiId,
+                SetDataId = x.SetDataId,
+                Index = x.Index,
+                Cost = x.Cost,
+                Currency = x.Currency,
+                SubTotal = x.SubTotal,
+                CreateUserId = dto.CurrUserId,
+                Remark = x.Remark
+            }).ToList();
+
+            var adds = infos.Where(x => x.Id <= 0).ToList();
+            var upds = infos.Where(x => x.Id > 0).ToList();
+            var status = false;
+            if (adds.Count > 0)
+            {
+                var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
+                if (add > 0) status = true;
+            }
+            if (upds.Count > 0)
+            {
+                var upd = await _sqlSugar.Updateable(adds)
+                    .UpdateColumns(x => new
+                    {
+                        x.Index,
+                        x.SetDataId,
+                        x.Cost,
+                        x.Currency,
+                        x.SubTotal,
+                        x.Remark
+                    })
+                    .WhereColumns(x => new { x.Id })
+                    .ExecuteCommandAsync();
+                if (upd > 0) status = true;
+            }
+
+            if (status)
+            {
+                return Ok(JsonView(true));
+            }
+            return Ok(JsonView(false));
+        }
+
+        #endregion
+
         #endregion
 
         #region 签证费用录入

+ 6 - 1
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -121,9 +121,14 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<EnterExitCostOperateDto, Grp_EnterExitCost>();
             CreateMap<DayAndCostAddView, Grp_DayAndCost>();
 
-
             CreateMap<Grp_EnterExitCost, EnterExitCostMobileInfoView>();
 
+            CreateMap<PostEnterExitCostMobileFeeOpCheckboxDto, Grp_EnterExitCost>();
+            CreateMap<PostEnterExitCostMobileOpStep1Dto, Grp_EnterExitCost>();
+            CreateMap<PostEnterExitCostMobileOpStep2Dto, Grp_EnterExitCost>();
+            CreateMap<DayAndCostMobileInfoDto, Grp_DayAndCost>();
+            CreateMap<DayOtherPriceMobileInfoDto, Grp_DayOtherPrice>();
+
             #endregion
 
             #region 出入境国家费用标准

+ 233 - 0
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs

@@ -218,6 +218,7 @@ namespace OASystem.Domain.Dtos.Groups
         #endregion
 
         #region 其他费用
+
         /// <summary>
         ///  其他费用选择框
         /// </summary>
@@ -451,5 +452,237 @@ namespace OASystem.Domain.Dtos.Groups
         public int DiId { get; set; }
     }
 
+    #region op
+
+    public class PostEnterExitCostMobileUpdateDtoBase : PortDtoBase {
+
+        public int Id { get; set; }
+
+        public int DiId { get; set; }
+
+        public int CurrUserId { get; set; }
+    }
+
+    public class PostEnterExitCostMobileFeeRateOpDto : PostEnterExitCostMobileUpdateDtoBase
+    {
+        /// <summary>
+        ///  多个币种存储
+        ///  存储方式: 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
+        /// </summary>
+        public CurrencyInfo[] Currencys { get; set; }
+    }
+
+    public class PostEnterExitCostMobileFeeOpCheckboxDto : PostEnterExitCostMobileUpdateDtoBase
+    {
+
+        /// <summary>
+        ///  境内费用(其他费用)选择框
+        /// </summary>
+        public int ChoiceOne { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计选择框
+        /// </summary>
+        public int ChoiceTwo { get; set; }
+
+        /// <summary>
+        ///  经济舱小计选择框
+        /// </summary>
+        public int SumJJC { get; set; }
+
+        /// <summary>
+        ///  公务舱小计选择框
+        /// </summary>
+        public int SumGWC { get; set; }
+
+        /// <summary>
+        ///  公务舱小计选择框
+        /// </summary>
+        public int SumTDC { get; set; }
+
+        /// <summary>
+        ///  住宿费合计选择框
+        /// </summary>
+        public int ChoiceThree { get; set; }
+
+        /// <summary>
+        ///  伙食费合计选择框
+        /// </summary>
+        public int ChoiceFour { get; set; }
+
+        /// <summary>
+        ///  公杂费合计选择框
+        /// </summary>
+        public int ChoiceFive { get; set; }
+
+        /// <summary>
+        ///  培训费用选择框
+        /// </summary>
+        public int ChoiceSix { get; set; }
+
+        /// <summary>
+        ///  其他费用选择框
+        /// </summary>
+        public int OtherExpenses_Checked { get; set; }
+    }
+
+    public class PostEnterExitCostMobileOpStep1Dto : PostEnterExitCostMobileFeeRateOpDto
+    {
+        /// <summary>
+        /// 签证费
+        /// </summary>
+        public decimal Visa { get; set; }
+
+        /// <summary>
+        /// 签证费描述
+        /// </summary>
+        public string? VisaRemark { get; set; }
+
+        /// <summary>
+        /// 疫苗费
+        /// </summary>
+        public decimal YiMiao { get; set; }
+
+        /// <summary>
+        /// 核酸检测费用
+        /// </summary>
+        public decimal HeSuan { get; set; }
+
+        /// <summary>
+        /// 服务费用
+        /// </summary>
+        public decimal Service { get; set; }
+
+        /// <summary>
+        /// 参展门票
+        /// </summary>
+        public decimal Ticket { get; set; }
+
+        /// <summary>
+        /// 保险费
+        /// </summary>
+        public decimal Safe { get; set; }
+    }
+
+    public class PostEnterExitCostMobileOpStep2Dto : PostEnterExitCostMobileUpdateDtoBase
+    {
+        /// <summary>
+        /// 国际旅费合计(经济舱)
+        /// </summary>
+        public decimal OutsideJJPay { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计(公务舱)
+        /// </summary>
+        public decimal OutsideGWPay { get; set; }
+
+        /// <summary>
+        /// 国际旅费合计(头等舱)
+        /// </summary>
+        public decimal OutsideTDPay { get; set; }
+
+        /// <summary>
+        ///  国际机票(经济舱)
+        /// </summary>
+        public decimal AirJJ { get; set; }
+
+        /// <summary>
+        ///  国际机票(公务舱)
+        /// </summary>
+        public decimal AirGW { get; set; }
+
+        /// <summary>
+        ///  国际机票(头等舱)
+        /// </summary>
+        public decimal AirTD { get; set; }
+
+        /// <summary>
+        ///  国外城市间交通费
+        /// </summary>
+        public decimal CityTranffic { get; set; }
+    }
+
+    public class PostEnterExitCostMobileOpStep3To6Dto
+    {
+        public int PortType { get; set; }
+        public int DiId { get; set; }
+
+        public int CurrUserId { get; set; }
+
+        /// <summary>
+        /// 费用类型
+        /// 1 住宿费;2 伙食费;3 公杂费;4 培训费
+        /// </summary>
+        public int FeeType { get; set; }
+
+        /// <summary>
+        /// 详情
+        /// </summary>
+        public DayAndCostMobileInfoDto[] Infos { get; set; }
+    }
+
+    public class DayAndCostMobileInfoDto
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 天数
+        /// </summary>
+        public int Days { get; set; }
+
+        /// <summary>
+        /// 地名Id
+        /// </summary>
+        public int NationalTravelFeeId { get; set; }
+
+        /// <summary>
+        /// 费用标准
+        /// </summary>
+        public decimal Cost { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// Sys_SetData STid = 66
+        /// </summary>
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 小计
+        /// </summary>
+        public decimal SubTotal { get; set; }
+    }
+
+    public class PostEnterExitCostMobileOpStep7Dto 
+    {
+        public int PortType { get; set; }
+        public int DiId { get; set; }
+
+        public int CurrUserId { get; set; }
+
+        /// <summary>
+        /// 详情
+        /// </summary>
+        public DayOtherPriceMobileInfoDto[] Infos { get; set; }
+    }
+
+    public class DayOtherPriceMobileInfoDto
+    {
+        public int Id { get; set; }
+        public int Diid { get; set; }
+
+        public int SetDataId { get; set; }
+
+        public int Index { get; set; }
+
+        public decimal Cost { get; set; }
+
+        public int Currency { get; set; }
+
+        public decimal SubTotal { get; set; }
+
+        public string Remark { get; set; }
+    }
+    #endregion
+
     #endregion
 }

+ 0 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -64,7 +64,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
-
         /// <summary>
         /// 查询 根据 Diid 查询
         /// </summary>