public BasicResponse EndByLinkageId(EndByLinkageIdRequest request)
        {
            var models = _Repository.GetNotEndEmergencyLinkHistoryByLinkageId(request.Id);

            TransactionsManager.BeginTransaction(() =>
            {
                foreach (var item in models)
                {
                    if (item.EndTime != new DateTime(1900, 1, 1))
                    {
                        continue;
                    }

                    item.EndTime = request.EndTime;
                    _Repository.UpdateEmergencyLinkHistory(item);
                }
            });
            return(new BasicResponse());
        }
 public BasicResponse EndByLinkageId(EndByLinkageIdRequest request)
 {
     return(_EmergencyLinkageHistoryService.EndByLinkageId(request));
 }
Example #3
0
        /// <summary>结束之前的历史记录和call
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <param name="nowTime"></param>
        private static void EndLinkageHisAndCall(SysEmergencyLinkageInfo item, DateTime nowTime,
                                                 bool ifUpdateRealTimeValue)
        {
            //结束之前的历史记录
            var req12 = new EndByLinkageIdRequest
            {
                EndTime = nowTime,
                Id      = item.Id
            };

            EmergencyLinkHistoryService.EndByLinkageId(req12);

            //结束之前的rcall
            RCallInfoGetByMasterIDRequest req13 = new RCallInfoGetByMasterIDRequest();

            req13.CallType = 1;
            if (item.MasterModelId != "0")
            {
                req13.MasterId = item.MasterModelId;
            }
            else
            {
                req13.MasterId = item.Id;
            }

            var res13 = RcallService.GetRCallInfoByMasterID(req13);
            var req14 = new EndRcallByRcallInfoListEequest
            {
                RcallInfo = res13.Data
            };

            RcallService.EndRcallByRcallInfoList(req14);

            //结束之前的bcall
            BCallInfoGetByMasterIDRequest req15 = new BCallInfoGetByMasterIDRequest();

            req15.CallType = 1;
            if (item.MasterModelId != "0")
            {
                req15.MasterId = item.MasterModelId;
            }
            else
            {
                req15.MasterId = item.Id;
            }

            var res15 = BcallService.GetBCallInfoByMasterID(req15);
            var req16 = new EndBcallByBcallInfoListRequest
            {
                Info = res15.Data
            };

            BcallService.EndBcallByBcallInfoList(req16);

            if (ifUpdateRealTimeValue)
            {
                //更新实时状态
                var req10 = new UpdateRealTimeStateRequest
                {
                    LinkageId = item.Id,
                    State     = "0"
                };
                SysEmergencyLinkageService.UpdateRealTimeState(req10);
            }
        }
        public BasicResponse EndByLinkageId(EndByLinkageIdRequest request)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/EmergencyLinkHistory/EndByLinkageId?token=" + Token, JSONHelper.ToJSONString(request));

            return(JSONHelper.ParseJSONString <BasicResponse>(responseStr));
        }