tangjiang il y a 4 mois
Parent
commit
3f88c137b6

+ 69 - 0
src/DataSharing.Application/Receivers/ProvinceReceiver.cs

@@ -336,6 +336,12 @@ namespace DataSharing.Application.Receivers
             //热线工单流程开启 --服务工单受理
             await _provinceService.OrderFlowStartedAsync(pushdto, cancellationToken);
 
+            //自贡110独有业务,如果是110派来的工单,流程开启后传签收状态
+            if (_sharingConfigurationManager.IsCity(ConfigurationConsts.ZiGong) && dto.Source == ESource.Police110)
+            {
+                await _policeService.SingForPoliceAsync(dto, cancellationToken);
+            }
+
             //是否需要往第三方推送
             await OrderDispatchAsync(new OrderFlowDto { Order = pushdto.Order, WorkflowTrace = pushdto.WorkflowTrace, ExpiredTimeChanged = false }, cancellationToken);
 
@@ -615,6 +621,19 @@ namespace DataSharing.Application.Receivers
             //市州其他业务推送办理结果
             await _sendTaskDataService.AddHandleOpinion(dto, cancellationToken);
 
+            //自贡110独有业务,接收到110推送的办理结果,需要反馈结果签收
+            if (_sharingConfigurationManager.IsCity(ConfigurationConsts.ZiGong))
+            {
+                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);
+            }
         }
 
         /// <summary>
@@ -903,5 +922,55 @@ namespace DataSharing.Application.Receivers
                 }
             }
         }
+
+        /// <summary>
+        /// 给110推送行政审批工单(自贡独有)
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        private async Task InitPoliceAdministrativeApproval(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken)
+        {
+            string arrTypeName = $@"'交通管理-车驾管业务-驾驶证业务-考试'
+                                       ,'交通管理-车驾管业务-驾驶证业务-补、换证'
+                                       ,'交通管理-车驾管业务-驾驶证业务-登记'
+                                       ,'交通管理-车驾管业务-非机动车业务-驾驶证业务'
+                                       ,'政务服务-行政效能-工作作风'
+                                       ,'政务服务-行政效能-工作效率'
+                                       ,'政务服务-行政效能-服务态度'
+                                       ,'政务服务-行政效能-其他行政效能投诉'
+                                       ,'政务服务-行政效能-服务质量'
+                                       ,'政务服务-审批信息-审批信息'
+                                       ,'城市管理-户籍管理-户口登记项目变更更正-变更更正民族'
+                                       ,'城市管理-户籍管理-户口登记项目变更更正-更正籍贯'
+                                       ,'城市管理-户籍管理-户口登记项目变更更正-变更更正姓名'
+                                       ,'城市管理-户籍管理-户口登记项目变更更正-更正出生日期'
+                                       ,'城市管理-户籍管理-户口登记项目变更更正-变更服务处所'
+                                       ,'城市管理-户籍管理-户口登记项目变更更正-变更婚姻状况'
+                                       ,'城市管理-户籍管理-户口登记-出生登记'
+                                       ,'城市管理-户籍管理-户口登记-集体户口'
+                                       ,'城市管理-户籍管理-户口登记-分户登记'
+                                       ,'城市管理-户籍管理-户口登记-非婚生子女户口申报'
+                                       ,'城市管理-户籍管理-居住证-首次申领'
+                                       ,'城市管理-户籍管理-居住证-居住登记'
+                                       ,'城市管理-户籍管理-身份证-身份证申领'
+                                       ,'城市管理-户籍管理-身份证-身份证丢失补办'
+                                       ,'城市管理-户籍管理-身份证-临时身份证申领'
+                                       ,'城市管理-户籍管理-户口注销-服兵役户口注销'
+                                       ,'城市管理-户籍管理-户口注销-死亡人口户口注销'
+                                       ,'城市管理-户籍管理-出入境管理-往来港澳通行证办理'
+                                       ,'城市管理-户籍管理-出入境管理-护照办理'
+                                       ,'城市管理-户籍管理-出入境管理-往来港澳通行证'
+                                       ,'城市管理-户籍管理-户口注销-出国或赴港、澳、台定居注销户口'";
+
+            string typenameFull = orderDto.HotspotSpliceName;
+            if (string.IsNullOrEmpty(typenameFull))
+            {
+                if (arrTypeName.IndexOf("'" + typenameFull + "'") > -1)
+                {
+                    await _policeService.InitPoliceAdministrativeApproval(orderDto, cancellationToken);
+                }
+            }
+        }
     }
 }

+ 6 - 3
src/DataSharing.Host/Controllers/Police110/PoliceDCJTController.cs

