ISF保存时添加公司类型过滤,解决出现异常公司类型的问题

master
zhangxiaofeng 4 months ago
parent 20510386e1
commit 44f861f9cf

@ -21,6 +21,8 @@ namespace djy.Service.Isf
public class IsfService : ServBase, IIsfService public class IsfService : ServBase, IIsfService
{ {
private readonly IWebHostEnvironment env; private readonly IWebHostEnvironment env;
string[] ISF10CompanyTypeCode = new string[] { "CS", "BY", "LG", "MF", "CN", "SE", "ST", "IM" };
string[] ISF5CompanyTypeCode = new string[] { "ST", "BKP" };
public IsfService(IWebHostEnvironment env) public IsfService(IWebHostEnvironment env)
{ {
@ -184,6 +186,15 @@ namespace djy.Service.Isf
//DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows(); //DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
if (dto.companyList != null && dto.companyList.Count() > 0) if (dto.companyList != null && dto.companyList.Count() > 0)
{ {
if (dto.InFoType == "1")
{
dto.companyList = dto.companyList.Where(x => ISF5CompanyTypeCode.Contains(x.CompanyType)).ToList();
}
else if (dto.InFoType == "2")
{
dto.companyList = dto.companyList.Where(x => ISF10CompanyTypeCode.Contains(x.CompanyType)).ToList();
}
foreach (var item in dto.companyList) foreach (var item in dto.companyList)
{ {
ISF_Company companylist = item.MapTo<ISF_Company>(); ISF_Company companylist = item.MapTo<ISF_Company>();

Loading…
Cancel
Save