예제 #1
0
 public Basic.Framework.Web.BasicResponse <List <Sys.Safety.DataContract.R_PersoninfInfo> > GetPersoninfCacheByBh(Sys.Safety.Request.R_Personinf.R_PersoninfGetByBhRequest personinfRequest)
 {
     return(_presonInfoService.GetPersoninfCacheByBh(personinfRequest));
 }
        /// <summary>
        /// 将R_Call转换成呼叫历史记录,并写入到R_PHJ表中
        /// </summary>
        /// <param name="tempCallInfo"></param>
        public void AddR_PHJInfo(R_CallInfo tempCallInfo)
        {
            //写呼叫历史记录
            R_PhjInfo r_phj = new R_PhjInfo();

            r_phj.Id       = Basic.Framework.Common.IdHelper.CreateLongId().ToString();
            r_phj.Hjlx     = 1;
            r_phj.Bh       = "0";
            r_phj.Yid      = "0";
            r_phj.PointId  = "0";
            r_phj.CallTime = DateTime.Now;
            r_phj.Tsycs    = 0;
            r_phj.State    = tempCallInfo.Type;
            r_phj.Type     = tempCallInfo.CallType;
            //修改,将呼叫卡号及设备写入明细表中
            //if (tempCallInfo.Type == 0)
            //{
            //    r_phj.Card = tempCallInfo.BhContent;
            //}
            //else
            //{
            //    r_phj.Card = tempCallInfo.PointList;
            //}
            r_phj.Username = tempCallInfo.CreateUserName;
            r_phj.IP       = tempCallInfo.CreateClientIP;
            r_phj.Timer    = DateTime.Now;
            r_phj.Flag     = 0;
            r_phj.SysFlag  = 0;
            r_phj.upflag   = "0";
            r_phj.By2      = tempCallInfo.Type.ToString();
            PhjAddRequest phjRequest = new PhjAddRequest();

            phjRequest.PhjInfo = r_phj;
            _R_PhjService.AddPhjToDB(phjRequest);
            //添加呼叫明细表  20180312
            if (tempCallInfo.BhContent != null && tempCallInfo.BhContent.Length > 0)
            {
                string[] bhList;
                if (tempCallInfo.BhContent.Contains("-"))
                {
                    int sBh = int.Parse(tempCallInfo.BhContent.Split('-')[0]);
                    int eBh = int.Parse(tempCallInfo.BhContent.Split('-')[1]);
                    bhList = new string[12];
                    int bhIndex = sBh;
                    for (int i = 0; i < 12; i++)
                    {
                        bhList[i] = bhIndex.ToString();
                        bhIndex++;
                    }
                }
                bhList = tempCallInfo.BhContent.Split(',');
                foreach (string bh in bhList)
                {
                    List <R_PersoninfInfo> tempPerson = _R_PersoninfService.GetPersoninfCacheByBh(new Sys.Safety.Request.R_Personinf.R_PersoninfGetByBhRequest()
                    {
                        Bh = bh
                    }).Data;
                    if (tempPerson.Count > 0)
                    {
                        //写入呼叫人员历史记录明细表中  20180312
                        _Repository.ExecuteNonQuery("global_R_PhjService_AddPhjPersonDetailToDB",
                                                    r_phj.Timer.ToString("yyyyMM"),
                                                    Basic.Framework.Common.IdHelper.CreateLongId().ToString(),
                                                    r_phj.Id,
                                                    tempPerson[0].Yid);
                    }
                }
            }
            if (tempCallInfo.PointList != null && tempCallInfo.PointList.Length > 0)
            {
                string[] pointList = tempCallInfo.PointList.Split(',');
                foreach (string point in pointList)
                {
                    PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();
                    PointDefineRequest.Point = point;
                    Jc_DefInfo tempPoint = _PersonPointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;
                    if (tempPoint != null)
                    {
                        //写入呼叫人员历史记录明细表中  20180312
                        _Repository.ExecuteNonQuery("global_R_PhjService_AddPhjPointDetailToDB",
                                                    r_phj.Timer.ToString("yyyyMM"),
                                                    Basic.Framework.Common.IdHelper.CreateLongId().ToString(),
                                                    r_phj.Id,
                                                    tempPoint.PointID);
                    }
                }
            }
        }