Commit 633b55ee authored by liudong1993's avatar liudong1993

1 教育商品资产化

parent d70204ea
...@@ -70,5 +70,23 @@ namespace Mall.Common.Enum.Education ...@@ -70,5 +70,23 @@ namespace Mall.Common.Enum.Education
/// </summary> /// </summary>
[EnumField("教育咖啡劵")] [EnumField("教育咖啡劵")]
EduCoffee = 15, EduCoffee = 15,
/// <summary>
/// 教育商品- 资产
/// </summary>
[EnumField("教育资产商品")]
EduProperty = 16,
/// <summary>
/// 教育商品- 资产 取消退款
/// </summary>
[EnumField("教育资产商品取消退款")]
EduPropertyRefund = 17,
/// <summary>
/// 教育商品- 运费成本
/// </summary>
[EnumField("教育资产商品运费成本")]
EduFreightCost = 18,
} }
} }
...@@ -68,5 +68,10 @@ namespace Mall.Model.Entity.Coffee ...@@ -68,5 +68,10 @@ namespace Mall.Model.Entity.Coffee
/// </summary> /// </summary>
public int MallGoodsId { get; set; } public int MallGoodsId { get; set; }
/// <summary>
/// 对应的物料档案ID
/// </summary>
public int MaterialId { get; set; }
} }
} }
...@@ -63,16 +63,6 @@ namespace Mall.Model.Entity.Coffee ...@@ -63,16 +63,6 @@ namespace Mall.Model.Entity.Coffee
/// </summary> /// </summary>
public int PaymentWay { get; set; } public int PaymentWay { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal Unit_Price { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Number { get; set; }
/// <summary> /// <summary>
/// 应收金额 /// 应收金额
/// </summary> /// </summary>
...@@ -89,7 +79,7 @@ namespace Mall.Model.Entity.Coffee ...@@ -89,7 +79,7 @@ namespace Mall.Model.Entity.Coffee
public decimal Fee { get; set; } public decimal Fee { get; set; }
/// <summary> /// <summary>
/// 退款 /// 退款金额
/// </summary> /// </summary>
public decimal Refund { get; set; } public decimal Refund { get; set; }
...@@ -113,26 +103,6 @@ namespace Mall.Model.Entity.Coffee ...@@ -113,26 +103,6 @@ namespace Mall.Model.Entity.Coffee
/// </summary> /// </summary>
public DateTime? CancelTime { get; set; } public DateTime? CancelTime { get; set; }
/// <summary>
/// 教育商品id
/// </summary>
public int GoodsId { get; set; }
/// <summary>
/// 对应电商商品ID
/// </summary>
public int MallGoodsId { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName { get; set; }
/// <summary>
/// 封面图
/// </summary>
public string CoverImage { get; set; }
/// <summary> /// <summary>
/// 总成本价格 /// 总成本价格
/// </summary> /// </summary>
...@@ -163,5 +133,9 @@ namespace Mall.Model.Entity.Coffee ...@@ -163,5 +133,9 @@ namespace Mall.Model.Entity.Coffee
/// </summary> /// </summary>
public DateTime UpdateDate { get; set; } public DateTime UpdateDate { get; set; }
/// <summary>
/// 总运费成本
/// </summary>
public decimal FreightCostMoney { get; set; }
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Enum.Education;
using VT.FW.DB;
namespace Mall.Model.Entity.Coffee
{
/// <summary>
/// 教育商品订单明细实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "EduConnection")]
public class RB_Goods_OrderDetail
{
/// <summary>
/// 明细ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// OrderId
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 对应电商订单ID
/// </summary>
public int MallOrderId { get; set; }
/// <summary>
/// 对应电商订单明细ID
/// </summary>
public int MallOrderDetailId { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal Unit_Price { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Number { get; set; }
/// <summary>
/// 应收金额
/// </summary>
public decimal PreferPrice { get; set; }
/// <summary>
/// 实收金额
/// </summary>
public decimal Income { get; set; }
/// <summary>
/// 手续费
/// </summary>
public decimal Fee { get; set; }
/// <summary>
/// 运费
/// </summary>
public decimal FreightMoney { get; set; }
/// <summary>
/// 教育商品id
/// </summary>
public int GoodsId { get; set; }
/// <summary>
/// 对应电商商品ID
/// </summary>
public int MallGoodsId { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName { get; set; }
/// <summary>
/// 封面图
/// </summary>
public string CoverImage { get; set; }
/// <summary>
/// 总成本价格
/// </summary>
public decimal CostMoney { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 集团ID
/// </summary>
public int Group_Id { 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>
/// 对应的物料档案ID
/// </summary>
public int MaterialId { get; set; }
/// <summary>
/// 商品运费成本
/// </summary>
public decimal FreightCostMoney { get; set; }
}
}
...@@ -371,5 +371,6 @@ namespace Mall.Model.Entity.Product ...@@ -371,5 +371,6 @@ namespace Mall.Model.Entity.Product
/// 教育商品 0 正常订单 1咖啡劵 2耗材类 3教室类 /// 教育商品 0 正常订单 1咖啡劵 2耗材类 3教室类
/// </summary> /// </summary>
public int OrderEduType { get; set; } public int OrderEduType { get; set; }
} }
} }
...@@ -414,5 +414,10 @@ namespace Mall.Model.Entity.Product ...@@ -414,5 +414,10 @@ namespace Mall.Model.Entity.Product
/// 赠送咖啡数量 /// 赠送咖啡数量
/// </summary> /// </summary>
public int PresentCoffeeNum { get; set; } public int PresentCoffeeNum { get; set; }
/// <summary>
/// 耗材对应的ID
/// </summary>
public int MaterialId { get; set; }
} }
} }
using System;
using VT.FW.DB;
using Mall.Common.Plugin;
namespace Mall.Model.Entity.Property
{
/// <summary>
/// 耗材出库申请实体
/// </summary>
[Serializable]
[DB(ConnectionName = "PropertyConnection")]
public class RB_Supplies_StockOutApplyFor
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 总数量
/// </summary>
public int TotalNumber { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 状态 0 正常 1删除
/// </summary>
public int Status { get; set; }
/// <summary>
/// 公司
/// </summary>
public int RB_Branch_Id { get; set; }
/// <summary>
/// 集团
/// </summary>
public int RB_Group_Id { get; set; }
/// <summary>
/// CreateBy
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// CreateDate
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// UpdateBy
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// UpdateDate
/// </summary>
public DateTime UpdateDate { get; set; }
/// <summary>
/// 关联财务单据id(英文逗号分隔)
/// </summary>
public string FinanceIds { get; set; }
/// <summary>
/// 出库状态 1未出库 2部分出库 3已出库
/// </summary>
public int StockOutStatus { get; set; }
/// <summary>
/// 审核状态 1审核中 2通过 3驳回
/// </summary>
public int AuditStatus { get; set; }
/// <summary>
/// 审核备注
/// </summary>
public string AuditRemark { get; set; }
/// <summary>
/// 审核人
/// </summary>
public int AuditEmpId { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime? AuditDate { get; set; }
/// <summary>
/// 类型 1主营业务 2其他业务
/// </summary>
public int Type { get; set; }
/// <summary>
/// 电商关联订单ID
/// </summary>
public int MallOrderId { get; set; }
/// <summary>
/// 电商关联凭证
/// </summary>
public string MallRelevance { get; set; }
}
}
\ No newline at end of file
using System;
using VT.FW.DB;
using Mall.Common.Plugin;
namespace Mall.Model.Entity.Property
{
/// <summary>
/// 耗材出库申请明细实体
/// </summary>
[Serializable]
[DB(ConnectionName = "PropertyConnection")]
public class RB_Supplies_StockOutApplyForDetail
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 申请id
/// </summary>
public int ApplyForId { get; set; }
/// <summary>
/// 班级id
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 耗材id
/// </summary>
public int SuppliesId { get; set; }
/// <summary>
/// 出库数量
/// </summary>
public int Number { get; set; }
/// <summary>
/// 已出库数量
/// </summary>
public int StockOutNum { get; set; }
/// <summary>
/// 状态 0 正常 1删除
/// </summary>
public int Status { get; set; }
/// <summary>
/// 公司
/// </summary>
public int RB_Branch_Id { get; set; }
/// <summary>
/// 集团
/// </summary>
public int RB_Group_Id { get; set; }
/// <summary>
/// CreateBy
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// CreateDate
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// UpdateBy
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// UpdateDate
/// </summary>
public DateTime UpdateDate { get; set; }
/// <summary>
/// 校区id
/// </summary>
public int SchoolId { get; set; }
/// <summary>
/// 校区名称
/// </summary>
public string SchoolName { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Extend.Education
{
/// <summary>
/// 教育商品订单明细扩展类
/// </summary>
[Serializable]
[DB(ConnectionName = "EduConnection")]
public class RB_Goods_OrderDetail_ViewModel : Entity.Coffee.RB_Goods_OrderDetail
{
/// <summary>
/// 订单Ids
/// </summary>
public string OrderIds { get; set; }
}
}
...@@ -16,5 +16,10 @@ namespace Mall.Model.Extend.Education ...@@ -16,5 +16,10 @@ namespace Mall.Model.Extend.Education
/// 商品Ids /// 商品Ids
/// </summary> /// </summary>
public string GoodsIds { get; set; } public string GoodsIds { get; set; }
/// <summary>
/// 电商商品IDs
/// </summary>
public string MallGoodsIds { get; set; }
} }
} }
...@@ -992,7 +992,8 @@ namespace Mall.Module.Product ...@@ -992,7 +992,8 @@ namespace Mall.Module.Product
model.RejectRemark, model.RejectRemark,
model.IsCanApplyForAfterSale, model.IsCanApplyForAfterSale,
model.PresentFXGrade, model.PresentFXGrade,
model.BuyerMessage model.BuyerMessage,
model.OrderEduType
}); });
} }
...@@ -3381,6 +3382,11 @@ namespace Mall.Module.Product ...@@ -3381,6 +3382,11 @@ namespace Mall.Module.Product
{ {
return ApiResult.Failed("有商品不存在或者商品已失效"); return ApiResult.Failed("有商品不存在或者商品已失效");
} }
if (gmodel.GoodsEduType == 2)
{
demodel.OrderEduType = 2;//资产商品化
}
item.MaterialId = gmodel.MaterialId;
if (gmodel.PresentFXGrade > 0) if (gmodel.PresentFXGrade > 0)
{ {
//是赠送VIP商品 //是赠送VIP商品
...@@ -3915,6 +3921,13 @@ namespace Mall.Module.Product ...@@ -3915,6 +3921,13 @@ namespace Mall.Module.Product
{ {
continue; continue;
} }
if (demodel.OrderEduType == 2)
{
if (item.MaterialId <= 0) {
return ApiResult.Failed("不同板块商品,无法一起下单");
}
}
item.MaterialId = gmodel.MaterialId;
item.SupplierId = gmodel.SupplierId; item.SupplierId = gmodel.SupplierId;
item.CouponMoney = 0; item.CouponMoney = 0;
var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault(); var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault();
...@@ -7860,7 +7873,8 @@ namespace Mall.Module.Product ...@@ -7860,7 +7873,8 @@ namespace Mall.Module.Product
ClassId = item.ClassId, ClassId = item.ClassId,
FXCommission = item.CommissionPrice, FXCommission = item.CommissionPrice,
OriginalCostMoney = item.CostMoney ?? 0, OriginalCostMoney = item.CostMoney ?? 0,
PresentCoffeeNum = item.PresentCoffeeNum PresentCoffeeNum = item.PresentCoffeeNum,
MaterialId = item.MaterialId
}, trans); }, trans);
item.Id = detailId; item.Id = detailId;
if (detailId > 0 && SatisfiedGoodsList.Any()) if (detailId > 0 && SatisfiedGoodsList.Any())
......
This diff is collapsed.
...@@ -7141,8 +7141,7 @@ namespace Mall.Module.Product ...@@ -7141,8 +7141,7 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
/// <param name="demodel"></param> /// <param name="demodel"></param>
/// <returns></returns> /// <returns></returns>
[TransactionCallHandler] public bool SetProductGoodsInfo(RB_Goods_Extend demodel)
public virtual bool SetProductGoodsInfo(RB_Goods_Extend demodel)
{ {
var goodsModel = new RB_Goods(); var goodsModel = new RB_Goods();
if (demodel.Id > 0) if (demodel.Id > 0)
...@@ -7797,7 +7796,7 @@ namespace Mall.Module.Product ...@@ -7797,7 +7796,7 @@ namespace Mall.Module.Product
#endregion #endregion
#region 修改咖啡劵商品 #region 修改咖啡劵商品
if (goodsModel.GoodsEduType == 1) { if (goodsModel.GoodsEduType == 1 || goodsModel.GoodsEduType == 2) {
var eduGoodsMdoel = eduGoodsRepository.GetList(new Model.Extend.Education.RB_Goods_ViewModel() { MallBaseId = goodsModel.MallBaseId, MallGoodsId = goodsModel.Id }).FirstOrDefault(); var eduGoodsMdoel = eduGoodsRepository.GetList(new Model.Extend.Education.RB_Goods_ViewModel() { MallBaseId = goodsModel.MallBaseId, MallGoodsId = goodsModel.Id }).FirstOrDefault();
if (eduGoodsMdoel != null) { if (eduGoodsMdoel != null) {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
...@@ -7821,10 +7820,12 @@ namespace Mall.Module.Product ...@@ -7821,10 +7820,12 @@ namespace Mall.Module.Product
else else
{ {
#region 验证咖啡劵 #region 验证咖啡劵
if (demodel.GoodsEduType == 1) { if (demodel.GoodsEduType == 1 || demodel.GoodsEduType == 2)
//咖啡劵商品需唯一 {
var kfList = goodsRepository.GetSingleList(new RB_Goods_Extend() { MallBaseId = demodel.MallBaseId, GoodsEduType = 1 }); //咖啡劵商品需唯一 //验证资产商品必须唯一
if (kfList.Any()) { var kfList = goodsRepository.GetSingleList(new RB_Goods_Extend() { MallBaseId = demodel.MallBaseId, GoodsEduType = demodel.GoodsEduType, MaterialId = demodel.MaterialId });
if (kfList.Any())
{
return false; return false;
} }
} }
...@@ -7964,22 +7965,23 @@ namespace Mall.Module.Product ...@@ -7964,22 +7965,23 @@ namespace Mall.Module.Product
} }
} }
if (demodel.GoodsEduType == 1) { if (demodel.GoodsEduType == 1 || demodel.GoodsEduType == 2) {
//咖啡劵商品 (分布式事务 无法跨服保存) //咖啡劵商品 (分布式事务 无法跨服保存)
//eduGoodsRepository.Insert(new Model.Entity.Coffee.RB_Goods() eduGoodsRepository.Insert(new Model.Entity.Coffee.RB_Goods()
//{ {
// CoverImage = demodel.CarouselImageList.Where(x => x.Type == 0).FirstOrDefault()?.Path ?? "", CoverImage = demodel.CarouselImageList.Where(x => x.Type == 0).FirstOrDefault()?.Path ?? "",
// CreateDate = DateTime.Now, CreateDate = DateTime.Now,
// GoodsName = demodel.Name, GoodsName = demodel.Name,
// GoodsType = demodel.GoodsEduType, GoodsType = demodel.GoodsEduType,
// Group_Id = 100000, Group_Id = 100000,
// Id = 0, Id = 0,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// MallGoodsId = Id, MallGoodsId = Id,
// SellingPrice = demodel.SellingPrice ??0, SellingPrice = demodel.SellingPrice ?? 0,
// Status = 0, Status = 0,
// UpdateDate = DateTime.Now UpdateDate = DateTime.Now,
//}); MaterialId = demodel.MaterialId
});
} }
} }
} }
......
...@@ -2134,5 +2134,42 @@ namespace Mall.Module.Property ...@@ -2134,5 +2134,42 @@ namespace Mall.Module.Property
#endregion #endregion
#region 教育资产商品化
/// <summary>
/// 获取所有的耗材列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="demodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public List<RB_Supplies_Material_Extend> GetEduGoodsMaterialList(RB_Supplies_Material_Extend demodel)
{
var list = supplies_MaterialRepository.GetList(demodel);
List<RB_Supplies_Inventory_Extend> iList = new List<RB_Supplies_Inventory_Extend>();
if (list.Any())
{
//查询出该仓库 耗材下 所有的库存
string Sstr = string.Join(",", list.Select(x => x.Id).Distinct());
iList = supplies_InventoryRepository.GetList(new RB_Supplies_Inventory_Extend() { RB_Group_Id = demodel.RB_Group_Id, SuppliesIdStr = Sstr }, null);
}
foreach (var item in list)
{
if (item.Images == "" || item.Images == null)
{
item.Images = "[]";
}
item.ImageList = JsonConvert.DeserializeObject<List<string>>(item.Images);
item.InventoryNum = iList.Where(x => x.SuppliesId == item.Id).Sum(x => x.Number ?? 0);
var inventoryModel = iList.Where(x => x.SuppliesId == item.Id).OrderByDescending(x => x.Money).FirstOrDefault();
if (inventoryModel != null && inventoryModel.Number > 0)
{
item.Money = Math.Round((inventoryModel.Money ?? 0) / (inventoryModel.Number ?? 0), 2, MidpointRounding.AwayFromZero);
}
}
return list;
}
#endregion
} }
} }
This diff is collapsed.
...@@ -38,6 +38,10 @@ namespace Mall.Repository.Education ...@@ -38,6 +38,10 @@ namespace Mall.Repository.Education
{ {
where += $@" and {nameof(RB_Goods_ViewModel.MallGoodsId)} ={demodel.MallGoodsId}"; where += $@" and {nameof(RB_Goods_ViewModel.MallGoodsId)} ={demodel.MallGoodsId}";
} }
if (!string.IsNullOrEmpty(demodel.MallGoodsIds))
{
where += $@" and {nameof(RB_Goods_ViewModel.MallGoodsId)} in({demodel.MallGoodsIds})";
}
if (!string.IsNullOrEmpty(demodel.GoodsIds)) if (!string.IsNullOrEmpty(demodel.GoodsIds))
{ {
where += $@" and {nameof(RB_Goods_ViewModel.Id)} in({demodel.GoodsIds})"; where += $@" and {nameof(RB_Goods_ViewModel.Id)} in({demodel.GoodsIds})";
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Coffee;
using Mall.Model.Extend.Education;
using VT.FW.DB.Dapper;
namespace Mall.Repository.Education
{
/// <summary>
/// 教育商品订单明细仓储
/// </summary>
public class RB_EduGoods_OrderDetailRepository : BaseRepository<RB_Goods_OrderDetail>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderDetail_ViewModel> GetList(RB_Goods_OrderDetail_ViewModel demodel)
{
var parameters = new DynamicParameters();
string where = $@" 1=1 and Status =0";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail_ViewModel.MallBaseId)} ={demodel.MallBaseId}";
}
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.MallOrderId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail_ViewModel.MallOrderId)} ={demodel.MallOrderId}";
}
if (!string.IsNullOrEmpty(demodel.OrderIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail_ViewModel.OrderId)} in({demodel.OrderIds})";
}
string sql = $@" select * from RB_Goods_OrderDetail where {where} order by Id desc";
return Get<RB_Goods_OrderDetail_ViewModel>(sql, parameters).ToList();
}
}
}
...@@ -122,6 +122,14 @@ namespace Mall.Repository.Product ...@@ -122,6 +122,14 @@ namespace Mall.Repository.Product
where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,2)"; where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,2)";
} }
} }
if (dmodel.MaterialId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MaterialId)}={dmodel.MaterialId}";
}
if (dmodel.GoodsEduType > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)}={dmodel.GoodsEduType}";
}
if (dmodel.Q_GoodsEduType == 1) if (dmodel.Q_GoodsEduType == 1)
{ {
where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)} >0"; where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)} >0";
...@@ -711,6 +719,10 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -711,6 +719,10 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{ {
where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)}={dmodel.GoodsEduType}"; where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)}={dmodel.GoodsEduType}";
} }
if (dmodel.MaterialId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MaterialId)}={dmodel.MaterialId}";
}
string sql = $@"select g.* from RB_Goods g where {where}"; string sql = $@"select g.* from RB_Goods g where {where}";
return Get<RB_Goods_Extend>(sql).ToList(); return Get<RB_Goods_Extend>(sql).ToList();
...@@ -918,7 +930,7 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -918,7 +930,7 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
} }
else else
{ {
where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)} =0"; where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)} <>1";
} }
//HK 新加参数 //HK 新加参数
if (!string.IsNullOrEmpty(dmodel.StoresIds)) if (!string.IsNullOrEmpty(dmodel.StoresIds))
......
...@@ -151,7 +151,7 @@ namespace Mall.Repository.Product ...@@ -151,7 +151,7 @@ namespace Mall.Repository.Product
} }
else { else {
//默认查询 //默认查询
where += $@" and o.{nameof(RB_Goods_Order.OrderEduType)}=0"; where += $@" and o.{nameof(RB_Goods_Order.OrderEduType)} <>1";
} }
......
using Mall.Model.Entity.Property;
using Mall.Model.Extend.Property;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.Property
{
/// <summary>
/// 耗材出库申请明细仓储类
/// </summary>
public class RB_Supplies_StockOutApplyForDetailRepository : BaseRepository<RB_Supplies_StockOutApplyForDetail>
{
}
}
using Mall.Model.Entity.Property;
using Mall.Model.Extend.Property;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.Property
{
/// <summary>
/// 耗材出库申请仓储类
/// </summary>
public class RB_Supplies_StockOutApplyForRepository : BaseRepository<RB_Supplies_StockOutApplyFor>
{
}
}
...@@ -267,6 +267,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -267,6 +267,7 @@ namespace Mall.WebApi.Controllers.MallBase
x.OrderStatus, x.OrderStatus,
OrderStatusName = x.OrderStatus.GetEnumName(), OrderStatusName = x.OrderStatus.GetEnumName(),
x.VersionSource, x.VersionSource,
x.OrderEduType,
x.TenantId, x.TenantId,
x.MallBaseId, x.MallBaseId,
x.PresentFXGrade, x.PresentFXGrade,
......
...@@ -145,6 +145,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -145,6 +145,8 @@ namespace Mall.WebApi.Controllers.MallBase
y.IsApplyForAfterSale, y.IsApplyForAfterSale,
y.OriginalCostMoney, y.OriginalCostMoney,
y.FXCommission, y.FXCommission,
y.CostFinanceId,
y.FreightFinanceId,
SFinanceList = y.FinanceList.Where(z => z.Type == Common.Enum.Finance.WFTempLateClassEnum.IN).Select(z => new SFinanceList = y.FinanceList.Where(z => z.Type == Common.Enum.Finance.WFTempLateClassEnum.IN).Select(z => new
{ {
z.FrID, z.FrID,
...@@ -4740,6 +4742,29 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -4740,6 +4742,29 @@ namespace Mall.WebApi.Controllers.MallBase
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
#endregion #endregion
#region 教育资产商品
[HttpPost]
public ApiResult SetEduGoodsFreightCostFinance() {
var userInfo = base.UserInfo;
var parm = JObject.Parse(base.RequestParm.msg.ToString());
int OrderId = parm.GetInt("OrderId", 0);
if (OrderId <= 0) {
return ApiResult.ParamIsNull();
}
string msg = orderModule.SetEduGoodsFreightCostFinance(OrderId, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else {
return ApiResult.Failed(msg);
}
}
#endregion
} }
} }
\ No newline at end of file
...@@ -1228,7 +1228,9 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1228,7 +1228,9 @@ namespace Mall.WebApi.Controllers.MallBase
OrderBy = parameters.GetInt("OrderBy"), OrderBy = parameters.GetInt("OrderBy"),
RetailStore = parameters.GetInt("RetailStore", -1), RetailStore = parameters.GetInt("RetailStore", -1),
CreateBy = parameters.GetInt("EmpId", -1), CreateBy = parameters.GetInt("EmpId", -1),
Q_GoodsEduType = parameters.GetInt("Q_GoodsEduType", 0) Q_GoodsEduType = parameters.GetInt("Q_GoodsEduType", 0),
GoodsEduType = parameters.GetInt("GoodsEduType", 0),
MaterialId = parameters.GetInt("MaterialId", 0)
}; };
demodel.TenantId = parms.TenantId; demodel.TenantId = parms.TenantId;
...@@ -1285,7 +1287,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1285,7 +1287,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.SourceGoodsId, x.SourceGoodsId,
x.RetailStore, x.RetailStore,
x.SupplierName, x.SupplierName,
x.GoodsEduType x.GoodsEduType,
x.MaterialId
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
...@@ -1825,7 +1828,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1825,7 +1828,8 @@ namespace Mall.WebApi.Controllers.MallBase
model?.FatCode, model?.FatCode,
model?.GoodsUrl, model?.GoodsUrl,
model?.goodsLogo, model?.goodsLogo,
model?.GoodsEduType model?.GoodsEduType,
model?.MaterialId
}; };
} }
return ApiResult.Success("", obj); return ApiResult.Success("", obj);
...@@ -1900,7 +1904,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1900,7 +1904,8 @@ namespace Mall.WebApi.Controllers.MallBase
goodsLogo = parms.GetStringValue("goodsLogo"), goodsLogo = parms.GetStringValue("goodsLogo"),
RetailStore = parms.GetInt("RetailStore"), RetailStore = parms.GetInt("RetailStore"),
CreateBy = parms.GetInt("EmpId", 0), CreateBy = parms.GetInt("EmpId", 0),
GoodsEduType = parms.GetInt("GoodsEduType", 0) GoodsEduType = parms.GetInt("GoodsEduType", 0),
MaterialId = parms.GetInt("MaterialId", 0)
}; };
if (!string.IsNullOrEmpty(parms.GetStringValue("ShelvesDate"))) if (!string.IsNullOrEmpty(parms.GetStringValue("ShelvesDate")))
{ {
......
...@@ -12,6 +12,7 @@ using Mall.Common; ...@@ -12,6 +12,7 @@ using Mall.Common;
using Mall.Module.Property; using Mall.Module.Property;
using Mall.Model.Extend.Property; using Mall.Model.Extend.Property;
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using Microsoft.AspNetCore.Authorization;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
{ {
...@@ -639,5 +640,43 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -639,5 +640,43 @@ namespace Mall.WebApi.Controllers.MallBase
} }
#endregion #endregion
#region 教育资产商品化
/// <summary>
/// 获取所有的耗材列表
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpPost]
public ApiResult GetEduGoodsMaterialList() {
var demdoel = JsonHelper.DeserializeObject<RB_Supplies_Material_Extend>(base.RequestParm.msg.ToString());
if (demdoel.RB_Group_Id <= 0)
{
return ApiResult.ParamIsNull("请传递集团ID");
}
if (string.IsNullOrEmpty(demdoel.Name)) {
return ApiResult.ParamIsNull("请输入资产名称");
}
var list = propertyModule.GetEduGoodsMaterialList(demdoel);
return ApiResult.Success("", list.Select(x => new
{
x.Id,
x.Name,
x.SuppliesNum,
x.CategoryId,
x.CategoryName,
x.BrandName,
x.SuppliesModel,
x.Units,
SellPrice = (x.Money ?? 0) + Math.Ceiling((x.Money ?? 0) * Convert.ToDecimal(0.006)),// 提高 千分之6的手续费
x.Money,
x.InventoryNum,
x.ImageList
}));
}
#endregion
} }
} }
\ No newline at end of file
...@@ -89,6 +89,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -89,6 +89,7 @@ namespace Mall.WebApi.Controllers.User
IsShow = 1, IsShow = 1,
LookTimes = 5, LookTimes = 5,
}; };
int EduId = parms.GetInt("EduId");//用于教育绑定用户 2022-03-15
if (requestParm.TenantId <= 0) if (requestParm.TenantId <= 0)
{ {
return ApiResult.ParamIsNull("请传递商户号"); return ApiResult.ParamIsNull("请传递商户号");
...@@ -298,6 +299,39 @@ namespace Mall.WebApi.Controllers.User ...@@ -298,6 +299,39 @@ namespace Mall.WebApi.Controllers.User
UserGroupIds=demodel.BelongGroupIds, UserGroupIds=demodel.BelongGroupIds,
}; };
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime); UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime);
if (EduId > 0 && demodel.MallBaseId == 5) {
try
{
//教育 甲小鹤跳转至甲鹤小程序 自动绑定账号信息
var eduModel = activityModule.GetEducationSellBaseInfo(new Model.Extend.Education.RB_Education_EduSell_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, EduSellId = EduId }).FirstOrDefault();
if (eduModel != null && eduModel.UserId != UserId)
{
LogHelper.Write("账户已绑定其他用户(甲小鹤跳甲鹤自动绑学员账号)EduId:" + EduId + ",UserId:" + UserId);
}
else
{
if (eduModel == null || eduModel.Id == 0)
{
eduModel = new Model.Extend.Education.RB_Education_EduSell_Extend
{
Id = 0,
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
CreateDate = DateTime.Now,
Status = 0,
UserId = UserId,
EduSellId = EduId,
Type = 2 //甲小鹤过来的 都是学生
};
activityModule.SetEduSellBaseInfo(eduModel);
}
}
}
catch (Exception ex)
{
LogHelper.Write(ex, "SetEduSellBaseInfo_RLogin");
}
}
if (isGiveCoupon) if (isGiveCoupon)
{ {
return ApiResult.CouponSuccess(ResultCode.Success, 1, "", couponName, appletUserInfo); return ApiResult.CouponSuccess(ResultCode.Success, 1, "", couponName, appletUserInfo);
...@@ -413,6 +447,41 @@ namespace Mall.WebApi.Controllers.User ...@@ -413,6 +447,41 @@ namespace Mall.WebApi.Controllers.User
} }
} }
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime); UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime);
if (EduId > 0 && demodel.MallBaseId == 5)
{
try
{
//教育 甲小鹤跳转至甲鹤小程序 自动绑定账号信息
var eduModel = activityModule.GetEducationSellBaseInfo(new Model.Extend.Education.RB_Education_EduSell_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, EduSellId = EduId }).FirstOrDefault();
if (eduModel != null && eduModel.UserId != umodel.Id)
{
LogHelper.Write("账户已绑定其他用户(甲小鹤跳甲鹤自动绑学员账号)EduId:" + EduId + ",UserId:" + umodel.Id);
}
else
{
if (eduModel == null || eduModel.Id == 0)
{
eduModel = new Model.Extend.Education.RB_Education_EduSell_Extend
{
Id = 0,
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
CreateDate = DateTime.Now,
Status = 0,
UserId = umodel.Id,
EduSellId = EduId,
Type = 2 //甲小鹤过来的 都是学生
};
activityModule.SetEduSellBaseInfo(eduModel);
}
}
}
catch (Exception ex)
{
LogHelper.Write(ex, "SetEduSellBaseInfo_Login");
}
}
if (isGiveCoupon) if (isGiveCoupon)
{ {
return ApiResult.CouponSuccess(ResultCode.Success, 1, "", couponName, appletUserInfo); return ApiResult.CouponSuccess(ResultCode.Success, 1, "", couponName, appletUserInfo);
......
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