【调整】移除后台设置是否会员绑定手机号码的设置。

【新增】新增商城小程序前端商家管理员功能,商家管理员可以通过商家中心查看所有信息。
【调整】商家中心按门店进行过滤,提货单,服务券,订单等,本门店只能处理本门店业务及查看相应数据。
【调整】后台商城配置移除【会员设置】tab,增加【商家设置】tab,将商家相关设置归集到一起。
This commit is contained in:
大灰灰
2022-12-03 01:44:19 +08:00
parent 201586ab4f
commit 0422df5552
24 changed files with 471 additions and 184 deletions

View File

@@ -56,6 +56,11 @@ namespace CoreCms.Net.Configuration
/// </summary>
public const string ShopMobile = "shopMobile";
/// <summary>
/// 商家管理员手机号
/// </summary>
public const string ShopManagerMobile = "shopManagerMobile";
/// <summary>
/// 开启门店自提
/// </summary>
@@ -469,13 +474,6 @@ namespace CoreCms.Net.Configuration
public const string InvoiceSwitch = "invoiceSwitch";
//第三方的登陆的时候,是否需要绑定手机号码,强烈建议用户开启,除非只在微信小程序内使用============================================================================
//1绑定2不绑定
/// <summary>
/// 绑定手机号码
/// </summary>
public const string IsBindMobile = "isBindMobile";
//支付宝小程序appid============================================================================
/// <summary>

View File

@@ -72,10 +72,15 @@ namespace CoreCms.Net.Configuration
di.Add(SystemSettingConstVars.ShareTitle, new DictionaryKeyValues() { sKey = "分享标题", sValue = "优质好店邀您共享" });
di.Add(SystemSettingConstVars.ShareDesc, new DictionaryKeyValues() { sKey = "分享描述", sValue = "" });
//会员设置
//商家信息
di.Add(SystemSettingConstVars.ShopMobile, new DictionaryKeyValues() { sKey = "商家手机号", sValue = "" });
//1绑定2不绑定-第三方的登陆的时候,是否需要绑定手机号码,强烈建议用户开启,除非只在微信小程序内使用
di.Add(SystemSettingConstVars.IsBindMobile, new DictionaryKeyValues() { sKey = "绑定手机号码", sValue = "1" });
di.Add(SystemSettingConstVars.ShopManagerMobile, new DictionaryKeyValues() { sKey = "商家管理员手机号", sValue = "" });
di.Add(SystemSettingConstVars.ReshipName, new DictionaryKeyValues() { sKey = "退货联系人", sValue = "" });
di.Add(SystemSettingConstVars.ReshipMobile, new DictionaryKeyValues() { sKey = "退货联系方式", sValue = "" });
di.Add(SystemSettingConstVars.ReshipAreaId, new DictionaryKeyValues() { sKey = "商家区域", sValue = "" });
di.Add(SystemSettingConstVars.ReshipAddress, new DictionaryKeyValues() { sKey = "商家详细地址", sValue = "" });
di.Add(SystemSettingConstVars.ReshipCoordinate, new DictionaryKeyValues() { sKey = "商家坐标", sValue = "" });
//商品设置
di.Add(SystemSettingConstVars.GoodsStocksWarn, new DictionaryKeyValues() { sKey = "库存警报数量", sValue = "10" });
@@ -85,11 +90,7 @@ namespace CoreCms.Net.Configuration
di.Add(SystemSettingConstVars.OrderAutoSignTime, new DictionaryKeyValues() { sKey = "订单确认收货时间", sValue = "20" });
di.Add(SystemSettingConstVars.OrderAutoEvalTime, new DictionaryKeyValues() { sKey = "订单自动评价时间", sValue = "30" });
di.Add(SystemSettingConstVars.RemindOrderTime, new DictionaryKeyValues() { sKey = "订单提醒付款时间", sValue = "1" });
di.Add(SystemSettingConstVars.ReshipName, new DictionaryKeyValues() { sKey = "商家联系人", sValue = "" });
di.Add(SystemSettingConstVars.ReshipMobile, new DictionaryKeyValues() { sKey = "商家联系方式", sValue = "" });
di.Add(SystemSettingConstVars.ReshipAreaId, new DictionaryKeyValues() { sKey = "商家区域", sValue = "" });
di.Add(SystemSettingConstVars.ReshipAddress, new DictionaryKeyValues() { sKey = "商家详细地址", sValue = "" });
di.Add(SystemSettingConstVars.ReshipCoordinate, new DictionaryKeyValues() { sKey = "商家坐标", sValue = "" });
di.Add(SystemSettingConstVars.StoreOrderAutomaticDelivery, new DictionaryKeyValues() { sKey = "门店自提自动发货", sValue = "2" });

View File

@@ -59,8 +59,9 @@ namespace CoreCms.Net.IRepository
/// 根据用户序列获取单个门店数据
/// </summary>
/// <param name="userId">用户序列</param>
/// <param name="storeId">门店序列</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
Task<CoreCmsStore> GetStoreByUserId(int userId, bool blUseNoLock = false);
Task<CoreCmsStore> GetStoreByUserId(int userId, int storeId, bool blUseNoLock = false);
}
}

View File

@@ -39,7 +39,7 @@ namespace CoreCms.Net.IServices
/// 获取店铺提货单列表
/// </summary>
/// <returns></returns>
Task<WebApiCallBack> GetStoreLadingList(int userId, int page, int limit);
Task<WebApiCallBack> GetStoreLadingList(int userId, int storeId, int page, int limit);
/// <summary>

