Browse Source

新增时添加界面下拉框初始化

wangh 1 year ago
parent
commit
5df492d3c5

+ 42 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2864,6 +2864,7 @@ namespace OASystem.API.Controllers
         #endregion
 
         #region 签证费用录入
+
         /// <summary>
         /// 根据diid查询签证费用列表
         /// </summary>
@@ -2940,6 +2941,47 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
+        /// <summary>
+        /// 签证费用录入下拉框初始化
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> VisaPriceAddSelect()
+        {
+            try
+            {
+                //支付方式
+                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);
+
+                //币种
+                List<Sys_SetData> CurrencyList = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 66 && a.IsDel == 0).ToList();
+                List<SetDataInfoView> _CurrencyList = _mapper.Map<List<SetDataInfoView>>(CurrencyList);
+
+                //支付方式
+                List<Sys_SetData> PassengerType = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 69 && a.IsDel == 0).ToList();
+                List<SetDataInfoView> _PassengerType = _mapper.Map<List<SetDataInfoView>>(PassengerType);
+
+                //卡类型
+                List<Sys_SetData> BankCard = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 15 && a.IsDel == 0).ToList();
+                List<SetDataInfoView> _BankCard = _mapper.Map<List<SetDataInfoView>>(BankCard);
+
+                var data = new
+                {
+                    Payment = _Payment,
+                    CurrencyList = _CurrencyList,
+                    PassengerType = _PassengerType,
+                    BankCard = _BankCard
+                };
+                return Ok(JsonView(true, "查询成功!",data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
 
         /// <summary>
         /// 签证费用录入操作(Status:1.新增,2.修改)

+ 5 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -123,6 +123,11 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<OpVisaPriceDto, Grp_CreditCardPayment>();
             #endregion
 
+
+            #region op费用
+            CreateMap<OpCarTouristGuideGroundDto, Grp_CarTouristGuideGroundReservations>();
+            #endregion
+
             #endregion
             #region Resource
 

+ 6 - 12
OASystem/OASystem.Domain/Dtos/Groups/CarTouristGuideGroundDto.cs

@@ -28,6 +28,12 @@ namespace OASystem.Domain.Dtos.Groups
     /// </summary>
     public class OpCarTouristGuideGroundDto
     {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
         /// <summary>
         /// 编号
         /// </summary>
@@ -36,41 +42,33 @@ namespace OASystem.Domain.Dtos.Groups
         /// 团组外键编号
         /// </summary>
         public int DiId { get; set; }
-
         /// <summary>
         /// 地接地区
         /// </summary>
         public string Area { get; set; }
-
         /// <summary>
         /// 服务公司
         /// </summary>
         public string ServiceCompany { get; set; }
-
         /// <summary>
         /// 服务导游
         /// </summary>
         public string ServiceGuide { get; set; }
-
         /// <summary>
         /// 导游地接联系电话
         /// </summary>
         public string ServiceTel { get; set; }
-
         /// <summary>
         /// Bus名称
         /// </summary>
         public string BusName { get; set; }
-
         /// <summary>
         /// Bus描述
         /// </summary>
         public string BusDescription { get; set; }
-
         /// <summary>
         /// 车公司联系电话
         /// </summary>
-        /// 
         public string BusTel { get; set; }
 
         /// <summary>
@@ -101,9 +99,5 @@ namespace OASystem.Domain.Dtos.Groups
         /// 备注
         /// </summary>
         public string Remark { get; set; }
-        /// <summary>
-        /// 是否删除
-        /// </summary>
-        public int IsDel { get; set; } = 0;
     }
 }

+ 94 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -1,8 +1,10 @@
 using AutoMapper;
 using OASystem.Domain;
 using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
+using OASystem.Infrastructure.Tools;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -21,9 +23,99 @@ namespace OASystem.Infrastructure.Repositories.Groups
             _mapper = mapper;
         }
 
-        public Task<Result> OpCarTouristGuideGround(OpCarTouristGuideGroundDto dto)
+        public async Task<Result> OpCarTouristGuideGround(OpCarTouristGuideGroundDto dto)
         {
-            throw new NotImplementedException();
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            BeginTran();
+            try
+            {
+                //int id = 0;
+                //Grp_CarTouristGuideGroundReservations grp_CarTouristGuide = _mapper.Map<Grp_CarTouristGuideGroundReservations>(dto);
+                //if (dto.Status == 1)//添加
+                //{
+                //    Grp_CarTouristGuideGroundReservations grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(a => a.IsDel == 0 && a.Area == dto.Area && a.BusName == dto.BusName && a.ServiceGuide == dto.ServiceGuide);
+                //    if (grp_CarTouristGuideGround != null)
+                //    {
+                //        return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };
+                //    }
+                //    else
+                //    {
+                //        id = await AddAsyncReturnId(grp_CarTouristGuide);
+                //        if (id != 0)
+                //        {
+                //            //int cId = await _sqlSugar.Insertable(c).ExecuteReturnIdentityAsync();
+                //            if (true)
+                //            {
+                //                result = new Result() { Code = 0, Msg = "添加成功!" };
+
+                //            }
+                //            else
+                //            {
+                //                RollbackTran();
+                //                result = new Result() { Code = -1, Msg = "添加失败!" };
+                //            }
+                //        }
+                //        else
+                //        {
+                //            RollbackTran();
+                //            result = new Result() { Code = -1, Msg = "添加失败,请稍后重试!" };
+                //        }
+                //    }
+
+                //}
+                //else if (dto.Status == 2)//修改
+                //{
+
+                //    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_VisaInfo
+                //    {
+                //        VisaClient = grp_Visa1.VisaClient,
+                //        VisaPrice = grp_Visa1.VisaPrice,
+                //        VisaCurrency = grp_Visa1.VisaCurrency,
+                //        IsThird = grp_Visa1.IsThird,
+                //        PassengerType = grp_Visa1.PassengerType,
+                //        VisaNumber = grp_Visa1.VisaNumber,
+                //        VisaFreeNumber = grp_Visa1.VisaFreeNumber,
+                //        Remark = dto.Remark,
+                //    });
+                //    if (res)
+                //    {
+                //        int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == grp_Visa1.Id && a.CTable == 80).SetColumns(a => new Grp_CreditCardPayment
+                //        {
+                //            PayDId = dto.PayDId,
+                //            PayMoney = c.PayMoney,
+                //            PaymentCurrency = c.PaymentCurrency,
+                //            Payee = c.Payee,
+                //            OrbitalPrivateTransfer = c.OrbitalPrivateTransfer,
+                //            DayRate = c.DayRate,
+                //            RMBPrice = c.RMBPrice,
+                //            ConsumptionPatterns = c.ConsumptionPatterns,
+                //            ConsumptionDate = c.ConsumptionDate,
+                //            CTDId = c.CTDId,
+                //            CompanyBankNo = c.CompanyBankNo,
+                //            OtherBankName = c.OtherBankName,
+                //            OtherSideNo = c.OtherSideNo,
+                //            OtherSideName = c.OtherSideName,
+                //            BankNo = c.BankNo,
+                //            CardholderName = c.CardholderName,
+                //            Remark = c.Remark,
+
+                //        }).ExecuteCommandAsync();
+
+                //        result = new Result() { Code = 0, Msg = "修改成功!" };
+                //    }
+                //    else
+                //    {
+                //        RollbackTran();
+                //        result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
+                //    }
+                //}
+                //CommitTran();
+            }
+            catch (Exception ex)
+            {
+                result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
         }
 
         public async Task<Result> QueryCarTouristGuideGroundByDiId(CarTouristGuideGroundDto dto)