Commit b7731e90 authored by liudong1993's avatar liudong1993

资产 商品规格,分类 返回

parent 484b5d74
using System; using System;
using System.Collections.Generic;
using Property.Model.Entity; using Property.Model.Entity;
using REBORN.Common.AOP; using REBORN.Common.AOP;
...@@ -43,5 +44,21 @@ namespace Property.Model.Extend ...@@ -43,5 +44,21 @@ namespace Property.Model.Extend
/// 入库单Id /// 入库单Id
/// </summary> /// </summary>
public string StockInIdStr { get; set; } public string StockInIdStr { get; set; }
/// <summary>
/// 规格
/// </summary>
public string SpecificationName { get; set; }
/// <summary>
/// 分类
/// </summary>
public string GoodsCategoryName { get; set; }
/// <summary>
/// 规格列表
/// </summary>
public List<string> GoodsSpecificationList { get; set; }
/// <summary>
/// 分类列表
/// </summary>
public List<string> GoodsCategoryList { get; set; }
} }
} }
\ No newline at end of file
using System; using System;
using System.Collections.Generic;
using Property.Model.Entity; using Property.Model.Entity;
using REBORN.Common.AOP; using REBORN.Common.AOP;
...@@ -93,5 +94,22 @@ namespace Property.Model.Extend ...@@ -93,5 +94,22 @@ namespace Property.Model.Extend
/// 出库单号 /// 出库单号
/// </summary> /// </summary>
public string StockOutNum { get; set; } public string StockOutNum { get; set; }
/// <summary>
/// 规格
/// </summary>
public string SpecificationName { get; set; }
/// <summary>
/// 分类
/// </summary>
public string GoodsCategoryName { get; set; }
/// <summary>
/// 规格列表
/// </summary>
public List<string> GoodsSpecificationList { get; set; }
/// <summary>
/// 分类列表
/// </summary>
public List<string> GoodsCategoryList { get; set; }
} }
} }
\ No newline at end of file
...@@ -341,6 +341,18 @@ namespace Property.Module.FixedAssets ...@@ -341,6 +341,18 @@ namespace Property.Module.FixedAssets
} }
foreach (var item in list) { foreach (var item in list) {
item.DetailList = sdList.Where(x => x.StockInId == item.Id).ToList(); item.DetailList = sdList.Where(x => x.StockInId == item.Id).ToList();
foreach (var qitem in item.DetailList) {
qitem.GoodsSpecificationList = new List<string>();
qitem.GoodsCategoryList = new List<string>();
if (!string.IsNullOrEmpty(qitem.SpecificationName))
{
qitem.GoodsSpecificationList = JsonConvert.DeserializeObject<List<string>>(qitem.SpecificationName);
}
if (!string.IsNullOrEmpty(qitem.GoodsCategoryName))
{
qitem.GoodsCategoryList = JsonConvert.DeserializeObject<List<string>>(qitem.GoodsCategoryName);
}
}
} }
return list; return list;
...@@ -836,6 +848,16 @@ namespace Property.Module.FixedAssets ...@@ -836,6 +848,16 @@ namespace Property.Module.FixedAssets
item.BranchName = bmodel?.BName ?? ""; item.BranchName = bmodel?.BName ?? "";
item.DepartmentName = dmodel?.DepartmentName ?? ""; item.DepartmentName = dmodel?.DepartmentName ?? "";
item.EmName = CacheManager.User.UserReidsCache.GetEmployee(item.EmployeeId)?.EmName ?? ""; item.EmName = CacheManager.User.UserReidsCache.GetEmployee(item.EmployeeId)?.EmName ?? "";
item.GoodsSpecificationList = new List<string>();
item.GoodsCategoryList = new List<string>();
if (!string.IsNullOrEmpty(item.SpecificationName))
{
item.GoodsSpecificationList = JsonConvert.DeserializeObject<List<string>>(item.SpecificationName);
}
if (!string.IsNullOrEmpty(item.GoodsCategoryName))
{
item.GoodsCategoryList = JsonConvert.DeserializeObject<List<string>>(item.GoodsCategoryName);
}
} }
return list; return list;
} }
...@@ -868,6 +890,16 @@ namespace Property.Module.FixedAssets ...@@ -868,6 +890,16 @@ namespace Property.Module.FixedAssets
if (item.SModel == null) { if (item.SModel == null) {
item.SModel = new RB_Supplies_Material_Extend(); item.SModel = new RB_Supplies_Material_Extend();
} }
item.SModel.GoodsSpecificationList = new List<string>();
item.SModel.GoodsCategoryList = new List<string>();
if (!string.IsNullOrEmpty(item.SModel.SpecificationName))
{
item.SModel.GoodsSpecificationList = JsonConvert.DeserializeObject<List<string>>(item.SModel.SpecificationName);
}
if (!string.IsNullOrEmpty(item.SModel.GoodsCategoryName))
{
item.SModel.GoodsCategoryList = JsonConvert.DeserializeObject<List<string>>(item.SModel.GoodsCategoryName);
}
} }
} }
return list; return list;
...@@ -1247,6 +1279,20 @@ namespace Property.Module.FixedAssets ...@@ -1247,6 +1279,20 @@ namespace Property.Module.FixedAssets
string Wstr = string.Join(",", list.Select(x => x.WarehouseId).Distinct()); string Wstr = string.Join(",", list.Select(x => x.WarehouseId).Distinct());
string Sstr = string.Join(",", sdList.Select(x => x.SuppliesId).Distinct()); string Sstr = string.Join(",", sdList.Select(x => x.SuppliesId).Distinct());
iList = supplies_InventoryRepository.GetList(new RB_Supplies_Inventory_Extend() { RB_Group_Id = demodel.RB_Group_Id, WarehouseIdStr = Wstr, SuppliesIdStr = Sstr }); iList = supplies_InventoryRepository.GetList(new RB_Supplies_Inventory_Extend() { RB_Group_Id = demodel.RB_Group_Id, WarehouseIdStr = Wstr, SuppliesIdStr = Sstr });
foreach (var qitem in sdList)
{
qitem.GoodsSpecificationList = new List<string>();
qitem.GoodsCategoryList = new List<string>();
if (!string.IsNullOrEmpty(qitem.SpecificationName))
{
qitem.GoodsSpecificationList = JsonConvert.DeserializeObject<List<string>>(qitem.SpecificationName);
}
if (!string.IsNullOrEmpty(qitem.GoodsCategoryName))
{
qitem.GoodsCategoryList = JsonConvert.DeserializeObject<List<string>>(qitem.GoodsCategoryName);
}
}
} }
} }
foreach (var item in list) foreach (var item in list)
......
...@@ -32,7 +32,7 @@ namespace Property.Repository ...@@ -32,7 +32,7 @@ namespace Property.Repository
where += " and ssd." + nameof(RB_Supplies_StockInDetail_Extend.StockInId) + " in(" + dmodel.StockInIdStr + ")"; where += " and ssd." + nameof(RB_Supplies_StockInDetail_Extend.StockInId) + " in(" + dmodel.StockInIdStr + ")";
} }
string sql = $@" select ssd.*,sm.Name as SuppliesName,sm.SuppliesNum,sm.BrandName,sm.SuppliesModel,sm.Units,pc.Name as CategoryName string sql = $@" select ssd.*,sm.Name as SuppliesName,sm.SuppliesNum,sm.BrandName,sm.SpecificationName,sm.GoodsCategoryName,sm.SuppliesModel,sm.Units,pc.Name as CategoryName
from rb_supplies_stockindetail ssd from rb_supplies_stockindetail ssd
left join rb_supplies_material sm on ssd.SuppliesId=sm.Id left join rb_supplies_material sm on ssd.SuppliesId=sm.Id
left join rb_property_category pc on pc.Id=sm.CategoryId left join rb_property_category pc on pc.Id=sm.CategoryId
......
...@@ -31,7 +31,7 @@ namespace Property.Repository ...@@ -31,7 +31,7 @@ namespace Property.Repository
where += " and ssd." + nameof(RB_Supplies_StockOutDetail_Extend.StockOutId) + " in(" + dmodel.StockOutIdStr + ")"; where += " and ssd." + nameof(RB_Supplies_StockOutDetail_Extend.StockOutId) + " in(" + dmodel.StockOutIdStr + ")";
} }
string sql = $@" select ssd.*,sm.Name as SuppliesName,sm.SuppliesNum,sm.BrandName,sm.SuppliesModel,sm.Units,pc.Name as CategoryName string sql = $@" select ssd.*,sm.Name as SuppliesName,sm.SuppliesNum,sm.BrandName,sm.SpecificationName,sm.GoodsCategoryName,sm.SuppliesModel,sm.Units,pc.Name as CategoryName
from rb_supplies_stockoutdetail ssd from rb_supplies_stockoutdetail ssd
left join rb_supplies_material sm on ssd.SuppliesId=sm.Id left join rb_supplies_material sm on ssd.SuppliesId=sm.Id
left join rb_property_category pc on pc.Id=sm.CategoryId left join rb_property_category pc on pc.Id=sm.CategoryId
...@@ -80,7 +80,7 @@ left join rb_property_category pc on pc.Id=sm.CategoryId ...@@ -80,7 +80,7 @@ left join rb_property_category pc on pc.Id=sm.CategoryId
where += " and sm." + nameof(RB_Supplies_StockOut.BranchId) + "=" + dmodel.BranchId; where += " and sm." + nameof(RB_Supplies_StockOut.BranchId) + "=" + dmodel.BranchId;
} }
string sql = $@" select ssd.*,ss.StockOutDate,ss.EmployeeId,ss.BranchId,ss.DepartmentId,ss.StockOutNum,sm.Name as SuppliesName,pc.Name as CategoryName string sql = $@" select ssd.*,ss.StockOutDate,ss.EmployeeId,ss.BranchId,ss.DepartmentId,ss.StockOutNum,sm.Name as SuppliesName,sm.SpecificationName,sm.GoodsCategoryName,pc.Name as CategoryName
from rb_supplies_stockoutdetail ssd from rb_supplies_stockoutdetail ssd
left join rb_supplies_stockout ss on ssd.StockOutId=ss.Id left join rb_supplies_stockout ss on ssd.StockOutId=ss.Id
left join rb_supplies_material sm on ssd.SuppliesId=sm.Id left join rb_supplies_material sm on ssd.SuppliesId=sm.Id
......
...@@ -317,7 +317,9 @@ namespace Property.WebApi.Controllers.User ...@@ -317,7 +317,9 @@ namespace Property.WebApi.Controllers.User
z.SuppliesModel, z.SuppliesModel,
z.SuppliesId, z.SuppliesId,
z.Units, z.Units,
z.Remark z.Remark,
z.GoodsSpecificationList,
z.GoodsCategoryList
}), }),
UpdateBy = CacheManager.User.UserReidsCache.GetEmployee(x.UpdateBy)?.EmName ?? "", UpdateBy = CacheManager.User.UserReidsCache.GetEmployee(x.UpdateBy)?.EmName ?? "",
UpdateDate = x.UpdateDate.Value.ToString("yyyy-MM-dd") UpdateDate = x.UpdateDate.Value.ToString("yyyy-MM-dd")
...@@ -638,7 +640,9 @@ namespace Property.WebApi.Controllers.User ...@@ -638,7 +640,9 @@ namespace Property.WebApi.Controllers.User
z.SuppliesId, z.SuppliesId,
z.Units, z.Units,
z.Remark, z.Remark,
z.InventoryNum z.InventoryNum,
z.GoodsSpecificationList,
z.GoodsCategoryList
}), }),
UpdateBy = (CacheManager.User.UserReidsCache.GetEmployee(x.UpdateBy)?.EmName ?? ""), UpdateBy = (CacheManager.User.UserReidsCache.GetEmployee(x.UpdateBy)?.EmName ?? ""),
UpdateDate = x.UpdateDate.Value.ToString("yyyy-MM-dd") UpdateDate = x.UpdateDate.Value.ToString("yyyy-MM-dd")
...@@ -917,6 +921,8 @@ namespace Property.WebApi.Controllers.User ...@@ -917,6 +921,8 @@ namespace Property.WebApi.Controllers.User
x.SModel.Units, x.SModel.Units,
x.SModel.SafetyStock, x.SModel.SafetyStock,
x.SModel.ReservedStock, x.SModel.ReservedStock,
x.SModel.GoodsSpecificationList,
x.SModel.GoodsCategoryList,
WareHouseName = x.WModel.Name WareHouseName = x.WModel.Name
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
...@@ -1058,6 +1064,8 @@ namespace Property.WebApi.Controllers.User ...@@ -1058,6 +1064,8 @@ namespace Property.WebApi.Controllers.User
x.CategoryName, x.CategoryName,
x.SuppliesName, x.SuppliesName,
x.StockOutNum, x.StockOutNum,
x.GoodsSpecificationList,
x.GoodsCategoryList,
StockOutDate = x.StockOutDate.Value.ToString("yyyy-MM-dd") StockOutDate = x.StockOutDate.Value.ToString("yyyy-MM-dd")
}); });
return ApiResult.Success("", new { return ApiResult.Success("", new {
......
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