Commit f06bd2a3 authored by liudong1993's avatar liudong1993

1幻灯片配置

parent 25ff469a
......@@ -30,7 +30,7 @@ namespace Edu.Education
new QuarzHelper().RevenueReportTimer().GetAwaiter().GetResult();
new QuarzHelper().WeXinMediumTimer().GetAwaiter().GetResult();//企业微信定时上传文件 2021-08-09
new QuarzHelper().WeXinChannelTimer().GetAwaiter().GetResult();//企业微信定时渠道码更新 2021-08-20
//new QuarzHelper().EduB2BOrderCancelTimer().GetAwaiter().GetResult();//教育同业订单超时取消
new QuarzHelper().EduB2BOrderCancelTimer().GetAwaiter().GetResult();//教育同业订单超时取消
//new QuarzHelper().EduB2BOrderCommissionTimer().GetAwaiter().GetResult();//教育同业订单返佣
new QuarzHelper().CheckPerparingTimer().GetAwaiter().GetResult();
}
......
using Edu.Common.Enum;
using Edu.Common.Enum.Customer;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 同业幻灯片实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_B2B_SlideShow
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 副标题
/// </summary>
public string SubTitle { get; set; }
/// <summary>
/// 轮播的列表
/// </summary>
public string Content { get; set; }
/// <summary>
/// 状态 0正常,1删除
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
\ No newline at end of file
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 同业提款账户扩展类
/// </summary>
public class RB_B2B_SlideShow_Extend : RB_B2B_SlideShow
{
/// <summary>
/// 幻灯片列表
/// </summary>
public List<B2BSlideShowModel> SlideShowList { get; set; }
}
/// <summary>
/// 幻灯片列表
/// </summary>
public class B2BSlideShowModel
{
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 图片地址
/// </summary>
public string Image { get; set; }
/// <summary>
/// 跳转路径
/// </summary>
public string Path { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}
......@@ -44,6 +44,10 @@ namespace Edu.Module.Customer
/// 财务账户
/// </summary>
private readonly RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
/// <summary>
/// 幻灯片
/// </summary>
private readonly RB_B2B_SlideShowRepository b2B_SlideShowRepository = new RB_B2B_SlideShowRepository();
......@@ -272,39 +276,73 @@ namespace Edu.Module.Customer
}
}
return flag ? "" : "出错了,请联系管理员";
}
}
#endregion
#region 幻灯片
/// <summary>
/// 获取客户幸福存折分页列表
/// 获取幻灯片配置
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public List<RB_Customer_BalanceDetail_ViewModel> GetCustomerBalanceDetailPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Customer_BalanceDetail_ViewModel query)
public object GetB2BSlideShowInfo(UserInfo userInfo)
{
var list = customer_BalanceDetailRepository.GetCustomerBalanceDetailPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
var smodel = b2B_SlideShowRepository.GetList(new RB_B2B_SlideShow_Extend() { Group_Id = userInfo.Group_Id }).FirstOrDefault();
if (smodel != null)
{
var list = JsonHelper.DeserializeObject<List<B2BSlideShowModel>>(smodel.Content);
return new
{
smodel.Title,
smodel.SubTitle,
List = list.OrderBy(x => x.Sort).ToList()
};
}
else {
return new
{
Title = "",
SubTitle = "",
List = new List<B2BSlideShowModel>()
};
}
}
/// <summary>
/// 获取客户返佣或幸福存折列表
/// 保存幻灯片配置
/// </summary>
/// <param name="query"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Customer_BalanceDetail_ViewModel> GetCustomerBalanceDetailListModule(RB_Customer_BalanceDetail_ViewModel query)
public string SetB2BSlideShowInfo(RB_B2B_SlideShow_Extend demodel)
{
var list = customer_BalanceDetailRepository.GetCustomerBalanceDetailListRepository(query);
return list;
var smodel = b2B_SlideShowRepository.GetList(new RB_B2B_SlideShow_Extend() { Group_Id = demodel.Group_Id }).FirstOrDefault();
if (smodel == null)
{
bool flag = b2B_SlideShowRepository.Insert(demodel) > 0;
return flag ? "" : "出错了,请联系管理员";
}
else {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_B2B_SlideShow_Extend.Title), demodel.Title},
{ nameof(RB_B2B_SlideShow_Extend.SubTitle), demodel.SubTitle},
{ nameof(RB_B2B_SlideShow_Extend.Content), demodel.Content},
{ nameof(RB_B2B_SlideShow_Extend.UpdateBy), demodel.UpdateBy},
{ nameof(RB_B2B_SlideShow_Extend.UpdateTime), demodel.UpdateTime},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_B2B_SlideShow_Extend.Id),
FiledValue = smodel.Id,
OperatorEnum =OperatorEnum.Equal
}
};
bool flag = b2B_SlideShowRepository.Update(keyValues, wheres);
return flag ? "" : "出错了,请联系管理员";
}
}
#endregion
}
}
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using VT.FW.DB.Dapper;
using Edu.Common.Enum;
namespace Edu.Repository.Customer
{
/// <summary>
/// 同业幻灯片仓储层对象
/// </summary>
public class RB_B2B_SlideShowRepository : BaseRepository<RB_B2B_SlideShow>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_B2B_SlideShow_Extend> GetList(RB_B2B_SlideShow_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_B2B_SlideShow AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_B2B_SlideShow_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_B2B_SlideShow_Extend.Group_Id), query.Group_Id);
}
}
return Get<RB_B2B_SlideShow_Extend>(builder.ToString(), parameters).ToList();
}
}
}
......@@ -1100,7 +1100,7 @@ ORDER BY {orderBy}
/// <returns></returns>
public List<RB_Order_ViewModel> GetEduB2BTimeoutOrderList(int groupId)
{
string sql = $@"SELECT * FROM rb_order WHERE Group_Id ={groupId} and OrderState =1 and OrderSource =9 and IFNULL(PayState,0) <>1 and CreateTime <'{DateTime.Now.AddMinutes(-30).ToString("yyyy-MM-dd HH:mm:ss")}'";
string sql = $@"SELECT * FROM rb_order WHERE Group_Id ={groupId} and OrderState =4 and OrderSource =9 and IFNULL(PayState,0) <>1 and CreateTime <'{DateTime.Now.AddMinutes(-30).ToString("yyyy-MM-dd HH:mm:ss")}'";
return Get<RB_Order_ViewModel>(sql).ToList();
}
......
......@@ -99,5 +99,66 @@ namespace Edu.WebApi.Controllers.Customer
}
#endregion
#region 幻灯片
/// <summary>
/// 获取幻灯片配置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetB2BSlideShowInfo() {
var userInfo = base.UserInfo;
var Robj = customerRemitModule.GetB2BSlideShowInfo(userInfo);
return ApiResult.Success("", Robj);
}
/// <summary>
/// 保存幻灯片配置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetB2BSlideShowInfo() {
var userInfo = base.UserInfo;
RB_B2B_SlideShow_Extend demodel = JsonHelper.DeserializeObject<RB_B2B_SlideShow_Extend>(base.RequestParm.Msg.ToString());
if (string.IsNullOrEmpty(demodel.Title)) {
return ApiResult.ParamIsNull("请输入标题");
}
if (string.IsNullOrEmpty(demodel.SubTitle)) {
return ApiResult.ParamIsNull("请输入副标题");
}
if (demodel.SlideShowList == null || !demodel.SlideShowList.Any()) {
return ApiResult.ParamIsNull("请选择轮播图片");
}
foreach (var item in demodel.SlideShowList) {
if (item.Sort <= 0) {
return ApiResult.ParamIsNull("请传递排序");
}
if (string.IsNullOrEmpty(item.Image)) {
return ApiResult.ParamIsNull("请传递图片路劲");
}
if (string.IsNullOrEmpty(item.Path)) {
return ApiResult.ParamIsNull("请传递跳转地址");
}
}
demodel.Content = JsonHelper.Serialize(demodel.SlideShowList);
demodel.Group_Id = userInfo.Group_Id;
demodel.CreateBy = userInfo.Id;
demodel.CreateTime = DateTime.Now;
demodel.UpdateBy = userInfo.Id;
demodel.UpdateTime = DateTime.Now;
string msg = customerRemitModule.SetB2BSlideShowInfo(demodel);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
#endregion
}
}
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