public ActionResult Index(string code)
        {
            U_WeChatUserID userInfo    = new U_WeChatUserID();
            string         accessToken = Common.WeChatPush.WeChatTools.GetAccessoken();
            string         userInfoStr = Common.WeChatPush.WeChatTools.GetUserInfoByCode(accessToken, code);

            userInfo = Common.JsonHelper.JsonToModel <U_WeChatUserID>(userInfoStr);//用户ID
            //userInfo.UserId = "18936495119";
            Business_Personnel_Information personInfoModel = _logic.GetUserInfo(userInfo.UserId);
            Personnel_Info      Personnel          = getPersonnelInfo(personInfoModel);
            Master_Organization organizationDetail = new Master_Organization();

            organizationDetail = _ol.GetOrganizationDetail(personInfoModel.OwnedFleet.ToString());
            Business_HomecomingSurvey bhs = _hsl.GetHomecomingSurvey(userInfo.UserId, DateTime.Now.Year.ToString());

            if (bhs == null)
            {
                bhs             = new Business_HomecomingSurvey();
                bhs.Name        = personInfoModel != null ? personInfoModel.Name : "";
                bhs.Year        = DateTime.Now.Year.ToString();
                bhs.CreatedUser = userInfo.UserId;
            }
            bhs.OrganizationName = organizationDetail.OrganizationName;
            if (Personnel != null)
            {
                bhs.Fleet        = Personnel.MotorcadeName;
                bhs.LicensePlate = Personnel.CabLicense;
            }
            return(View(bhs));
        }
