修改字段类型
This commit is contained in:
parent
d6ea92bd20
commit
8ac687a9be
@ -47,5 +47,5 @@ public class UpdateTrackPullContentInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -57,5 +57,5 @@ public class EditTrackPushContentInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -100,83 +100,83 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
|||||||
switch (input.Options)
|
switch (input.Options)
|
||||||
{
|
{
|
||||||
case OptionTypeNoNull.新增:
|
case OptionTypeNoNull.新增:
|
||||||
{
|
|
||||||
var trackPullEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPullConfigEntity>(input);
|
|
||||||
var trackPullParamsEntity =
|
|
||||||
ObjectMapper.Map<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(input);
|
|
||||||
|
|
||||||
var trackTemplateContentEntities =
|
|
||||||
await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId);
|
|
||||||
|
|
||||||
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
|
||||||
|
|
||||||
using (var ts = TransactionScopeHelper.Create())
|
|
||||||
{
|
{
|
||||||
int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity);
|
var trackPullEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPullConfigEntity>(input);
|
||||||
|
var trackPullParamsEntity =
|
||||||
|
ObjectMapper.Map<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(input);
|
||||||
|
|
||||||
trackPullParamsEntity.PullOrPushConfigId = id;
|
var trackTemplateContentEntities =
|
||||||
await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity);
|
await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId);
|
||||||
|
|
||||||
foreach (var item in trackTemplateContentEntities)
|
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
||||||
|
|
||||||
|
using (var ts = TransactionScopeHelper.Create())
|
||||||
{
|
{
|
||||||
trackPullContentEntities.Add(new()
|
int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity);
|
||||||
|
|
||||||
|
trackPullParamsEntity.PullOrPushConfigId = id;
|
||||||
|
await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity);
|
||||||
|
|
||||||
|
foreach (var item in trackTemplateContentEntities)
|
||||||
{
|
{
|
||||||
TrackPullConfigId = id,
|
trackPullContentEntities.Add(new()
|
||||||
TrackContentId = item.TrackContentId
|
{
|
||||||
});
|
TrackPullConfigId = id,
|
||||||
|
TrackContentId = item.TrackContentId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
||||||
|
|
||||||
|
ts.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
|
||||||
|
|
||||||
ts.Complete();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OptionTypeNoNull.修改:
|
case OptionTypeNoNull.修改:
|
||||||
{
|
|
||||||
var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ??
|
|
||||||
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
|
||||||
|
|
||||||
var oldTrackPullParamsEntity =
|
|
||||||
await _trackPullConfigRepository.GetParamsSingleAsync(x =>
|
|
||||||
x.PullOrPushConfigId == input.Id && !x.IsPush);
|
|
||||||
|
|
||||||
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
|
||||||
|
|
||||||
if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId)
|
|
||||||
{
|
{
|
||||||
var trackTemplateContentEntities =
|
var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ??
|
||||||
await _trackTemplateRepository.GetContentListAsync(x =>
|
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
x.TrackTemplateId == input.TrackTemplateId);
|
|
||||||
|
|
||||||
foreach (var item in trackTemplateContentEntities)
|
var oldTrackPullParamsEntity =
|
||||||
{
|
await _trackPullConfigRepository.GetParamsSingleAsync(x =>
|
||||||
trackPullContentEntities.Add(new()
|
x.PullOrPushConfigId == input.Id && !x.IsPush);
|
||||||
{
|
|
||||||
TrackPullConfigId = oldTrackPullEntity.Id,
|
|
||||||
TrackContentId = item.TrackContentId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectMapper.Map(input, oldTrackPullEntity);
|
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
||||||
ObjectMapper.Map(input, oldTrackPullParamsEntity);
|
|
||||||
|
|
||||||
using (var ts = TransactionScopeHelper.Create())
|
|
||||||
{
|
|
||||||
await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity);
|
|
||||||
await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity);
|
|
||||||
|
|
||||||
if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId)
|
if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId)
|
||||||
{
|
{
|
||||||
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id);
|
var trackTemplateContentEntities =
|
||||||
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
await _trackTemplateRepository.GetContentListAsync(x =>
|
||||||
|
x.TrackTemplateId == input.TrackTemplateId);
|
||||||
|
|
||||||
|
foreach (var item in trackTemplateContentEntities)
|
||||||
|
{
|
||||||
|
trackPullContentEntities.Add(new()
|
||||||
|
{
|
||||||
|
TrackPullConfigId = oldTrackPullEntity.Id,
|
||||||
|
TrackContentId = item.TrackContentId
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ts.Complete();
|
ObjectMapper.Map(input, oldTrackPullEntity);
|
||||||
|
ObjectMapper.Map(input, oldTrackPullParamsEntity);
|
||||||
|
|
||||||
|
using (var ts = TransactionScopeHelper.Create())
|
||||||
|
{
|
||||||
|
await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity);
|
||||||
|
await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity);
|
||||||
|
|
||||||
|
if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId)
|
||||||
|
{
|
||||||
|
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id);
|
||||||
|
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
||||||
|
}
|
||||||
|
|
||||||
|
ts.Complete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OptionTypeNoNull.删除:
|
case OptionTypeNoNull.删除:
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
using AutoMapper.Internal.Mappers;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using Nito.AsyncEx;
|
|
||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public class TrackContentMapEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "MapTrackContentId")]
|
[SugarColumn(ColumnName = "MapTrackContentId")]
|
||||||
public int MapTrackContentId { get; set; }
|
public int MapTrackContentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 映射轨迹内容code
|
/// 映射轨迹内容code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -64,5 +64,5 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -70,5 +70,5 @@ public class TrackPushContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -52,5 +52,5 @@ public class GetTrackPullContentDetailOutputVO
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹时区
|
/// 拉取轨迹时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -57,5 +57,5 @@ public class GetTrackPushContentDetailOutputVO
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹时区
|
/// 推送轨迹时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user