Commit 803f2e34 authored by liudong1993's avatar liudong1993

新增相亲项目

parent 021b2c8c
using VT.FW.DB;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.Miai
{
/// <summary>
/// 活动版块表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Miai_Forum
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 版块名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 图标
/// </summary>
public string Icon { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 是否显示 1是 2否
/// </summary>
public int IsShow { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号id
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate
{
get;
set;
}
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateDate
{
get;
set;
}
}
}
using VT.FW.DB;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Miai;
namespace Mall.Model.Extend.Miai
{
/// <summary>
/// 活动版块表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Miai_Forum_Extend : RB_Miai_Forum
{
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
</Project>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Common;
using Mall.Common.Plugin;
using Newtonsoft.Json;
using Mall.Common.API;
using Newtonsoft.Json.Linq;
using VT.FW.DB;
using Mall.Repository.Miai;
using Mall.Model.Extend.Miai;
namespace Mall.Module.Miai
{
/// <summary>
/// 相亲处理层
/// </summary>
public class MiaiModule
{
private readonly RB_Miai_ForumRepository miai_ForumRepository = new RB_Miai_ForumRepository();
#region 活动版块
/// <summary>
/// 获取活动版本分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Miai_Forum_Extend> GetForumPageList(int pageIndex, int pageSize, out long count, RB_Miai_Forum_Extend dmodel)
{
return miai_ForumRepository.GetPageList(pageIndex, pageSize, out count, dmodel);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Miai;
using Mall.Model.Extend.Miai;
using System.Linq;
namespace Mall.Repository.Miai
{
/// <summary>
/// 活动版块仓储层
/// </summary>
public class RB_Miai_ForumRepository : BaseRepository<RB_Miai_Forum>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Miai_Forum_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Miai_Forum_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Miai_Forum_Extend.Status)}=0 ";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Miai_Forum_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Miai_Forum_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
where += $@" and {nameof(RB_Miai_Forum_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.IsShow > 0) {
where += $@" and {nameof(RB_Miai_Forum_Extend.IsShow)} ={dmodel.IsShow}";
}
string sql = $@"select * from RB_Miai_Forum where {where} order by Id desc";
return GetPage<RB_Miai_Forum_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Miai_Forum_Extend> GetList(RB_Miai_Forum_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Miai_Forum_Extend.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Miai_Forum_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Miai_Forum_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and {nameof(RB_Miai_Forum_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.IsShow > 0)
{
where += $@" and {nameof(RB_Miai_Forum_Extend.IsShow)} ={dmodel.IsShow}";
}
string sql = $@"select * from RB_Miai_Forum where {where} order by Id desc";
return Get<RB_Miai_Forum_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Mall.Common.API;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Mall.Common.Plugin;
using Mall.CacheManager.User;
using Newtonsoft.Json.Linq;
using Mall.Common;
using Mall.AOP;
using Mall.Module.Miai;
namespace Mall.WebApi.Controllers.MallBase
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class AppletMiaiController : BaseController
{
private readonly MiaiModule miaiModule = new MiaiModule();
#region 活动版块
#endregion
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Mall.Common.API;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Mall.Common.Plugin;
using Mall.CacheManager.User;
using Newtonsoft.Json.Linq;
using Mall.Common;
using Mall.AOP;
using Mall.Module.Miai;
using Mall.Model.Extend.Miai;
namespace Mall.WebApi.Controllers.MallBase
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class MiaiController : BaseController
{
private readonly MiaiModule miaiModule = new MiaiModule();
#region 活动版块
/// <summary>
/// 获取活动版块分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetForumPageList() {
var req = base.RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_Miai_Forum_Extend demodel = JsonConvert.DeserializeObject<RB_Miai_Forum_Extend>(req.msg.ToString());
demodel.TenantId = Convert.ToInt32(req.uid);
demodel.MallBaseId = req.MallBaseId;
var list = miaiModule.GetForumPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list;
return ApiResult.Success("", pagelist);
}
#endregion
}
}
\ No newline at end of file
......@@ -38,6 +38,7 @@
<ProjectReference Include="..\Mall.Module.BaseSetUp\Mall.Module.BaseSetUp.csproj" />
<ProjectReference Include="..\Mall.Module.Education\Mall.Module.Education.csproj" />
<ProjectReference Include="..\Mall.Module.MarketingCenter\Mall.Module.MarketingCenter.csproj" />
<ProjectReference Include="..\Mall.Module.Miai\Mall.Module.Miai.csproj" />
<ProjectReference Include="..\Mall.Module.Product\Mall.Module.Product.csproj" />
<ProjectReference Include="..\Mall.Module.Property\Mall.Module.Property.csproj" />
<ProjectReference Include="..\Mall.Module.Reserve\Mall.Module.Reserve.csproj" />
......
......@@ -57,6 +57,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Reserve", "Mall
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.TradePavilion", "Mall.Module.TradePavilion\Mall.Module.TradePavilion.csproj", "{3982D5CA-D5BF-45FD-BCDA-FF6694D409D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mall.Module.Miai", "Mall.Module.Miai\Mall.Module.Miai.csproj", "{2EEB81FD-7176-4407-871E-AC41343BC601}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -151,6 +153,10 @@ Global
{3982D5CA-D5BF-45FD-BCDA-FF6694D409D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3982D5CA-D5BF-45FD-BCDA-FF6694D409D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3982D5CA-D5BF-45FD-BCDA-FF6694D409D3}.Release|Any CPU.Build.0 = Release|Any CPU
{2EEB81FD-7176-4407-871E-AC41343BC601}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EEB81FD-7176-4407-871E-AC41343BC601}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EEB81FD-7176-4407-871E-AC41343BC601}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EEB81FD-7176-4407-871E-AC41343BC601}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -173,6 +179,7 @@ Global
{B076F66B-B75E-43DE-B305-764BF3638A91} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
{449E8584-B4D1-4796-81EE-F7D70536C91D} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
{3982D5CA-D5BF-45FD-BCDA-FF6694D409D3} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
{2EEB81FD-7176-4407-871E-AC41343BC601} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {450F460D-A6AE-4FE3-948A-34E5FB8DBD7C}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment