Parcourir la source

修改自贡灯会

tangjiang il y a 3 mois
Parent
commit
6c8189a406

+ 50 - 32
src/DataSharing.Application/Receivers/ProvinceReceiver.cs

@@ -639,21 +639,27 @@ namespace DataSharing.Application.Receivers
             //自贡110独有业务,接收到110推送的办理结果,需要反馈结果签收
             if (_sharingConfigurationManager.IsCity(ConfigurationConsts.ZiGong))
             {
-                if (dto.Order.ActualHandleOrgCode == _sharingConfigurationManager.GetPoliceOrgCode()
-                    || dto.Order.OrgLevelOneCode == _sharingConfigurationManager.GetPoliceOrgCode())
+                try
                 {
-                    //如果是12345的工单,并且办理部门是110,110办理完成之后将结果信息推送到12345后,12345反馈结果接收
-                    await _policeService.FileEndPoliceAsync(dto.Order, cancellationToken);
-                }
+                    if (dto.Order.ActualHandleOrgCode == _sharingConfigurationManager.GetPoliceOrgCode()
+                         || dto.Order.OrgLevelOneCode == _sharingConfigurationManager.GetPoliceOrgCode())
+                    {
+                        //如果是12345的工单,并且办理部门是110,110办理完成之后将结果信息推送到12345后,12345反馈结果接收
+                        await _policeService.FileEndPoliceAsync(dto.Order, cancellationToken);
+                    }
 
-                //给110推送行政审批工单(自贡独有)
-                await InitPoliceAdministrativeApproval(dto.Order, cancellationToken);
+                    //给110推送行政审批工单(自贡独有)
+                    await InitPoliceAdministrativeApproval(dto.Order, cancellationToken);
 
-                //自贡智慧城市系统
-                if (!string.IsNullOrEmpty(dto.Order.OrderTagCode) && dto.Order.OrderTagCode.StartsWith("zgdh") == true)
+                    //自贡智慧城市系统
+                    if (!string.IsNullOrEmpty(dto.Order.OrderTagCode) && dto.Order.OrderTagCode.StartsWith("zgdh") == true)
+                    {
+                        //其他服务推送
+                        await _sendTaskDataService.OtherSendTask("zgdh", dto.Order, cancellationToken);
+                    }
+                }
+                catch (Exception)
                 {
-                    //其他服务推送
-                    await _sendTaskDataService.OtherSendTask("zgdh", dto.Order, cancellationToken);
                 }
             }
         }
@@ -918,30 +924,36 @@ namespace DataSharing.Application.Receivers
         {
             if (dto != null && dto.WorkflowTrace != null && dto.WorkflowTrace.NextHandlers != null && dto.WorkflowTrace.NextHandlers.Count > 0)
             {
-                foreach (var item in dto.WorkflowTrace.NextHandlers)
+                try
                 {
-                    if (!string.IsNullOrEmpty(item.Key))
+                    foreach (var item in dto.WorkflowTrace.NextHandlers)
                     {
-                        //是否向省上派单,不用区分市州,根据部门Code上传
-                        if (item.Key == _sharingConfigurationManager.GetProvinceOrgCode() || item.Key == _sharingConfigurationManager.GetProvinceAssignmentOrgCode())
+                        if (!string.IsNullOrEmpty(item.Key))
                         {
-                            //先上传拓展信息
-                            if (dto.Order.OrderExtension != null)
-                                await _provinceService.SubmitCaseExtendsAsync(dto.Order, cancellationToken);
+                            //是否向省上派单,不用区分市州,根据部门Code上传
+                            if (item.Key == _sharingConfigurationManager.GetProvinceOrgCode() || item.Key == _sharingConfigurationManager.GetProvinceAssignmentOrgCode())
+                            {
+                                //先上传拓展信息
+                                if (dto.Order.OrderExtension != null)
+                                    await _provinceService.SubmitCaseExtendsAsync(dto.Order, cancellationToken);
 
-                            await _provinceService.SendCaseInfoDataAsync(dto.Order, cancellationToken);
-                        }
+                                await _provinceService.SendCaseInfoDataAsync(dto.Order, cancellationToken);
+                            }
 
 
-                        //需要判断是否需要往110推送
-                        if (item.Key == _sharingConfigurationManager.GetPoliceOrgCode())
-                            //写入110本地数据库
-                            await _policeService.InitPoliceSendChainAlarmAsync(dto.Order, cancellationToken);
+                            //需要判断是否需要往110推送
+                            if (item.Key == _sharingConfigurationManager.GetPoliceOrgCode())
+                                //写入110本地数据库
+                                await _policeService.InitPoliceSendChainAlarmAsync(dto.Order, cancellationToken);
 
-                        //其他服务推送
-                        await _sendTaskDataService.OtherSendTask(item.Key, dto.Order, cancellationToken);
+                            //其他服务推送
+                            await _sendTaskDataService.OtherSendTask(item.Key, dto.Order, cancellationToken);
+                        }
                     }
                 }
+                catch (Exception)
+                {
+                }
             }
         }
 