View File

@@ -24,7 +24,7 @@ namespace CoreCms.Net.IServices
/// 店铺核销的服务券列表
/// </summary>
/// <returns></returns>
Task<WebApiCallBack> GetVerificationLogs(int userId, int page, int limit);
Task<WebApiCallBack> GetVerificationLogs(int userId, int storeId, int page, int limit);
/// <summary>

View File

@@ -24,7 +24,7 @@ namespace CoreCms.Net.IServices
public interface ICoreCmsClerkServices : IBaseServices<CoreCmsClerk>
{
/// <summary>
/// 判断是不是店员
/// 判断是否是商家,店员,开启商家中心
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>

View File

@@ -60,8 +60,9 @@ namespace CoreCms.Net.IServices
/// 根据用户序列获取单个门店数据
/// </summary>
/// <param name="userId">用户序列</param>
/// <param name="storeId">门店序列</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
Task<CoreCmsStore> GetStoreByUserId(int userId, bool blUseNoLock = false);
Task<CoreCmsStore> GetStoreByUserId(int userId, int storeId, bool blUseNoLock = false);
}
}

View File

@@ -209,9 +209,10 @@ namespace CoreCms.Net.Repository
/// 根据用户序列获取单个门店数据
/// </summary>
/// <param name="userId">用户序列</param>
/// <param name="storeId">门店序列</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public async Task<CoreCmsStore> GetStoreByUserId(int userId, bool blUseNoLock = false)
public async Task<CoreCmsStore> GetStoreByUserId(int userId, int storeId, bool blUseNoLock = false)
{
CoreCmsStore obj;
if (blUseNoLock)
@@ -219,7 +220,7 @@ namespace CoreCms.Net.Repository
obj = await DbClient.Queryable<CoreCmsStore, CoreCmsClerk>((p, clerks) => new JoinQueryInfos(
JoinType.Left, p.id == clerks.storeId
))
.Where((p, clerks) => clerks.userId == userId)
.Where((p, clerks) => clerks.userId == userId && p.id == storeId)
.Select((p, clerks) => new CoreCmsStore
{
id = p.id,
@@ -243,7 +244,7 @@ namespace CoreCms.Net.Repository
obj = await DbClient.Queryable<CoreCmsStore, CoreCmsClerk>((p, clerks) => new JoinQueryInfos(
JoinType.Left, p.id == clerks.storeId
))
.Where((p, clerks) => clerks.userId == userId)
.Where((p, clerks) => clerks.userId == userId && p.id == storeId)
.Select((p, clerks) => new CoreCmsStore
{
id = p.id,

View File

@@ -18,9 +18,12 @@ using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using static SKIT.FlurlHttpClient.Wechat.Api.Models.CgibinUserInfoBatchGetResponse.Types;
namespace CoreCms.Net.Services
@@ -36,13 +39,20 @@ namespace CoreCms.Net.Services
private readonly ICoreCmsOrderItemRepository _orderItemRepository;
private readonly ICoreCmsUserRepository _userRepository;
private readonly IUnitOfWork _unitOfWork;
public CoreCmsBillLadingServices(IUnitOfWork unitOfWork, ICoreCmsBillLadingRepository dal, ICoreCmsClerkRepository clerkRepository, ICoreCmsStoreRepository storeRepository, ICoreCmsOrderItemRepository orderItemRepository, ICoreCmsUserRepository userRepository)
private readonly ICoreCmsSettingServices _settingServices;
private readonly IServiceProvider _serviceProvider;
public CoreCmsBillLadingServices(IUnitOfWork unitOfWork, ICoreCmsBillLadingRepository dal, ICoreCmsClerkRepository clerkRepository, ICoreCmsStoreRepository storeRepository, ICoreCmsOrderItemRepository orderItemRepository, ICoreCmsUserRepository userRepository, IServiceProvider serviceProvider, ICoreCmsSettingServices settingServices)
{
this._dal = dal;
_clerkRepository = clerkRepository;
_storeRepository = storeRepository;
_orderItemRepository = orderItemRepository;
_userRepository = userRepository;
_serviceProvider = serviceProvider;
_settingServices = settingServices;
base.BaseDal = dal;
_unitOfWork = unitOfWork;
}
@@ -95,13 +105,39 @@ namespace CoreCms.Net.Services
/// 获取店铺提货单列表
/// </summary>
/// <returns></returns>
public async Task<WebApiCallBack> GetStoreLadingList(int userId, int page, int limit)
public async Task<WebApiCallBack> GetStoreLadingList(int userId, int storeId, int page, int limit)
{
var jm = new WebApiCallBack();
var clerks = await _clerkRepository.QueryListByClauseAsync(p => p.userId == userId);
var storeIds = clerks.Select(p => p.storeId).ToList();
var ladingList = await _dal.QueryPageAsync(p => storeIds.Contains(p.storeId) && p.isDel == false, p => p.createTime, OrderByType.Desc, page, limit);
var where = PredicateBuilder.True<CoreCmsBillLading>();
using var container = _serviceProvider.CreateScope();
var _userServices = container.ServiceProvider.GetService<ICoreCmsUserServices>();
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var user = await _userServices.QueryByClauseAsync(p => p.id == userId);
if (user == null)
{
jm.status = false;
jm.msg = "用户获取失败";
return jm;
}
var isManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile);
if (isManager)
{
where = storeId == 0 ? where.And(p => p.isDel == false) : where.And(p => p.isDel == false && p.storeId == storeId);
}
else
{
where = where.And(p => p.isDel == false && p.storeId == storeId);
//var clerks = await _clerkRepository.QueryListByClauseAsync(p => p.userId == userId);
//var storeIds = clerks.Select(p => p.storeId).ToList();
//where = where.And(p => storeIds.Contains(p.storeId) && p.isDel == false);
}
var ladingList = await _dal.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, page, limit);
jm.status = true;
@@ -186,7 +222,18 @@ namespace CoreCms.Net.Services
var data = new List<CoreCmsBillLading>();
if (list != null)
{
if (userId > 0)
var userInfo = await _userRepository.QueryByClauseAsync(p => p.id == userId);
if (userInfo != null)
{
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var isManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(userInfo.mobile);
if (isManager)
{
data = list;
}
else
{
var clerks = await _clerkRepository.QueryListByClauseAsync(p => p.userId == userId);
if (clerks != null && clerks.Any())
@@ -201,6 +248,7 @@ namespace CoreCms.Net.Services
}
}
}
}
foreach (var item in data)
{
var statusInt = item.status
@@ -209,7 +257,7 @@ namespace CoreCms.Net.Services
item.statusName = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.BillLadingStatus>(statusInt);
if (item.clerkId > 0)
{
var userInfo = await _userRepository.QueryByClauseAsync(p => p.id == userId);
if (userInfo != null)
{
item.clerkIdName = !string.IsNullOrEmpty(userInfo.nickName)

View File

@@ -17,8 +17,10 @@ using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
@@ -33,13 +35,19 @@ namespace CoreCms.Net.Services
private readonly ICoreCmsServicesServices _servicesServices;
private readonly ICoreCmsUserServicesTicketServices _userServicesTicketServices;
private readonly ICoreCmsClerkServices _clerkServices;
private readonly ICoreCmsSettingServices _settingServices;
private readonly IServiceProvider _serviceProvider;
private readonly IUnitOfWork _unitOfWork;
public CoreCmsUserServicesTicketVerificationLogServices(IUnitOfWork unitOfWork, ICoreCmsUserServicesTicketVerificationLogRepository dal, ICoreCmsClerkServices clerkServices, ICoreCmsServicesServices servicesServices, ICoreCmsUserServicesTicketServices userServicesTicketServices)
public CoreCmsUserServicesTicketVerificationLogServices(IUnitOfWork unitOfWork, ICoreCmsUserServicesTicketVerificationLogRepository dal, ICoreCmsClerkServices clerkServices, ICoreCmsServicesServices servicesServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsSettingServices settingServices, IServiceProvider serviceProvider)
{
this._dal = dal;
_clerkServices = clerkServices;
_servicesServices = servicesServices;
_userServicesTicketServices = userServicesTicketServices;
_settingServices = settingServices;
_serviceProvider = serviceProvider;
base.BaseDal = dal;
_unitOfWork = unitOfWork;
}
@@ -48,18 +56,38 @@ namespace CoreCms.Net.Services
/// 店铺核销的服务券列表
/// </summary>
/// <returns></returns>
public async Task<WebApiCallBack> GetVerificationLogs(int userId, int page, int limit)
public async Task<WebApiCallBack> GetVerificationLogs(int userId, int storeId, int page, int limit)
{
var jm = new WebApiCallBack();
using var container = _serviceProvider.CreateScope();
var _userServices = container.ServiceProvider.GetService<ICoreCmsUserServices>();
var clerk = await _clerkServices.QueryByClauseAsync(p => p.userId == userId);
if (clerk == null)
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsUserServicesTicketVerificationLog>();
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var user = await _userServices.QueryByClauseAsync(p => p.id == userId);
if (user == null)
{
jm.msg = "未查询到用户门店";
jm.status = false;
jm.msg = "用户获取失败";
return jm;
}
var isManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile);
if (isManager)
{
where = storeId == 0 ? where.And(p => p.isDel == false) : where.And(p => p.isDel == false && p.storeId == storeId);
}
else
{
where = where.And(p => p.isDel == false && p.storeId == storeId);
//var stroes = await _clerkServices.QueryListByClauseAsync(p => p.userId == userId);
//var stroeIds = stroes.Select(p => p.storeId).ToList();
//where = where.And(p => stroeIds.Contains(p.storeId) && p.isDel == false);
}
var logs = await _dal.QueryPageAsync(p => p.storeId == clerk.storeId && p.isDel == false, p => p.verificationTime, OrderByType.Desc, page, limit);
var logs = await _dal.QueryPageAsync(where, p => p.verificationTime, OrderByType.Desc, page, limit);
if (logs != null && logs.Any())
{
@@ -78,6 +106,7 @@ namespace CoreCms.Net.Services
jm.msg = "获取成功";
}
jm.status = true;
jm.data = logs;
jm.otherData = new
{

View File

@@ -23,6 +23,7 @@ using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Microsoft.IdentityModel.Tokens;
using SqlSugar;
@@ -49,7 +50,7 @@ namespace CoreCms.Net.Services
}
/// <summary>
/// 判断是不是店员
/// 判断是否是商家,店员,开启商家中心
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
@@ -58,22 +59,33 @@ namespace CoreCms.Net.Services
var jm = new WebApiCallBack();
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var storeSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StoreSwitch).ObjectToInt(2);
if (storeSwitch == 1)
var user = await _userServices.QueryByClauseAsync(p => p.id == userId);
if (user == null)
{
var bl = await base.ExistsAsync(p => p.userId == userId);
jm.status = true;
jm.data = bl;
jm.msg = bl ? "是店员" : "不是店员";
}
else
jm.status = false;
jm.msg = "用户获取失败";
jm.data = new
{
jm.status = true;
jm.data = false;
jm.msg = "未开启到店自提";
storeId = 0,
isShopManager = false,
isClerk = false,
};
return jm;
}
var store = await _dal.QueryByClauseAsync(p => p.userId == userId);
jm.status = true;
jm.data = new
{
storeId = store?.storeId ?? 0,
isShopManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile),
isClerk = store != null || (!string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile)),
};
jm.otherData = store != null ||
(!string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile));
return jm;
}

