123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using AngleSharp.Text;
- using Hotline.Orders;
- using Hotline.Share.Dtos.Snapshot;
- using Hotline.Share.Enums.Order;
- using Hotline.Share.Tools;
- using Hotline.Snapshot;
- using Mapster;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Hotline.Application.Mappers;
- public class SnapshotMapperConfigs : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.ForType<GuiderSystemInDto, CommunityInfo>()
- .Map(dest => dest.Name, src => src.OrgName)
- .Map(dest => dest.ParentCode, src => src.ParentOrgId)
- .Map(dest => dest.Id, src => src.OrgId)
- .Map(dest => dest.FullName, src => src.OrgFullName)
- .AfterMapping((dest, src) =>
- {
- src.Id = dest.OrgId;
- });
- config.ForType<AddIndustryDto, Industry>();
- config.ForType<Hotline.File.File, IndustryFileDto>()
- .Map(m => m.AdditionId, n => n.Additions);
- config.ForType<IndustryFileDto, Hotline.File.File>()
- .Map(m => m.Additions, n => n.AdditionId);
- config.ForType<AddSnapshotOrderInDto, Order>()
- .Map(m => m.Contact, n => n.PhoneNumber)
- .Map(m => m.FromName, n => n.Name)
- .Map(m => m.FromPhone, n => n.PhoneNumber);
- config.ForType<SnapshotOrderPublish, OrderPublishDetailOutDto>()
- .Map(m => m.Title, n => n.ArrangeTitle)
- .Map(m => m.Content, n => n.ArrangeContent)
- .Map(m => m.Opinion, n => n.ArrangeOpinion);
- config.ForType<Order, OrderPublishDetailOutDto>()
- .Map(m => m.Opinion, n => n.ActualOpinion);
- config.ForType<AddBatchPractitionerInDto, Practitioner>()
- .Ignore(m => m.Gender);
- config.ForType<GuiderSystemInDto, OrderSnapshot>()
- .Map(m => m.ReplyDate, n => n.ReplyDate)
- .Map(m => m.ReplyUserName, n => n.ReplyUserName)
- .Map(m => m.ReplyBMName, n => n.ReplyBMName)
- .Map(m => m.ReplyResultType, n => n.ReplyResultType)
- .Map(m => m.IsTruth, n => n.ReplyISTrue == "1")
- .Map(m => m.IsDeal, n => n.ReplyResultType == "2")
- .Map(m => m.IsRepetition, n => n.IsRepeat == "1")
- .Map(m => m.IsDanger, n => n.IsHiddenDanger == "1")
- .Map(m => m.MemberName, n => n.MemberName)
- .Map(m => m.MemberMobile, n => n.MemberMobile)
- .Map(m => m.CommunityId, n => n.OrgId)
- .Map(m => m.NetworkRemark, n => n.ReplyContent);
- }
- }
|