You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using SlnMesnac.Model.domain;
|
|
|
|
namespace SlnMesnac.Repository.service.Impl
|
|
{
|
|
public class CwssMaterialInfoServiceImpl:ICwssMaterialInfoService
|
|
{
|
|
private readonly Repository<CwssMaterialInfo> _rep;
|
|
|
|
public CwssMaterialInfoServiceImpl(Repository<CwssMaterialInfo> rep)
|
|
{
|
|
_rep = rep;
|
|
}
|
|
|
|
public List<CwssMaterialInfo> GetCwssMaterialInfoList()
|
|
{
|
|
try
|
|
{
|
|
return _rep.GetList();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
throw new ArgumentException($"获取CWSS物料信息异常:{e.Message}");
|
|
}
|
|
}
|
|
|
|
public CwssMaterialInfo GetCwssMaterialInfoByMatCode(string MatCode)
|
|
{
|
|
try
|
|
{
|
|
//return _rep.GetList(x => x.MatCode == MatCode).OrderByDescending(x => x.WriteTime).First();
|
|
return _rep.GetFirst(x => x.MaterialCode == MatCode);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
throw new ArgumentException($"根据物料代码获取物料信息异常:{e.Message}");
|
|
}
|
|
}
|
|
}
|
|
} |