Commit f540783c authored by liudong1993's avatar liudong1993

物料有效期+重新入库

parent ed60c2a7
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_StockInValidity
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 入库单id
/// </summary>
public int StockinId { get; set; }
/// <summary>
/// 入库单明细id
/// </summary>
public int StockinDetailId { get; set; }
/// <summary>
/// 有效日期
/// </summary>
public DateTime ExpirationDate { get; set; }
/// <summary>
/// 是否出库 1是 2否
/// </summary>
public int IsOut { get; set; }
/// <summary>
/// 出库单id
/// </summary>
public int StockoutId { get; set; }
/// <summary>
/// 状态 0正常 1删除
/// </summary>
public int Status { 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; }
}
}
\ No newline at end of file
...@@ -141,5 +141,10 @@ namespace Mall.Model.Entity.Property ...@@ -141,5 +141,10 @@ namespace Mall.Model.Entity.Property
/// 成本价 /// 成本价
/// </summary> /// </summary>
public decimal? CostMoney { get; set; } public decimal? CostMoney { get; set; }
/// <summary>
/// 商品有效期id
/// </summary>
public int ValidityId { get; set; }
} }
} }
...@@ -39,6 +39,11 @@ namespace Mall.Model.Extend.Property ...@@ -39,6 +39,11 @@ namespace Mall.Model.Extend.Property
/// </summary> /// </summary>
public int InStockNum { get; set; } public int InStockNum { get; set; }
/// <summary>
/// 物料有效期
/// </summary>
public List<RB_Supplies_StockInValidity_Extend> ValidityList { get; set; }
/// <summary> /// <summary>
/// 条形码 /// 条形码
/// </summary> /// </summary>
......
using System; using System;
using System.Collections.Generic;
using Mall.Model.Entity.Property; using Mall.Model.Entity.Property;
using VT.FW.DB; using VT.FW.DB;
...@@ -43,5 +44,10 @@ namespace Mall.Model.Extend.Property ...@@ -43,5 +44,10 @@ namespace Mall.Model.Extend.Property
/// 踱等Id /// 踱等Id
/// </summary> /// </summary>
public string StockInIdStr { get; set; } public string StockInIdStr { get; set; }
/// <summary>
/// 昜蹋衄虴
/// </summary>
public List<RB_Supplies_StockInValidity_Extend> ValidityList { get; set; }
} }
} }
\ No newline at end of file
using System;
using Mall.Model.Entity.Property;
using VT.FW.DB;
namespace Mall.Model.Extend.Property
{
/// <summary>
/// 物料有效期扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "PropertyConnection")]
public class RB_Supplies_StockInValidity_Extend : RB_Supplies_StockInValidity
{
/// <summary>
/// 入库ids
/// </summary>
public string StockInIdStr { get; set; }
/// <summary>
/// 有效期ids
/// </summary>
public string ValidityIds { get; set; }
}
}
\ No newline at end of file
...@@ -20,6 +20,11 @@ namespace Mall.Model.Extend.Property ...@@ -20,6 +20,11 @@ namespace Mall.Model.Extend.Property
/// </summary> /// </summary>
public string WarehouseOutIds { get; set; } public string WarehouseOutIds { get; set; }
/// <summary>
/// 有效期ids
/// </summary>
public string ValidityIds { get; set; }
/// <summary> /// <summary>
/// 订单号 /// 订单号
/// </summary> /// </summary>
......
...@@ -8409,6 +8409,10 @@ namespace Mall.Module.Product ...@@ -8409,6 +8409,10 @@ namespace Mall.Module.Product
//剑鱼兄需求 2020=07-30 再查询一次商品表 //剑鱼兄需求 2020=07-30 再查询一次商品表
string GoodsIds = string.Join(",", dlist.Select(x => x.GoodsId).Distinct()); string GoodsIds = string.Join(",", dlist.Select(x => x.GoodsId).Distinct());
var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true); var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true);
#region 查询商品申请售后
string OrderDetialIds = string.Join(",", dlist.Select(x => x.Id));
var afterSaleList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetailIds = OrderDetialIds, Type = 1, MallBaseId = demodel.MallBaseId, TenantId = demodel.TenantId });
#endregion
foreach (var item in dlist) foreach (var item in dlist)
{ {
item.CoverImagePath = item.CoverImage; item.CoverImagePath = item.CoverImage;
...@@ -8417,6 +8421,12 @@ namespace Mall.Module.Product ...@@ -8417,6 +8421,12 @@ namespace Mall.Module.Product
item.GoodsSubName = GList.Where(x => x.Id == item.GoodsId).FirstOrDefault()?.SubName ?? ""; item.GoodsSubName = GList.Where(x => x.Id == item.GoodsId).FirstOrDefault()?.SubName ?? "";
item.FinanceList = flist.Where(x => x.ECOrderDetailId == item.Id).ToList();// 2020-08-19 新增财务单据列表 item.FinanceList = flist.Where(x => x.ECOrderDetailId == item.Id).ToList();// 2020-08-19 新增财务单据列表
#region 是否申请售后
item.IsApplyForAfterSale = 2;
if (afterSaleList.Where(x => x.OrderDetialId == item.Id).Any()) {
item.IsApplyForAfterSale = 1;
}
#endregion
} }
} }
string areaIds1 = string.Join(",", list.Select(x => x.Province ?? 0).Distinct()); string areaIds1 = string.Join(",", list.Select(x => x.Province ?? 0).Distinct());
......
This diff is collapsed.
using Mall.Model.Entity.Property;
using Mall.Model.Extend.Property;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.Property
{
/// <summary>
/// 物料有效期仓储类
/// </summary>
public partial class RB_Supplies_StockInValidityRepository : BaseRepository<RB_Supplies_StockInValidity>
{
/// <summary>
/// 获取分页数据
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="dmodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public List<RB_Supplies_StockInValidity_Extend> GetPageList(int pageIndex, int pageSize, RB_Supplies_StockInValidity_Extend dmodel, out long count)
{
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_StockInValidity_Extend.Status), 0);
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.StockinId > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockinId) + $" ={dmodel.StockinId}";
}
if (dmodel.StockinDetailId > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockinDetailId) + $" ={dmodel.StockinDetailId}";
}
if (dmodel.IsOut > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.IsOut) + $" ={dmodel.IsOut}";
}
if (dmodel.StockoutId > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockoutId) + $" ={dmodel.StockoutId}";
}
string sql = $@" select * from RB_Supplies_StockInValidity {where} order by Id desc";
return GetPage<RB_Supplies_StockInValidity_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Supplies_StockInValidity_Extend> GetList(RB_Supplies_StockInValidity_Extend dmodel)
{
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_StockInValidity_Extend.Status), 0);
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (!string.IsNullOrEmpty(dmodel.ValidityIds))
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.Id) + $" in({dmodel.ValidityIds})";
}
if (dmodel.StockinId > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockinId) + $" ={dmodel.StockinId}";
}
if (!string.IsNullOrEmpty(dmodel.StockInIdStr))
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockinId) + $" in({dmodel.StockInIdStr})";
}
if (dmodel.StockinDetailId > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockinDetailId) + $" ={dmodel.StockinDetailId}";
}
if (dmodel.IsOut > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.IsOut) + $" ={dmodel.IsOut}";
}
if (dmodel.StockoutId > 0)
{
where += " and " + nameof(RB_Supplies_StockInValidity_Extend.StockoutId) + $" ={dmodel.StockoutId}";
}
string sql = $@" select * from RB_Supplies_StockInValidity {where} order by Id desc";
return Get<RB_Supplies_StockInValidity_Extend>(sql).ToList();
}
}
}
...@@ -103,7 +103,7 @@ namespace Mall.Repository.Property ...@@ -103,7 +103,7 @@ namespace Mall.Repository.Property
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append($@"SELECT a.*,i.InventoryNum,i.CreateDate as StockInDate FROM( builder.Append($@"SELECT a.*,i.InventoryNum,i.CreateDate as StockInDate FROM(
SELECT gd.OrderId,gd.OrderGoodsId,gd.GoodsId,gd.StockOutId,gd.MaterialId,gd.GoodsName SELECT gd.OrderId,gd.OrderGoodsId,gd.GoodsId,gd.StockOutId,gd.MaterialId,gd.GoodsName
,gd.Specification,gd.CostMoney,gd.ProductCode,gd.WarehouseId,s.StockOutDate,w.`Name` as WarehouseName,COUNT(0) AS Number ,gd.Specification,gd.CostMoney,gd.ProductCode,gd.WarehouseId,s.StockOutDate,w.`Name` as WarehouseName,GROUP_CONCAT(gd.ValidityId) as ValidityIds,COUNT(0) AS Number
FROM rb_warehouseout_goodsdetail gd FROM rb_warehouseout_goodsdetail gd
LEFT JOIN rb_supplies_stockout s on gd.StockOutId = s.Id and s.`Status`=0 and s.StockOutState =1 LEFT JOIN rb_supplies_stockout s on gd.StockOutId = s.Id and s.`Status`=0 and s.StockOutState =1
LEFT JOIN rb_supplies_warehouse w on gd.WarehouseId =w.Id LEFT JOIN rb_supplies_warehouse w on gd.WarehouseId =w.Id
......
...@@ -139,6 +139,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -139,6 +139,7 @@ namespace Mall.WebApi.Controllers.MallBase
IntegralMoney = y.IntegralMoney ?? 0, IntegralMoney = y.IntegralMoney ?? 0,
IntegralNumber = y.IntegralNumber ?? 0, IntegralNumber = y.IntegralNumber ?? 0,
DeductionCommission = y.DeductionCommission ?? 0, DeductionCommission = y.DeductionCommission ?? 0,
y.IsApplyForAfterSale,
SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new
{ {
z.FrID, z.FrID,
......
...@@ -292,6 +292,13 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -292,6 +292,13 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.ParamIsNull("请输入入库数量"); return ApiResult.ParamIsNull("请输入入库数量");
} }
if (item.ValidityList != null && item.ValidityList.Count() > 0)
{
if (item.ValidityList.Count() != item.InStockNum)
{
return ApiResult.ParamIsNull("有效期数量与入库数量不匹配");
}
}
} }
//判断当前仓库是否在盘点中2020-07-28 Add By:W //判断当前仓库是否在盘点中2020-07-28 Add By:W
...@@ -408,6 +415,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -408,6 +415,7 @@ namespace Mall.WebApi.Controllers.MallBase
x.WarehouseId, x.WarehouseId,
x.WarehouseName, x.WarehouseName,
x.Number, x.Number,
x.ValidityIds,
StockOutDate = x.StockOutDate.HasValue ? x.StockOutDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", StockOutDate = x.StockOutDate.HasValue ? x.StockOutDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
StockInDate = x.StockInDate.HasValue ? x.StockInDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", StockInDate = x.StockInDate.HasValue ? x.StockInDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.InventoryNum x.InventoryNum
...@@ -448,8 +456,11 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -448,8 +456,11 @@ namespace Mall.WebApi.Controllers.MallBase
if (item.WarehouseId <= 0) { if (item.WarehouseId <= 0) {
return ApiResult.ParamIsNull("请传递仓库id"); return ApiResult.ParamIsNull("请传递仓库id");
} }
if (item.Number <= 0){
return ApiResult.ParamIsNull("请传递出库数量");
}
if (item.InventoryNum <= 0) { if (item.InventoryNum <= 0) {
return ApiResult.ParamIsNull("请传递入库数量"); return ApiResult.ParamIsNull("请传递重新入库数量");
} }
if (string.IsNullOrEmpty(item.GoodsName)) if (string.IsNullOrEmpty(item.GoodsName))
{ {
......
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