|
@@ -214,10 +214,10 @@ namespace DataSharing.Police110.DCJT110
|
|
|
};
|
|
|
//如果来源是110,直接取工单里面的编号
|
|
|
var alarmReceiptNumber = dto.Order.ExternalId;
|
|
|
- if ( string.IsNullOrEmpty(alarmReceiptNumber))
|
|
|
+ if (string.IsNullOrEmpty(alarmReceiptNumber))
|
|
|
{
|
|
|
var checkDataAlarm = await _policeSendChainAlarmDcjtRepository.GetAsync(p => p.OrderId == dto.Order.Id && p.AlarmReceptionType == "0", cancellationToken);
|
|
|
- if (checkDataAlarm!=null)
|
|
|
+ if (checkDataAlarm != null)
|
|
|
{
|
|
|
alarmReceiptNumber = checkDataAlarm.AlarmReceiptNumber;
|
|
|
}
|
|
@@ -313,60 +313,66 @@ namespace DataSharing.Police110.DCJT110
|
|
|
/// <returns></returns>
|
|
|
public async Task InitPoliceAdministrativeApproval(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken)
|
|
|
{
|
|
|
- var areaCodeDefu = _sharingConfigurationManager.GetCityCode();
|
|
|
- var config = _sharingConfigurationManager.GetZiGongConfig().PoliceDCJT;
|
|
|
- var registerNo = "10001";
|
|
|
- if (!string.IsNullOrEmpty(orderDto.AcceptorStaffNo))
|
|
|
- registerNo = orderDto.AcceptorStaffNo;
|
|
|
- else
|
|
|
- {
|
|
|
- if (!string.IsNullOrEmpty(orderDto.AcceptorId))
|
|
|
- registerNo = orderDto.AcceptorId.Substring(orderDto.AcceptorId.Length - 12);
|
|
|
- }
|
|
|
- var Content = orderDto.Content.Length > 1900 ? orderDto.Content.Substring(0, 1900) : orderDto.Content;
|
|
|
- var policeTypeCode = "01";
|
|
|
- if (!string.IsNullOrEmpty(orderDto.HotspotId))
|
|
|
- policeTypeCode = orderDto.HotspotId.Length > 8 ? orderDto.HotspotId.Substring(0, 7) : orderDto.HotspotId;
|
|
|
- DsPoliceSendChainAlarmDcjt policeSend = new()
|
|
|
+ try
|
|
|
{
|
|
|
- SerialNumber = orderDto.ExternalId,
|
|
|
- AlarmReceiptNumber = orderDto.ExternalId,
|
|
|
- RegisterNo = registerNo,
|
|
|
- RegisterName = orderDto.AcceptorName,
|
|
|
- CallPoliceNumber = string.IsNullOrEmpty(orderDto.FromPhone) == true ? orderDto.Contact : orderDto.FromPhone,
|
|
|
- CallPoliceName = orderDto.FromName,
|
|
|
- PhoneNumber = orderDto.Contact,
|
|
|
- CallPoliceContent = Content,
|
|
|
- PoliceTypeCode = policeTypeCode,
|
|
|
- PoliceTypeName = orderDto.HotspotSpliceName,
|
|
|
- JurisdictionalUnitCode = config.GXDWDM,
|
|
|
- JurisdictionalUnitName = config.GXDWMC,
|
|
|
- JurisdictionalUnitNumber = config.GXDWDH,
|
|
|
- AlarmReceivingUnitCode = "510300010000",
|
|
|
- AlarmReceivingUnitName = "四川省自贡市公安局指挥中心",
|
|
|
- CallPoliceTime = Convert.ToDateTime(orderDto.CreationTime),
|
|
|
- PushTime = DateTime.Now,
|
|
|
- AlarmReceptionType = "3",
|
|
|
- AreaCode = orderDto.AreaCode.Substring(0, 6),
|
|
|
- CallPoliceAddress = orderDto.FullAddress,
|
|
|
- OrderId = orderDto.Id
|
|
|
- };
|
|
|
+ var areaCodeDefu = _sharingConfigurationManager.GetCityCode();
|
|
|
+ var config = _sharingConfigurationManager.GetZiGongConfig().PoliceDCJT;
|
|
|
+ var registerNo = "10001";
|
|
|
+ if (!string.IsNullOrEmpty(orderDto.AcceptorStaffNo))
|
|
|
+ registerNo = orderDto.AcceptorStaffNo;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(orderDto.AcceptorId))
|
|
|
+ registerNo = orderDto.AcceptorId.Substring(orderDto.AcceptorId.Length - 12);
|
|
|
+ }
|
|
|
+ var Content = orderDto.Content.Length > 1900 ? orderDto.Content.Substring(0, 1900) : orderDto.Content;
|
|
|
+ var policeTypeCode = "01";
|
|
|
+ if (!string.IsNullOrEmpty(orderDto.HotspotId))
|
|
|
+ policeTypeCode = orderDto.HotspotId.Length > 8 ? orderDto.HotspotId.Substring(0, 7) : orderDto.HotspotId;
|
|
|
+ DsPoliceSendChainAlarmDcjt policeSend = new()
|
|
|
+ {
|
|
|
+ SerialNumber = orderDto.ExternalId,
|
|
|
+ AlarmReceiptNumber = orderDto.ExternalId,
|
|
|
+ RegisterNo = registerNo,
|
|
|
+ RegisterName = orderDto.AcceptorName,
|
|
|
+ CallPoliceNumber = string.IsNullOrEmpty(orderDto.FromPhone) == true ? orderDto.Contact : orderDto.FromPhone,
|
|
|
+ CallPoliceName = orderDto.FromName,
|
|
|
+ PhoneNumber = orderDto.Contact,
|
|
|
+ CallPoliceContent = Content,
|
|
|
+ PoliceTypeCode = policeTypeCode,
|
|
|
+ PoliceTypeName = orderDto.HotspotSpliceName,
|
|
|
+ JurisdictionalUnitCode = config.GXDWDM,
|
|
|
+ JurisdictionalUnitName = config.GXDWMC,
|
|
|
+ JurisdictionalUnitNumber = config.GXDWDH,
|
|
|
+ AlarmReceivingUnitCode = "510300010000",
|
|
|
+ AlarmReceivingUnitName = "四川省自贡市公安局指挥中心",
|
|
|
+ CallPoliceTime = Convert.ToDateTime(orderDto.CreationTime),
|
|
|
+ PushTime = DateTime.Now,
|
|
|
+ AlarmReceptionType = "3",
|
|
|
+ AreaCode = orderDto.AreaCode.Substring(0, 6),
|
|
|
+ CallPoliceAddress = orderDto.FullAddress,
|
|
|
+ OrderId = orderDto.Id
|
|
|
+ };
|
|
|
|
|
|
- policeSend.FromGender = orderDto.FromGender switch
|
|
|
- {
|
|
|
- Hotline.Share.Enums.Order.EGender.Female => "0",
|
|
|
- Hotline.Share.Enums.Order.EGender.Male => "1",
|
|
|
- Hotline.Share.Enums.Order.EGender.Unknown => "2",
|
|
|
- _ => "2",
|
|
|
- };
|
|
|
+ policeSend.FromGender = orderDto.FromGender switch
|
|
|
+ {
|
|
|
+ Hotline.Share.Enums.Order.EGender.Female => "0",
|
|
|
+ Hotline.Share.Enums.Order.EGender.Male => "1",
|
|
|
+ Hotline.Share.Enums.Order.EGender.Unknown => "2",
|
|
|
+ _ => "2",
|
|
|
+ };
|
|
|
|
|
|
- policeSend.AlarmReceiptNumber = areaCodeDefu + "1234512345" + orderDto.No;
|
|
|
- policeSend.SerialNumber = areaCodeDefu + "1234512345" + orderDto.No;
|
|
|
+ policeSend.AlarmReceiptNumber = areaCodeDefu + "1234512345" + orderDto.No;
|
|
|
+ policeSend.SerialNumber = areaCodeDefu + "1234512345" + orderDto.No;
|
|
|
|
|
|
- //查询是否有此工单,如果没有新增此工单
|
|
|
- var data = await _policeSendChainAlarmDcjtRepository.GetAsync(p => p.OrderId == orderDto.Id && p.AlarmReceptionType == "3", cancellationToken);
|
|
|
- if (data == null)
|
|
|
- await _policeSendChainAlarmDcjtRepository.AddAsync(policeSend, cancellationToken);
|
|
|
+ //查询是否有此工单,如果没有新增此工单
|
|
|
+ var data = await _policeSendChainAlarmDcjtRepository.GetAsync(p => p.OrderId == orderDto.Id && p.AlarmReceptionType == "3", cancellationToken);
|
|
|
+ if (data == null)
|
|
|
+ await _policeSendChainAlarmDcjtRepository.AddAsync(policeSend, cancellationToken);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|