Beispiel #1
0
        /// <summary>
        /// 保存部门信息
        /// </summary>
        /// <param name="organizationModel"></param>
        /// <param name="isEdit"></param>
        /// <returns></returns>
        public bool Save(Master_Organization organizationModel, bool isEdit)
        {
            using (SqlSugarClient dbMsSql = SugarDao.SugarDao_MsSql.GetInstance())
            {
                bool result = false;
                if (isEdit)//编辑
                {
                    var model = new
                    {
                        OrganizationName = organizationModel.OrganizationName,
                        //OrganizationCode = organizationModel.OrganizationCode,
                        Description = organizationModel.Description,
                        ChangeDate  = organizationModel.ChangeDate,
                        ChangeUser  = organizationModel.ChangeUser
                    };
                    result = dbMsSql.Update <Master_Organization>(model, i => i.Vguid == organizationModel.Vguid);

                    //存入操作日志表
                    string logData = JsonHelper.ModelToJson(organizationModel);
                    _ll.SaveLog(4, 3, CurrentUser.GetCurrentUser().LoginName, organizationModel.OrganizationName, logData);
                }
                else//新增
                {
                    result = dbMsSql.Insert(organizationModel, false) != DBNull.Value;
                    //存入操作日志表
                    string logData = JsonHelper.ModelToJson(organizationModel);
                    _ll.SaveLog(1, 2, CurrentUser.GetCurrentUser().LoginName, organizationModel.OrganizationName, logData);
                }
                return(result);
            }
        }
        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 #3
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 #4
0
        public void getPartnerInfo(Business_Personnel_Information personInfoModel)
        {
            Master_Organization organizationDetail = new Master_Organization();

            organizationDetail = _ol.GetOrganizationDetail(personInfoModel.OwnedFleet.ToString());
            var ownedCompany = personInfoModel.OwnedCompany;

            if (ownedCompany == "全部")
            {
                ownedCompany = getAllOwnedCompany(organizationDetail.Description, "11");
            }
            Personnel_Info Personnel = new Personnel_Info();

            Personnel.IdCard           = personInfoModel.IDNumber;
            Personnel.OldMotorcadeName = personInfoModel.OwnedFleet; //公司
            Personnel.OldOrganization  = ownedCompany;               //车队
            Personnel.Organization     = organizationDetail.Description;
            //Personnel.Organization = "第一服务中心";
            Personnel.MotorcadeName = 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 newfleet = Personnel.MotorcadeName;//现车队

            ViewBag.MotorcadeName = newfleet;
            //ViewBag.Date = getTaxiSummary();
            ViewBag.Validate = true;
            ViewBag.Code     = personInfoModel.Vguid;
        }
Beispiel #5
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));
        }
        /// <summary>
        /// 保存部门信息
        /// </summary>
        /// <param name="organizationModel"></param>
        /// <param name="isEdit"></param>
        /// <returns></returns>
        public bool Save(Master_Organization organizationModel, bool isEdit)
        {
            Master_Organization organization = new Master_Organization();

            if (isEdit)//编辑
            {
                organization = GetOrganizationDetail(organizationModel.Vguid.ToString());
                organization.OrganizationName = organizationModel.OrganizationName;
                //organization.OrganizationCode = organizationModel.OrganizationCode;
                organization.Description = organizationModel.Description;
                organization.ChangeUser  = Common.CurrentUser.GetCurrentUser().LoginName;
                organization.ChangeDate  = DateTime.Now;
            }
            else//新增
            {
                //organization = new Master_Organization();
                organization.OrganizationName = organizationModel.OrganizationName;
                //organization.OrganizationCode = organizationModel.OrganizationCode;
                organization.ParentVguid = organizationModel.ParentVguid;
                organization.Vguid       = Guid.NewGuid();
                organization.Description = organizationModel.Description;
                organization.CreatedUser = Common.CurrentUser.GetCurrentUser().LoginName;
                organization.CreatedDate = DateTime.Now;
                organization.ChangeDate  = DateTime.Now;
            }

            return(_os.Save(organization, isEdit));
        }
        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 #8
0
 /// <summary>
 /// 判断同一部门下是否存在同名称部门
 /// </summary>
 /// <param name="organizationModel"></param>
 /// <returns></returns>
 public bool CheckIsExist(Master_Organization organizationModel, string isEdit)
 {
     using (SqlSugarClient dbMsSql = SugarDao.SugarDao_MsSql.GetInstance())
     {
         bool result   = false;
         bool isEditor = isEdit != "0";
         if (isEditor)//编辑
         {
             result = dbMsSql.Queryable <Master_Organization>().Where(i => i.ParentVguid == organizationModel.ParentVguid && i.Vguid != organizationModel.Vguid).Any(i => i.OrganizationName == organizationModel.OrganizationName);
         }
         else//新增
         {
             result = dbMsSql.Queryable <Master_Organization>().Where(i => i.ParentVguid == organizationModel.ParentVguid).Any(i => i.OrganizationName == organizationModel.OrganizationName);
         }
         return(result);
     }
 }
Beispiel #9
0
        /// <summary>
        /// 保存部门信息
        /// </summary>
        /// <param name="organizationModel"></param>
        /// <param name="isEdit"></param>
        /// <returns></returns>
        public JsonResult Save(Master_Organization organizationModel, string isEdit)
        {
            var models = new ActionResultModel <String>();

            models.isSuccess = false;

            models.isSuccess = _ol.CheckIsExist(organizationModel, isEdit);//判断同一部门下是否存在同名称部门
            if (!models.isSuccess)
            {
                models.isSuccess   = _ol.Save(organizationModel, isEdit == "0" ? false : true);
                models.respnseInfo = models.isSuccess == true ? "1" : "0";
            }
            else
            {
                models.respnseInfo = "2";//同一部门下存在同名称部门
            }
            return(Json(models, JsonRequestBehavior.AllowGet));
        }
Beispiel #10
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());
        }
 /// <summary>
 /// 判断同一部门下是否存在同名称部门
 /// </summary>
 /// <param name="organizationModel"></param>
 /// <returns></returns>
 public bool CheckIsExist(Master_Organization organizationModel, string isEdit)
 {
     return(_os.CheckIsExist(organizationModel, isEdit));
 }