|
@@ -1,6 +1,8 @@
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using MapsterMapper;
|
|
|
+using Sharing.DaoShu110;
|
|
|
+using Sharing.DaoShu110.Dtos;
|
|
|
using Sharing.Province.HuiJu.Send;
|
|
|
using XF.Domain.Cache;
|
|
|
using XF.Domain.Dependency;
|
|
@@ -16,6 +18,7 @@ namespace Sharing.Api
|
|
|
private readonly ITypedCache<CacheOrderNO> _cacheOrderNo;
|
|
|
private readonly ISubmitCaseInfoRepository _submitCaseInfoRepository;
|
|
|
private readonly IMapper _mapper;
|
|
|
+ private readonly IPoliceSendChainAlarmDsRepository _policeSendChainAlarmDsRepository;
|
|
|
|
|
|
/// <summary>
|
|
|
///
|
|
@@ -23,11 +26,13 @@ namespace Sharing.Api
|
|
|
/// <param name="cacheOrderNo"></param>
|
|
|
/// <param name="submitCaseInfoRepository"></param>
|
|
|
/// <param name="mapper"></param>
|
|
|
- public ProvinceService(ITypedCache<CacheOrderNO> cacheOrderNo, ISubmitCaseInfoRepository submitCaseInfoRepository, IMapper mapper)
|
|
|
+ /// <param name="policeSendChainAlarmDsRepository"></param>
|
|
|
+ public ProvinceService(ITypedCache<CacheOrderNO> cacheOrderNo, ISubmitCaseInfoRepository submitCaseInfoRepository, IMapper mapper, IPoliceSendChainAlarmDsRepository policeSendChainAlarmDsRepository)
|
|
|
{
|
|
|
_cacheOrderNo = cacheOrderNo;
|
|
|
_submitCaseInfoRepository = submitCaseInfoRepository;
|
|
|
_mapper = mapper;
|
|
|
+ _policeSendChainAlarmDsRepository = policeSendChainAlarmDsRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -164,9 +169,53 @@ namespace Sharing.Api
|
|
|
}
|
|
|
|
|
|
submitCaseInfo.Id = await _submitCaseInfoRepository.AddAsync(submitCaseInfo);
|
|
|
+
|
|
|
+ //需要判断是否需要往110推送
|
|
|
+ //写入110本地数据库
|
|
|
+ await InitPoliceSendChainAlarmDs(dto, submitCaseInfo.CaseAddress);
|
|
|
return submitCaseInfo;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 组装110数据
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="orderDto"></param>
|
|
|
+ /// <param name="CaseAddress"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private async Task InitPoliceSendChainAlarmDs(OrderDto orderDto, string CaseAddress)
|
|
|
+ {
|
|
|
+ string SerialNumber = $"{orderDto.AreaCode}{orderDto.No}{"12345"}{DateTime.Now.Millisecond.ToString("00000")}";
|
|
|
+ PoliceSendChainAlarmDs policeSend = new PoliceSendChainAlarmDs
|
|
|
+ {
|
|
|
+ SerialNumber = SerialNumber,
|
|
|
+ AlarmReceiptNumber = SerialNumber,
|
|
|
+ RegisterNo = orderDto.EmployeeStaffNo,
|
|
|
+ CallPoliceNumber = orderDto.FromPhone,
|
|
|
+ CallPoliceName = orderDto.FromName,
|
|
|
+ PhoneNumber = orderDto.Contact,
|
|
|
+ CallPoliceContent = orderDto.Content,
|
|
|
+ PoliceTypeCode = "",
|
|
|
+ PoliceTypeName = "",
|
|
|
+ JurisdictionalUnitCode = "511500000000",
|
|
|
+ JurisdictionalUnitName = "宜宾市公安局",
|
|
|
+ JurisdictionalUnitNumber = "0831110",
|
|
|
+ AlarmReceivingUnitCode = "",
|
|
|
+ AlarmReceivingUnitName = "",
|
|
|
+ CallPoliceTime = Convert.ToDateTime(orderDto.CreationTime),
|
|
|
+ PushTime = DateTime.Now,
|
|
|
+ AlarmReceptionType = "0",
|
|
|
+ AreaCode = orderDto.AreaCode,
|
|
|
+ CallPoliceAddress = CaseAddress,
|
|
|
+ OrderId = orderDto.Id
|
|
|
+ };
|
|
|
+ //查询是否有此工单,如果没有新增此工单
|
|
|
+ var data = await _policeSendChainAlarmDsRepository.GetAsync(p => p.OrderId == orderDto.Id);
|
|
|
+ if (data == null)
|
|
|
+ {
|
|
|
+ await _policeSendChainAlarmDsRepository.AddAsync(policeSend);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#region 私有方法
|
|
|
|
|
|
#region 生成省编号
|