Commit 09a722c9 authored by liudong1993's avatar liudong1993

物料详情

parent 3d508526
...@@ -56,6 +56,33 @@ namespace Property.Module.FixedAssets ...@@ -56,6 +56,33 @@ namespace Property.Module.FixedAssets
private readonly RB_Supplies_ApplyforWeekdayRepository supplies_ApplyforWeekdayRepository = new RB_Supplies_ApplyforWeekdayRepository(); private readonly RB_Supplies_ApplyforWeekdayRepository supplies_ApplyforWeekdayRepository = new RB_Supplies_ApplyforWeekdayRepository();
private readonly RB_Supplies_ApplyforSpecialRepository supplies_ApplyforSpecialRepository = new RB_Supplies_ApplyforSpecialRepository(); private readonly RB_Supplies_ApplyforSpecialRepository supplies_ApplyforSpecialRepository = new RB_Supplies_ApplyforSpecialRepository();
/// <summary>
/// 获取物料详情
/// </summary>
/// <param name="materialId"></param>
/// <returns></returns>
public RB_Supplies_Material_Extend GetMaterialInfo(int materialId)
{
var model = supplies_MaterialRepository.GetEntity(materialId).RefMapperTo<RB_Supplies_Material_Extend>();
if (model == null)
{
return new RB_Supplies_Material_Extend();
}
if (model.Images == "" || model.Images == null)
{
model.Images = "[]";
}
var imglist = JsonConvert.DeserializeObject<List<string>>(model.Images);
model.ImageList = new List<string>();
foreach (var img in imglist)
{
model.ImageList.Add(Config.GetFileUrl(img));
}
return model;
}
/// <summary> /// <summary>
/// 获取物料档案分页列表 /// 获取物料档案分页列表
/// </summary> /// </summary>
......
...@@ -57,9 +57,6 @@ namespace Property.WebApi.Controllers.Login ...@@ -57,9 +57,6 @@ namespace Property.WebApi.Controllers.Login
{ {
Domain = Domain.Replace("zc", "");//资产管理专用 Domain = Domain.Replace("zc", "");//资产管理专用
} }
if (Domain.Contains("test")) {
Domain = Domain.Replace("test", "");//资产管理测试专用
}
var gmodel = loginModule.GetGroupByDomain(new RB_Group_Extend { Domain = Domain }).FirstOrDefault(); var gmodel = loginModule.GetGroupByDomain(new RB_Group_Extend { Domain = Domain }).FirstOrDefault();
if (gmodel == null) if (gmodel == null)
{ {
......
...@@ -56,6 +56,40 @@ namespace Property.WebApi.Controllers.User ...@@ -56,6 +56,40 @@ namespace Property.WebApi.Controllers.User
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
/// <summary>
/// 获取物料详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMaterialInfo() {
var requestParm = GetRequestParm();
JObject parms = JObject.Parse(requestParm.msg.ToString());
int MaterialId = parms.GetInt("MaterialId", 0);
if (MaterialId <= 0) {
return ApiResult.ParamIsNull();
}
var model = suppliesModule.GetMaterialInfo(MaterialId);
return ApiResult.Success("", new
{
model.Id,
model.Name,
model.CategoryId,
model.CategoryName,
model.BrandName,
model.Money,
model.Units,
model.ImageList,
model.Remark,
model.SupplierName,
model.Barcode,
model.ReservedStock,
model.SafetyStock,
model.SuppliesModel,
model.SuppliesNum
});
}
/// <summary> /// <summary>
/// 设置物料档案 /// 设置物料档案
/// </summary> /// </summary>
......
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