Ejemplo n.º 1
0
 public ActionResult Refuse(string keyvalue, int type)
 {
     if (type == 0)
     {//拜访车辆(有车)
         VisitcarEntity car = visitcarbll.GetEntity(keyvalue);
         car.State = 99;
         visitcarbll.SaveForm(keyvalue, car);
     }
     else if (type == 3)
     {//拜访人员
         CarUserEntity car = CarUserbll.GetEntity(keyvalue);
         car.State = 99;
         CarUserbll.SaveForm(keyvalue, car, null);
     }
     else if (type == 1)
     {//物料车
         OperticketmanagerBLL    obll = new OperticketmanagerBLL();
         OperticketmanagerEntity op   = obll.GetEntity(keyvalue);
         op.ExamineStatus = 99;
         obll.SaveForm(keyvalue, op);
     }
     else
     {//2危化品车
         HazardouscarBLL    hbll = new HazardouscarBLL();
         HazardouscarEntity ha   = hbll.GetEntity(keyvalue);
         ha.State = 99;
         hbll.Update(keyvalue, ha);
     }
     return(Success("操作成功。"));
 }
        /// <summary>
        /// 完善司机信息
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity1"></param>
        /// <returns></returns>
        public ActionResult SaveDriverInfo(string keyValue, OperticketmanagerEntity entity1)
        {
            try
            {
                OperticketmanagerEntity entity = new OperticketmanagerBLL().GetEntity(keyValue);
                if (entity != null)
                {
                    entity.DriverName    = entity1.DriverName;
                    entity.DriverTel     = entity1.DriverTel;
                    entity.ExamineStatus = 1;
                    entity.JsImgpath     = entity1.JsImgpath;
                    entity.ISwharf       = entity1.ISwharf;
                    entity.XsImgpath     = entity1.XsImgpath;
                    entity.IdentitetiImg = entity1.IdentitetiImg;
                    entity.HzWeight      = entity1.HzWeight;
                    //new OperticketmanagerBLL().SaveForm(keyValue, entity);
                }


                return(Success("操作成功。"));
            }
            catch (Exception)
            {
                return(Success("操作失败!"));
            }
        }
