|
@@ -4,6 +4,7 @@ using NPOI.SS.Formula.Functions;
|
|
|
using NPOI.SS.UserModel;
|
|
|
using NPOI.Util;
|
|
|
using OASystem.Domain;
|
|
|
+using OASystem.Domain.AesEncryption;
|
|
|
using OASystem.Domain.Dtos.Financial;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Dtos.QiYeWeChat;
|
|
@@ -53,13 +54,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
if (dto.Status == 1)//添加
|
|
|
{
|
|
|
var grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
|
|
|
- .First(a => a.IsDel == 0 &&
|
|
|
- a.Area == dto.Area &&
|
|
|
- a.BusName == dto.BusName &&
|
|
|
- a.ServiceGuide == dto.ServiceGuide &&
|
|
|
- a.DiId == dto.DiId &&
|
|
|
- a.BusTel == dto.BusTel &&
|
|
|
- a.ServiceTel == dto.ServiceTel &&
|
|
|
+ .First(a => a.IsDel == 0 &&
|
|
|
+ a.Area == dto.Area &&
|
|
|
+ a.BusName == dto.BusName &&
|
|
|
+ a.ServiceGuide == dto.ServiceGuide &&
|
|
|
+ a.DiId == dto.DiId &&
|
|
|
+ a.BusTel == dto.BusTel &&
|
|
|
+ a.ServiceTel == dto.ServiceTel &&
|
|
|
a.PriceName == dto.PriceName
|
|
|
);
|
|
|
if (grp_CarTouristGuideGround != null)
|
|
@@ -115,16 +116,28 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
if (id != 0)
|
|
|
{
|
|
|
- Res_LocalGuideData _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.BusName && a.ContactTel == dto.BusTel && a.IsDel == 0);
|
|
|
+ var _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>()
|
|
|
+ .First(a =>
|
|
|
+ a.UnitName == AesEncryptionHelper.Encrypt(dto.BusName) &&
|
|
|
+ a.ContactTel == AesEncryptionHelper.Encrypt(dto.BusTel) &&
|
|
|
+ a.IsDel == 0
|
|
|
+ );
|
|
|
if (_LocalGuideDataCar == null)
|
|
|
{
|
|
|
- Res_LocalGuideData res_LocalGuideCar = new Res_LocalGuideData();
|
|
|
+ var res_LocalGuideCar = new Res_LocalGuideData();
|
|
|
res_LocalGuideCar.UnitName = dto.BusName;
|
|
|
res_LocalGuideCar.ContactTel = dto.BusTel;
|
|
|
res_LocalGuideCar.CreateUserId = dto.CreateUserId;
|
|
|
+
|
|
|
+ EncryptionProcessor.EncryptProperties(res_LocalGuideCar);
|
|
|
int cId = await _sqlSugar.Insertable(res_LocalGuideCar).ExecuteReturnIdentityAsync();
|
|
|
}
|
|
|
- Res_LocalGuideData _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.ServiceCompany && a.ContactTel == dto.ServiceTel && a.IsDel == 0);
|
|
|
+ var _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>()
|
|
|
+ .First(a =>
|
|
|
+ a.UnitName == AesEncryptionHelper.Encrypt(dto.ServiceCompany) &&
|
|
|
+ a.ContactTel == AesEncryptionHelper.Encrypt(dto.ServiceTel) &&
|
|
|
+ a.IsDel == 0
|
|
|
+ );
|
|
|
if (_LocalGuideDataService == null)
|
|
|
{
|
|
|
Res_LocalGuideData res_LocalGuideService = new Res_LocalGuideData();
|
|
@@ -133,6 +146,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
res_LocalGuideService.ContactTel = dto.ServiceTel;
|
|
|
res_LocalGuideService.Contact = dto.ServiceTel;
|
|
|
res_LocalGuideService.CreateUserId = dto.CreateUserId;
|
|
|
+ EncryptionProcessor.EncryptProperties(res_LocalGuideService);
|
|
|
int cId = await _sqlSugar.Insertable(res_LocalGuideService).ExecuteReturnIdentityAsync();
|
|
|
}
|
|
|
}
|
|
@@ -179,14 +193,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
int day = ts.Days;
|
|
|
|
|
|
var diid = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 79)
|
|
|
- .Select(x=>x.DIId)
|
|
|
+ .Select(x => x.DIId)
|
|
|
.Distinct()
|
|
|
.ToList();
|
|
|
|
|
|
//团组下拉框
|
|
|
- List<Grp_DelegationInfo> _Delegations = diid.Any()
|
|
|
+ List<Grp_DelegationInfo> _Delegations = diid.Any()
|
|
|
? _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
- .Where(x => x.IsDel == 0 && diid.Contains(x.Id)).ToList()
|
|
|
+ .Where(x => x.IsDel == 0 && diid.Contains(x.Id)).ToList()
|
|
|
: new List<Grp_DelegationInfo>();
|
|
|
List<ShareGroupInfoIIView> grp_Delegations = _mapper.Map<List<ShareGroupInfoIIView>>(_Delegations);
|
|
|
|
|
@@ -203,9 +217,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
List<SetDataInfoView> ssdv = _mapper.Map<List<Sys_SetData>, List<SetDataInfoView>>(ssd);
|
|
|
|
|
|
var carTouristGuides = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>()
|
|
|
- .LeftJoin<Sys_SetData>((a,b) => b.IsDel == 0 && a.SId == b.Id)
|
|
|
+ .LeftJoin<Sys_SetData>((a, b) => b.IsDel == 0 && a.SId == b.Id)
|
|
|
.Where(a => a.IsDel == 0 && a.CTGGRId == dto.Id)
|
|
|
- .Select((a, b) => new CarTouristGuideGroundReservationsContentView {
|
|
|
+ .Select((a, b) => new CarTouristGuideGroundReservationsContentView
|
|
|
+ {
|
|
|
SId = a.SId,
|
|
|
Id = a.Id,
|
|
|
Count = a.Count,
|
|
@@ -217,9 +232,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
})
|
|
|
.ToList();
|
|
|
|
|
|
- var weikuanSign = new int[] { 1070, 1071,};
|
|
|
+ var weikuanSign = new int[] { 1070, 1071, };
|
|
|
TableInitialization.RemoveAll(x => weikuanSign.Contains(x.Id));
|
|
|
- var weiKuanArr = _TableInitialization.Where(x => weikuanSign.Contains(x.Id) ).ToList();
|
|
|
+ var weiKuanArr = _TableInitialization.Where(x => weikuanSign.Contains(x.Id)).ToList();
|
|
|
var weiKuanResultArr = carTouristGuides.Where(x => weikuanSign.Contains(x.SId)).ToList();
|
|
|
carTouristGuides.RemoveAll(x => weikuanSign.Contains(x.SId));
|
|
|
|
|
@@ -301,7 +316,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
carTouristGuides = groupResult.Values.SelectMany(sublist => sublist).OrderBy(x => x.SId).ThenBy(x => x.DatePrice).ToList();
|
|
|
|
|
|
var _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment, Sys_SetData, Sys_SetData>(
|
|
|
- (g, s1, s2) => new JoinQueryInfos (
|
|
|
+ (g, s1, s2) => new JoinQueryInfos(
|
|
|
JoinType.Left, g.PayDId == s1.Id,
|
|
|
JoinType.Left, g.PaymentCurrency == s2.Id
|
|
|
))
|
|
@@ -464,7 +479,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
//三公费用金额以及币种
|
|
|
var boolParse = int.TryParse(grpCarOp.Area, out int natiId);
|
|
|
var NationalTravelFee = _sqlSugar.Queryable<Grp_NationalTravelFee>()
|
|
|
- .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id )
|
|
|
+ .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id)
|
|
|
.Where((a, b) => a.IsDel == 0 && b.IsDel == 0)
|
|
|
.Select((a, b) => new
|
|
|
{
|
|
@@ -484,12 +499,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
};
|
|
|
|
|
|
var bankCard = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 15)
|
|
|
- .Select(x=> new
|
|
|
- {
|
|
|
- x.Id,
|
|
|
- x.Name
|
|
|
- })
|
|
|
- .OrderByDescending(x=>x.Id)
|
|
|
+ .Select(x => new
|
|
|
+ {
|
|
|
+ x.Id,
|
|
|
+ x.Name
|
|
|
+ })
|
|
|
+ .OrderByDescending(x => x.Id)
|
|
|
.ToList();
|
|
|
|
|
|
if (dto.PortType == 1)
|
|
@@ -806,7 +821,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
#region 旧数据处理
|
|
|
string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm ss");
|
|
|
var ids = carTouristList.Select(x1 => x1.Id);
|
|
|
- _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && x.CTGGRId == dto.CTGGRId && !ids.Contains(x.Id) && x.IsDel == 0).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
|
|
|
+ _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && x.CTGGRId == dto.CTGGRId && !ids.Contains(x.Id) && x.IsDel == 0).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
|
|
|
{
|
|
|
IsDel = 1,
|
|
|
DeleteTime = time,
|
|
@@ -854,9 +869,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
};
|
|
|
|
|
|
List<Tuple<int, string, int, decimal>> arr = new List<Tuple<int, string, int, decimal>>();
|
|
|
- arr.Add(new Tuple<int, string, int,decimal>(1074, "早餐超支费用", 1077, 1M)); // sid name setdataid 系数
|
|
|
- arr.Add(new Tuple<int, string, int,decimal>(1075, "午餐超支费用", 1078, 1M));
|
|
|
- arr.Add(new Tuple<int, string, int,decimal>(1076, "晚餐超支费用", 1079, 1M));
|
|
|
+ arr.Add(new Tuple<int, string, int, decimal>(1074, "早餐超支费用", 1077, 1M)); // sid name setdataid 系数
|
|
|
+ arr.Add(new Tuple<int, string, int, decimal>(1075, "午餐超支费用", 1078, 1M));
|
|
|
+ arr.Add(new Tuple<int, string, int, decimal>(1076, "晚餐超支费用", 1079, 1M));
|
|
|
arr.Add(new Tuple<int, string, int, decimal>(982, "车超时费用", 1050, 2.4M));
|
|
|
arr.Add(new Tuple<int, string, int, decimal>(1059, "导游超时费用", 1072, 1M));
|
|
|
arr.Add(new Tuple<int, string, int, decimal>(1085, "景点门票超支费用", 1086, 1.2M));
|
|
@@ -890,7 +905,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
PriceDetailType = item.Item3,
|
|
|
Remark = x.PriceContent,
|
|
|
Area = opSingleCityId
|
|
|
-
|
|
|
+
|
|
|
}).ToList();
|
|
|
|
|
|
if (a.Count > 0)
|
|
@@ -945,26 +960,26 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
remake += $"{start.ToString("M/d")}午餐和晚餐,";
|
|
|
exitMealCount += 2;
|
|
|
- price += (aMeal * 2 * di.VisitPNumber) - (mealPriceWu * dto.Rate) - (mealPriceWan * dto.Rate);
|
|
|
+ price += (aMeal * 2 * di.VisitPNumber) - (mealPriceWu * dto.Rate) - (mealPriceWan * dto.Rate);
|
|
|
}
|
|
|
else if (isExistsWu)
|
|
|
{
|
|
|
remake += $"{start.ToString("M/d")}午餐,";
|
|
|
exitMealCount += 1;
|
|
|
- price += (aMeal * di.VisitPNumber) - (mealPriceWu * dto.Rate);
|
|
|
+ price += (aMeal * di.VisitPNumber) - (mealPriceWu * dto.Rate);
|
|
|
}
|
|
|
else if (isExistsWan)
|
|
|
{
|
|
|
remake += $"{start.ToString("M/d")}晚餐,";
|
|
|
exitMealCount += 1;
|
|
|
- price += (aMeal * di.VisitPNumber) - (mealPriceWan * dto.Rate);
|
|
|
+ price += (aMeal * di.VisitPNumber) - (mealPriceWan * dto.Rate);
|
|
|
}
|
|
|
|
|
|
start = start.AddDays(1);
|
|
|
//day++;
|
|
|
}
|
|
|
|
|
|
- var priceTypeArr = new int[] { 1061 , 1069 };
|
|
|
+ var priceTypeArr = new int[] { 1061, 1069 };
|
|
|
|
|
|
if (exitMealCount > 0 && priceTypeArr.Contains(opSingle.PriceType))
|
|
|
{
|
|
@@ -981,10 +996,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
DiId = dto.DiId,
|
|
|
FilePath = string.Empty,
|
|
|
IsDel = 0,
|
|
|
- PriceCount = di.VisitPNumber * exitMealCount * -1 ,
|
|
|
+ PriceCount = di.VisitPNumber * exitMealCount * -1,
|
|
|
Price = priceInt,
|
|
|
PriceDt = opSingle.ServiceStartTime.ObjToDate(),
|
|
|
- PriceCurrency = findSetDataCurr == null ? dto.toCurr: findSetDataCurr.Id ,
|
|
|
+ PriceCurrency = findSetDataCurr == null ? dto.toCurr : findSetDataCurr.Id,
|
|
|
PriceSum = (di.VisitPNumber * exitMealCount * -1) * priceInt,
|
|
|
PriceName = di.TeamName + "-" + priceCity + "-" + $"退餐费(地接导入)",
|
|
|
PriceType = 1028,
|
|
@@ -994,7 +1009,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- var needToConfirm = new int[] { 1088, 1050 };
|
|
|
+ var needToConfirm = new int[] { 1088, 1050 };
|
|
|
|
|
|
if (groupExtraCostsArr.Count > 0)
|
|
|
{
|
|
@@ -1071,8 +1086,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
_foreignReceivablesRepository.OverSpSeteceivables(new OverSpSeteceivablesDto
|
|
|
{
|
|
|
- CreateUserId = dto.CreateUserId,
|
|
|
- DiId = dto.DiId,
|
|
|
+ CreateUserId = dto.CreateUserId,
|
|
|
+ DiId = dto.DiId,
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -1133,7 +1148,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Regex regex = new Regex("^[\u4e00-\u9fa5]{0,}$");
|
|
|
|
|
|
#region 修改C表数据
|
|
|
-
|
|
|
+
|
|
|
Grp_CreditCardPayment c = new Grp_CreditCardPayment();
|
|
|
c.PaymentCurrency = dto.Currency;
|
|
|
for (int i = 0; i < dto.SelectCheck.Count; i++)
|
|
@@ -1282,7 +1297,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
RollbackTran();
|
|
|
- result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})"};
|
|
|
+ result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})" };
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -1405,7 +1420,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
if (costDto.costSign != 3)
|
|
|
{
|
|
|
//获取新汇率 int diId,int CId, int currencyId
|
|
|
- Result rate = await _setDataRep.PostCurrencyByDiid(costDto.diId, 1015, costDto.currency);
|
|
|
+ Result rate = await _setDataRep.PostCurrencyByDiid(costDto.diId, 1015, costDto.currency);
|
|
|
|
|
|
if (rate.Code == 0)
|
|
|
{
|
|
@@ -1524,7 +1539,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Result rt = new Result();
|
|
|
foreach (var item in dto)
|
|
|
{
|
|
|
- await _daiRep.UpdateAsync<Fin_GroupExtraCost>(s => s.PriceName == item.priceName && s.DiId == item.diId,
|
|
|
+ await _daiRep.UpdateAsync<Fin_GroupExtraCost>(s => s.PriceName == item.priceName && s.DiId == item.diId,
|
|
|
s => new Fin_GroupExtraCost
|
|
|
{
|
|
|
IsDel = 1,
|