工厂和车间下拉

This commit is contained in:
quowingwang 2026-01-10 10:34:11 +08:00
parent 00108081e7
commit ff4d6c2307
3 changed files with 9 additions and 10 deletions

View File

@ -119,9 +119,9 @@ namespace MDM.Controllers.Plant
/// <param name="site_code">工厂code</param>
/// <returns></returns>
[HttpGet("get_factory_site")]
public IActionResult GetFactorySite(string site_code)
public IActionResult GetFactorySite()
{
var response = _PlantProductlinebodyService.GetFactorySite(site_code);
var response = _PlantProductlinebodyService.GetFactorySite();
return SUCCESS(response);
}
@ -129,9 +129,9 @@ namespace MDM.Controllers.Plant
//获取车间
[HttpGet("get_workshop")]
public IActionResult GetWorkShop(string site_code, string workshop_code)
public IActionResult GetWorkShop(string site_code)
{
var response = _PlantProductlinebodyService.GetWorkShop(site_code, workshop_code);
var response = _PlantProductlinebodyService.GetWorkShop(site_code);
return SUCCESS(response);
}

View File

@ -22,9 +22,9 @@ namespace MDM.Services.IPlantService
List<LinePullDownDto> GetAllLine();
List<PlantWorkstation> GetWorkstationList(int id);
List<PlantFactorySite> GetFactorySite(string site_code);
List<PlantFactorySite> GetFactorySite();
List<PlantWorkshop> GetWorkShop(string site_code, string workshop_code);
List<PlantWorkshop> GetWorkShop(string site_code);
}
}

View File

@ -106,17 +106,16 @@ namespace MDM.Services.Plant
return Context.Queryable<PlantWorkstation>().Where(it => it.FkFactorySiteCode == productlinebody.FkFactorySiteCode && it.FkWorkshopCode == productlinebody.FkWorkshopCode && it.FkProductlinebody == productlinebody.LineCode).ToList();
}
public List<PlantFactorySite> GetFactorySite(string site_code)
public List<PlantFactorySite> GetFactorySite()
{
return Context.Queryable<PlantFactorySite>().WhereIF(!string.IsNullOrEmpty(site_code), it => it.SiteCode.Contains(site_code)).ToList();
return Context.Queryable<PlantFactorySite>().ToList();
}
public List<PlantWorkshop> GetWorkShop(string site_code, string workshop_code)
public List<PlantWorkshop> GetWorkShop(string site_code)
{
return Context.Queryable<PlantWorkshop>()
.WhereIF(!string.IsNullOrEmpty(site_code), it => it.FkSiteCode.Contains(site_code))
.WhereIF(!string.IsNullOrEmpty(workshop_code), it => it.WorkshopCode.Contains(workshop_code))
.ToList();
}
}