/// <summary> /// 获取社保公积金基数 /// </summary> /// <param name="area"></param> /// <param name="householdProperty"></param> /// <returns></returns> public ActionResult GetSocialSecurityBase(string area, string householdProperty) { EnterpriseSocialSecurity model = _socialSecurity.GetDefaultEnterpriseSocialSecurityByArea(area, householdProperty); decimal minBase = 0; decimal maxBase = 0; decimal aFMinBase = 0; decimal aFMaxBase = 0; if (model != null) { minBase = Math.Round(model.SocialAvgSalary * (model.MinSocial / 100)); maxBase = Math.Round(model.SocialAvgSalary * (model.MaxSocial / 100)); aFMinBase = model.MinAccumulationFund; aFMaxBase = model.MaxAccumulationFund; } Dictionary <string, decimal> dict = new Dictionary <string, decimal>(); dict["MinBase"] = minBase; dict["MaxBase"] = maxBase; dict["AFMinBase"] = aFMinBase; dict["AFMaxBase"] = aFMaxBase; return(Json(dict, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 根据签约单位ID获取签约单位信息 /// </summary> /// <param name="EnterpriseID"></param> /// <returns></returns> public ActionResult GetSSEnterprise(int EnterpriseID, int HouseholdProperty) { EnterpriseSocialSecurity model = _enterpriseService.GetEnterpriseSocialSecurity(EnterpriseID); decimal SSMaxBase = Math.Round(model.SocialAvgSalary * model.MaxSocial / 100); decimal SSMinBase = Math.Round(model.SocialAvgSalary * model.MinSocial / 100); decimal value = 0; if (HouseholdProperty == (int)HouseholdPropertyEnum.InRural || HouseholdProperty == (int)HouseholdPropertyEnum.OutRural) { value = model.PersonalShiYeRural; } else if (HouseholdProperty == (int)HouseholdPropertyEnum.InTown || HouseholdProperty == (int)HouseholdPropertyEnum.OutTown) { value = model.PersonalShiYeTown; } decimal SSPayProportion = model.CompYangLao + model.CompYiLiao + model.CompShiYe + model.CompGongShang + model.CompShengYu + model.PersonalYangLao + model.PersonalYiLiao + value + model.PersonalGongShang + model.PersonalShengYu; decimal SSMonthAccount = Math.Round(Math.Round(Convert.ToDecimal(SSMinBase)) * Convert.ToDecimal(SSPayProportion) / 100, 2); return(Json(new { SSMaxBase = SSMaxBase, SSMinBase = SSMinBase, SSPayProportion = SSPayProportion, SSMonthAccount = SSMonthAccount }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 根据企业ID获取签约企业实体 /// </summary> /// <param name="EnterpriseID"></param> /// <returns></returns> public EnterpriseSocialSecurity GetEnterpriseSocialSecurity(int EnterpriseID) { string sqlstr = $"select * from EnterpriseSocialSecurity where EnterpriseID={EnterpriseID}"; EnterpriseSocialSecurity model = DbHelper.QuerySingle <EnterpriseSocialSecurity>(sqlstr); return(model); }
public JsonResult <dynamic> GetSocialSecurityBase(string area, string HouseholdProperty) { EnterpriseSocialSecurity model = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(area, HouseholdProperty); if (model == null) { return new JsonResult <dynamic> { status = false, Message = "该区域不能进行缴费操作,请选择其他区域" } } ; decimal minBase = Math.Round(model.SocialAvgSalary * (model.MinSocial / 100)); decimal maxBase = Math.Round(model.SocialAvgSalary * (model.MaxSocial / 100)); return(new JsonResult <dynamic> { status = true, Message = "获取成功", Data = new { minBase = minBase, maxBase = maxBase } }); }
/// <summary> /// 根据参公积金地获取社保基数范围 公积金基数范围:minBase:最小基数,maxBase:最大基数 /// </summary> /// <param name="area">区域:省市名称之间用|隔开,如:山东省|青岛市</param> /// <returns></returns> public JsonResult <dynamic> GetAccumulationFundBase(string area, string HouseholdProperty) { EnterpriseSocialSecurity model = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(area, HouseholdProperty); if (model == null) { return new JsonResult <dynamic> { status = false, Message = "该区域不能进行缴费操作,请选择其他区域" } } ; decimal minBase = model.MinAccumulationFund; decimal maxBase = model.MaxAccumulationFund; return(new JsonResult <dynamic> { status = true, Message = "获取成功", Data = new { minBase = minBase, maxBase = maxBase } }); }
public ActionResult AddEnterprise() { //List<SelectListItem> UserTypeList = EnumExt.GetSelectList(typeof(HouseholdPropertyEnum)); //UserTypeList.Insert(0, new SelectListItem { Text = "请选择", Value = "" }); //ViewData["HouseholdProperty"] = new SelectList(UserTypeList, "Value", "Text"); EnterpriseSocialSecurity model = new EnterpriseSocialSecurity(); return(View(model)); }
public ActionResult EditEnterprise(int EnterpriseID) { EnterpriseSocialSecurity model = _enterpriseService.GetEnterpriseSocialSecurity(EnterpriseID); //List<SelectListItem> UserTypeList = EnumExt.GetSelectList(typeof(HouseholdPropertyEnum)); //UserTypeList.Insert(0, new SelectListItem { Text = "请选择", Value = "" }); //ViewData["HouseholdProperty1"] = UserTypeList; return(View(model)); }
/// <summary> /// 添加企业 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddEnterprise(EnterpriseSocialSecurity model) { string sqlStr = "insert into EnterpriseSocialSecurity(EnterpriseName,EnterpriseArea,ContactUser,ContactTel,Fax,Email" + ",OfficeTel,OrgAddress,SocialAvgSalary,MinSocial" + ",MaxSocial,CompYangLao,CompYiLiao,CompShiYe,CompGongShang,CompShengYu" + ",PersonalYangLao,PersonalYiLiao,PersonalShiYeTown,PersonalShiYeRural,PersonalGongShang" + ",PersonalShengYu,MinAccumulationFund,MaxAccumulationFund,CompProportion" + ",PersonalProportion,IsDefault)" + " values(@EnterpriseName,@EnterpriseArea,@ContactUser,@ContactTel,@Fax,@Email" + ",@OfficeTel,@OrgAddress,@SocialAvgSalary,@MinSocial" + ",@MaxSocial,@CompYangLao,@CompYiLiao,@CompShiYe,@CompGongShang,@CompShengYu" + ",@PersonalYangLao,@PersonalYiLiao,@PersonalShiYeTown,@PersonalShiYeRural,@PersonalGongShang" + ",@PersonalShengYu,@MinAccumulationFund,@MaxAccumulationFund,@CompProportion" + ",@PersonalProportion,@IsDefault)"; SqlParameter[] sqlparameters = new SqlParameter[] { new SqlParameter("EnterpriseName", model.EnterpriseName), new SqlParameter("EnterpriseArea", model.EnterpriseArea), new SqlParameter("ContactUser", model.ContactUser), new SqlParameter("ContactTel", model.ContactTel), new SqlParameter("Fax", model.Fax), new SqlParameter("Email", model.Email), new SqlParameter("OfficeTel", model.OfficeTel), //new SqlParameter("HouseholdProperty",model.HouseholdProperty), new SqlParameter("OrgAddress", model.OrgAddress), new SqlParameter("SocialAvgSalary", model.SocialAvgSalary), new SqlParameter("MinSocial", model.MinSocial), new SqlParameter("MaxSocial", model.MaxSocial), new SqlParameter("CompYangLao", model.CompYangLao), new SqlParameter("CompYiLiao", model.CompYiLiao), new SqlParameter("CompShiYe", model.CompShiYe), new SqlParameter("CompGongShang", model.CompGongShang), new SqlParameter("CompShengYu", model.CompShengYu), new SqlParameter("PersonalYangLao", model.PersonalYangLao), new SqlParameter("PersonalYiLiao", model.PersonalYiLiao), new SqlParameter("PersonalShiYeTown", model.PersonalShiYeTown), new SqlParameter("PersonalShiYeRural", model.PersonalShiYeRural), new SqlParameter("PersonalGongShang", model.PersonalGongShang), new SqlParameter("PersonalShengYu", model.PersonalShengYu), new SqlParameter("MinAccumulationFund", model.MinAccumulationFund), new SqlParameter("MaxAccumulationFund", model.MaxAccumulationFund), new SqlParameter("CompProportion", model.CompProportion), new SqlParameter("PersonalProportion", model.PersonalProportion), new SqlParameter("IsDefault", model.IsDefault) }; int result = DbHelper.ExecuteSqlCommandScalar(sqlStr, sqlparameters); return(result > 0); }
/// <summary> /// 根据参保人ID获取详情 /// </summary> /// <param name="SocialSecurityPeopleID"></param> /// <param name="MemberID"></param> /// <returns></returns> public ActionResult GetSocialSecurityPeopleDetail(int SocialSecurityPeopleID, int MemberID, int Type) { SocialSecurityPeople socialSecurityPeople = _socialSecurityService.GetSocialSecurityPeopleForAdmin(SocialSecurityPeopleID); if (socialSecurityPeople.IsPaySocialSecurity) { socialSecurityPeople.socialSecurity = _socialSecurityService.GetSocialSecurityDetail(SocialSecurityPeopleID); //企业签约单位列表 List <EnterpriseSocialSecurity> SSList = _socialSecurityService.GetEnterpriseSocialSecurityByAreaList(socialSecurityPeople.socialSecurity.InsuranceArea, socialSecurityPeople.HouseholdProperty); EnterpriseSocialSecurity SS = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(socialSecurityPeople.socialSecurity.InsuranceArea, socialSecurityPeople.HouseholdProperty); ViewData["SSEnterpriseList"] = new SelectList(SSList, "EnterpriseID", "EnterpriseName", socialSecurityPeople.socialSecurity.RelationEnterprise); ViewData["SSMaxBase"] = Math.Round(SS.SocialAvgSalary * SS.MaxSocial / 100); ViewData["SSMinBase"] = Math.Round(SS.SocialAvgSalary * SS.MinSocial / 100); } if (socialSecurityPeople.IsPayAccumulationFund) { socialSecurityPeople.accumulationFund = _accumulationFundService.GetAccumulationFundDetail(SocialSecurityPeopleID); //企业签约单位列表 List <EnterpriseSocialSecurity> AFList = _socialSecurityService.GetEnterpriseSocialSecurityByAreaList(socialSecurityPeople.accumulationFund.AccumulationFundArea, socialSecurityPeople.HouseholdProperty); EnterpriseSocialSecurity AF = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(socialSecurityPeople.accumulationFund.AccumulationFundArea, socialSecurityPeople.HouseholdProperty); ViewData["AFEnterpriseList"] = new SelectList(AFList, "EnterpriseID", "EnterpriseName", socialSecurityPeople.accumulationFund.RelationEnterprise); ViewData["AFMaxBase"] = AF.MaxAccumulationFund; ViewData["AFMinBase"] = AF.MinAccumulationFund; } //获取会员信息 ViewData["member"] = _memberService.GetMemberInfoForAdmin(MemberID); //获取账户列表 ViewData["accountRecordList"] = _memberService.GetAccountRecordList(MemberID).OrderByDescending(n => n.CreateTime).ToList(); #region 户口性质 List <SelectListItem> list = EnumExt.GetSelectList(typeof(HouseholdPropertyEnum)); int householdType = 0; foreach (var item in list) { if (item.Text == socialSecurityPeople.HouseholdProperty) { householdType = Convert.ToInt32(item.Value); break; } } ViewData["HouseholdProperty"] = new SelectList(list, "value", "text", householdType); #endregion return(View(socialSecurityPeople)); }
/// <summary> /// 根据签约单位ID获取签约单位信息 /// </summary> /// <param name="EnterpriseID"></param> /// <returns></returns> public ActionResult GetAFEnterprise(int EnterpriseID) { EnterpriseSocialSecurity model = _enterpriseService.GetEnterpriseSocialSecurity(EnterpriseID); decimal AFMaxBase = model.MaxAccumulationFund; decimal AFMinBase = model.MinAccumulationFund; decimal AFPayProportion = model.CompProportion + model.PersonalProportion; decimal AFMonthAccount = Math.Round(AFMinBase * AFPayProportion / 100, 2); return(Json(new { AFMaxBase = AFMaxBase, AFMinBase = AFMinBase, AFPayProportion = AFPayProportion, AFMonthAccount = AFMonthAccount }, JsonRequestBehavior.AllowGet)); }
public ActionResult AddEnterprise(EnterpriseSocialSecurity model) { //已存在判断 bool isExists = _enterpriseService.IsExistsEnterprise(model.EnterpriseName); if (isExists) { ViewBag.Message = "企业名称已存在"; return(AddEnterprise()); } //ProvinceCode CityCode CountyCode string ProvinceName = string.Empty; string CityName = string.Empty; string CountyName = string.Empty; #region 将编码变成名称 string sqlstr = "select * from Region where RegionCode = '{0}'"; ProvinceName = DbHelper.QuerySingle <Region>(string.Format(sqlstr, model.ProvinceCode)).RegionName; CityName = DbHelper.QuerySingle <Region>(string.Format(sqlstr, model.CityCode)).RegionName; CountyName = DbHelper.QuerySingle <Region>(string.Format(sqlstr, model.CountyCode)).RegionName; #endregion model.EnterpriseArea = ProvinceName + "|" + CityName + "|" + CountyName; //更新其他签约企业 注:满足省份|城市和户口类型 默认的只有一个 if (model.IsDefault) { _enterpriseService.UpdateEnterpriseDefault(ProvinceName + "|" + CityName, 0); } //添加 bool flag = _enterpriseService.AddEnterprise(model); #region 记录日志 LogService.WriteLogInfo(new Log { UserName = HttpContext.User.Identity.Name, Contents = string.Format("新增签约企业:{0}", model.EnterpriseName) }); #endregion TempData["Message"] = flag ? "保存成功" : "保存失败"; return(RedirectToAction("GetEnterpriseList")); }
/// <summary> /// 更新企业 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateEnterprise(EnterpriseSocialSecurity model) { string sqlstr = "update EnterpriseSocialSecurity set EnterpriseName=@EnterpriseName,EnterpriseArea=@EnterpriseArea,ContactUser=@ContactUser,ContactTel=@ContactTel,Fax=@Fax,Email=@Email,OfficeTel=@OfficeTel,OrgAddress=@OrgAddress,SocialAvgSalary=@SocialAvgSalary,MinSocial=@MinSocial,MaxSocial=@MaxSocial,CompYangLao=@CompYangLao,CompYiLiao=@CompYiLiao,CompShiYe=@CompShiYe,CompGongShang=@CompGongShang,CompShengYu=@CompShengYu,PersonalYangLao=@PersonalYangLao,PersonalYiLiao=@PersonalYiLiao,PersonalShiYeTown=@PersonalShiYeTown,PersonalShiYeRural=@PersonalShiYeRural,PersonalGongShang=@PersonalGongShang,PersonalShengYu=@PersonalShengYu,MinAccumulationFund=@MinAccumulationFund,MaxAccumulationFund=@MaxAccumulationFund,CompProportion=@CompProportion,PersonalProportion=@PersonalProportion,IsDefault=@IsDefault where EnterpriseID=@EnterpriseID"; int result = DbHelper.ExecuteSqlCommand(sqlstr, new { EnterpriseName = model.EnterpriseName, EnterpriseArea = model.EnterpriseArea, ContactUser = model.ContactUser, ContactTel = model.ContactTel, Fax = model.Fax, Email = model.Email, OfficeTel = model.OfficeTel, //HouseholdProperty = model.HouseholdProperty, OrgAddress = model.OrgAddress, SocialAvgSalary = model.SocialAvgSalary, MinSocial = model.MinSocial, MaxSocial = model.MaxSocial, CompYangLao = model.CompYangLao, CompYiLiao = model.CompYiLiao, CompShiYe = model.CompShiYe, CompGongShang = model.CompGongShang, CompShengYu = model.CompShengYu, PersonalYangLao = model.PersonalYangLao, PersonalYiLiao = model.PersonalYiLiao, PersonalShiYeTown = model.PersonalShiYeTown, PersonalShiYeRural = model.PersonalShiYeRural, PersonalGongShang = model.PersonalGongShang, PersonalShengYu = model.PersonalShengYu, MinAccumulationFund = model.MinAccumulationFund, MaxAccumulationFund = model.MaxAccumulationFund, CompProportion = model.CompProportion, PersonalProportion = model.PersonalProportion, IsDefault = model.IsDefault, EnterpriseID = model.EnterpriseID }); return(result > 0); }
public ActionResult GetDefaultEnterpriseSocialSecurityByArea(string area, string HouseholdProperty) { EnterpriseSocialSecurity model = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(area, HouseholdProperty); return(Json(model, JsonRequestBehavior.AllowGet)); }
public ActionResult GetEnterpriseDetail(int EnterpriseID) { EnterpriseSocialSecurity model = _enterpriseService.GetEnterpriseSocialSecurity(EnterpriseID); return(View(model)); }
public JsonResult <dynamic> ConfirmSocialSecurityScheme(SocialSecurityPeople socialSecurityPeople) { //社保 bool IsExistSocialSecurityCase = false; DateTime socialSecurityStartTime = DateTime.MinValue; DateTime socialSecurityEndTime = DateTime.MinValue; int socialSecuritypayMonth = 0; decimal socialSecurityFirstBacklogCost = 0; decimal SocialSecurityBase = 0; decimal FreezingCharge = 0; decimal SocialSecurityAmount = 0; if (socialSecurityPeople.socialSecurity != null) { IsExistSocialSecurityCase = true; socialSecurityStartTime = socialSecurityPeople.socialSecurity.PayTime; socialSecurityEndTime = socialSecurityPeople.socialSecurity.PayTime.AddMonths(socialSecurityPeople.socialSecurity.PayMonthCount - 1); socialSecuritypayMonth = socialSecurityPeople.socialSecurity.PayMonthCount; socialSecurityFirstBacklogCost = _parameterSettingService.GetCostParameter((int)PayTypeEnum.SocialSecurity).BacklogCost; SocialSecurityBase = socialSecurityPeople.socialSecurity.SocialSecurityBase; FreezingCharge = 0; EnterpriseSocialSecurity enterpriseSocialSecurity = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(socialSecurityPeople.socialSecurity.InsuranceArea, socialSecurityPeople.HouseholdProperty); if (enterpriseSocialSecurity == null) { return new JsonResult <dynamic> { status = false, Message = "该区域不能进行缴费操作,请选择其他区域" } } ; decimal value = 0; //model.PersonalShiYeTown if (socialSecurityPeople.HouseholdProperty == EnumExt.GetEnumCustomDescription((HouseholdPropertyEnum)((int)HouseholdPropertyEnum.InRural)) || socialSecurityPeople.HouseholdProperty == EnumExt.GetEnumCustomDescription((HouseholdPropertyEnum)((int)HouseholdPropertyEnum.OutRural))) { value = enterpriseSocialSecurity.PersonalShiYeRural; } else if (socialSecurityPeople.HouseholdProperty == EnumExt.GetEnumCustomDescription((HouseholdPropertyEnum)((int)HouseholdPropertyEnum.InTown)) || socialSecurityPeople.HouseholdProperty == EnumExt.GetEnumCustomDescription((HouseholdPropertyEnum)((int)HouseholdPropertyEnum.OutTown))) { value = enterpriseSocialSecurity.PersonalShiYeTown; } decimal PayProportion = enterpriseSocialSecurity.CompYangLao + enterpriseSocialSecurity.CompYiLiao + enterpriseSocialSecurity.CompShiYe + enterpriseSocialSecurity.CompGongShang + enterpriseSocialSecurity.CompShengYu + enterpriseSocialSecurity.PersonalYangLao + enterpriseSocialSecurity.PersonalYiLiao + value + enterpriseSocialSecurity.PersonalGongShang + enterpriseSocialSecurity.PersonalShengYu; SocialSecurityAmount = PayProportion * socialSecurityPeople.socialSecurity.SocialSecurityBase / 100; } //公积金 bool IsExistaAccumulationFundCase = false; DateTime AccumulationFundStartTime = DateTime.MinValue; DateTime AccumulationFundEndTime = DateTime.MinValue; int AccumulationFundpayMonth = 0; decimal AccumulationFundFirstBacklogCost = 0; decimal AccumulationFundBase = 0; decimal AccumulationFundAmount = 0; if (socialSecurityPeople.accumulationFund != null) { IsExistaAccumulationFundCase = true; AccumulationFundStartTime = socialSecurityPeople.accumulationFund.PayTime; AccumulationFundEndTime = socialSecurityPeople.accumulationFund.PayTime.AddMonths(socialSecurityPeople.accumulationFund.PayMonthCount - 1); AccumulationFundpayMonth = socialSecurityPeople.accumulationFund.PayMonthCount; AccumulationFundFirstBacklogCost = _parameterSettingService.GetCostParameter((int)PayTypeEnum.AccumulationFund).BacklogCost; AccumulationFundBase = socialSecurityPeople.accumulationFund.AccumulationFundBase; EnterpriseSocialSecurity enterpriseSocialSecurity2 = _socialSecurityService.GetDefaultEnterpriseSocialSecurityByArea(socialSecurityPeople.accumulationFund.AccumulationFundArea, socialSecurityPeople.HouseholdProperty); if (enterpriseSocialSecurity2 == null) { return new JsonResult <dynamic> { status = false, Message = "该区域不能进行缴费操作,请选择其他区域" } } ; decimal PayProportion2 = enterpriseSocialSecurity2.CompProportion + enterpriseSocialSecurity2.PersonalProportion; AccumulationFundAmount = PayProportion2 * socialSecurityPeople.accumulationFund.AccumulationFundBase / 100; } return(new JsonResult <dynamic> { status = true, Message = "获取成功", Data = new { IsExistSocialSecurityCase = IsExistSocialSecurityCase, socialSecurityStartTime = socialSecurityStartTime.ToString("yyyy-MM"), socialSecurityEndTime = socialSecurityEndTime.ToString("yyyy-MM"), socialSecuritypayMonth = socialSecuritypayMonth, socialSecurityFirstBacklogCost = socialSecurityFirstBacklogCost, SocialSecurityBase = SocialSecurityBase, FreezingCharge = FreezingCharge, SocialSecurityAmount = SocialSecurityAmount, IsExistaAccumulationFundCase = IsExistaAccumulationFundCase, AccumulationFundStartTime = AccumulationFundStartTime.ToString("yyyy-MM"), AccumulationFundEndTime = AccumulationFundEndTime.ToString("yyyy-MM"), AccumulationFundpayMonth = AccumulationFundpayMonth, AccumulationFundFirstBacklogCost = AccumulationFundFirstBacklogCost, AccumulationFundBase = AccumulationFundBase, AccumulationFundAmount = AccumulationFundAmount } }); }