@@ -12,6 +12,7 @@ using DataSharing.Share.Dtos.Police110.DCJT110;
 using DataSharing.Share.Enums;
 using DotNetCore.CAP;
 using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
+using Hotline.Share.Enums.DataSharing;
 using Hotline.Share.Enums.Order;
 using MapsterMapper;
 using MediatR;
@@ -530,7 +531,9 @@ namespace DataSharing.Host.Controllers.Police110
                                  .WhereIF(!string.IsNullOrEmpty(sendData.StartDate), p => p.WarehousingTime >= Convert.ToDateTime(sendData.StartDate))
                                  .WhereIF(!string.IsNullOrEmpty(sendData.EndDate), p => p.WarehousingTime <= Convert.ToDateTime(sendData.EndDate))
                                  .WhereIF(!string.IsNullOrEmpty(sendData.AlarmReceiptNumber), p => p.AlarmReceiptNumber == sendData.AlarmReceiptNumber)
-                                 .Where(p => p.DisposalType == sendData.DisposalType).Select(p => new ChainDeal_DCJTNewDto
+                               //  .Where(p => p.DisposalType == sendData.DisposalType)
+                                 .WhereIF(!string.IsNullOrEmpty(sendData.DisposalType)&& sendData.DisposalType=="1",p=> sendData.DisposalType.Contains(p.DisposalType))
+                                 .Select(p => new ChainDeal_DCJTNewDto
                                  {
                                      JJDBH = p.AlarmReceiptNumber,
                                      FKSJ = p.FeedbackTime,
@@ -549,8 +552,8 @@ namespace DataSharing.Host.Controllers.Police110
                                      HANDLEBMNAME = p.ReturnUnit,
                                      HANDLEOPINION = p.ReturnOpinion,
                                      HANDLETIME = p.ReturnTime,
-                                     CZLX = p.DisposalType.ToString(),
-                                     DYYY = "请求成功"
+                                     CZLX = p.DisposalType,
+                                     DYYY = p.CreatorName
                                  })
                                  .OrderBy(p => p.TSSJ)
                                  .Take(50)

+ 1 - 1
src/DataSharing.Host/config/appsettings.Development.json

@@ -102,7 +102,7 @@
 
   //地市系统配置
   "SharingConfiguration": {
-    "CityCode": "511500", //系统市州编码 
+    "CityCode": "510300", //系统市州编码 
     "CityName": "宜宾市", //系统市州名称
     "HotlineName": "宜宾12345",
     "ProvinceOrgCode": "001171", //省12345平台部门Code

+ 126 - 14
src/DataSharing.Police110/DCJT110/DcjtService.cs

@@ -59,6 +59,10 @@ namespace DataSharing.Police110.DCJT110
             }
             //  var registerNo = string.IsNullOrEmpty(orderDto.AcceptorId) == true ? "1001" : 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,
@@ -69,16 +73,16 @@ namespace DataSharing.Police110.DCJT110
                 CallPoliceName = orderDto.FromName,
                 PhoneNumber = orderDto.Contact,
                 CallPoliceContent = Content,
-                PoliceTypeCode = "07240400",
-                PoliceTypeName = "人民调解、社区矫正、基层法律服务和帮教",
+                PoliceTypeCode = policeTypeCode,
+                PoliceTypeName = orderDto.HotspotSpliceName,
                 JurisdictionalUnitCode = config.GXDWDM,
                 JurisdictionalUnitName = config.GXDWMC,
                 JurisdictionalUnitNumber = config.GXDWDH,
-                AlarmReceivingUnitCode = "12345",
-                AlarmReceivingUnitName = "12345热线中心",
+                AlarmReceivingUnitCode = "510300010000",
+                AlarmReceivingUnitName = "四川省自贡市公安局指挥中心",
                 CallPoliceTime = Convert.ToDateTime(orderDto.CreationTime),
                 PushTime = DateTime.Now,
-                AlarmReceptionType = "1",
+                AlarmReceptionType = "0",
                 AreaCode = orderDto.AreaCode.Substring(0, 6),
                 CallPoliceAddress = orderDto.FullAddress,
                 OrderId = orderDto.Id
@@ -94,8 +98,8 @@ namespace DataSharing.Police110.DCJT110
 
             if (string.IsNullOrEmpty(policeSend.AlarmReceiptNumber))
             {
-                policeSend.AlarmReceiptNumber = areaCodeDefu + "12345" + orderDto.No;
-                policeSend.SerialNumber = areaCodeDefu + "12345" + orderDto.No;
+                policeSend.AlarmReceiptNumber = areaCodeDefu + "1234512345" + orderDto.No;
+                policeSend.SerialNumber = areaCodeDefu + "1234512345" + orderDto.No;
             }
 
             //修改外部唯一ID
@@ -107,7 +111,7 @@ namespace DataSharing.Police110.DCJT110
             }
 
             //查询是否有此工单,如果没有新增此工单
