fixed 修改店铺列表细节
This commit is contained in:
parent
747ba75b8e
commit
f5cbb5b1ce
@ -86,9 +86,22 @@ namespace ARW.Model.Dto.Business.ShopManager.Shops
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 未绑定的用户查询对象
|
||||
///
|
||||
/// @author 黎文豪
|
||||
/// @date 2023-06-09
|
||||
/// </summary>
|
||||
public class UserWithOutBindQueryDto : PagerInfo
|
||||
{
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 店铺查询对象
|
||||
/// 未绑定的客户查询对象
|
||||
///
|
||||
/// @author 黎文豪
|
||||
/// @date 2023-06-09
|
||||
|
@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Business.ShopManager.Shops
|
||||
{
|
||||
/// <summary>
|
||||
/// 未绑定客户展示对象
|
||||
///
|
||||
/// @author 黎文豪
|
||||
/// @date 2023-06-12
|
||||
/// </summary>
|
||||
public class CustomerWithOutBindVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 描述 : 客户guid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long CustomerGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :客户名称
|
||||
/// </summary>
|
||||
public string CustomerNickname { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -36,6 +36,11 @@ namespace ARW.Model.Vo.Business.ShopManager.Shops
|
||||
[EpplusIgnore]
|
||||
public int? ShopUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :客户guid
|
||||
@ -44,6 +49,11 @@ namespace ARW.Model.Vo.Business.ShopManager.Shops
|
||||
[EpplusIgnore]
|
||||
public long? ShopCustomerGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名
|
||||
/// </summary>
|
||||
public string CustomerNickname { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :经营类目guid
|
||||
@ -53,6 +63,12 @@ namespace ARW.Model.Vo.Business.ShopManager.Shops
|
||||
public long ShopBusinessCategoryGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 经营类别名称
|
||||
/// </summary>
|
||||
public string ShopBusinessCategoryName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :图标
|
||||
/// </summary>
|
||||
@ -109,5 +125,7 @@ namespace ARW.Model.Vo.Business.ShopManager.Shops
|
||||
[EpplusTableColumn(Header = "审核人")]
|
||||
public long ShopAuditUserGuid { get; set; }
|
||||
|
||||
public string CreateTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
29
ARW.Model/Vo/Business/ShopManager/Shops/UserWithOutBindVo.cs
Normal file
29
ARW.Model/Vo/Business/ShopManager/Shops/UserWithOutBindVo.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Business.ShopManager.Shops
|
||||
{
|
||||
/// <summary>
|
||||
/// 未绑定用户展示对象
|
||||
///
|
||||
/// @author 黎文豪
|
||||
/// @date 2023-06-12
|
||||
/// </summary>
|
||||
public class UserWithOutBindVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 描述 : 用户guid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long UserId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :用户名称
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -17,6 +17,11 @@ using ARW.Model.Vo.Business.ShopManager.Shops;
|
||||
using MimeKit;
|
||||
using ARW.Model.Models.Business.Custom.Customers;
|
||||
using ARW.Repository.Business.Custom.Customers;
|
||||
using ARW.Model.System;
|
||||
using ARW.Repository.System;
|
||||
using ARW.Model.Vo.Business.GoodsManager.GoodsCategorys;
|
||||
using ARW.Repository.Business.GoodsManager.GoodsCategorys;
|
||||
using ARW.Model.Models.Business.GoodsManager.GoodsCategorys;
|
||||
|
||||
namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||
{
|
||||
@ -31,12 +36,16 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||
{
|
||||
private readonly ShopRepository _ShopRepository;
|
||||
private readonly CustomerRepository _CustomerRepository;
|
||||
private readonly SysUserRepository _SysUserRepository;
|
||||
private readonly GoodsCategoryRepository _GoodsCategoryRepository;
|
||||
|
||||
|
||||
public ShopServiceImpl(ShopRepository ShopRepository, CustomerRepository customerRepository)
|
||||
public ShopServiceImpl(ShopRepository ShopRepository, CustomerRepository customerRepository, SysUserRepository sysUserRepository, GoodsCategoryRepository goodsCategoryRepository)
|
||||
{
|
||||
this._ShopRepository = ShopRepository;
|
||||
_CustomerRepository = customerRepository;
|
||||
_SysUserRepository = sysUserRepository;
|
||||
_GoodsCategoryRepository = goodsCategoryRepository;
|
||||
}
|
||||
|
||||
#region 业务逻辑代码
|
||||
@ -54,10 +63,16 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||
predicate = predicate.AndIF(parm.ShopAuditStatus != null, it => it.ShopAuditStatus == parm.ShopAuditStatus);
|
||||
var query = _ShopRepository
|
||||
.Queryable()
|
||||
.LeftJoin<SysUser>((s, c) => s.ShopUserId == c.UserId)
|
||||
.LeftJoin<Customer>((s, c, d) => s.ShopCustomerGuid == d.CustomerGuid)
|
||||
.LeftJoin<GoodsCategory>((s, c, d, f) => s.ShopBusinessCategoryGuid == f.GoodsCategoryGuid)
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(s => s.ShopSort, OrderByType.Asc)
|
||||
.Select(s => new ShopVo
|
||||
.Select((s, c, d,f) => new ShopVo
|
||||
{
|
||||
UserName = c.UserName,
|
||||
CustomerNickname = d.CustomerNickname,
|
||||
ShopBusinessCategoryName = f.GoodsCategoryName,
|
||||
ShopId = s.ShopId,
|
||||
ShopGuid = s.ShopGuid,
|
||||
ShopUserId = s.ShopUserId,
|
||||
@ -71,6 +86,7 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||
ShopSalesOrderCount = s.ShopSalesOrderCount,
|
||||
ShopAuditStatus = s.ShopAuditStatus,
|
||||
ShopAuditUserGuid = s.ShopAuditUserGuid,
|
||||
CreateTime = s.Create_time.ToString("yyyy-MM-dd HH:mm")
|
||||
});
|
||||
|
||||
|
||||
@ -89,7 +105,8 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
model.ShopAuditStatus = 2;
|
||||
model.ShopAuditUserGuid = 1;
|
||||
var response = await _ShopRepository.InsertReturnSnowflakeIdAsync(model);
|
||||
return "添加成功!";
|
||||
}
|
||||
@ -109,19 +126,73 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取经营类目列表(一级类目)
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<GoodsCategoryVo>> GetFirstGoodsCategoryList()
|
||||
{
|
||||
var query = _GoodsCategoryRepository
|
||||
.Queryable()
|
||||
.Where(s => s.GoodsCategoryParentGuid == 0)
|
||||
.OrderBy(s => s.Update_time, OrderByType.Desc)
|
||||
.Select((s) => new GoodsCategoryVo
|
||||
{
|
||||
GoodsCategoryId = s.GoodsCategoryId,
|
||||
GoodsCategoryGuid = s.GoodsCategoryGuid,
|
||||
GoodsCategoryParentGuid = s.GoodsCategoryParentGuid,
|
||||
GoodsCategoryAncestralGuid = s.GoodsCategoryAncestralGuid,
|
||||
GoodsCategoryName = s.GoodsCategoryName,
|
||||
GoodsCategoryImg = s.GoodsCategoryImg,
|
||||
GoodsCategoryDisplayStatus = s.GoodsCategoryDisplayStatus,
|
||||
GoodsCategoryIsPopular = s.GoodsCategoryIsPopular,
|
||||
ProductCategorySort = s.ProductCategorySort,
|
||||
});
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取未绑定的用户列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PagedInfo<UserWithOutBindVo>> GetUserWithOutBindList(UserWithOutBindQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<SysUser>();
|
||||
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.UserName), s => s.UserName.Contains(parm.UserName));
|
||||
|
||||
var query = _SysUserRepository
|
||||
.Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.Where(s => SqlFunc.Subqueryable<Shop>().Where(it => it.ShopUserId == s.UserId).NotAny())
|
||||
.Where(s => s.UserId != 1)
|
||||
.OrderBy(s => s.Update_time, OrderByType.Desc)
|
||||
.Select((s) => new UserWithOutBindVo
|
||||
{
|
||||
UserId = s.UserId,
|
||||
UserName = s.UserName,
|
||||
});
|
||||
|
||||
return await query.ToPageAsync(parm);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取未绑定的客户列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<PagedInfo<CustomerWithOutBindVo>> GetCustomerWithOutBindList(CustomerWithOutBindQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<Customer>();
|
||||
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerNickname), s => s.CustomerNickname .Contains(parm.CustomerNickname));
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerNickname), s => s.CustomerNickname.Contains(parm.CustomerNickname));
|
||||
|
||||
var query = _CustomerRepository
|
||||
.Queryable()
|
||||
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Model.Dto.Business.ShopManager.Shops;
|
||||
using ARW.Model.Models.Business.ShopManager.Shops;
|
||||
using ARW.Model.Vo.Business.GoodsManager.GoodsCategorys;
|
||||
using ARW.Model.Vo.Business.ShopManager.Shops;
|
||||
|
||||
namespace ARW.Service.Business.IBusinessService.ShopManager.Shops
|
||||
@ -26,6 +27,14 @@ namespace ARW.Service.Business.IBusinessService.ShopManager.Shops
|
||||
Task<PagedInfo<ShopVo>> GetShopList(ShopQueryDto parm);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取未绑定的用户列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<PagedInfo<UserWithOutBindVo>> GetUserWithOutBindList(UserWithOutBindQueryDto parm);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取未绑定的客户列表
|
||||
/// </summary>
|
||||
@ -33,8 +42,15 @@ namespace ARW.Service.Business.IBusinessService.ShopManager.Shops
|
||||
/// <returns></returns>
|
||||
Task<PagedInfo<CustomerWithOutBindVo>> GetCustomerWithOutBindList(CustomerWithOutBindQueryDto parm);
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
/// <summary>
|
||||
/// 获取经营类目列表(一级类目)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GoodsCategoryVo>> GetFirstGoodsCategoryList();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改店铺
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
|
@ -15,7 +15,7 @@ using ARW.Model.Models.Business.ShopManager.Shops;
|
||||
using ARW.Model.Vo.Business.ShopManager.Shops;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using ARW.Admin.WebApi.Framework;
|
||||
|
||||
using ARW.Model.Vo.Business.GoodsManager.GoodsCategorys;
|
||||
|
||||
namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
||||
{
|
||||
@ -54,6 +54,34 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取未绑定的用户列表
|
||||
/// </summary>
|
||||
/// <param name="parm">查询参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getUserWithOutBindList")]
|
||||
public async Task<IActionResult> GetUserWithOutBindList([FromQuery] UserWithOutBindQueryDto parm)
|
||||
{
|
||||
var res = await _ShopService.GetUserWithOutBindList(parm);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取经营类目列表(一级类目)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getFirstGoodsCategoryList")]
|
||||
public async Task<IActionResult> GetFirstGoodsCategoryList()
|
||||
{
|
||||
var res = await _ShopService.GetFirstGoodsCategoryList();
|
||||
res ??= new List<GoodsCategoryVo>();
|
||||
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取未绑定的客户列表
|
||||
/// </summary>
|
||||
@ -78,7 +106,7 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
||||
{
|
||||
if (parm == null) { throw new CustomException("请求参数错误"); }
|
||||
|
||||
var modal = new Shop();
|
||||
var modal = new Shop();
|
||||
if (parm.ShopId != 0) modal = parm.Adapt<Shop>().ToUpdate(HttpContext);
|
||||
else modal = parm.Adapt<Shop>().ToCreate(HttpContext);
|
||||
|
||||
@ -93,23 +121,31 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:shop:delete")]
|
||||
[Log(Title = "店铺删除", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Delete(string ids)
|
||||
public async Task<IActionResult> Delete(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
var response = _ShopService.Delete(idsArr);
|
||||
foreach (var item in ids)
|
||||
{
|
||||
await _ShopService.UpdateAsync(f => new Shop
|
||||
{
|
||||
ShopUserId = null,
|
||||
ShopCustomerGuid = null
|
||||
}, s => s.ShopUserId == item);
|
||||
}
|
||||
return SUCCESS("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出店铺
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "店铺导出", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||||
[HttpGet("exportShop")]
|
||||
[ActionPermissionFilter(Permission = "business:shop:export")]
|
||||
public async Task<IActionResult> ExportExcel([FromQuery] ShopQueryDto parm)
|
||||
public async Task<IActionResult> ExportExcel([FromQuery] ShopQueryDto parm)
|
||||
{
|
||||
parm.PageSize = 10000;
|
||||
var list = await _ShopService.GetShopList(parm);
|
||||
@ -128,7 +164,7 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
||||
data = selectDataList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 导出数据处理
|
||||
var handleData = await _ShopService.HandleExportData(data);
|
||||
@ -137,7 +173,7 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
||||
return SUCCESS(new { path = "/export/" + sFileName, fileName = sFileName });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// 审核店铺
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
@ -147,7 +147,7 @@ $if(column.HtmlType == "customInput" && column.IsPk == false)
|
||||
$elseif(column.HtmlType == "imageUpload")
|
||||
<el-table-column prop="${columnName}" label="${labelName}" align="center">
|
||||
<template #default="scope">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.${columnName}.split(',')[0]" :preview-src-list="scope.row.${columnName}.split(',')">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.${columnName}?.split(',')[0]" :preview-src-list="scope.row.${columnName}?.split(',')">
|
||||
<div><el-icon :size="15"><document /></el-icon></div>
|
||||
</el-image>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user