Ejemplo n.º 3
0
        public ActionResult UpateOutTime(string keyValue, OperticketmanagerEntity entity)
        {
            var data = operticketmanagerbll.GetEntity(keyValue);

            if (data != null)
            {
                if (data.OutDate == null)
                {
                    UpdateCalculate(keyValue);
                    if (data.ShipLoading == 0)
                    {
                        data.OutDate = DateTime.Now;
                        data.LetMan  = OperatorProvider.Provider.Current().UserName;
                    }
                    //SaveDailyRecord(data, "打印");
                }
                data.OutDatabasetime = DateTime.Now;
                //else SaveDailyRecord(data, "再次打印");
                data.ExamineStatus = 4;
                data.OrderNum      = 1;
                if (data.Getdata != null)
                {
                    System.TimeSpan t1 = DateTime.Parse(data.OutDate.ToString()) - DateTime.Parse(data.Getdata.ToString());
                    data.StayTime  = t1.TotalMinutes;
                    data.DbOutTime = data.RCdbTime = null;
                }
                operticketmanagerbll.SaveForm(keyValue, data);
            }
            return(Success("操作成功。", data));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 保存工作日志
        /// </summary>
        /// <param name="data"></param>
        /// <param name="type"></param>
        public void SaveDailyRecord(OperticketmanagerEntity data, string type)
        {
            DailyrRecordEntity entity = new DailyrRecordEntity();

            entity.Content  = data.Transporttype;
            entity.WorkType = 2;
            entity.Theme    = type;
            operticketmanagerbll.InsetDailyRecord(entity);
        }
Ejemplo n.º 5
0
        public ActionResult CarOut(string keyValue, string Note, int type, List <PersongpsEntity> pergps)
        {
            //根据危化品类型添加二级节点
            var    data = dataItemDetailBLL.GetDataItemListByItemCode("'SocketUrl'");
            string IP   = "";
            int    Port = 0;

            foreach (var item in data)
            {
                if (item.ItemName == "IP")
                {
                    IP = item.ItemValue;
                }
                else if (item.ItemName == "Port")
                {
                    Port = Convert.ToInt32(item.ItemValue);
                }
            }
            visitcarbll.CarOut(keyValue, Note, type, pergps);
            CarAlgorithmEntity Car = new CarAlgorithmEntity();

            Car.ID    = keyValue;
            Car.State = 1;
            SocketHelper.SendMsg(Car.ToJson(), IP, Port);

            DataItemDetailBLL pdata = new DataItemDetailBLL();
            string            key   = string.Empty;       // "21049470";
            string            sign  = string.Empty;       // "4gZkNoh3W92X6C66Rb6X";
            var pitem = pdata.GetItemValue("Hikappkey");  //海康服务器密钥
            var url   = pdata.GetItemValue("HikBaseUrl"); //海康服务器地址

            if (!string.IsNullOrEmpty(pitem))
            {
                key  = pitem.Split('|')[0];
                sign = pitem.Split('|')[1];
            }

            if (type == 0)
            {
                VisitcarEntity car = visitcarbll.GetEntity(keyValue);
                HikOut(url, key, sign, car.CarNo);
            }
            else if (type == 1)
            {
                OperticketmanagerBLL    obll = new OperticketmanagerBLL();
                OperticketmanagerEntity op   = obll.GetEntity(keyValue);
                HikOut(url, key, sign, op.Platenumber);
            }
            else if (type == 2)
            {
                HazardouscarBLL    hbll = new HazardouscarBLL();
                HazardouscarEntity ha   = hbll.GetEntity(keyValue);
                HikOut(url, key, sign, ha.CarNo);
            }
            return(Success("操作成功。"));
        }
Ejemplo n.º 6
0
        public ActionResult SaveImg(string keyValue, OperticketmanagerEntity entity)
        {
            var data = operticketmanagerbll.GetEntity(keyValue);

            if (data != null)
            {
                operticketmanagerbll.SaveForm(keyValue, data);
            }
            return(Success("操作成功。"));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 改变GPS绑定信息
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity"></param>
        /// <param name="pgpslist"></param>
        public void WlChangeGps(string keyValue, OperticketmanagerEntity entity)
        {
            //开始事物
            var res = DbFactory.Base().BeginTrans();

            try
            {
                //将该车1小时内的打卡记录都变为已进场
                Repository <OperticketmanagerEntity> inlogdb = new Repository <OperticketmanagerEntity>(DbFactory.Base());
                OperticketmanagerEntity old = inlogdb.FindEntity(keyValue);
                bool isupdate = false;//是否修改
                if (old.GpsId != entity.GpsId)
                {
                    isupdate = true;
                }
                old.GpsId   = entity.GpsId;
                old.GpsName = entity.GpsName;
                old.Modify(keyValue);
                if (old.ExamineStatus == 1)
                {
                    old.ExamineStatus = 2;


                    CargpsEntity cgps = new CargpsEntity();
                    cgps.AID     = old.ID;
                    cgps.CarNo   = old.Platenumber;
                    cgps.GpsId   = old.GpsId;
                    cgps.GpsName = old.GpsName;
                    cgps.Status  = 0;
                    cgps.Type    = 1;
                    cgps.Create();
                    res.Insert <CargpsEntity>(cgps);
                }
                else
                {
                    if (isupdate)
                    {
                        Repository <CargpsEntity> Carinlogdb = new Repository <CargpsEntity>(DbFactory.Base());
                        CargpsEntity Car = Carinlogdb.IQueryable(it => it.AID == old.ID && it.Status == 0).FirstOrDefault();
                        Car.GpsId   = old.GpsId;
                        Car.GpsName = old.GpsName;
                        Car.Modify(Car.ID);
                        res.Update <CargpsEntity>(Car);
                    }
                }
                res.Update <OperticketmanagerEntity>(old);
                res.Commit();
            }
            catch (Exception ex)
            {
                res.Rollback();
                throw ex;
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, OperticketmanagerEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 9
0
        public ActionResult UpateStatus(string keyValue, OperticketmanagerEntity entity)
        {
            var data = operticketmanagerbll.GetEntity(keyValue);

            if (data != null)
            {
                data.Isdelete      = 0;
                data.DeleteContent = entity.DeleteContent;
                operticketmanagerbll.SaveForm(keyValue, data);
            }
            return(Success("操作成功。"));
        }
Ejemplo n.º 10
0
        public ActionResult SaveForm(string keyValue, OperticketmanagerEntity entity)
        {
            var data = operticketmanagerbll.GetEntity(keyValue);

            if (data != null)
            {
                data.Remark = entity.Remark;
                operticketmanagerbll.SaveForm(keyValue, data);
                SaveDailyRecord(data, "修改");
            }
            return(Success("操作成功。"));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 自动生成装船开票单
        /// </summary>
        /// <param name="originalEntity"></param>
        private CalculateEntity AutoGenerateTicket(OperticketmanagerEntity originalEntity)
        {
            OperticketmanagerEntity newEntity = new OperticketmanagerEntity()
            {
                CreateUserId       = originalEntity.CreateUserId,
                CreateUserName     = originalEntity.CreateUserName,
                Createuserdeptid   = originalEntity.Createuserdeptid,
                CreateUserDeptCode = originalEntity.CreateUserDeptCode,
                CreateUserOrgCode  = originalEntity.CreateUserOrgCode,
                CreateDate         = DateTime.Now,
                Getdata            = DateTime.Now,
                Producttype        = originalEntity.Producttype,
                ProducttypeId      = originalEntity.ProducttypeId,
                Platenumber        = originalEntity.Platenumber,
                DriverName         = originalEntity.DriverName,
                DriverTel          = originalEntity.DriverTel,
                Dress         = originalEntity.Dress,
                Takegoodsname = originalEntity.Takegoodsname,
                Takegoodsid   = originalEntity.Takegoodsid,
                Supplyname    = originalEntity.Supplyname,
                Supplyid      = originalEntity.Supplyid,
                Opername      = originalEntity.Opername,
                Operaccount   = originalEntity.Operaccount,
                Transporttype = originalEntity.Transporttype,
                Isdelete      = 1,
                Remark        = originalEntity.Remark,
                PassRemark    = originalEntity.PassRemark,
                IsFirst       = "是",
                Status        = originalEntity.Status,
                ExamineStatus = 0,
                Weight        = 0,
                ISwharf       = originalEntity.ISwharf,
                TravelStatus  = originalEntity.TravelStatus,
                TemplateSort  = originalEntity.TemplateSort,
                ShipLoading   = originalEntity.ShipLoading
            };

            new OperticketmanagerService().SaveForm(string.Empty, newEntity);


            CalculateEntity returnEntity = new CalculateEntity()
            {
                BaseId        = newEntity.ID,
                Numbers       = newEntity.Numbers,
                DataType      = "4",
                Takegoodsname = newEntity.Takegoodsname,
                Goodsname     = newEntity.Producttype,
                Platenumber   = newEntity.Platenumber,
            };

            return(returnEntity);
        }
Ejemplo n.º 12
0
        public ActionResult UpateStatus(string keyValue, OperticketmanagerEntity entity)
        {
            var data = operticketmanagerbll.GetEntity(keyValue);

            if (data != null)
            {
                data.Isdelete   = 0;
                data.PassRemark = entity.PassRemark;
                operticketmanagerbll.SaveForm(keyValue, data);
                RemoveCarpermission(data.Platenumber);
                SaveDailyRecord(data, "删除");
            }
            return(Success("操作成功。"));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 增加一个违章接口
        /// </summary>
        public void AddViolation(string id, int type, int ViolationType, string ViolationMsg)
        {
            CarviolationEntity entity = new CarviolationEntity();

            //0为电厂班车 1为私家车 2为商务公车 3为拜访车辆 4为物料车辆 5为危化品车辆
            switch (type)
            {
            case 0:
            case 1:
            case 2:
                Repository <CarinfoEntity> inlogdbC = new Repository <CarinfoEntity>(DbFactory.Base());
                CarinfoEntity car = inlogdbC.FindEntity(id);
                entity.CardNo = car.CarNo;
                entity.Dirver = car.Dirver;
                entity.Phone  = car.Phone;
                break;

            case 3:
                Repository <VisitcarEntity> inlogdbv = new Repository <VisitcarEntity>(DbFactory.Base());
                VisitcarEntity oldv = inlogdbv.FindEntity(id);
                entity.CardNo = oldv.CarNo;
                entity.Dirver = oldv.Dirver;
                entity.Phone  = oldv.Phone;
                break;

            case 4:
                Repository <OperticketmanagerEntity> inlogdbo = new Repository <OperticketmanagerEntity>(DbFactory.Base());
                OperticketmanagerEntity oldo = inlogdbo.FindEntity(id);
                entity.CardNo = oldo.Platenumber;
                entity.Dirver = oldo.DriverName;
                entity.Phone  = oldo.DriverTel;
                break;

            case 5:
                Repository <HazardouscarEntity> inlogdb = new Repository <HazardouscarEntity>(DbFactory.Base());
                HazardouscarEntity old = inlogdb.FindEntity(id);

                entity.CardNo = old.CarNo;
                entity.Dirver = old.Dirver;
                entity.Phone  = old.Phone;
                break;
            }
            entity.CarType       = type;
            entity.CID           = id;
            entity.ViolationType = ViolationType;
            entity.ViolationMsg  = ViolationMsg;
            entity.IsProcess     = 0;
            entity.Create();
            this.BaseRepository().Insert(entity);
        }
Ejemplo n.º 14
0
        public ActionResult SaveForm(string keyValue, OperticketmanagerEntity entity)
        {
            operticketmanagerbll.SaveForm(keyValue, entity);

            #region 修改时更新称重记录信息
            if (!string.IsNullOrEmpty(keyValue))
            {//该开票记录是否已有称重记录信息
                string    sql = string.Format("select id from wl_calculate d where d.baseid='{0}' and d.isdelete='1'", keyValue);
                DataTable dt  = operticketmanagerbll.GetDataTable(sql);
                if (dt.Rows.Count > 0)
                {
                    var data = calculatebll.GetEntity(dt.Rows[0][0].ToString());
                    if (data != null)
                    {
                        data.Platenumber   = entity.Platenumber;
                        data.Takegoodsid   = entity.Takegoodsid;
                        data.Takegoodsname = entity.Takegoodsname;
                        data.Transporttype = entity.Transporttype;
                        data.Goodsname     = entity.Producttype;
                        calculatebll.SaveForm(data.ID, data);
                    }
                }
            }
            #endregion

            //日志
            if (string.IsNullOrEmpty(keyValue))
            {
                SaveDailyRecord(entity, "新增");
                BindGPSEquipment(entity);
            }
            else
            {
                SaveDailyRecord(entity, "修改");
            }
            return(Success("操作成功。", entity.ID));
        }
Ejemplo n.º 15
0
        public ActionResult UpateContent(string keyValue, OperticketmanagerEntity entity)
        {
            var data = operticketmanagerbll.GetEntity(keyValue);

            if (data != null)
            {
                data.PassRemark = entity.PassRemark;
                data.LetMan     = entity.LetMan;
                if (string.IsNullOrEmpty(entity.Status))
                {
                    data.Status     = "正常";
                    data.PassRemark = data.PassRemark + "(正常放行)";
                }
                operticketmanagerbll.SaveForm(keyValue, data);
                if (!data.OutDate.HasValue)
                {
                    UpateOutTime(keyValue, data);//异常放行相当于车辆出厂
                }
                RemoveCarpermission(data.Platenumber);
                ReleaseGPSEquipment(keyValue);
            }

            return(Success("操作成功。", data));
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 车辆出厂
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="Note"></param>
        /// <param name="type"></param>
        public void CarOut(string keyValue, string Note, int type, List <PersongpsEntity> pergps)
        {
            //开始事物
            var res = DbFactory.Base().BeginTrans();

            try
            {
                List <CarUserFileImgEntity>       dellist   = new List <CarUserFileImgEntity>();//离场
                Repository <CarUserFileImgEntity> caruserdb = new Repository <CarUserFileImgEntity>(DbFactory.Base());
                if (type == 0)
                {//拜访车辆
                    Repository <VisitcarEntity> inlogdb = new Repository <VisitcarEntity>(DbFactory.Base());
                    VisitcarEntity old = inlogdb.FindEntity(keyValue);
                    //old.OutTime = DateTime.Now;
                    //old.State = 4;
                    old.Issubmit = 1;
                    old.Note     = Note;
                    old.Modify(old.ID);
                    Repository <PersongpsEntity> pgpsinlogdb = new Repository <PersongpsEntity>(DbFactory.Base());
                    List <PersongpsEntity>       pgps        = pgpsinlogdb.IQueryable(it => it.VID == keyValue && it.State == 0).ToList();
                    foreach (PersongpsEntity item in pergps)
                    {
                        if (item.UserName == "车辆" && item.State == 1)
                        {//车辆出厂但跟随人员部分未出厂
                            old.Issubmit = 2;
                            //List<PersongpsEntity> list = pgpsinlogdb.IQueryable(it => it.VID == keyValue && it.State == 0).ToList();
                            //if (list.Count == 0)
                            //{//子表所有人员都出厂修改主表出厂状态
                            //    old.OutTime = DateTime.Now;
                            //    old.State = 4;
                            //}
                        }
                        else
                        {//人员
                            PersongpsEntity entity = pgpsinlogdb.FindEntity(item.ID);
                            if (entity != null)
                            {
                                entity.Issubmit = 1;
                                entity.State    = item.State;
                                entity.Modify(item.ID);
                                if (item.State == 1)
                                {
                                    entity.OutTime = DateTime.Now;
                                    var carentity = caruserdb.IQueryable(it => it.Baseid == keyValue && it.Username == entity.UserName).ToList();
                                    dellist.AddRange(carentity);
                                }
                                pgps.Add(entity);
                            }
                        }
                        if (pergps.Where(t => t.State == 1).ToList().Count == pergps.Count)
                        {//子表所有人员都出厂修改主表出厂状态
                            old.OutTime = DateTime.Now;
                            old.State   = 4;
                        }
                    }
                    res.Update <VisitcarEntity>(old);
                    res.Update <PersongpsEntity>(pgps);
                }
                else if (type == 1)
                {
                    //将该车1小时内的打卡记录都变为已进场
                    Repository <OperticketmanagerEntity> inlogdb = new Repository <OperticketmanagerEntity>(DbFactory.Base());
                    OperticketmanagerEntity old = inlogdb.FindEntity(keyValue);
                    old.ExamineStatus = 4;
                    old.OutDate       = DateTime.Now;
                    old.PassRemark    = Note;
                    old.Modify(old.ID);
                    res.Update <OperticketmanagerEntity>(old);
                }
                else
                {//危化品车辆
                    //将该车1小时内的打卡记录都变为已进场
                    Repository <HazardouscarEntity> inlogdb = new Repository <HazardouscarEntity>(DbFactory.Base());
                    HazardouscarEntity old = inlogdb.FindEntity(keyValue);
                    //old.OutTime = DateTime.Now;
                    //old.State = 4;
                    old.Note     = Note;
                    old.Issubmit = 1;
                    old.Modify(old.ID);
                    Repository <PersongpsEntity> pgpsinlogdb = new Repository <PersongpsEntity>(DbFactory.Base());
                    List <PersongpsEntity>       pgps        = new List <PersongpsEntity>();
                    foreach (PersongpsEntity item in pergps)
                    {
                        if (item.UserName == "车辆" && item.State == 1)
                        {//车辆出厂但跟随人员部分未出厂
                            old.Issubmit = 2;
                        }
                        else
                        {//人员
                            PersongpsEntity entity = pgpsinlogdb.FindEntity(item.ID);
                            if (entity != null)
                            {
                                entity.Issubmit = 1;
                                entity.State    = item.State;
                                entity.Modify(item.ID);
                                if (item.State == 1)
                                {
                                    entity.OutTime = DateTime.Now;
                                    var carentity = caruserdb.IQueryable(it => it.Baseid == keyValue && it.Username == entity.UserName).ToList();
                                    dellist.AddRange(carentity);
                                }
                                pgps.Add(entity);
                            }
                        }
                        if (pergps.Where(t => t.State == 1).ToList().Count == pergps.Count)
                        {//子表所有人员都出厂修改主表出厂状态
                            old.OutTime = DateTime.Now;
                            old.State   = 4;
                        }
                    }
                    res.Update <HazardouscarEntity>(old);
                    res.Update <PersongpsEntity>(pgps);
                }
                Repository <CargpsEntity> cgpsinlogdb = new Repository <CargpsEntity>(DbFactory.Base());
                List <CargpsEntity>       cgps        = cgpsinlogdb.IQueryable(it => it.AID == keyValue && it.Status == 0).ToList();
                if (cgps.Count > 0)
                {
                    for (int i = 0; i < cgps.Count; i++)
                    {
                        cgps[i].Status  = 1;
                        cgps[i].EndTime = DateTime.Now;
                        cgps[i].Modify(cgps[i].ID);
                    }
                    res.Update <CargpsEntity>(cgps);
                }

                //车辆违章记录处理
                Repository <CarviolationEntity> violinlogdb = new Repository <CarviolationEntity>(DbFactory.Base());
                List <CarviolationEntity>       violation   = violinlogdb.IQueryable(it => it.CID == keyValue && it.IsProcess == 0).ToList();
                if (violation.Count > 0)
                {
                    for (int i = 0; i < violation.Count; i++)
                    {
                        violation[i].IsProcess      = 1;
                        violation[i].ProcessMeasure = Note;
                        violation[i].Modify(violation[i].ID);
                    }
                    res.Update <CarviolationEntity>(violation);
                }

                res.Commit();
                DeleteUserHiK(dellist, 1);
            }
            catch (Exception ex)
            {
                res.Rollback();
                throw ex;
            }
        }
Ejemplo n.º 17
0
 public ActionResult SaveForm(string keyValue, OperticketmanagerEntity entity)
 {
     operticketmanagerbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }
Ejemplo n.º 18
0
        private void BindGPSEquipment(OperticketmanagerEntity entity)
        {
            #region 定位数据发送
            int    Port    = 0;
            string IP      = CacheFactory.Cache().GetCache <string>("SocketUrl:IP");
            string PostStr = CacheFactory.Cache().GetCache <string>("SocketUrl:Port");
            if (!string.IsNullOrEmpty(PostStr))
            {
                Port = Convert.ToInt32(PostStr);
            }
            if (string.IsNullOrEmpty(IP) || Port == 0)
            {
                var data = dataItemDetailBLL.GetDataItemListByItemCode("'SocketUrl'");
                foreach (var item in data)
                {
                    if (item.ItemName == "IP")
                    {
                        IP = item.ItemValue;
                        CacheFactory.Cache().WriteCache <string>(item.ItemValue, "SocketUrl:IP");
                    }
                    else if (item.ItemName == "Port")
                    {
                        Port = Convert.ToInt32(item.ItemValue);
                        CacheFactory.Cache().WriteCache <string>(item.ItemValue, "SocketUrl:Port");
                    }
                }
            }
            #endregion

            string key     = CacheFactory.Cache().GetCache <string>("Hik:key");  // "21049470";
            string sign    = CacheFactory.Cache().GetCache <string>("Hik:sign"); // "4gZkNoh3W92X6C66Rb6X";
            string baseUrl = CacheFactory.Cache().GetCache <string>("Hik:baseUrl");
            if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(key))
            {
                var pitem = dataItemDetailBLL.GetItemValue("Hikappkey");//海康服务器密钥
                if (!string.IsNullOrEmpty(pitem))
                {
                    key  = pitem.Split('|')[0];
                    sign = pitem.Split('|')[1];
                    CacheFactory.Cache().WriteCache <string>(key, "Hik:key");
                    CacheFactory.Cache().WriteCache <string>(sign, "Hik:sign");
                }
            }
            if (string.IsNullOrEmpty(baseUrl))
            {
                baseUrl = dataItemDetailBLL.GetItemValue("HikBaseUrl");//海康服务器地址
                CacheFactory.Cache().WriteCache <string>(baseUrl, "Hik:baseUrl");
            }

            string parkNames = "1号岗,二号地磅";
            entity.ExamineStatus = 3;
            if (!entity.Getdata.HasValue)
            {
                entity.Getdata = DateTime.Now;
            }

            operticketmanagerbll.SaveForm(entity.ID, entity);
            if (!string.IsNullOrEmpty(entity.GpsId))
            {
                CarAlgorithmEntity Car = new CarAlgorithmEntity();
                Car.CarNo   = entity.Platenumber;
                Car.GPSID   = entity.GpsId;
                Car.GPSName = entity.GpsName;
                Car.ID      = entity.ID;
                Car.State   = 0;
                Car.Type    = 4;
                if (entity.Transporttype == "提货")
                {
                    Car.LineName = entity.Dress + entity.Transporttype;
                    if (entity.ShipLoading == 1)
                    {
                        Car.LineName += "(码头)";
                        parkNames    += ",码头岗";
                    }
                }
                else
                {
                    if (entity.ShipLoading == 1)
                    {
                        Car.LineName = "物料转运(码头)";
                        parkNames   += ",码头岗";
                    }
                    else
                    {
                        Car.LineName = "转运(纯称重)";
                    }
                }
                SocketHelper.SendMsg(Car.ToJson(), IP, Port);
            }
            //车辆放行
            AddCarpermission(baseUrl, key, sign, entity.Platenumber, entity.DriverTel, entity.DriverName, parkNames);
        }
Ejemplo n.º 19
0
        public ActionResult ChangeState(string keyvalue, int type, int state)
        {
            //根据危化品类型添加二级节点
            #region 获取编码管理配置信息
            var    data = dataItemDetailBLL.GetDataItemListByItemCode("'SocketUrl'");
            string IP   = "";
            int    Port = 0;
            foreach (var item in data)
            {
                if (item.ItemName == "IP")
                {
                    IP = item.ItemValue;
                }
                else if (item.ItemName == "Port")
                {
                    Port = Convert.ToInt32(item.ItemValue);
                }
            }

            DataItemDetailBLL pdata = new DataItemDetailBLL();
            string            key   = string.Empty;         // "21049470";
            string            sign  = string.Empty;         // "4gZkNoh3W92X6C66Rb6X";
            var pitem   = pdata.GetItemValue("Hikappkey");  //海康服务器密钥
            var baseurl = pdata.GetItemValue("HikBaseUrl"); //海康服务器地址
            if (!string.IsNullOrEmpty(pitem))
            {
                key  = pitem.Split('|')[0];
                sign = pitem.Split('|')[1];
            }
            #endregion
            state++;
            if (type == 0)
            {//拜访车辆
                VisitcarEntity car = visitcarbll.GetEntity(keyvalue);
                car.State  = state;
                car.InTime = DateTime.Now;
                visitcarbll.SaveForm(keyvalue, car);
                CarAlgorithmEntity Car = new CarAlgorithmEntity();
                Car.CarNo     = car.CarNo;
                Car.GPSID     = car.GPSID;
                Car.GPSName   = car.GPSNAME;
                Car.ID        = car.ID;
                Car.Type      = 3;
                Car.State     = 0;
                Car.LineName  = car.LineName;
                Car.GoodsName = "";
                SocketHelper.SendMsg(Car.ToJson(), IP, Port);
                //车辆放行 (疫情期间此功能暂时屏蔽)
                //AddCarpermission(baseurl, key, sign, car.CarNo, car.Phone, car.Dirver);
                var baselist = CarUserbll.addUserJurisdiction(keyvalue, state, baseurl, key, sign);
                return(Content(baselist.ToJson()));
            }
            else if (type == 3)
            {//拜访人员
                CarUserEntity car = CarUserbll.GetEntity(keyvalue);
                car.State  = type;
                car.InTime = DateTime.Now;
                CarUserbll.SaveForm(keyvalue, car, null);
                //人员添加出入权限
                var baselist = CarUserbll.addUserJurisdiction(keyvalue, state, baseurl, key, sign);
                return(Content(baselist.ToJson()));
            }
            else if (type == 1)
            {//物料车辆
                string parkNames             = "1号岗,二号地磅";
                OperticketmanagerBLL    obll = new OperticketmanagerBLL();
                OperticketmanagerEntity op   = obll.GetEntity(keyvalue);
                op.ExamineStatus = state;
                if (state == 3)
                {
                    op.Getdata = DateTime.Now;
                }
                obll.SaveForm(keyvalue, op);
                CarAlgorithmEntity Car = new CarAlgorithmEntity();
                Car.CarNo   = op.Platenumber;
                Car.GPSID   = op.GpsId;
                Car.GPSName = op.GpsName;
                Car.ID      = op.ID;
                Car.State   = 0;
                Car.Type    = 4;
                string Dress = op.Dress;
                Car.GoodsName = Dress;
                int    ISwharf       = op.ISwharf;
                string Transporttype = op.Transporttype;
                if (Transporttype == "提货")
                {
                    Car.LineName = op.Dress + Transporttype;
                    if (ISwharf == 1)
                    {
                        Car.LineName += "(码头)";
                        parkNames    += ",码头岗";
                    }
                }
                else
                {
                    if (ISwharf == 1)
                    {
                        Car.LineName = "物料转运(码头)";
                        parkNames   += ",码头岗";
                    }
                    else
                    {
                        Car.LineName = "转运(纯称重)";
                    }
                }
                SocketHelper.SendMsg(Car.ToJson(), IP, Port);
                //车辆放行
                AddCarpermission(baseurl, key, sign, op.Platenumber, op.DriverName, op.DriverTel, parkNames);
                return(Success("操作成功。"));
            }
            else
            {//危化品车辆
                HazardouscarBLL    hbll = new HazardouscarBLL();
                HazardouscarEntity ha   = hbll.GetEntity(keyvalue);
                ha.State  = state;
                ha.InTime = DateTime.Now;
                hbll.Update(keyvalue, ha);
                CarAlgorithmEntity Car = new CarAlgorithmEntity();
                Car.CarNo     = ha.CarNo;
                Car.GPSID     = ha.GPSID;
                Car.GPSName   = ha.GPSNAME;
                Car.ID        = ha.ID;
                Car.Type      = 5;
                Car.State     = 0;
                Car.LineName  = ha.HazardousName;
                Car.GoodsName = ha.HazardousName;
                SocketHelper.SendMsg(Car.ToJson(), IP, Port);
                //车辆放行
                CarIn(baseurl, key, sign, ha.CarNo, ha.Phone, ha.Dirver);
                //人员添加出入权限
                var baselist = CarUserbll.addUserJurisdiction(keyvalue, state, baseurl, key, sign);
                return(Content(baselist.ToJson()));
            }
        }
Ejemplo n.º 20
0
        public string GetLastTicket(string plateNo)
        {
            OperticketmanagerEntity lastTicket = operticketmanagerbll.GetCar(plateNo);

            return(lastTicket.ToJson());
        }
Ejemplo n.º 21
0
 /// <summary>
 /// 改变GPS绑定信息
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="entity"></param>
 /// <param name="pgpslist"></param>
 public void WlChangeGps(string keyValue, OperticketmanagerEntity entity)
 {
     service.WlChangeGps(keyValue, entity);
 }
Ejemplo n.º 22
0
 public ActionResult WlSaveForm(string keyValue, OperticketmanagerEntity entity)
 {
     visitcarbll.WlChangeGps(keyValue, entity);
     return(Success("操作成功。"));
 }