-            var data = await _policeSendChainAlarmDcjtRepository.GetAsync(p => p.OrderId == orderDto.Id, cancellationToken);
+            var data = await _policeSendChainAlarmDcjtRepository.GetAsync(p => p.OrderId == orderDto.Id && p.AlarmReceptionType == "1", cancellationToken);
             if (data == null)
                 await _policeSendChainAlarmDcjtRepository.AddAsync(policeSend, cancellationToken);
         }
@@ -119,7 +123,7 @@ namespace DataSharing.Police110.DCJT110
         /// <returns></returns>
         public async Task InitPoliceSendChainDealAsync(OrderFlowDto dto, CancellationToken cancellationToken)
         {
-            var data = await _policeSendChainDealDcjtRepository.GetAsync(p => p.OrderId == dto.Order.Id && p.DisposalType == (int)EDsDisposalType.OrderFiled, cancellationToken);
+            var data = await _policeSendChainDealDcjtRepository.GetAsync(p => p.OrderId == dto.Order.Id && p.DisposalType == "1", cancellationToken);
             var actualOpinion = dto.Order.ActualOpinion.Length > 1500 ? dto.Order.ActualOpinion.Substring(0, 1500) : dto.Order.ActualOpinion;
             var feedbackPersonNumber = "10001";
             if (!string.IsNullOrEmpty(dto.Order.AcceptorStaffNo))
@@ -147,7 +151,7 @@ namespace DataSharing.Police110.DCJT110
                     FeedbackUnitCode = actualHandleOrgCode,
                     FeedbackUnitName = dto.Order.ActualHandleOrgName,
                     WarehousingTime = DateTime.Now,
-                    DisposalType = 1,
+                    DisposalType = "1",
                     OrderId = dto.Order.Id
                 };
                 await _policeSendChainDealDcjtRepository.AddAsync(data, cancellationToken);
@@ -175,7 +179,7 @@ namespace DataSharing.Police110.DCJT110
         /// <returns></returns>
         public async Task ReturnPoliceAsync(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken)
         {
-            var checkData = await _policeSendChainDealDcjtRepository.AnyAsync(p => p.AlarmReceiptNumber == orderDto.ExternalId && p.DisposalType == (int)EDsDisposalType.Return, cancellationToken);
+            var checkData = await _policeSendChainDealDcjtRepository.AnyAsync(p => p.AlarmReceiptNumber == orderDto.ExternalId && p.DisposalType == "2", cancellationToken);
             if (!checkData)
             {
                 var actualOpinion = orderDto.ActualOpinion.Length > 100 ? orderDto.ActualOpinion.Substring(0, 80) : orderDto.ActualOpinion;
@@ -188,7 +192,7 @@ namespace DataSharing.Police110.DCJT110
                     ReturnOpinion = actualOpinion,
                     ReturnTime = orderDto.ActualHandleTime,
                     WarehousingTime = DateTime.Now,
-                    DisposalType = 2
+                    DisposalType = "2"
                 };
                 await _policeSendChainDealDcjtRepository.AddAsync(dataPolice, cancellationToken);
             }
@@ -208,7 +212,7 @@ namespace DataSharing.Police110.DCJT110
                 "4" or "5" => "1",
                 _ => "2",
             };
-            var checkData = await _policeSendChainDealDcjtRepository.GetAsync(p => p.AlarmReceiptNumber == dto.Order.ExternalId && p.DisposalType == (int)EDsDisposalType.Visit, cancellationToken);
+            var checkData = await _policeSendChainDealDcjtRepository.GetAsync(p => p.AlarmReceiptNumber == dto.Order.ExternalId && p.DisposalType == "3", cancellationToken);
             string visitRemark = "默认评价";
             if (!string.IsNullOrEmpty(dto.VisitRemark))
             {
@@ -223,7 +227,8 @@ namespace DataSharing.Police110.DCJT110
                     CheckingContent = visitRemark,
                     VisitContent = visitRemark,
                     VisitResult = VisitResult,
-                    DisposalType = 3
+                    DisposalType = "3",
+                    CreatorName = dto.VisitName
                 };
                 await _policeSendChainDealDcjtRepository.AddAsync(checkData, cancellationToken);
             }
@@ -234,9 +239,116 @@ namespace DataSharing.Police110.DCJT110
                 checkData.CheckingContent = visitRemark;
                 checkData.VisitContent = visitRemark;
                 checkData.VisitResult = VisitResult;