@@ -953,7 +965,9 @@ namespace DataSharing.Application.Receivers
         /// <returns></returns>
         private async Task InitPoliceAdministrativeApproval(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken)
         {
-            string arrTypeName = $@"'交通管理-车驾管业务-驾驶证业务-考试'
+            try
+            {
+                string arrTypeName = $@"'交通管理-车驾管业务-驾驶证业务-考试'
                                        ,'交通管理-车驾管业务-驾驶证业务-补、换证'
                                        ,'交通管理-车驾管业务-驾驶证业务-登记'
                                        ,'交通管理-车驾管业务-非机动车业务-驾驶证业务'
@@ -985,14 +999,18 @@ namespace DataSharing.Application.Receivers
                                        ,'城市管理-户籍管理-出入境管理-往来港澳通行证'
                                        ,'城市管理-户籍管理-户口注销-出国或赴港、澳、台定居注销户口'";
 
-            string typenameFull = orderDto.HotspotSpliceName;
-            if (!string.IsNullOrEmpty(typenameFull))
-            {
-                if (arrTypeName.IndexOf("'" + typenameFull + "'") > -1)
+                string typenameFull = orderDto.HotspotSpliceName;
+                if (!string.IsNullOrEmpty(typenameFull))
                 {
-                    await _policeService.InitPoliceAdministrativeApproval(orderDto, cancellationToken);
+                    if (arrTypeName.IndexOf("'" + typenameFull + "'") > -1)
+                    {
+                        await _policeService.InitPoliceAdministrativeApproval(orderDto, cancellationToken);
+                    }
                 }
             }
+            catch (Exception)
+            {
+            }
         }
     }
 }

+ 58 - 52
src/DataSharing.Police110/DCJT110/DcjtService.cs

@@ -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)
+            {
+            }
         }
     }
 }

+ 26 - 19
src/DataSharing.ZiGong/ZiGongSendTaskDataService.cs

@@ -79,29 +79,36 @@ namespace DataSharing.ZiGong
         /// <returns></returns>
         public async Task OtherSendTask(string Key, OrderDto order, CancellationToken cancellationToken)
         {
-            //智慧城市系统
-            if (Key == "zgdh" && order.AcceptTypeCode == "35")
+            try
             {
-                SmartCitySystem smartCitySystem = new SmartCitySystem()
+                //智慧城市系统
+                if (Key == "zgdh" && order.AcceptTypeCode == "35")
                 {
-                    No = order.No,
-                    AcceptType = order.AcceptType,
-                    Title = order.Title,
-                    CreationTime = order.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
-                    Status = order.StatusText,
-                    Visits = null
-                };
-                var request = JsonSerializer.Serialize(smartCitySystem,new JsonSerializerOptions
-                {
-                    PropertyNamingPolicy = JsonNamingPolicy.CamelCase
-                } );
-                if (_sharingConfigurationManager.IsCity(ConfigurationConsts.ZiGong))
-                {
-                    ConfigurationSmartCitySystem config = _sharingConfigurationManager.GetZiGongConfig().SmartCitySystem;
-                    await _initPushDataService.InitDsSendTaskOtherPlatforms("SmartCitySystem", config.PushDataUrl, order.No,
-                    request, request, EPlatformSource.SmartCitySystem, cancellationToken: cancellationToken);
+                    SmartCitySystem smartCitySystem = new SmartCitySystem()
+                    {
+                        No = order.No,
+                        AcceptType = order.AcceptType,
+                        Title = order.Title,
+                        CreationTime = order.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
+                        Status = order.StatusText,
+                        Visits = null
+                    };
+                    var request = JsonSerializer.Serialize(smartCitySystem, new JsonSerializerOptions
+                    {
+                        PropertyNamingPolicy = JsonNamingPolicy.CamelCase
+                    });
+                    if (_sharingConfigurationManager.IsCity(ConfigurationConsts.ZiGong))
+                    {
+                        ConfigurationSmartCitySystem config = _sharingConfigurationManager.GetZiGongConfig().SmartCitySystem;
+                        await _initPushDataService.InitDsSendTaskOtherPlatforms("SmartCitySystem", config.PushDataUrl, order.No,
+                        request, request, EPlatformSource.SmartCitySystem, cancellationToken: cancellationToken);
+                    }
                 }
             }
+            catch (Exception)
+            {
+
+            }
         }
 
         /// <summary>