|
@@ -1,7 +1,9 @@
|
|
|
|
|
|
using AutoMapper;
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
using OASystem.Domain;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
+using OASystem.Domain.Dtos.System;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
@@ -67,9 +69,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// 查询 根据 Diid 查询
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> GetEnterExitCostInfoByDiId(EnterExitCostInfobyDiIdDto dto)
|
|
|
+ public async Task<JsonView> GetEnterExitCostInfoByDiId(EnterExitCostInfobyDiIdDto dto)
|
|
|
{
|
|
|
- Result result = new Result();
|
|
|
+ var result = new JsonView() { Code = 400 , Msg = "暂无数据" };
|
|
|
|
|
|
var enterExitCostData = await _sqlSugar.Queryable<Grp_EnterExitCost>().FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
|
|
|
@@ -97,7 +99,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
enterExitCostInfoView.DayOtherPriceData = _sqlSugar.Queryable<Grp_DayOtherPrice>()
|
|
|
.Where(x => x.IsDel == 0 && x.Diid == dto.DiId)
|
|
|
- .OrderBy(x=>x.Index)
|
|
|
+ .OrderBy(x => x.Index)
|
|
|
.Select(x => new DayOtherPriceView
|
|
|
{
|
|
|
DiId = x.Diid,
|
|
@@ -113,8 +115,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
enterExitCostInfoView.Currencys = (List<CurrencyInfo>?)CommonFun.GetCurrencyChinaToList(enterExitCostData.CurrencyRemark);
|
|
|
|
|
|
- result.Msg = "查询成功";
|
|
|
- result.Code = 0;
|
|
|
+ result.Msg = "操作成功";
|
|
|
+ result.Code = 200;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -139,9 +141,83 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
result.Data = enterExitCostInfoView;
|
|
|
}
|
|
|
- else result.Msg = MsgTips.Port;
|
|
|
+ else if (dto.PortType == 2 || dto.PortType == 3)
|
|
|
+ {
|
|
|
+ var mobileInfo = new EnterExitCostMobileInfoView();
|
|
|
+ if (enterExitCostData != null)
|
|
|
+ {
|
|
|
+ mobileInfo = _mapper.Map<EnterExitCostMobileInfoView>(enterExitCostData);
|
|
|
|
|
|
+ var dayAndCostData = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
+ .LeftJoin<Grp_NationalTravelFee>((dac,ntf) => dac.NationalTravelFeeId == ntf.Id)
|
|
|
+ .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
|
|
|
+ .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId)
|
|
|
+ .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
|
|
|
+ {
|
|
|
+ Id = dac.Id,
|
|
|
+ DiId = dac.DiId,
|
|
|
+ Type = dac.Type,
|
|
|
+ Days = dac.Days,
|
|
|
+ NationalTravelFeeId = dac.NationalTravelFeeId,
|
|
|
+ Arae = $"{ntf.Country}-{ntf.City}",
|
|
|
+ Cost = dac.Cost,
|
|
|
+ Currency = dac.Currency,
|
|
|
+ CurrencyName = sd.Name,
|
|
|
+ SubTotal = dac.SubTotal,
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ mobileInfo.ChoiceOneTotalCost = enterExitCostData.InsidePay;
|
|
|
+ mobileInfo.ChoiceOneDetails = new ChoiceOneMobileInfoView() {
|
|
|
+ Visa = enterExitCostData.Visa,
|
|
|
+ VisaRemark = enterExitCostData.VisaRemark,
|
|
|
+ YiMiao = enterExitCostData.YiMiao,
|
|
|
+ HeSuan = enterExitCostData.HeSuan,
|
|
|
+ Service = enterExitCostData.Service,
|
|
|
+ Ticket = enterExitCostData.Ticket,
|
|
|
+ Safe = enterExitCostData.Safe,
|
|
|
+ };
|
|
|
+ mobileInfo.ChoiceTwoDetails = new ChoiceTwoMobileInfoView()
|
|
|
+ {
|
|
|
+ AirJJ = enterExitCostData.AirJJ,
|
|
|
+ AirGW = enterExitCostData.AirGW,
|
|
|
+ AirTD = enterExitCostData.AirTD,
|
|
|
+ CityTranffic = enterExitCostData.CityTranffic
|
|
|
+ };
|
|
|
+ mobileInfo.ChoiceThreeDetails = dayAndCostData.Where(it => it.Type == 1).OrderBy(it => it.Days).ToArray(); //住宿费 1
|
|
|
+ mobileInfo.ChoiceFourDetails = dayAndCostData.Where(it => it.Type == 2).OrderBy(it => it.Days).ToArray(); //伙食费 2
|
|
|
+ mobileInfo.ChoiceFiveDetails = dayAndCostData.Where(it => it.Type == 3).OrderBy(it => it.Days).ToArray(); //公杂费 3
|
|
|
+ mobileInfo.ChoiceSixDetails = dayAndCostData.Where(it => it.Type == 4).OrderBy(it => it.Days).ToArray(); //培训费 4
|
|
|
+
|
|
|
+ //其他款项
|
|
|
+ mobileInfo.OtherExpensesDetails = _sqlSugar.Queryable<Grp_DayOtherPrice>()
|
|
|
+ .LeftJoin<Sys_SetData>((dop,sd1) => dop.SetDataId == sd1.Id)
|
|
|
+ .LeftJoin<Sys_SetData>((dop, sd1,sd2) => dop.Currency == sd2.Id)
|
|
|
+ .Where((dop, sd1, sd2) => dop.IsDel == 0 && dop.Diid == dto.DiId)
|
|
|
+ .OrderBy((dop, sd1, sd2) => dop.Index)
|
|
|
+ .Select((dop, sd1, sd2) => new DayOtherPriceMobileInfoView
|
|
|
+ {
|
|
|
+ Id = dop.Id,
|
|
|
+ DiId = dop.Diid,
|
|
|
+ Index = dop.Index,
|
|
|
+ SetDataId = dop.SetDataId,
|
|
|
+ SetDataName = sd1.Name,
|
|
|
+ Cost = dop.Cost,
|
|
|
+ Currency = dop.Currency,
|
|
|
+ CurrencyName = sd2.Remark,
|
|
|
+ SubTotal = dop.SubTotal,
|
|
|
+ Remark = dop.Remark,
|
|
|
+ })
|
|
|
+ .ToArray();
|
|
|
+
|
|
|
+ mobileInfo.Currencys = (List<CurrencyInfo>?)CommonFun.GetCurrencyChinaToList(enterExitCostData.CurrencyRemark);
|
|
|
|
|
|
+ result.Msg = "查询成功";
|
|
|
+ result.Code = 200;
|
|
|
+ }
|
|
|
+ result.Data = mobileInfo;
|
|
|
+ }
|
|
|
+ else result.Msg = MsgTips.Port;
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -443,5 +519,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|