+                checkData.CreatorName = dto.VisitName;
                 await _policeSendChainDealDcjtRepository.UpdateAsync(checkData, cancellationToken);
             }
         }
 
+        /// <summary>
+        /// 签收状态
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        public async Task SingForPoliceAsync(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken)
+        {
+            var checkData = await _policeSendChainDealDcjtRepository.AnyAsync(p => p.AlarmReceiptNumber == orderDto.ExternalId && p.DisposalType == "4", cancellationToken);
+            if (!checkData)
+            {
+                var dataPolice = new DsPoliceSendChainDealDcjt()
+                {
+                    OrderId = orderDto.Id,
+                    AlarmReceiptNumber = orderDto.ExternalId,
+                    DisposalType = "4",
+                    WarehousingTime = DateTime.Now,
+                };
+                await _policeSendChainDealDcjtRepository.AddAsync(dataPolice, cancellationToken);
+            }
+        }
+
+        /// <summary>
+        /// 结果签收
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        public async Task FileEndPoliceAsync(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken)
+        {
+            var checkData = await _policeSendChainDealDcjtRepository.AnyAsync(p => p.AlarmReceiptNumber == orderDto.ExternalId && p.DisposalType == "5", cancellationToken);
+            if (!checkData)
+            {
+                var dataPolice = new DsPoliceSendChainDealDcjt()
+                {
+                    OrderId = orderDto.Id,
+                    AlarmReceiptNumber = orderDto.ExternalId,
+                    DisposalType = "5",
+                    WarehousingTime = DateTime.Now,
+                };
+                await _policeSendChainDealDcjtRepository.AddAsync(dataPolice, cancellationToken);
+            }
+        }
+
+        /// <summary>
+        /// 给110推送行政审批工单(自贡独有)
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <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()
+            {
+                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.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);
+        }
     }
 }

+ 1 - 1
src/DataSharing.Police110/DCJT110/DsPoliceSendChainDealDcjt.cs

@@ -117,7 +117,7 @@ namespace DataSharing.Police110.DCJT110
         /// 处置类型 1正常 2退回 3回访 4警情签收状态 5是结果签收状态  
         /// </summary>
         [SugarColumn(ColumnDescription = "处置类型")]
-        public int DisposalType { get; set; }
+        public string? DisposalType { get; set; }
 
         /// <summary>
         /// 入库时间

+ 32 - 1
src/DataSharing.Police110/DaoShu110/DaoShuService.cs

@@ -42,7 +42,6 @@ namespace DataSharing.Police110.DaoShu110
             _sharingConfigurationManager = sharingConfigurationManager;
         }
 
-
         /// <summary>
         /// 组装110数据,12345警情工单推送到110
         /// </summary>
@@ -235,5 +234,37 @@ namespace DataSharing.Police110.DaoShu110
             }
         }
 
+        /// <summary>
+        /// 签收状态
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        public async Task FileEndPoliceAsync(OrderDto orderDto, CancellationToken cancellationToken)
+        {
+
+        }
+
+        /// <summary>
+        /// 结果签收
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        public async Task SingForPoliceAsync(OrderDto orderDto, CancellationToken cancellationToken)
+        {
+
+        }
+
+        /// <summary>
+        /// 给110推送行政审批工单(自贡独有)
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        public async Task InitPoliceAdministrativeApproval(OrderDto orderDto, CancellationToken cancellationToken)
+        {
+
+        }
     }
 }

+ 23 - 0
src/DataSharing.Police110/IPoliceService.cs

@@ -33,5 +33,28 @@ namespace DataSharing.Police110
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
         Task Visit(PublishVisitDto dto, CancellationToken cancellationToken);
+
+        /// <summary>
+        /// 签收状态
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        Task SingForPoliceAsync(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken);
+
+        /// <summary>
+        /// 结果签收
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        Task FileEndPoliceAsync(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken);
+
+        /// <summary>
+        /// 给110推送行政审批工单(自贡独有)
+        /// </summary>
+        /// <param name="orderDto"></param>
+        /// <returns></returns>
+        Task InitPoliceAdministrativeApproval(Hotline.Share.Dtos.Order.OrderDto orderDto, CancellationToken cancellationToken);
     }
 }

+ 1 - 1
src/DataSharing.Share/Dtos/Police110/DCJT110/SendData.cs

@@ -26,6 +26,6 @@ namespace DataSharing.Share.Dtos.Police110.DCJT110
         /// 处置类型 1正常 2退回 3回访 4警情签收状态 5是结果签收状态  
         /// </summary>
         [JsonPropertyName("CZLX")]
-        public int DisposalType { get; set; } = 1;
+        public string DisposalType { get; set; } = "1";
     }
 }