Beispiel #2
0
        /// <summary>
        /// 通过vguid获取部门详细信息
        /// </summary>
        /// <param name="vguid"></param>
        /// <returns></returns>
        public JsonResult GetOrganizationDetail(string vguid)
        {
            Master_Organization organizationDetail = new Master_Organization();

            organizationDetail = _ol.GetOrganizationDetail(vguid);
            return(Json(organizationDetail, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult Index(string code)
        {
            U_WeChatUserID userInfo    = new U_WeChatUserID();
            string         accessToken = Common.WeChatPush.WeChatTools.GetAccessoken();
            string         userInfoStr = Common.WeChatPush.WeChatTools.GetUserInfoByCode(accessToken, code);

            userInfo = Common.JsonHelper.JsonToModel <U_WeChatUserID>(userInfoStr);//用户ID
            //userInfo.UserId = "18936495119";
            Business_Personnel_Information personInfoModel = _logic.GetUserInfo(userInfo.UserId);
            Personnel_Info      Personnel          = getPersonnelInfo(personInfoModel);
            Master_Organization organizationDetail = new Master_Organization();

            organizationDetail = _ol.GetOrganizationDetail(personInfoModel.OwnedFleet.ToString());

            Business_SurveyVaccination bsv = GetSurveyVaccination(userInfo.UserId);

            if (bsv == null)
            {
                bsv        = new Business_SurveyVaccination();
                bsv.Name   = personInfoModel != null ? personInfoModel.Name : "";
                bsv.UserID = userInfo.UserId;
            }
            //if (Personnel != null)
            //{
            //    bhs.Fleet = Personnel.MotorcadeName;
            //    bhs.LicensePlate = Personnel.CabLicense;
            //}
            return(View(bsv));
        }
        public JsonResult SaveCleaningInfo(string companyVGUID, string location, string type, string description, string code)
        {
            var model = new ActionResultModel <string>();
            var cm    = CacheManager <Business_Personnel_Information> .GetInstance()[PubGet.GetUserKey + code];

            var cabLicense = "";
            var cabOrgName = "";
            Master_Organization organizationDetail = new Master_Organization();

            organizationDetail = _ol.GetOrganizationDetail(cm.OwnedFleet.ToString());
            var manOrgName = organizationDetail.OrganizationName;

            using (SqlSugarClient _dbMsSql = SugarDao_MsSql.GetInstance2())
            {
                var manData = _dbMsSql.SqlQuery <Personnel_Info>(@"select Organization,CabLicense from [DZ_DW].[dbo].[Visionet_DriverInfo_View] 
                                where IdCard=@ID and status='1'", new { ID = cm.IDNumber }).FirstOrDefault();
                if (manData != null)
                {
                    cabLicense = manData.CabLicense;
                    cabOrgName = manData.Organization;
                }
            }
            using (SqlSugarClient _db = SugarDao_MsSql.GetInstance())
            {
                Business_SecondaryCleaning cleaning = new Business_SecondaryCleaning();
                cleaning.Vguid         = Guid.NewGuid();
                cleaning.Type          = type;
                cleaning.Description   = description;
                cleaning.Location      = location;
                cleaning.Personnel     = cm.UserID;
                cleaning.OperationDate = DateTime.Now;
                cleaning.CompanyVguid  = companyVGUID;
                cleaning.CouponType    = description;
                cleaning.CabLicense    = cabLicense;
                cleaning.CabOrgName    = cabOrgName;
                cleaning.ManOrgName    = manOrgName;
                cleaning.CreatedUser   = cm.Name;
                cleaning.CreatedDate   = DateTime.Now;
                cleaning.ChangeDate    = DateTime.Now;
                cleaning.ChangeUser    = cm.Name;
                model.isSuccess        = _db.Insert(cleaning, false) != DBNull.Value;
                model.respnseInfo      = model.isSuccess == true?cleaning.CreatedDate.TryToString() : "0";

                //同时修改权益表中优惠券状态
                UpdateMyRights(_db, description, cm.Vguid);
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        public ActionResult Index(string code)
        {
            string         accessToken = Common.WeChatPush.WeChatTools.GetAccessoken();
            U_WeChatUserID userInfo    = new U_WeChatUserID();
            string         userInfoStr = Common.WeChatPush.WeChatTools.GetUserInfoByCode(accessToken, code);

            userInfo = Common.JsonHelper.JsonToModel <U_WeChatUserID>(userInfoStr);//用户ID
            //userInfo.UserId = "13671595340";//合伙人
            //userInfo.UserId = "18936495119";//司机
            Business_Personnel_Information personInfoModel = GetUserInfo(userInfo.UserId);//获取人员表信息

            if (personInfoModel.DepartmenManager == 10 || personInfoModel.DepartmenManager == 11)
            {
                //合伙人;高级合伙人
                getPartnerInfo(personInfoModel);
            }
            else if (personInfoModel.DepartmenManager == 12)
            {
                //公司经理
                getManagerInfo(personInfoModel);
            }
            else if (personInfoModel.DepartmenManager == 1)
            {
                //司机;从Visionet_DriverInfo_View表中取出最新数据
                Personnel_Info Personnel = getPersonnelInfo(personInfoModel);
                if (Personnel != null)
                {
                    Master_Organization organizationDetail = new Master_Organization();
                    organizationDetail         = _ol.GetOrganizationDetail(personInfoModel.OwnedFleet.ToString());
                    Personnel.OldMotorcadeName = personInfoModel.OwnedFleet;   //公司
                    Personnel.OldOrganization  = personInfoModel.OwnedCompany; //车队
                    var key   = PubGet.GetUserKey + personInfoModel.Vguid + "K";
                    var csche = CacheManager <Personnel_Info> .GetInstance().Get(key);

                    if (csche != null)
                    {
                        CacheManager <Personnel_Info> .GetInstance().Remove(key);
                    }
                    CacheManager <Personnel_Info> .GetInstance().Add(key, Personnel, 8 * 60 * 60 * 1000);

                    var data = GetTaxiInfo(personInfoModel.Vguid.ToString());
                    if (data == "" || data == null)
                    {
                        return(View("/Areas/PartnerInquiryManagement/Views/DriverCheck/Index2.cshtml"));
                    }
                    else
                    {
                        ViewBag.Code = personInfoModel.Vguid;
                        return(View("/Areas/PartnerInquiryManagement/Views/DriverCheck/Index.cshtml"));
                    }
                }
                else
                {
                    return(View("/Areas/PartnerInquiryManagement/Views/DriverCheck/Index2.cshtml"));
                }
            }
            else
            {
                //ViewBag.Validate = false;
                //ViewBag.Date = DateTime.Now.ToString("yyyy-MM-dd");
                return(View("/Areas/PartnerInquiryManagement/Views/PartnerHomePage/Index2.cshtml"));
            }
            return(View());
        }