Commit 6c8cfcc3 authored by 吴春's avatar 吴春
parents 4d623be7 6fb02033
using System;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 拼团活动商品规格表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Specification
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 规格名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 排序
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// 是否启用规格图片 1是 2否
/// </summary>
public int? EnabledImage
{
get;
set;
}
/// <summary>
/// Status
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
}
}
\ No newline at end of file
using System;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 拼团活动商品关联规格价格表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Specificationprice
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 规格值 排序组
/// </summary>
public string SpecificationSort
{
get;
set;
}
/// <summary>
/// 价格
/// </summary>
public decimal? SellingPrice
{
get;
set;
}
/// <summary>
/// 返佣总金额
/// </summary>
public decimal Commission
{
get;
set;
}
/// <summary>
/// 成本价
/// </summary>
public decimal CostMoney
{
get;
set;
}
/// <summary>
/// 库存
/// </summary>
public int? InventoryNum
{
get;
set;
}
/// <summary>
/// 商品重量 克
/// </summary>
public int? GoodsWeight
{
get;
set;
}
/// <summary>
/// 商品货号
/// </summary>
public string GoodsNumbers
{
get;
set;
}
/// <summary>
/// Status
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
/// <summary>
/// 阶梯编号
/// </summary>
public int StepId { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 拼团活动商品关联规格值表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Specificationvalue
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// GoodsId
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 规格id
/// </summary>
public int? SpecificationId
{
get;
set;
}
/// <summary>
/// 规格值名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 规格图片
/// </summary>
public string Image
{
get;
set;
}
/// <summary>
/// 排序 不能重复 用于价格绑定Key
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// Status
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
}
}
using System;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 拼团活动阶梯团设置
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Step
{
/// <summary>
/// 阶梯编号
/// </summary>
public int StepId { get; set; }
/// <summary>
/// 商品编号
/// </summary>
public int GoodId { get; set; }
/// <summary>
/// 拼团人数
/// </summary>
public int People_Num { get; set; }
/// <summary>
/// 团长优惠金额
/// </summary>
public decimal Preferential_Price { get; set; }
/// <summary>
/// 拼团时间(小时)
/// </summary>
public int Pintuan_Time { get; set; }
/// <summary>
/// 最多开团数量
/// </summary>
public int Group_Num { get; set; }
/// <summary>
/// 商户Id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序Id
/// </summary>
public int MallBaseId { get; set; }
}
}
using VT.FW.DB;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 微店表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_SmallShops_Info
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 用户id
/// </summary>
public int? UserId
{
get;
set;
}
/// <summary>
/// 微店名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 微店logo
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 总计佣金
/// </summary>
public decimal? TotalCommission
{
get;
set;
}
/// <summary>
/// 可提现佣金
/// </summary>
public decimal? Commission
{
get;
set;
}
/// <summary>
/// 微店等级id
/// </summary>
public int? GradeId
{
get;
set;
}
/// <summary>
/// 上调价格
/// </summary>
public decimal? UpPrice { get; set; }
/// <summary>
/// 类型 1百分比 2固定金额
/// </summary>
public int? PriceType { get; set; }
/// <summary>
/// 公告
/// </summary>
public string Notice { get; set; }
/// <summary>
/// 审核状态 1审核中 2通过 3拒绝
/// </summary>
public DistributorAuditStatusEnum? AuditStatus
{
get;
set;
}
/// <summary>
/// 审核时间
/// </summary>
public DateTime? AuditDate
{
get;
set;
}
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get;
set;
}
/// <summary>
/// 删除状态
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
using VT.FW.DB;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 微店价格表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_SmallShops_Price
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 微店id
/// </summary>
public int? SmallShopsId
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 商品规格key
/// </summary>
public string SpecificationKey { get; set; }
/// <summary>
/// 上调价格
/// </summary>
public decimal? UpPrice
{
get;
set;
}
/// <summary>
/// 类型 1百分比 2固定金额
/// </summary>
public int? PriceType
{
get;
set;
}
/// <summary>
/// 删除状态
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
......@@ -111,5 +111,22 @@ namespace Mall.Model.Extend.Product
return str;
}
}
/// <summary>
/// 拼团阶梯价列表
/// </summary>
public List<RB_Groupbuy_Activity_Step_Extend> GroupList { get; set; }
/// <summary>
/// 规格名列表
/// </summary>
public List<RB_Groupbuy_Activity_Specification_Extend> SpecificationList { get; set; }
/// <summary>
/// 规格价格列表
/// </summary>
public List<RB_Groupbuy_Activity_Specificationprice_Extend> SpecificationPriceList { get; set; }
}
}
using Mall.Model.Entity.Product;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 拼团活动商品规格表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Specification_Extend : RB_Groupbuy_Activity_Specification
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 规格值列表
/// </summary>
public List<RB_Groupbuy_Activity_Specificationvalue_Extend> SpecificationValueList { get; set; }
}
}
using Mall.Model.Entity.Product;
using System;
using VT.FW.DB;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 拼团活动商品关联规格价格表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Specificationprice_Extend : RB_Groupbuy_Activity_Specificationprice
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 规格值列表
/// </summary>
public object AttrList { get; set; }
/// <summary>
/// 规格值
/// </summary>
public string AttrStr { get; set; }
/// <summary>
/// 查询排序
/// </summary>
public int? SortNum { get; set; }
}
}
using Mall.Model.Entity.Product;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 拼团商品关联规格值表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Specificationvalue_Extend: RB_Groupbuy_Activity_Specificationvalue
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 图片路径
/// </summary>
public string ImagePath { get; set; }
}
}
using System;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 拼团活动阶梯团扩展实体类设置
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Step_Extend: RB_Groupbuy_Activity_Step
{
/// <summary>
/// 商品编号
/// </summary>
public string GoodIds { get; set; }
}
}
using VT.FW.DB;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Common.Enum.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 微店表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_SmallShops_Info_Extend : RB_SmallShops_Info
{
/// <summary>
/// 用户昵称
/// </summary>
public string NickName { get; set; }
/// <summary>
/// 上级id
/// </summary>
public int SuperiorId { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public string Photo { get; set; }
/// <summary>
/// userids
/// </summary>
public string UserIds { get; set; }
}
}
using VT.FW.DB;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Common.Enum.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 微店价格表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_SmallShops_Price_Extend : RB_SmallShops_Price
{
/// <summary>
/// 微店ids
/// </summary>
public string SmallShopsIds{ get; set; }
}
}
......@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
using System.Linq;
using Mall.Model.Entity.Product;
namespace Mall.Module.Product
{
......@@ -18,6 +19,67 @@ namespace Mall.Module.Product
/// </summary>
private readonly RB_Groupbuy_ActivityRepository groupbuy_ActivityRepository = new RB_Groupbuy_ActivityRepository();
/// <summary>
/// 拼团活动商品规格价格仓储层对象
/// </summary>
private RB_Groupbuy_Activity_SpecificationPriceRepository groupbuy_Activity_SpecificationPriceRepository = new RB_Groupbuy_Activity_SpecificationPriceRepository();
/// <summary>
/// 拼团活动商品关联规格值仓储层对象
/// </summary>
private RB_Groupbuy_Activity_SpecificationValueRepository groupbuy_Activity_SpecificationValueRepository = new RB_Groupbuy_Activity_SpecificationValueRepository();
/// <summary>
/// 拼团商品关联规格仓储层对象
/// </summary>
private RB_Groupbuy_Activity_SpecificationRepository groupbuy_Activity_SpecificationRepository = new RB_Groupbuy_Activity_SpecificationRepository();
/// <summary>
/// 阶梯团仓储层对象
/// </summary>
private RB_Groupbuy_Activity_StepRepository stepRepository = new RB_Groupbuy_Activity_StepRepository();
/// <summary>
/// 获取拼团活动阶梯价列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Step_Extend> GetGroupBuyActivityListRepository(RB_Groupbuy_Activity_Step_Extend query)
{
return stepRepository.GetGroupBuyActivityListRepository(query);
}
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationprice_Extend> GetGroupbuyActivitySpecificationpriceListModule(RB_Groupbuy_Activity_Specificationprice_Extend dmodel)
{
return groupbuy_Activity_SpecificationPriceRepository.GetGroupbuyActivitySpecificationpriceListRepository(dmodel);
}
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationvalue_Extend> GetGroupbuyActivitySpecificationValueListModule(RB_Groupbuy_Activity_Specificationvalue_Extend dmodel)
{
return groupbuy_Activity_SpecificationValueRepository.GetGroupbuyActivitySpecificationValueListRepository(dmodel);
}
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specification_Extend> GetGroupbuyActivitySpecificationListModule(RB_Groupbuy_Activity_Specification_Extend dmodel)
{
return groupbuy_Activity_SpecificationRepository.GetGroupbuyActivitySpecificationListRepository(dmodel);
}
/// <summary>
/// 获取拼团活动分页列表
/// </summary>
......@@ -28,13 +90,13 @@ namespace Mall.Module.Product
/// <returns></returns>
public List<RB_Groupbuy_Activity_Extend> GetGroupbuyActivityPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Groupbuy_Activity_Extend query)
{
var list= groupbuy_ActivityRepository.GetGroupbuyActivityPageListRepository(pageIndex, pageSize, out rowsCount, query);
var list = groupbuy_ActivityRepository.GetGroupbuyActivityPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string Ids = string.Join(",", list.Select(qitem => qitem.ActivityId));
if (!string.IsNullOrEmpty(Ids))
{
{
}
}
return list;
......@@ -44,10 +106,58 @@ namespace Mall.Module.Product
/// 获取活动实体类
/// </summary>
/// <param name="query"></param>
/// <param name="isGetSpec">是否获取规格信息</param>
/// <returns></returns>
public RB_Groupbuy_Activity_Extend GetGroupbuyActivityEntityModule(RB_Groupbuy_Activity_Extend query)
public RB_Groupbuy_Activity_Extend GetGroupbuyActivityEntityModule(RB_Groupbuy_Activity_Extend query, bool isGetSpec = false)
{
var extModel = groupbuy_ActivityRepository.GetGroupbuyActivityEntityRepository(query);
if (extModel == null)
{
extModel = new RB_Groupbuy_Activity_Extend();
}
if (isGetSpec)
{
//获取规格列表
List<RB_Groupbuy_Activity_Specification_Extend> specificationList = GetGroupbuyActivitySpecificationListModule(new RB_Groupbuy_Activity_Specification_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodsId = extModel.GoodId,
});
//规格值列表
List<RB_Groupbuy_Activity_Specificationvalue_Extend> specificationvalueList = GetGroupbuyActivitySpecificationValueListModule(new RB_Groupbuy_Activity_Specificationvalue_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodsId = extModel.GoodId,
});
if (specificationList != null && specificationList.Count > 0)
{
foreach (var item in specificationList)
{
item.SpecificationValueList = specificationvalueList?.Where(qitem => qitem.SpecificationId == item.Id)?.ToList() ?? new List<RB_Groupbuy_Activity_Specificationvalue_Extend>();
}
}
//拼团价格列表
List<RB_Groupbuy_Activity_Specificationprice_Extend> specificationpriceList = GetGroupbuyActivitySpecificationpriceListModule(new RB_Groupbuy_Activity_Specificationprice_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodsId = extModel.GoodId,
});
//拼团阶梯价格列表
List<RB_Groupbuy_Activity_Step_Extend> groupStepList = GetGroupBuyActivityListRepository(new RB_Groupbuy_Activity_Step_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodId = extModel.GoodId,
});
extModel.SpecificationList = specificationList;
extModel.SpecificationPriceList = specificationpriceList;
extModel.GroupList = groupStepList;
}
return extModel;
}
......
......@@ -3420,10 +3420,13 @@ namespace Mall.Module.Product
List<RB_Goods_Specification_Extend> SpecificationList = new List<RB_Goods_Specification_Extend>();
//规格值
List<RB_Goods_SpecificationValue_Extend> svlist = new List<RB_Goods_SpecificationValue_Extend>();
//规格值列表
List<RB_Goods_SpecificationPrice_Extend> SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
if (IsGetSpec == 1)
{
SpecificationList= goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
SpecificationPriceList= goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
}
foreach (var item in list)
......@@ -3450,9 +3453,36 @@ namespace Mall.Module.Product
subItem.SpecificationValueList = svlist.Where(x => x.SpecificationId == subItem.Id).ToList();
}
}
var tempPriceList = SpecificationPriceList?.Where(qitem => qitem.GoodsId == item.Id)?.ToList() ?? new List<RB_Goods_SpecificationPrice_Extend>();
int SortNum = 1;
foreach (var childItem in tempPriceList)
{
if (!string.IsNullOrEmpty(childItem.SpecificationSort))
{
var ssarr = childItem.SpecificationSort.Split(':');
int Sort = Convert.ToInt32(ssarr[0]);
string pic_url = item.SpecificationList[0].SpecificationValueList.Where(x => x.Sort == Sort).FirstOrDefault()?.ImagePath;
List<object> AttrList = new List<object>();
for (int i = 0; i < ssarr.Length; i++)
{
var smodel = item.SpecificationList[i];
var svmodel = smodel.SpecificationValueList.Where(x => x.Sort == Convert.ToInt32(ssarr[i])).FirstOrDefault();
AttrList.Add(new
{
SName = smodel.Name,
SId = smodel.Id,
SVId = svmodel.Sort,
SVName = svmodel.Name
});
}
childItem.AttrList = AttrList;
}
childItem.SortNum = SortNum;
SortNum++;
}
item.SpecificationPriceList = tempPriceList.OrderByDescending(x => x.SortNum).ToList();
}
}
}
return list;
}
......
......@@ -409,7 +409,7 @@ namespace Mall.Module.Property
if (pid > 0)
{
//生成采购财务单
OrderProcurementFinanceModule(demodel, sModel.BankAccountId, pid, demodel.Remark);
OrderProcurementFinanceModule(demodel, sModel.BankAccountId, pid, demodel.Remark, eRPEmpId);
}
}
catch (Exception ex)
......@@ -426,7 +426,7 @@ namespace Mall.Module.Property
/// </summary>
/// <param name="omodel"></param>
/// <returns></returns>
public bool OrderProcurementFinanceModule(RB_Procurement_Extend demodel, int BankAccountId, int pid, string pRemark)
public bool OrderProcurementFinanceModule(RB_Procurement_Extend demodel, int BankAccountId, int pid, string pRemark,int eRPEmpId)
{
var flag = false;
try
......@@ -457,7 +457,7 @@ namespace Mall.Module.Property
string Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + " 自动生成采购单据";
var financeObj = new
{
CreateBy = ProcurementDirector,
CreateBy = eRPEmpId > 0 ? eRPEmpId : ProcurementDirector,
demodel.IsPublic,
ClientType = 10,
ClientID = BankAccountId,
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Common;
using Mall.Common.Plugin;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using Mall.Repository;
using Mall.Repository.User;
using Mall.Repository.Product;
using Mall.Model.Extend.Product;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using Newtonsoft.Json;
using Mall.Repository.BaseSetUp;
using Mall.Common.Enum.User;
using Mall.Common.API;
using Newtonsoft.Json.Linq;
using System.Threading;
using Mall.Repository.Finance;
using NPOI.SS.Formula.Functions;
using VT.FW.DB;
namespace Mall.Module.User
{
/// <summary>
/// 微店处理层
/// </summary>
public class SmallShopsModule
{
/// <summary>
/// 用户管理
/// </summary>
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
/// <summary>
/// 小程序
/// </summary>
private readonly RB_MiniProgramRepository miniProgramRepository = new RB_MiniProgramRepository();
/// <summary>
/// 微店
/// </summary>
private readonly RB_SmallShops_InfoRepository smallShops_InfoRepository = new RB_SmallShops_InfoRepository();
/// <summary>
/// 微店价格
/// </summary>
private readonly RB_SmallShops_PriceRepository smallShops_PriceRepository = new RB_SmallShops_PriceRepository();
#region 微店管理
/// <summary>
/// 获取微店分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetSmallShopsPageList(int pageIndex, int pageSize, out long count, RB_SmallShops_Info_Extend demodel)
{
var list = smallShops_InfoRepository.GetPageList(pageIndex, pageSize, out count, demodel);
return list;
}
/// <summary>
/// 获取下拉
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetSmallShopsDropDownList(int pageIndex, int pageSize, out long count, RB_SmallShops_Info_Extend demodel)
{
return smallShops_InfoRepository.GetSmallShopsDropDownList(pageIndex, pageSize, out count, demodel);
}
/// <summary>
/// 获取微店信息
/// </summary>
/// <param name="smallShopsId"></param>
/// <returns></returns>
public RB_SmallShops_Info_Extend GetSmallShopsInfo(int smallShopsId)
{
var model = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(smallShopsId);
model.NickName = member_UserRepository.GetEntity(model?.UserId ?? 0)?.Name ?? "";
return model;
}
/// <summary>
/// 微店审核
/// </summary>
/// <param name="ssmodel"></param>
/// <param name="type"></param>
/// <returns></returns>
public bool SetSmallShopsAudit(RB_SmallShops_Info_Extend ssmodel, int type)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_SmallShops_Info.UpdateDate),DateTime.Now}
};
if (type == 1)
{
keyValues.Add(nameof(RB_SmallShops_Info.AuditStatus), DistributorAuditStatusEnum.Audited);
keyValues.Add(nameof(RB_SmallShops_Info.AuditDate), DateTime.Now);
}
else if (type == 2)
{
keyValues.Add(nameof(RB_SmallShops_Info.AuditStatus), DistributorAuditStatusEnum.Reject);
}
else if (type == 3)
{
keyValues.Add(nameof(RB_SmallShops_Info.Remark), ssmodel.Remark);
}
else {
return false;
}
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_SmallShops_Info.Id),
FiledValue=ssmodel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
return smallShops_InfoRepository.Update(keyValues, wheres);
}
/// <summary>
/// 修改店铺佣金
/// </summary>
/// <param name="smallShopsId"></param>
/// <param name="commission"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetSmallShopsCommission(int smallShopsId, decimal commission, int tenantId, int mallBaseId,int empId)
{
var model = smallShops_InfoRepository.GetEntity(smallShopsId);
if (model == null) { return false; }
if (model.AuditStatus != DistributorAuditStatusEnum.Audited) { return false; }
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_SmallShops_Info.UpdateDate),DateTime.Now},
{ nameof(RB_SmallShops_Info.Commission),commission},
{ nameof(RB_SmallShops_Info.Remark),model.Remark +" EmpId:"+empId+"修改佣金:由"+(model.Commission??0)+"=>"+commission},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_SmallShops_Info.Id),
FiledValue=smallShopsId,
OperatorEnum=OperatorEnum.Equal
}
};
return smallShops_InfoRepository.Update(keyValues, wheres);
}
#endregion
}
}
......@@ -2099,8 +2099,9 @@ namespace Mall.Module.User
/// <param name="remark"></param>
/// <param name="uid"></param>
/// <param name="mallBaseId"></param>
/// <param name="erpEmpId"></param>
/// <returns></returns>
public string SetDistributorRemitAudit(int remitId, int type, string remark, string uid, int mallBaseId)
public string SetDistributorRemitAudit(int remitId, int type, string remark, string uid, int mallBaseId,int erpEmpId)
{
if (type == 1)
{
......@@ -2191,7 +2192,7 @@ namespace Mall.Module.User
#endregion
//提现审核通过 自动生成财务单据
OrderIncomeFinanceModule(remitId, Convert.ToInt32(uid), mallBaseId, remark);
OrderIncomeFinanceModule(remitId, Convert.ToInt32(uid), mallBaseId, remark, erpEmpId);
}
}
else if (type == 2)
......@@ -2314,7 +2315,7 @@ namespace Mall.Module.User
/// 生成提现单据
/// </summary>
/// <returns></returns>
public bool OrderIncomeFinanceModule(int remitId, int TenantId, int MallBaseId, string remark)
public bool OrderIncomeFinanceModule(int remitId, int TenantId, int MallBaseId, string remark,int erpEmpId)
{
var flag = false;
try
......@@ -2356,7 +2357,7 @@ namespace Mall.Module.User
item.IsPublic = 5;//默认平台虚拟账户
var financeObj = new
{
CreateBy = Config.ExpendDirector,
CreateBy = erpEmpId > 0 ? erpEmpId.ToString() : Config.ExpendDirector,
item.IsPublic,
ClientType = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("FinanceSetting")["RemitTypeId"]),
ClientID = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("FinanceSetting")["RemitAccountId"]),
......
......@@ -39,7 +39,7 @@ WHERE 1=1
'{1}' BETWEEN StartTime AND EndTime OR
StartTime BETWEEN '{0}' AND '{1}' OR
EndTime BETWEEN '{0}' AND '{1}'
)",Convert.ToDateTime(query.QStartDate).ToString("yyyy-MM-dd HH:mm:ss"), Convert.ToDateTime(query.QEndDate).ToString("yyyy-MM-dd HH:mm:ss"));
)", Convert.ToDateTime(query.QStartDate).ToString("yyyy-MM-dd HH:mm:ss"), Convert.ToDateTime(query.QEndDate).ToString("yyyy-MM-dd HH:mm:ss"));
}
if (!string.IsNullOrWhiteSpace(query.QGoodName))
{
......@@ -71,4 +71,127 @@ WHERE 1=1
}
}
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationPriceRepository : BaseRepository<RB_Groupbuy_Activity_Specificationprice>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationprice_Extend> GetGroupbuyActivitySpecificationpriceListRepository(RB_Groupbuy_Activity_Specificationprice_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specificationprice where {where} order by Id desc";
return Get<RB_Groupbuy_Activity_Specificationprice_Extend>(sql).ToList();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationValueRepository : BaseRepository<RB_Groupbuy_Activity_Specificationvalue>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationvalue_Extend> GetGroupbuyActivitySpecificationValueListRepository(RB_Groupbuy_Activity_Specificationvalue_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.Id)}={dmodel.Id}";
}
if (dmodel.SpecificationId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.SpecificationId)}={dmodel.SpecificationId}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specificationvalue where {where} order by Id asc";
return Get<RB_Groupbuy_Activity_Specificationvalue_Extend>(sql).ToList();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationRepository : BaseRepository<RB_Groupbuy_Activity_Specification>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specification_Extend> GetGroupbuyActivitySpecificationListRepository(RB_Groupbuy_Activity_Specification_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specification_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specification where {where} order by Id asc";
return Get<RB_Groupbuy_Activity_Specification_Extend>(sql).ToList();
}
}
}
using Mall.Model.Entity.Product;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace Mall.Repository.Product
{
/// <summary>
/// 拼团活动阶梯团仓储层
/// </summary>
public class RB_Groupbuy_Activity_StepRepository : BaseRepository<RB_Groupbuy_Activity_Step>
{
/// <summary>
/// 获取拼团活动阶梯价列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Step_Extend> GetGroupBuyActivityListRepository(RB_Groupbuy_Activity_Step_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Groupbuy_Activity_Step
WHERE 1=1
");
if (query != null)
{
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Groupbuy_Activity_Step_Extend.MallBaseId), query.MallBaseId);
}
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Groupbuy_Activity_Step_Extend.TenantId), query.TenantId);
}
if (query.GoodId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Groupbuy_Activity_Step_Extend.GoodId), query.GoodId);
}
if (!string.IsNullOrWhiteSpace(query.GoodIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Groupbuy_Activity_Step_Extend.GoodId), query.GoodIds);
}
}
return Get<RB_Groupbuy_Activity_Step_Extend>(builder.ToString()).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 微店仓储层
/// </summary>
public class RB_SmallShops_InfoRepository : BaseRepository<RB_SmallShops_Info>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_SmallShops_Info_Extend dmodel)
{
string where = $@" 1=1 and di.{nameof(RB_SmallShops_Info_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)}={dmodel.UserId}";
}
if (dmodel.AuditStatus > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.AuditStatus)}={(int)dmodel.AuditStatus}";
}
if (dmodel.GradeId >= 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.GradeId)}={dmodel.GradeId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.Name)} like '%{dmodel.Name}%'";
}
if (!string.IsNullOrEmpty(dmodel.NickName))
{
where += $@" and u.{nameof(RB_Member_User.Name)} like '%{dmodel.NickName}%'";
}
if (dmodel.SuperiorId > 0)
{
where += $@" and u.{nameof(RB_Member_User.SuperiorId)}={dmodel.SuperiorId}";
}
string sql = $@"select di.*,u.Name as NickName,u.SuperiorId,u.Photo from RB_SmallShops_Info di
inner join rb_member_user u on di.UserId=u.Id
where {where} order by di.CreateDate desc";
return GetPage<RB_SmallShops_Info_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetList(RB_SmallShops_Info_Extend dmodel)
{
string where = $@" 1=1 and di.{nameof(RB_SmallShops_Info_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)}={dmodel.UserId}";
}
if (dmodel.AuditStatus > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.AuditStatus)}={(int)dmodel.AuditStatus}";
}
if (dmodel.GradeId >= 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.GradeId)}={dmodel.GradeId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.Name)} like '%{dmodel.Name}%'";
}
if (!string.IsNullOrEmpty(dmodel.NickName))
{
where += $@" and u.{nameof(RB_Member_User.Name)} like '%{dmodel.NickName}%'";
}
if (dmodel.SuperiorId > 0)
{
where += $@" and u.{nameof(RB_Member_User.SuperiorId)}={dmodel.SuperiorId}";
}
string sql = $@"select di.*,u.Name as NickName,u.SuperiorId,u.Photo from RB_SmallShops_Info di
inner join rb_member_user u on di.UserId=u.Id
where {where} order by di.CreateDate desc";
return Get<RB_SmallShops_Info_Extend>(sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetListForSingle(RB_SmallShops_Info_Extend dmodel)
{
string where = $@" 1=1 and di.{nameof(RB_SmallShops_Info_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)}={dmodel.UserId}";
}
if (dmodel.AuditStatus > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.AuditStatus)}={(int)dmodel.AuditStatus}";
}
if (!string.IsNullOrEmpty(dmodel.UserIds))
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)} in({dmodel.UserIds})";
}
if (dmodel.GradeId >= 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.GradeId)}={dmodel.GradeId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.Name)} like '%{dmodel.Name}%'";
}
string sql = $@"select di.* from RB_SmallShops_Info di where {where} order by di.Id desc";
return Get<RB_SmallShops_Info_Extend>(sql).ToList();
}
/// <summary>
/// 下拉列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Info_Extend> GetSmallShopsDropDownList(int pageIndex, int pageSize, out long count, RB_SmallShops_Info_Extend dmodel)
{
string where = $@" 1=1 and di.{nameof(RB_SmallShops_Info_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)}={dmodel.UserId}";
}
if (dmodel.AuditStatus > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.AuditStatus)}={(int)dmodel.AuditStatus}";
}
if (!string.IsNullOrEmpty(dmodel.UserIds))
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.UserId)} in({dmodel.UserIds})";
}
if (dmodel.GradeId >= 0)
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.GradeId)}={dmodel.GradeId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and di.{nameof(RB_SmallShops_Info_Extend.Name)} like '%{dmodel.Name}%'";
}
string sql = $@"select di.Id,di.Name from RB_SmallShops_Info di where {where} order by di.Id desc";
return GetPage<RB_SmallShops_Info_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 微店价格仓储层
/// </summary>
public class RB_SmallShops_PriceRepository : BaseRepository<RB_SmallShops_Price>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_SmallShops_Price_Extend> GetList(RB_SmallShops_Price_Extend dmodel)
{
string where = $@" 1=1 and di.{nameof(RB_SmallShops_Price_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Price_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Price_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.SmallShopsId > 0)
{
where += $@" and di.{nameof(RB_SmallShops_Price_Extend.SmallShopsId)}={dmodel.SmallShopsId}";
}
if (!string.IsNullOrEmpty(dmodel.SmallShopsIds)) {
where += $@" and di.{nameof(RB_SmallShops_Price_Extend.SmallShopsId)} in({dmodel.SmallShopsIds})";
}
string sql = $@"select di.* from RB_SmallShops_Price_Extend di
where {where} order by di.Id desc";
return Get<RB_SmallShops_Price_Extend>(sql).ToList();
}
}
}
......@@ -166,7 +166,7 @@ namespace Mall.WebApi.Controllers.Finance
var flag = App_Code.PayUtil.GetTransfersOrder(model.OrderNum, model.RemitMoney ?? 0, (model.UserId ?? 0).ToString(), umodel.OpenId, mallModel, _accessor);
if (flag)
{
string msg1 = userModule.SetDistributorRemitAudit(RemitId, 2, Remark, TenantId.ToString(), MallBaseId);
string msg1 = userModule.SetDistributorRemitAudit(RemitId, 2, Remark, TenantId.ToString(), MallBaseId, 0);
if (msg1 != "")
{
LogHelper.Write("提现:" + RemitId + ",失败");
......@@ -180,7 +180,7 @@ namespace Mall.WebApi.Controllers.Finance
}
}
else {
string msg1 = userModule.SetDistributorRemitAudit(RemitId, 2, Remark, TenantId.ToString(), MallBaseId);
string msg1 = userModule.SetDistributorRemitAudit(RemitId, 2, Remark, TenantId.ToString(), MallBaseId, 0);
if (msg1 != "")
{
return ApiResult.Failed("提现:" + RemitId + ",失败");
......
......@@ -1398,7 +1398,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.GoodsWeight,
x.IsDefaultService,
x.GoodsService,
x.SpecificationList
x.SpecificationList,
x.SpecificationPriceList,
});
return ApiResult.Success("", pagelist);
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Mall.Common.API;
using Mall.Model.Extend.User;
using Mall.Module.User;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Mall.Common.Plugin;
using Mall.Common.Enum.User;
using Mall.CacheManager.User;
using Newtonsoft.Json.Linq;
using Mall.Common;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using Google.Protobuf.WellKnownTypes;
namespace Mall.WebApi.Controllers.User
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class SmallShopsController : BaseController
{
private readonly SmallShopsModule smallShopsModule = new SmallShopsModule();
#region 微店管理
/// <summary>
/// 获取店铺分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSmallShopsPageList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_SmallShops_Info_Extend demodel = JsonConvert.DeserializeObject<RB_SmallShops_Info_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = smallShopsModule.GetSmallShopsPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.Name,
x.Logo,
x.UserId,
UserName = x.NickName,
x.Commission,
x.TotalCommission,
x.Notice,
x.AuditStatus,
AuditStatusName = x.AuditStatus.GetEnumName(),
AuditDate = x.AuditDate.HasValue ? x.AuditDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.Remark,
x.TenantId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取店铺下拉列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSmallShopsDropDownList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_SmallShops_Info_Extend demodel = JsonConvert.DeserializeObject<RB_SmallShops_Info_Extend>(parms.msg.ToString());
demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId;
var list = smallShopsModule.GetSmallShopsDropDownList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.Name
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取店铺信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSmallShopsInfo()
{
var requestParm = RequestParm;
var parms = JObject.Parse(requestParm.msg.ToString());
int SmallShopsId = parms.GetInt("SmallShopsId", 0);
if (SmallShopsId <= 0)
{
return ApiResult.ParamIsNull();
}
var model = smallShopsModule.GetSmallShopsInfo(SmallShopsId);
if (model.TenantId != Convert.ToInt32(requestParm.uid))
{
return ApiResult.ParamIsNull("未查询到该微店信息");
}
if (model.MallBaseId != requestParm.MallBaseId)
{
return ApiResult.ParamIsNull("未查询到该微店信息");
}
return ApiResult.Success("", new
{
model.Id,
model.Name,
model.Logo,
model.UserId,
UserName = model.NickName,
model.Commission,
model.TotalCommission,
model.Notice,
model.AuditStatus,
AuditStatusName = model.AuditStatus.GetEnumName(),
AuditDate = model.AuditDate.HasValue ? model.AuditDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
model.Remark,
CreateDate = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
}
/// <summary>
/// 微店审核信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetSmallShopsAudit()
{
var req = RequestParm;
JObject prams = JObject.Parse(req.msg.ToString());
int SmallShopsId = prams.GetInt("SmallShopsId", 0);
int Type = prams.GetInt("Type", 1);//类型 1审核通过 2审核拒绝 3修改备注
string Remark = prams.GetStringValue("Remark");
if (SmallShopsId <= 0)
{
return ApiResult.ParamIsNull();
}
var ssmodel = smallShopsModule.GetSmallShopsInfo(SmallShopsId);
if (ssmodel == null)
{
return ApiResult.Failed("微店不存在");
}
if (ssmodel.TenantId != req.TenantId)
{
return ApiResult.ParamIsNull("未查询到该微店信息");
}
if (ssmodel.MallBaseId != req.MallBaseId)
{
return ApiResult.ParamIsNull("未查询到该微店信息");
}
if (Type == 1 || Type == 2)
{
if (ssmodel.AuditStatus != DistributorAuditStatusEnum.Auditing)
{
return ApiResult.ParamIsNull("微店状态不正确");
}
}
ssmodel.Remark = Remark;
bool flag = smallShopsModule.SetSmallShopsAudit(ssmodel, Type);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 设置微店佣金
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetSmallShopsCommission() {
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int SmallShopsId = parms.GetInt("SmallShopsId", 0);
decimal Commission = parms.GetDecimal("Commission");
if (SmallShopsId <= 0) {
return ApiResult.Failed();
}
bool flag = smallShopsModule.SetSmallShopsCommission(SmallShopsId, Commission, req.TenantId, req.MallBaseId, req.EmpId);
if (flag)
{
return ApiResult.Success();
}
else {
return ApiResult.Failed();
}
}
#endregion
}
}
\ No newline at end of file
......@@ -1872,6 +1872,7 @@ namespace Mall.WebApi.Controllers.User
var re = RequestParm;
var parms = JObject.Parse(re.msg.ToString());
int RemitId = parms.GetInt("RemitId", 0);
int ErpEmpId = parms.GetInt("ErpEmpId", 0);//erp用户id
int Type = parms.GetInt("Type", 0);//1审核通过 2打款 3驳回
string Remark = parms.GetStringValue("Remark");
if (RemitId <= 0)
......@@ -1915,7 +1916,7 @@ namespace Mall.WebApi.Controllers.User
var flag = App_Code.PayUtil.GetTransfersOrder(model.OrderNum, model.RemitMoney ?? 0, (model.UserId ?? 0).ToString(), umodel.OpenId, mallModel, _accessor);
if (flag)
{
string msg1 = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId);
string msg1 = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId, 0);
if (msg1 != "")
{
LogHelper.Write("提现:" + RemitId + ",失败");
......@@ -1932,7 +1933,7 @@ namespace Mall.WebApi.Controllers.User
}
else
{
string msg1 = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId);
string msg1 = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId, 0);
if (msg1 != "")
{
return ApiResult.Failed("提现:" + RemitId + ",失败");
......@@ -1957,7 +1958,7 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Failed("暂不支持该类型");
}
string msg = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId);
string msg = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId, ErpEmpId);
if (msg == "")
{
if (Type == 3)
......
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