View File

@@ -83,11 +83,12 @@ namespace CoreCms.Net.Services
/// 根据用户序列获取单个门店数据
/// </summary>
/// <param name="userId">用户序列</param>
/// <param name="storeId">门店序列</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public async Task<CoreCmsStore> GetStoreByUserId(int userId, bool blUseNoLock = false)
public async Task<CoreCmsStore> GetStoreByUserId(int userId, int storeId, bool blUseNoLock = false)
{
return await _dal.GetStoreByUserId(userId, blUseNoLock);
return await _dal.GetStoreByUserId(userId, storeId, blUseNoLock);
}
}

View File

@@ -204,6 +204,8 @@ const install = (Vue, vm) => {
let storeList = (params, config = {}) => http.post('/Api/Store/GetStoreList', params, { custom: { methodName: 'store.getstorelist', needToken: false } });
//根据用户序列获取门店数据
let getStoreByUserId = (params, config = {}) => http.post('/Api/Store/GetStoreByUserId', params, { custom: { methodName: 'store.getStoreByUserId', needToken: true } });
//获取单个用户能管理的门店列表
let getStoreListForUser = (params, config = {}) => http.post('/Api/Store/GetStoreListForUser', params, { custom: { methodName: 'store.GetStoreListForUser', needToken: true } });
//根据序列获取门店数据
let getStoreById = (params, config = {}) => http.post('/Api/Store/GetStoreById', params, { custom: { methodName: 'store.getStoreByUserId', needToken: false } });
//获取门店订单列表
@@ -500,6 +502,7 @@ const install = (Vue, vm) => {
storeList,
getStoreByUserId,
getStoreListForUser,
getStoreById,
getOrderPageByMerchant,
getOrderPageByMerchantSearch,

View File

@@ -149,7 +149,7 @@
</view>
<view class="coreshop-tools-list-box">
<u-grid :col="4" :border="false">
<u-grid-item @click="navigateToHandle('/pages/member/merchant/index/index')" v-if="isClerk">
<u-grid-item @click="goMerchant" v-if="isClerk">
<u-icon name="calendar" :size="25" color="#666" label="商家管理" labelPos="bottom" labelSize="13" space="25" top="15"></u-icon>
</u-grid-item>
<u-grid-item @tap="goDistributionPanel" v-if="isDistribution">
@@ -227,7 +227,10 @@
data() {
return {
afterSaleNums: 0, //售后数量
isClerk: false,//显示商家管理
isClerk: false,//是否门店人员
isShopManager: false,//是否商家管理员
storeId: 0,//关联门店
isDistribution: false,//显示分销中心
isAgent: false,//显示代理中心
@@ -532,7 +535,9 @@
})
//判断是否是店员
_this.$u.api.isStoreUser().then(res => {
this.isClerk = res.data
this.isClerk = res.data.isClerk;
this.isShopManager = res.data.isShopManager
this.storeId = res.data.storeId;
})
}
})
@@ -540,13 +545,31 @@
this.hasLogin = false
}
},
goMerchant() {
uni.showLoading({
title: '跳转中...'
});
if (!this.hasLogin) {
console.log('未登录');
this.$store.commit('showLoginTip', true);
uni.hideLoading();
return false;
}
uni.hideLoading();
this.$u.route({
url: '/pages/member/merchant/index/index',
params: {
storeId: this.storeId,
isShopManager: this.isShopManager
}
})
},
navigateToHandle(pageUrl) {
uni.showLoading({
title: '跳转中...'
});
if (!this.hasLogin) {
console.log('未登录');
//getApp().globalData.showLoginTip = true;
this.$store.commit('showLoginTip', true);
uni.hideLoading();
return false;

View File

@@ -351,11 +351,10 @@
<!--底部-->
<view class="coreshop-foot-hight-view" />
<!--<view class="coreshop-foot-hight-view" />
<view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom" v-if="orderInfo.status == 1 && !isDelivery">
<u-button class='coreshop-bg-red' type="success" size="default" @click="tackDeliery(orderInfo.orderId)">立即发货</u-button>
</view>
</view>-->
</view>
</template>
<script>

View File

@@ -20,7 +20,7 @@
</view>
</view>
<view class="coreshop-padding-top-5 coreshop-padding-right-10">
<u-button :plain="true" size="mini" icon="share-square" text="切换个人" @click="goUserCenter()"></u-button>
<u-button :plain="true" size="mini" icon="share-square" text="切换个人中心" @click="goUserCenter()"></u-button>
</view>
</view>
</view>
@@ -29,13 +29,13 @@
<!--业务列表-->
<view class="coreshop-tools-list-box coreshop-bg-white coreshop-padding-bottom-10 coreshop-solid-bottom">
<u-row>
<u-col span="3" @click="goRoute('/pages/member/merchant/takeDelivery/list')">
<u-col span="3" @click="goTakeDelivery">
<u-icon name="order" :size="23" color="#666" label="提货单列表" labelPos="bottom" labelSize="13" space="25" top="15"></u-icon>
</u-col>
<u-col span="3" @click="goRoute('/pages/member/merchant/takeDelivery/index')">
<u-icon name="fingerprint" :size="23" color="#666" label="提货单核销" labelPos="bottom" labelSize="13" space="25" top="15"></u-icon>
</u-col>
<u-col span="3" @click="goRoute('/pages/member/merchant/serviceVerification/list')">
<u-col span="3" @click="goServiceVerification">
<u-icon name="coupon" :size="23" color="#666" label="服务券列表" labelPos="bottom" labelSize="13" space="25" top="15"></u-icon>
</u-col>
<u-col span="3" @click="goRoute('/pages/member/merchant/serviceVerification/index')">
@@ -257,7 +257,13 @@
methods: {
goSearch() {
if (this.keyword) {
this.$u.route('/pages/member/merchant/search/index?keyword=' + this.keyword);
this.$u.route({
url: '/pages/member/merchant/search/index',
params: {
keyword: this.keyword,
storeId: this.storeId
}
})
} else {
this.$refs.uToast.show({ message: '请输订单号、收货人手机号、收货人姓名', type: 'warning', })
}
@@ -275,21 +281,30 @@
}
});
},
// 服务器核销列表
goServiceVerification() {
this.$u.route({
url: '/pages/member/merchant/serviceVerification/list',
params: {
storeId: this.storeId
}
});
},
// 提货单列表
goTakeDelivery() {
this.$u.route({
url: '/pages/member/merchant/takeDelivery/list',
params: {
storeId: this.storeId
}
});
},
// 获取门店信息
getStoreDetail() {
let that = this;
let data = {
id: this.storeId
}
if (this.storeId > 0) {
this.$u.api.getStoreById(data).then(e => {
if (e.status) {
that.storeDetail = e.data;
} else {
that.$refs.uToast.show({ message: e.msg, type: 'error', })
}
});
} else {
this.$u.api.getStoreByUserId(data).then(e => {
if (e.status) {
that.storeDetail = e.data;
@@ -297,7 +312,6 @@
that.$refs.uToast.show({ message: e.msg, type: 'error', })
}
});
}
},
// 门店订单列表
getStoreOrder() {

View File

@@ -98,10 +98,12 @@
loadStatus: this.$globalConstVars.loadStatus.loadMore, //loadmore-加载前的状态loading-加载中的状态nomore-没有更多的状态
currentPage: 1,
lastPage: 1,
storeId: 0,
}
},
onLoad(options) {
this.keyword = options.keyword
this.keyword = options.keyword;
this.storeId = options.storeId;
if (this.keyword) {
this.getStoreOrder();
}

View File

@@ -65,10 +65,12 @@
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
}
},
storeId: 0,
}
},
onShow() {
onLoad(option) {
this.storeId = option.storeId;
this.getlogs();
},
methods: {
@@ -77,7 +79,8 @@
let _this = this
let data = {
page: _this.page,
limit: _this.limit
limit: _this.limit,
id: _this.storeId
}
_this.status = 'loading';
this.$u.api.getverificationPageList(data).then(res => {

View File

@@ -29,8 +29,9 @@
<!--底部-->
<view class="coreshop-foot-hight-view" />
<view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom coreshop-text-center coreshop-padding-10">
<u-button class='coreshop-bg-red' type="success" size="default" @click="saveStore">确认</u-button>
<view class="coreshop-bottomBox">
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="saveAllStore" v-if="isShopManager">查看所有数据</button>
<button class="coreshop-btn coreshop-btn-square coreshop-btn-b" @click="saveStore">选择门店数据</button>
</view>
</view>
@@ -42,12 +43,17 @@
data() {
return {
storeList: [],
storeId: uni.getStorageSync('storeId')
storeId: 0,
isShopManager: false
};
},
computed: {},
onLoad() {
this.getStoreAddress();
//判断是否是店员
this.$u.api.isStoreUser().then(res => {
this.isShopManager = res.data.isShopManager
})
},
methods: {
// 选择门店
@@ -56,9 +62,20 @@
},
// 确认门店
saveStore() {
//uni.setStorageSync('storeId', this.storeId);
if (this.storeId == 0) {
this.$u.toast("请选择门店")
return false;
}
this.$u.route('/pages/member/merchant/index/index', {
storeId: this.storeId
storeId: this.storeId,
isShopManager: this.isShopManager,
});
},
// 确认门店
saveAllStore() {
this.$u.route('/pages/member/merchant/index/index', {
storeId: this.storeId,
isShopManager: this.isShopManager,
});
},
//获取门店列表
@@ -70,7 +87,7 @@
success(res) {
_this.latitude = res.latitude
_this.longitude = res.longitude
console.log('当前位置的经度1' + res);
//console.log('当前位置的经度1' + res);
},
fail: function () {
_this.$u.toast("获取您的经纬度坐标失败")
@@ -87,7 +104,7 @@
'page': _this.page,
'limit': _this.limit,
}
_this.$u.api.storeList(data).then(e => {
_this.$u.api.getStoreListForUser(data).then(e => {
if (e.status) {
console.log(e);
_this.storeList = [..._this.storeList, ...e.data]
@@ -104,7 +121,7 @@
success: function (res) {
_this.longitude = res.longitude;
_this.latitude = res.latitude;
console.log('当前位置的经度2' + res);
//console.log('当前位置的经度2' + res);
},
fail: function () {
_this.latitude = 0;
@@ -119,7 +136,7 @@
'page': _this.page,
'limit': _this.limit,
}
_this.$u.api.storeList(data).then(e => {
_this.$u.api.getStoreListForUser(data).then(e => {
if (e.status) {
console.log(e);
_this.storeList = [..._this.storeList, ...e.data]

View File

@@ -70,12 +70,12 @@
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
}
},
storeId: 0,
}
},
onShow() {
this.page = 1;
this.ladingList = [];
onLoad(option) {
this.storeId = option.storeId;
this.getLadingList();
},
methods: {
@@ -84,7 +84,8 @@
let _this = this
let data = {
page: _this.page,
limit: _this.limit
limit: _this.limit,
id: _this.storeId
}
_this.status = 'loading';
this.$u.api.storeLadingList(data).then(res => {

View File

@@ -34,7 +34,7 @@
<li lay-id="platform" class="layui-this">特殊开关</li>
<li lay-id="platform">平台设置</li>
<li lay-id="share">分享设置</li>
<li lay-id="users">会员设置</li>
<li lay-id="users">商家设置</li>
<li lay-id="goods">商品设置</li>
<li lay-id="order">订单管理</li>
<li lay-id="points">积分设置</li>
@@ -343,12 +343,11 @@
<div class="layui-tab-item">
<div class="layui-form coreshop-form">
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['isBindMobile']['sKey']}}</label>
<div class="layui-input-inline layui-inline-4">
<input type="radio" lay-filter="isBindMobile" name="isBindMobile" value="1" title="绑定" {{d.data.configs['isBindMobile']['sValue']==="1" ? 'checked':''}}>
<input type="radio" lay-filter="isBindMobile" name="isBindMobile" value="2" title="不绑定" {{d.data.configs['isBindMobile']['sValue']==="2" ? 'checked':''}}>
<label class="layui-form-label">{{d.data.configs['shopManagerMobile']['sKey']}}</label>
<div class="layui-input-inline layui-inline-5">
<input type="text" name="shopManagerMobile" value="{{d.data.configs['shopManagerMobile']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">第三方登录的时候是否需要绑定手机号码强烈建议绑定手机号码</div>
<div class="layui-form-mid layui-word-aux">商家管理员的手机号码绑定的用户在个人中心的商家中心可以查看所有商城数据门店列表的人员只能查看本门店的数据多个手机号请使用小写逗号,隔开最多8个号码19145919666,19145919666</div>
</div>
<div class="layui-form-item" style="margin-top: 20px;">
<label class="layui-form-label">{{d.data.configs['shopMobile']['sKey']}}</label>
@@ -357,6 +356,43 @@
</div>
<div class="layui-form-mid layui-word-aux">前台下单时给商家发送短信通知多个手机号请使用小写逗号,隔开最多8个号码19145919666,19145919666</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipName']['sKey']}}</label>
<div class="layui-input-inline layui-inline-3">
<input type="text" name="reshipName" value="{{d.data.configs['reshipName']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="收货人名称" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">用户退货时的收货人姓名</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipMobile']['sKey']}}</label>
<div class="layui-input-inline layui-inline-3">
<input type="text" name="reshipMobile" value="{{d.data.configs['reshipMobile']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="收货人手机号码" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">用户退货时的收货人联系方式</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipAreaId']['sKey']}}</label>
<div class="layui-input-inline layui-inline-4 address-class">
<!--<input type="text" name="reshipAreaId" value="{{d.data.configs['reshipAreaId']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="" class="layui-input">-->
<input type="hidden" name="reshipAreaId" value="{{d.data.configs['reshipAreaId']['sValue']}}">
</div>
<div class="layui-form-mid layui-word-aux">商家区域设置</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipCoordinate']['sKey']}}</label>
<div class="layui-input-inline layui-inline-5">
<input type="text" name="reshipCoordinate" id="coordinateBox" lay-active="showMap" value="{{d.data.configs['reshipCoordinate']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="退货坐标" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">商家坐标同城配送的运费计算将使用用户地址的坐标和本坐标进行计算多少公里数按照公里数计算运费</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipAddress']['sKey']}}</label>
<div class="layui-input-inline layui-inline-5">
<input type="text" name="reshipAddress" value="{{d.data.configs['reshipAddress']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="退货地址" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">商家的详细地址</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">&nbsp;</label>
<div class="layui-input-block">
@@ -420,42 +456,6 @@
</div>
<div class="layui-form-mid layui-word-aux">订单催付款时间,单位为分钟请设置10分钟以上时间因为催付款任务5分钟执行一次</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipName']['sKey']}}</label>
<div class="layui-input-inline layui-inline-3">
<input type="text" name="reshipName" value="{{d.data.configs['reshipName']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="收货人名称" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">用户退货时的收货人姓名</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipMobile']['sKey']}}</label>
<div class="layui-input-inline layui-inline-3">
<input type="text" name="reshipMobile" value="{{d.data.configs['reshipMobile']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="收货人手机号码" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">用户退货时的收货人联系方式</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipAreaId']['sKey']}}</label>
<div class="layui-input-inline layui-inline-4 address-class">
<!--<input type="text" name="reshipAreaId" value="{{d.data.configs['reshipAreaId']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="" class="layui-input">-->
<input type="hidden" name="reshipAreaId" value="{{d.data.configs['reshipAreaId']['sValue']}}">
</div>
<div class="layui-form-mid layui-word-aux">商家区域设置</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipCoordinate']['sKey']}}</label>
<div class="layui-input-inline layui-inline-5">
<input type="text" name="reshipCoordinate" id="coordinateBox" lay-active="showMap" value="{{d.data.configs['reshipCoordinate']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="退货坐标" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">商家坐标同城配送的运费计算将使用用户地址的坐标和本坐标进行计算多少公里数按照公里数计算运费</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">{{d.data.configs['reshipAddress']['sKey']}}</label>
<div class="layui-input-inline layui-inline-5">
<input type="text" name="reshipAddress" value="{{d.data.configs['reshipAddress']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="退货地址" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">商家的详细地址</div>
</div>
<blockquote class="layui-elem-quote">
佣金通道

View File

@@ -52,6 +52,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
private readonly ICoreCmsOrderDistributionModelServices _orderDistributionModelServices;
private readonly ICoreCmsBillPaymentsServices _billPaymentsServices;
private readonly IRedisOperationRepository _redisOperationRepository;
private readonly ICoreCmsUserServices _userServices;
private readonly ICoreCmsClerkServices _clerkServices;
@@ -64,7 +66,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
, ICoreCmsSettingServices settingServices
, ICoreCmsAreaServices areaServices
, ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillPaymentsServices billPaymentsServices)
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices)
{
_user = user;
_orderServices = orderServices;
@@ -80,6 +82,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
_orderDistributionModelServices = orderDistributionModelServices;
_redisOperationRepository = redisOperationRepository;
_billPaymentsServices = billPaymentsServices;
_userServices = userServices;
_clerkServices = clerkServices;
}
@@ -256,11 +260,23 @@ namespace CoreCms.Net.Web.WebApi.Controllers
var userId = _user.ID;
if ((string)entity.data == "merchant")
{
var store = await _storeServices.GetStoreByUserId(_user.ID);
if (store == null)
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var user = await _userServices.QueryByClauseAsync(p => p.id == userId);
if (user == null)
{
jm.status = false;
jm.msg = "你不是店员";
jm.msg = "用户获取失败";
return jm;
}
var isShopManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile);
var store = await _clerkServices.QueryByClauseAsync(p => p.userId == userId);
if (store == null && isShopManager == false)
{
jm.status = false;
jm.msg = "你不是店员或管理员";
return jm;
}
else

View File

@@ -46,6 +46,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
private readonly ICoreCmsClerkServices _clerkServices;
private readonly ICoreCmsStoreServices _storeServices;
private readonly ICoreCmsUserGradeServices _userGradeServices;
private readonly ICoreCmsSettingServices _settingServices;
private readonly IHttpContextUser _user;
@@ -53,16 +54,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
/// <summary>
/// 构造函数
/// </summary>
/// <param name="servicesServices"></param>
/// <param name="user"></param>
/// <param name="userServicesOrderServices"></param>
/// <param name="userServicesTicketServices"></param>
/// <param name="userServices"></param>
/// <param name="clerkServices"></param>
/// <param name="ticketVerificationLogServices"></param>
/// <param name="storeServices"></param>
/// <param name="userGradeServices"></param>
public ServiceController(ICoreCmsServicesServices servicesServices, IHttpContextUser user, ICoreCmsUserServicesOrderServices userServicesOrderServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices, ICoreCmsUserServicesTicketVerificationLogServices ticketVerificationLogServices, ICoreCmsStoreServices storeServices, ICoreCmsUserGradeServices userGradeServices)
public ServiceController(ICoreCmsServicesServices servicesServices, IHttpContextUser user, ICoreCmsUserServicesOrderServices userServicesOrderServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices, ICoreCmsUserServicesTicketVerificationLogServices ticketVerificationLogServices, ICoreCmsStoreServices storeServices, ICoreCmsUserGradeServices userGradeServices, ICoreCmsSettingServices settingServices)
{
_servicesServices = servicesServices;
_user = user;
@@ -73,6 +65,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
_ticketVerificationLogServices = ticketVerificationLogServices;
_storeServices = storeServices;
_userGradeServices = userGradeServices;
_settingServices = settingServices;
}
@@ -287,7 +280,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
[Authorize]
public async Task<WebApiCallBack> VerificationPageList([FromBody] FMPageByIntId entity)
{
var jm = await _ticketVerificationLogServices.GetVerificationLogs(_user.ID, entity.page, entity.limit);
var jm = await _ticketVerificationLogServices.GetVerificationLogs(_user.ID, entity.id, entity.page, entity.limit);
return jm;
}
#endregion
@@ -406,7 +399,13 @@ namespace CoreCms.Net.Web.WebApi.Controllers
return jm;
}
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var isManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile);
var clerk = await _clerkServices.QueryByClauseAsync(p => p.userId == user.id);
if (!isManager)
{
if (clerk == null)
{
jm.msg = "非门店店员无权限核验";
@@ -418,11 +417,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
jm.msg = "您所在的门店无权核销此券";
return jm;
}
}
//开始更新数据
var log = new CoreCmsUserServicesTicketVerificationLog
{
storeId = clerk.storeId,
storeId = clerk?.storeId ?? 0,
verificationUserId = _user.ID,
ticketId = ticket.id,
ticketRedeemCode = ticket.redeemCode,

View File

@@ -43,6 +43,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsBillLadingServices _billLadingServices;
private readonly ICoreCmsOrderServices _orderServices;
private readonly ICoreCmsUserServices _userServices;
/// <summary>
@@ -52,7 +53,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
, ICoreCmsStoreServices storeServices
, ICoreCmsClerkServices clerkServices
, ICoreCmsSettingServices settingServices
, ICoreCmsBillLadingServices billLadingServices, ICoreCmsOrderServices orderServices)
, ICoreCmsBillLadingServices billLadingServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices)
{
_user = user;
_storeServices = storeServices;
@@ -60,6 +61,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
_settingServices = settingServices;
_billLadingServices = billLadingServices;
_orderServices = orderServices;
_userServices = userServices;
}
//公共接口======================================================================================================
@@ -195,9 +197,9 @@ namespace CoreCms.Net.Web.WebApi.Controllers
//验证接口======================================================================================================
#region 访
#region
/// <summary>
/// 判断访问用户是否是店员
/// 判断是否是商家,店员,开启商家中心
/// </summary>
/// <returns></returns>
[HttpPost]
@@ -216,14 +218,129 @@ namespace CoreCms.Net.Web.WebApi.Controllers
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetStoreByUserId()
public async Task<WebApiCallBack> GetStoreByUserId([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack
var jm = new WebApiCallBack();
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var user = await _userServices.QueryByClauseAsync(p => p.id == _user.ID);
if (user == null)
{
status = true,
msg = "获取成功",
data = await _storeServices.GetStoreByUserId(_user.ID)
jm.status = false;
jm.msg = "用户获取失败";
return jm;
}
var isManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile);
if (entity.id == 0 && isManager)
{
var latlong = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipCoordinate);
var latLongArray = !string.IsNullOrEmpty(latlong) ? latlong.Split(",") : new string[2];
jm.status = true;
jm.data = new CoreCmsStore
{
id = 0,
storeName = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopName),
//mobile = p.mobile,
//linkMan = p.linkMan,
//logoImage = p.logoImage,
//areaId = p.areaId,
address = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipAddress),
//coordinate = p.coordinate,
latitude = latLongArray[0],
longitude = latLongArray[1],
//isDefault = p.isDefault,
//createTime = p.createTime,
//updateTime = p.updateTime,
};
}
else if (entity.id > 0 && isManager)
{
jm.status = true;
jm.data = await _storeServices.QueryByClauseAsync(p => p.id == entity.id);
}
else
{
jm.status = true;
jm.data = await _storeServices.GetStoreByUserId(_user.ID, entity.id);
}
return jm;
}
#endregion
#region
/// <summary>
/// 获取单个用户能管理的门店列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetStoreListForUser([FromBody] FMGetStoreQueryPageByCoordinate entity)
{
var jm = new WebApiCallBack();
try
{
var where = PredicateBuilder.True<CoreCmsStore>();
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopManagerMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopManagerMobile);
var user = await _userServices.QueryByClauseAsync(p => p.id == _user.ID);
if (user == null)
{
jm.status = false;
jm.msg = "用户获取失败";
return jm;
}
var isManager = !string.IsNullOrEmpty(shopManagerMobile) && shopManagerMobile.Contains(user.mobile);
if (!isManager)
{
var stroes = await _clerkServices.QueryListByClauseAsync(p => p.userId == _user.ID);
var stroeIds = stroes.Select(p => p.storeId).ToList();
where = where.And(p => stroeIds.Contains(p.id));
}
jm.status = true;
var data = await _storeServices.QueryPageAsyncByCoordinate(where, p => p.distance, OrderByType.Asc, entity.page, entity.limit, entity.latitude, entity.longitude);
foreach (var item in data)
{
if (item.distance > 0)
{
if (item.distance > 1000)
{
item.distanceStr = Math.Round(item.distance / 1000, 2) + "km";
}
else
{
item.distanceStr = Math.Round(item.distance, 2) + "m";
}
}
else
{
item.distanceStr = "";
}
}
jm.data = data;
jm.otherData = new
{
totalCount = data.TotalCount,
totalPages = data.TotalPages,
};
}
catch (Exception e)
{
jm.msg = GlobalConstVars.DataHandleEx;
jm.data = e.ToString();
}
return jm;
}
#endregion
@@ -240,8 +357,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
{
var jm = new WebApiCallBack();
var store = await _storeServices.GetStoreByUserId(_user.ID);
if (store != null)
var store = await _clerkServices.IsClerk(_user.ID);
if (store != null && store.otherData.ObjectToBool())
{
jm = await _orderServices.GetOrderPageByMerchant(entity.dateType, entity.date, entity.status, entity.receiptType, entity.storeId, entity.page, entity.limit);
}
@@ -268,8 +385,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
{
var jm = new WebApiCallBack();
var store = await _storeServices.GetStoreByUserId(_user.ID);
if (store != null)
var store = await _clerkServices.IsClerk(_user.ID);
if (store != null && store.otherData.ObjectToBool())
{
jm = await _orderServices.GetOrderPageByMerchantSearch(entity.keyword, entity.status, entity.receiptType, entity.storeId, entity.page, entity.limit);
}
@@ -294,7 +411,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
[Authorize]
public async Task<WebApiCallBack> StoreLadingList([FromBody] FMPageByIntId entity)
{
var jm = await _billLadingServices.GetStoreLadingList(_user.ID, entity.page, entity.limit);
var jm = await _billLadingServices.GetStoreLadingList(_user.ID, entity.id, entity.page, entity.limit);
return jm;
}
#endregion