/// <summary> /// 门店列表 只有总店进入才能看到该列表 /// </summary> /// <param name="appId"></param> /// <returns></returns> public ActionResult StoreList(int appId) { ViewBag.appId = appId; FootBath model = FootBathBLL.SingleModel.GetModel($"appId={appId} and HomeId=0"); if (model == null) { return(View("ErrorMsg", new Return_Msg() { Msg = "请先开通多门店!" })); } ViewBag.HomeId = model.Id;//用于查询该总店下的所有门店 ViewBag.storeId = model.Id; XcxAppAccountRelation xcx = XcxAppAccountRelationBLL.SingleModel.GetModel(appId); if (xcx != null) { var paycenter = PayCenterSettingBLL.SingleModel.GetPayCenterSettingByappid(xcx.AppId); if (paycenter != null) { ViewBag.Mch_id = paycenter.Mch_id; } } return(View()); }
/// <summary> /// 客户预订成功后将选定的时间点添加到已服务时间表 /// </summary> /// <param name="store"></param> /// <param name="goodsCart"></param> public void AddSelServiceTime(FootBath store, EntGoodsCart goodsCart, SwitchModel switchModel = null) { ServiceTime serviceTimeModel = GetModel($"aid={store.appId} and storeid={store.Id} and tid={goodsCart.technicianId} and date='{goodsCart.reservationTime.ToShortDateString()}'"); if (serviceTimeModel == null) { serviceTimeModel = new ServiceTime(); serviceTimeModel.aid = store.appId; serviceTimeModel.storeId = store.Id; serviceTimeModel.tid = goodsCart.technicianId; serviceTimeModel.date = Convert.ToDateTime(goodsCart.reservationTime.ToShortDateString()); serviceTimeModel.time = goodsCart.reservationTime.ToString("HH:mm");//SelTimeStr(goodsCart.reservationTime, goodsCart.goodsMsg.ServiceTime, switchModel.TimeInterval); serviceTimeModel.createTime = DateTime.Now; Add(serviceTimeModel); } else { serviceTimeModel.time += "," + goodsCart.reservationTime.ToString("HH:mm"); //SelTimeStr(goodsCart.reservationTime, goodsCart.goodsMsg.ServiceTime, switchModel.TimeInterval); serviceTimeModel.date = Convert.ToDateTime(goodsCart.reservationTime.ToShortDateString()); serviceTimeModel.createTime = DateTime.Now; MySqlParameter[] arr = null; string strSql = BuildUpdateSql(serviceTimeModel, "time,createtime", out arr); Update(serviceTimeModel, "time,createtime,date"); } }
/// <summary> /// 发起退款 /// </summary> /// <returns></returns> public ActionResult OutOrder() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } var appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModel($"id ={appId}"); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } int storeId = Context.GetRequestInt("storeid", -1); if (storeId < 0) { return(Json(new { isok = false, msg = "系统繁忙storeId_null" })); } string storeSqlwhere = $"appid={appId}"; if (storeId > 0) { storeSqlwhere = $"id={storeId}"; } FootBath storeModel = FootBathBLL.SingleModel.GetModel(storeSqlwhere); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } int orderId = Context.GetRequestInt("orderId", 0); if (orderId <= 0) { return(Json(new { isok = false, msg = "系统繁忙orderId_null" })); } EntGoodsOrder orderInfo = EntGoodsOrderBLL.SingleModel.GetModel($"aId={storeModel.appId} and id={orderId}"); if (orderInfo == null) { return(Json(new { isok = false, msg = "系统繁忙order_null" })); } List <EntGoodsCart> goodscarts = EntGoodsCartBLL.SingleModel.GetList($"GoodsOrderId={orderInfo.Id}"); bool isok = EntGoodsOrderBLL.SingleModel.outOrder(goodscarts, storeModel, orderInfo); string msg = "操作失败"; if (isok) { msg = "操作成功"; var data = TemplateMsg_Miniapp.MutilStoreGetTemplateMessageData(orderInfo, SendTemplateMessageTypeEnum.多门店退款通知); TemplateMsg_Miniapp.SendTemplateMessage(orderInfo.UserId, SendTemplateMessageTypeEnum.多门店退款通知, TmpType.小程序多门店模板, data); } return(Json(new { isok = isok, msg = msg })); }
/// <summary> /// 获取包间列表 /// </summary> /// <returns></returns> public ActionResult GetRoomList() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙account_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙store_null" })); } int pageIndex = Context.GetRequestInt("pageIndex", 1); int pageSize = Context.GetRequestInt("pageSize", 8); int recordCount = 0; List <EntGoodType> roomList = EntGoodTypeBLL.SingleModel.GetRoomList(appId, storeModel.Id, (int)GoodProjectType.足浴版包间分类, pageSize, pageIndex, out recordCount); return(Json(new { isok = true, roomList = roomList, recordCount = recordCount })); }
public ActionResult SaveTakeoutSetting(FootBath takeOut) { FootBath storeModel = FootBathBLL.SingleModel.GetModel(takeOut.Id); if (storeModel == null) { return(Json(new { isok = false, msg = "数据不存在!" }, JsonRequestBehavior.AllowGet)); } if (takeOut.takeOutWayModel != null) { if (!Regex.IsMatch(takeOut.takeOutWayModel.cityService.TakeFright.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的配送费(同城配送)" })); } if (!Regex.IsMatch(takeOut.takeOutWayModel.cityService.TakeRange.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的配送范围(同城配送)" })); } if (!Regex.IsMatch(takeOut.takeOutWayModel.selfTake.TakeRange.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的自取范围(同城配送)" })); } if (!Regex.IsMatch(takeOut.takeOutWayModel.cityService.TakeStartPrice.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的起送价格(同城配送)" })); } if (!Regex.IsMatch(takeOut.takeOutWayModel.cityService.FreeFrightCost.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的消费免邮金额(同城配送)" })); } if (storeModel.HomeId == 0) { if (!Regex.IsMatch(takeOut.takeOutWayModel.GetExpressdelivery.TakeFright.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的统一配送费(快递配送)" })); } if (!Regex.IsMatch(takeOut.takeOutWayModel.GetExpressdelivery.FreeFrightCost.ToString(), @"^\d+\.?\d*$")) { return(Json(new { isok = false, msg = "请填写正确的消费免邮金额(同城配送)" })); } } storeModel.TakeOutWayConfig = JsonConvert.SerializeObject(takeOut.takeOutWayModel); if (FootBathBLL.SingleModel.Update(storeModel, "TakeOutWayConfig")) { return(Json(new { isok = true, msg = "操作成功!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { isok = false, msg = "操作失败!" }, JsonRequestBehavior.AllowGet)); } } else { return(Json(new { isok = false, msg = "配送设置异常!" }, JsonRequestBehavior.AllowGet)); } }
// GET: footbath_gift:足浴版小程序-送花管理 #region 送花管理 /// <summary> /// 送花配置界面 /// </summary> /// <returns></returns> public ActionResult GiftSetting() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "没有数据!", code = "500" })); } ViewBag.GiftPrice = storeModel.ShowGiftPrice; SwitchModel switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); ViewBag.ShowPhotoByGift = switchModel.ShowPhotoByGift; List <EntGoods> giftPackages = EntGoodsBLL.SingleModel.GetGiftPackages(appId, (int)GoodsType.足浴版送花套餐); if (giftPackages == null || giftPackages.Count <= 0) { EntGoods giftPackage = new EntGoods() { aid = appId, exttypes = ((int)GoodsType.足浴版送花套餐).ToString(), stock = 2, name = "看相册", state = 1, }; giftPackage.id = Convert.ToInt32(EntGoodsBLL.SingleModel.Add(giftPackage)); giftPackages = new List <EntGoods>(); giftPackages.Add(giftPackage); } return(View(giftPackages)); }
public ActionResult UpdateTagOrDelete(EntGoods serviceInfo) { string action = Context.GetRequest("action", string.Empty); if (serviceInfo.aid <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(serviceInfo.aid, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={serviceInfo.aid}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } EntGoods model = EntGoodsBLL.SingleModel.GetServiceById(serviceInfo.aid, serviceInfo.id); if (model == null) { return(Json(new { isok = false, msg = "系统繁忙info_null" })); } bool isok = false; model.updatetime = DateTime.Now; switch (action) { case "updateTag": if (model.tag == 1) { model.tag = 0; } else { model.tag = 1; } isok = EntGoodsBLL.SingleModel.Update(model, "tag,updatetime"); break; case "delete": model.state = 0; isok = EntGoodsBLL.SingleModel.Update(model, "state,updatetime"); break; default: return(Json(new { isok = false, msg = "参数错误" })); } string msg = isok ? "操作成功" : "操作失败"; return(Json(new { isok = isok, msg = msg })); }
/// <summary> /// 多门店退款 /// </summary> /// <param name="orderInfo"></param> /// <returns></returns> public bool MultiStoreReFundQueue(List <EntGoodsCart> goodsCar, FootBath storeMaterial, EntGoodsOrder orderInfo) { bool result = false; orderInfo.outOrderDate = DateTime.Now; orderInfo.State = (int)MiniAppEntOrderState.退款中; if (orderInfo.BuyMode == (int)miniAppBuyMode.微信支付) { try { if (orderInfo.BuyPrice == 0) { orderInfo.State = (int)MiniAppEntOrderState.退款成功; EntGoodsOrderBLL.SingleModel.Update(orderInfo, "State,outOrderDate"); } else { CityMorders order = _cityMordersBLL.GetModel(orderInfo.OrderId); orderInfo.State = (int)MiniAppEntOrderState.退款中; if (order == null) { orderInfo.State = (int)MiniAppEntOrderState.退款失败; EntGoodsOrderBLL.SingleModel.Update(orderInfo, "State,outOrderDate"); return(result); } //微信支付 ReFundQueue reModel = new ReFundQueue { minisnsId = -5, money = orderInfo.BuyPrice, orderid = order.Id, traid = order.trade_no, addtime = DateTime.Now, note = "小程序多门店退款", retype = 1 }; base.Add(reModel); } TransactionModel tranModel = new TransactionModel(); tranModel.Add(EntGoodsOrderBLL.SingleModel.BuildUpdateSql(orderInfo, "State,outOrderDate")); if (!EntGoodsOrderBLL.SingleModel.HandleStockSql_MultiStore(goodsCar, storeMaterial, tranModel, -1)) { log4net.LogHelper.WriteInfo(GetType(), "生成库存处理sql失败 HandleStockSql_MultiStore_error"); return(false); } result = ExecuteTransactionDataCorect(tranModel.sqlArray, tranModel.ParameterArray); return(result); } catch (Exception ex) { log4net.LogHelper.WriteInfo(GetType(), $"{ex.Message} xxxxxxxxxxxxxxxx小程序多门店退款订单插入队列失败 ID={orderInfo.Id}"); log4net.LogHelper.WriteError(GetType(), ex); } } return(result); }
/// <summary> /// 支付方式 /// </summary> /// <returns></returns> public ActionResult PayWaySetting() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "数据不存在!", code = "500" })); } if (!string.IsNullOrEmpty(storeModel.SwitchConfig)) { try { storeModel.switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); } catch (Exception ex) { log4net.LogHelper.WriteError(this.GetType(), ex); return(View("PageError", new Return_Msg() { Msg = "系统繁忙!", code = "500" })); } } else { storeModel.switchModel = new SwitchModel(); } return(View(storeModel)); }
/// <summary> /// 删除技师或修改技师状态(删除技师同时要删除技师值班表数据) /// </summary> /// <returns></returns> public ActionResult DelOrChangeState() { try { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙store_null" })); } int id = Context.GetRequestInt("id", 0); if (id <= 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } int state = Context.GetRequestInt("state", -2); if (state < -1) { return(Json(new { isok = false, msg = "系统繁忙state_null" })); } TechnicianInfo model = TechnicianInfoBLL.SingleModel.GetModelById(id); if (model == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } model.updateDate = DateTime.Now; model.state = state; string stateName = Enum.GetName(typeof(TechnicianState), state); bool isok = TechnicianInfoBLL.SingleModel.Update(model, "state,updatedate"); if (isok && model.state == -1) { RotaBLL.SingleModel.deleteRotaByTid(model.id); } string msg = isok ? "操作成功" : "操作失败"; return(Json(new { isok = isok, msg = msg, stateName = stateName }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { isok = false, msg = ex.Message }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 获取项目列表 /// </summary> /// <returns></returns> public ActionResult GetServiceList() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } int pageSize = Context.GetRequestInt("pageSize", 10); int pageIndex = Context.GetRequestInt("pageIndex", 1); int ptypes = Context.GetRequestInt("ptypes", 0); string name = Context.GetRequest("name", string.Empty); int tag = Context.GetRequestInt("tag", -1); int recordCount = 0; List <EntGoods> serviceList = EntGoodsBLL.SingleModel.GetServiceList(appId, (int)GoodsType.足浴版服务, ptypes, name, tag, pageSize, pageIndex, out recordCount); if (serviceList != null && serviceList.Count > 0) { serviceList.ForEach(s => { if (!string.IsNullOrEmpty(s.ptypes)) { List <EntGoodType> typeList = EntGoodTypeBLL.SingleModel.GetList($"id in ({s.ptypes}) and type = {(int)GoodProjectType.足浴版服务项目分类} and state> 0"); if (typeList != null && typeList.Count > 0) { foreach (EntGoodType typeInfo in typeList) { s.ptypestr += typeInfo.name + ","; } } s.ptypestr = s.ptypestr.TrimEnd(','); } }); } return(Json(new { isok = true, serviceList = serviceList, recordCount = recordCount })); }
/// <summary> /// 获取技师列表 /// </summary> /// <returns></returns> public ActionResult GetTechnicianList() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } int pageIndex = Context.GetRequestInt("pageIndex", 1); int pageSize = Context.GetRequestInt("pageSize", 10); string jobNumber = Context.GetRequest("jobNumber", string.Empty); string name = Context.GetRequest("name", string.Empty); int sex = Context.GetRequestInt("sex", -1); string phone = Context.GetRequest("phone", string.Empty); int itemId = Context.GetRequestInt("itemId", 0); int isShow = Context.GetRequestInt("isShow", -1); int state = Context.GetRequestInt("state", -1); int recordCount = 0; List <TechnicianInfo> technicianList = TechnicianInfoBLL.SingleModel.GetTechnicianList(storeModel.Id, jobNumber, name, sex, phone, itemId, isShow, state, pageIndex, pageSize, out recordCount); if (technicianList != null && technicianList.Count > 0) { foreach (TechnicianInfo info in technicianList) { info.switchModel = JsonConvert.DeserializeObject <TechnicianSwitch>(info.switchConfig); info.wxname = UserBaseInfoBLL.SingleModel.GetWxname(info.unionId); info.showBirthday = info.birthday.ToString("yyyy-MM-dd"); if (!string.IsNullOrEmpty(info.itemId)) { info.serviceList = EntGoodsBLL.SingleModel.GetServerListByIds(info.appId, info.itemId); } } } return(Json(new { isok = true, recordCount = recordCount, list = technicianList })); }
public ActionResult SaveReserveSetting(FootBath info) { if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } if (info == null) { return(Json(new { isok = false, msg = "参数错误" })); } if (info.appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(info.appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={info.appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } storeModel.switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); if (info.switchModel.TimeInterval != 30 && info.switchModel.TimeInterval != 60) { return(Json(new { isok = false, msg = "系统繁忙TimeInterval_error" })); } storeModel.switchModel.TimeInterval = info.switchModel.TimeInterval; if (info.switchModel.PresetTime < 1 || info.switchModel.PresetTime > 15) { return(Json(new { isok = false, msg = "预订时间只能在1~15天之间" })); } storeModel.switchModel.PresetTime = info.switchModel.PresetTime; storeModel.switchModel.AdvancePayment = info.switchModel.AdvancePayment; storeModel.switchModel.PresetTechnician = info.switchModel.PresetTechnician; storeModel.switchModel.WriteSex = info.switchModel.WriteSex; storeModel.switchModel.WriteDesc = info.switchModel.WriteDesc; storeModel.switchModel.AutoLock = info.switchModel.AutoLock; storeModel.SwitchConfig = JsonConvert.SerializeObject(storeModel.switchModel); storeModel.UpdateDate = DateTime.Now; bool isok = FootBathBLL.SingleModel.Update(storeModel, "switchconfig,updatedate"); string msg = isok ? "保存成功" : "保存失败"; return(Json(new { isok = isok, msg = msg })); }
/// <summary> /// 删除项目分类 /// </summary> /// <returns></returns> public ActionResult DelType() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } int id = Context.GetRequestInt("id", -1); if (id < 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } EntGoodType typeInfo = EntGoodTypeBLL.SingleModel.GetServiceItem(appId, storeModel.Id, (int)GoodProjectType.足浴版服务项目分类, id); if (typeInfo == null) { return(Json(new { isok = false, msg = "系统繁忙info_null" })); } //获取该分类下的项目数目 int serviceCount = EntGoodsBLL.SingleModel.GetServiceCountById(appId, typeInfo.id); if (serviceCount > 0) { return(Json(new { isok = false, msg = $"不可删除:该分类下已关联{serviceCount}个项目" })); } typeInfo.state = 0; bool isok = EntGoodTypeBLL.SingleModel.Update(typeInfo, "state"); string msg = isok ? "已删除" : "删除失败"; return(Json(new { isok = isok, msg = msg })); }
public ActionResult pageset(int appId = 0, int storeId = 0) { if (appId <= 0) { return(View("ErrorMsg", new Return_Msg() { Msg = "非法操作!" })); } FootBath model = new FootBath(); if (storeId > 0) { //表示门店 model = FootBathBLL.SingleModel.GetModel(storeId); } else { //表示总店 model = FootBathBLL.SingleModel.GetModel($"appId={appId} and HomeId=0"); } if (model == null) { return(View("ErrorMsg", new Return_Msg() { Msg = "非法操作(请先开通多店铺)!" })); } ViewBag.accountid = dzuserId; ViewModel <EntSetting> vm = new ViewModel <EntSetting>(); vm.PageType = 26; vm.DataModel = new EntSetting() { aid = model.appId, pages = model.StoreMaterialPages, storeId = model.Id, HomeId = model.HomeId }; ViewBag.storeId = storeId; ViewBag.TypeIndex = 0; string souceFrom = Context.GetRequest("SouceFrom", string.Empty); ViewBag.SouceFrom = souceFrom; if (souceFrom == "")//&& !WebSiteConfig.CustomerLoginId.Contains(dzaccount.LoginId) { return(Redirect($"/config/functionlist?appId={appId}&type=26")); } return(View("../enterprise/pageset", vm)); }
/// <summary> /// 开单 /// </summary> /// <returns></returns> public ActionResult createOrder() { #region 数据验证 int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } int orderId = Context.GetRequestInt("orderId", 0); if (orderId <= 0) { return(Json(new { isok = false, msg = "系统繁忙orderId_null" })); } EntGoodsOrder orderInfo = EntGoodsOrderBLL.SingleModel.GetModelByOrderIdAndAid(orderId, appId, 1); if (orderInfo == null) { return(Json(new { isok = false, msg = "系统繁忙order_null" })); } #endregion if (orderInfo.State == (int)MiniAppEntOrderState.已超时) { orderInfo.State = (int)MiniAppEntOrderState.务中; } orderInfo.OrderType = 0; orderInfo.ConfDate = DateTime.Now; bool isok = EntGoodsOrderBLL.SingleModel.Update(orderInfo, "State,ordertype,ConfDate") && VipRelationBLL.SingleModel.updatelevel(orderInfo.UserId, "footbath"); #region 预约成功通知 模板消息 if (isok) { object objData = TemplateMsg_Miniapp.FootbathGetTemplateMessageData(orderInfo, SendTemplateMessageTypeEnum.足浴预约成功通知); TemplateMsg_Miniapp.SendTemplateMessage(orderInfo.UserId, SendTemplateMessageTypeEnum.足浴预约成功通知, TmpType.小程序足浴模板, objData); } #endregion string msg = isok ? "操作成功" : "操作失败"; return(Json(new { isok = isok, msg = msg })); }
// GET: footbath_technician:足浴版小程序-技师管理 #region 技师管理 /// <summary> /// 技师管理视图 /// </summary> /// <returns></returns> public ActionResult TechnicianList() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "数据不存在!", code = "500" })); } List <EntGoods> serviceList = EntGoodsBLL.SingleModel.GetServicList(appId); //扫码绑定代码 string sessonid = new Random().Next(1, 3) + DateTime.Now.ToString("mmssfffff"); Session["qrcodekey"] = sessonid; if (null == RedisUtil.Get <LoginQrCode>("SessionID:" + sessonid)) { LoginQrCode wxkey = new LoginQrCode(); wxkey.SessionId = sessonid; wxkey.IsLogin = false; RedisUtil.Set <LoginQrCode>("SessionID:" + sessonid, wxkey); } return(View(serviceList)); }
public ActionResult RemoveUserStoreManagerRole() { //删除用户在这个模板里的权限 var deleteRoleSql = $" update userRole set State = 0 Where Appid = {_appId} and storeId = {_storeId} and RoleId = {(int)RoleType.分店管理员} and State = 1 "; TransactionModel tran = new TransactionModel(); tran.Add(deleteRoleSql); FootBath store = FootBathBLL.SingleModel.GetModel(_storeId); store.ShopManagerName = string.Empty; store.ShopManager = string.Empty; tran.Add(FootBathBLL.SingleModel.BuildUpdateSql(store)); bool isSuccess = UserRoleBLL.SingleModel.ExecuteTransactionDataCorect(tran.sqlArray); return(Json(new { success = isSuccess, msg = isSuccess ? "解除权限成功!" : "解除权限失败!", ShopManagerName = store.ShopManagerName, ShopManager = store.ShopManager })); }
/// <summary> /// 保存值班信息 /// </summary> /// <param name="rotaInfo"></param> /// <returns></returns> public ActionResult SaveRotaInfo(Rota rotaInfo) { if (rotaInfo.aid <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(rotaInfo.aid, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={rotaInfo.aid}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } if (rotaInfo.Id <= 0) { return(Json(new { isok = false, msg = "系统繁忙rotaId_null" })); } Rota model = RotaBLL.SingleModel.GetModelById(rotaInfo.aid, rotaInfo.Id); if (model == null) { return(Json(new { isok = false, msg = "系统繁忙rota_null" })); } model.monday = RotaBLL.SingleModel.GetDayStr(rotaInfo.mondayState); model.tuesday = RotaBLL.SingleModel.GetDayStr(rotaInfo.tuesdayState); model.wensday = RotaBLL.SingleModel.GetDayStr(rotaInfo.wensdayState); model.thursday = RotaBLL.SingleModel.GetDayStr(rotaInfo.thursdayState); model.friday = RotaBLL.SingleModel.GetDayStr(rotaInfo.fridayState); model.saturday = RotaBLL.SingleModel.GetDayStr(rotaInfo.saturdayState); model.sunday = RotaBLL.SingleModel.GetDayStr(rotaInfo.sundayState); bool isok = RotaBLL.SingleModel.Update(model, "monday,tuesday,wensday,thursday,friday,saturday,sunday"); string msg = isok ? "保存成功" : "保存失败"; return(Json(new { isok = isok, msg = msg })); }
public ActionResult OrderTotalList() { int appId = Context.GetRequestInt("appId", 0); int storeId = Context.GetRequestInt("storeId", 0); string sqlwhere = $"appid={appId}"; if (storeId > 0) { sqlwhere = $"id={storeId}"; } if (appId == 0) { return(Content("系统繁忙id_null")); } if (dzaccount == null) { return(Content("系统繁忙auth_null")); } var xcx = XcxAppAccountRelationBLL.SingleModel.GetModel($"id ={appId}"); if (xcx == null) { return(Content("系统繁忙app_null")); } FootBath storeModel = FootBathBLL.SingleModel.GetModel(sqlwhere); if (storeModel == null) { return(Content("系统繁忙store_null")); } ViewBag.storeId = storeModel.Id; List <FootBath> storeList = new List <FootBath>(); storeList.Add(storeModel); if (storeModel.HomeId == 0) { storeList.AddRange(FootBathBLL.SingleModel.GetList($"HomeId={storeModel.Id} and state>0 and IsDel>-1")); } List <VipLevel> levelList = VipLevelBLL.SingleModel.GetList($"appid='{xcx.AppId}' and state>=0"); ViewBag.storeList = storeList; return(View(levelList)); }
/// <summary> /// 保存支付方式 /// </summary> /// <returns></returns> public ActionResult SavePayWay(SwitchModel paySetting) { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } if (paySetting == null) { return(Json(new { isok = false, msg = "系统繁忙switch_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙model_null" })); } storeModel.switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); storeModel.switchModel.Alipay = paySetting.Alipay; storeModel.switchModel.BankCardPay = paySetting.BankCardPay; storeModel.switchModel.CashPay = paySetting.CashPay; storeModel.switchModel.OtherPay = paySetting.OtherPay; storeModel.switchModel.SaveMoneyPay = paySetting.SaveMoneyPay; storeModel.switchModel.WeChatPay = paySetting.WeChatPay; storeModel.SwitchConfig = JsonConvert.SerializeObject(storeModel.switchModel); storeModel.UpdateDate = DateTime.Now; bool isok = FootBathBLL.SingleModel.Update(storeModel, "switchconfig,updatedate"); string msg = isok ? "修改成功" : "修改失败"; return(Json(new { isok = isok, msg = msg })); }
/// <summary> /// 删除套餐 /// </summary> /// <returns></returns> public ActionResult DelGift() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙account_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙store_null" })); } int id = Context.GetRequestInt("id", 0); if (id <= 0) { return(Json(new { isok = false, msg = "参数错误" })); } EntGoods giftInfo = EntGoodsBLL.SingleModel.GetGiftInfo(appId, id, (int)GoodsType.足浴版送花套餐); if (giftInfo == null) { return(Json(new { isok = false, msg = "系统繁忙giftInfo_null" })); } giftInfo.state = 0; bool isok = EntGoodsBLL.SingleModel.Update(giftInfo, "state"); string msg = isok ? "删除成功" : "删除失败"; return(Json(new { isok = isok, msg = msg })); }
// GET: footbath_ordermanager:足浴版小程序-订单管理管理 #region 订单管理 /// <summary> /// 订单管理视图 /// </summary> /// <returns></returns> public ActionResult Ordermanager() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "数据不存在!", code = "500" })); } List <EntGoodType> roomList = EntGoodTypeBLL.SingleModel.GetRoomList(appId, storeModel.Id, (int)GoodProjectType.足浴版包间分类); storeModel.switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); ViewBag.dateList = FootBathBLL.SingleModel.GetReservationTime(storeModel.switchModel.PresetTime); return(View(roomList)); }
/// <summary> /// 开启|关闭 送花看相册功能 /// </summary> /// <returns></returns> public ActionResult SaveGiftConfig() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙account_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙store_null" })); } int isOpen = Context.GetRequestInt("isOpen", -1); if (isOpen < 0) { return(Json(new { isok = false, msg = "系统繁忙isOpen_null" })); } SwitchModel switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); switchModel.ShowPhotoByGift = isOpen > 0; storeModel.SwitchConfig = JsonConvert.SerializeObject(switchModel); storeModel.UpdateDate = DateTime.Now; bool isok = FootBathBLL.SingleModel.Update(storeModel, "switchconfig,updatedate"); return(Json(new { isok = isok })); }
/// <summary> /// 送花记录(视图) /// </summary> /// <returns></returns> public ActionResult GiftRecord() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "数据不存在!", code = "500" })); } SwitchModel switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); ViewBag.ShowPhotoByGift = switchModel.ShowPhotoByGift; return(View()); }
/// <summary> /// 项目分类 /// </summary> /// <returns></returns> public ActionResult ServiceType() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "数据不存在!", code = "500" })); } List <EntGoodType> goodTypeList = EntGoodTypeBLL.SingleModel.GetServiceItemList(appId, storeModel.Id, (int)GoodProjectType.足浴版服务项目分类); return(View(goodTypeList)); }
/// <summary> /// 排班表(视图) /// </summary> /// <returns></returns> public ActionResult Rota() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "500" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "数据不存在!", code = "500" })); } storeModel.switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); ViewBag.week = ServiceTimeBLL.SingleModel.IsSingleWeek(DateTime.Now); return(View(storeModel.switchModel)); }
/// <summary> /// 保存 花朵价格 /// </summary> /// <returns></returns> public ActionResult SaveGiftPrice() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙id_null" })); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙account_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModelByAppId(appId); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙store_null" })); } int GiftPrice = Context.GetRequestInt("GiftPrice", -1); if (GiftPrice < 0 || GiftPrice > 99900) { return(Json(new { isok = false, msg = "价格范围:0~999,最多两位小数" })); } storeModel.GiftPrice = GiftPrice; storeModel.UpdateDate = DateTime.Now; bool isok = FootBathBLL.SingleModel.Update(storeModel, "giftprice,updatedate"); string msg = isok ? "保存成功" : "保存失败"; return(Json(new { isok = isok, msg = msg })); }
/// <summary> /// 包间管理界面 /// </summary> /// <returns></returns> public ActionResult PrivateRoom() { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(View("PageError", new Return_Msg() { Msg = "参数错误!", code = "500" })); } ViewBag.appId = appId; if (dzaccount == null) { return(Redirect("/dzhome/login")); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(View("PageError", new Return_Msg() { Msg = "没有权限!", code = "403" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(View("PageError", new Return_Msg() { Msg = "没有数据!", code = "500" })); } return(View()); }
/// <summary> /// 保存早中晚班值班时间 /// </summary> /// <param name="switchModel"></param> /// <returns></returns> public ActionResult saveWorkTime(SwitchModel switchModel) { int appId = Context.GetRequestInt("appId", 0); if (appId <= 0) { return(Json(new { isok = false, msg = "系统繁忙appid_null" }, JsonRequestBehavior.AllowGet)); } if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙auth_null" })); } XcxAppAccountRelation appAcountRelation = XcxAppAccountRelationBLL.SingleModel.GetModelByaccountidAndAppid(appId, dzaccount.Id.ToString()); if (appAcountRelation == null) { return(Json(new { isok = false, msg = "系统繁忙relation_null" })); } FootBath storeModel = FootBathBLL.SingleModel.GetModel($"appId={appId}"); if (storeModel == null) { return(Json(new { isok = false, msg = "系统繁忙store_null" })); } storeModel.switchModel = JsonConvert.DeserializeObject <SwitchModel>(storeModel.SwitchConfig); storeModel.switchModel.morningShift = switchModel.morningShift; storeModel.switchModel.noonShift = switchModel.noonShift; storeModel.switchModel.eveningShift = switchModel.eveningShift; storeModel.SwitchConfig = JsonConvert.SerializeObject(storeModel.switchModel); storeModel.UpdateDate = DateTime.Now; bool isok = FootBathBLL.SingleModel.Update(storeModel, "SwitchConfig,UpdateDate"); string msg = isok ? "保存成功" : "保存失败"; return(Json(new { isok = isok, msg = msg })); }