using JinYuan.DAL.Models; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace JinYuan.DAL.Service { public interface IMesUrlService { string GetMesUrl(string trayCode, string interfaceKey); } public class MesUrlService : IMesUrlService { protected readonly ISqlSugarClient _db; private MaterialFrameRuleService _ruleService; private WorkshopInterCfgService _cfgService; public MesUrlService(ISqlSugarClient db) { _db = db; _ruleService = new MaterialFrameRuleService(_db); _cfgService = new WorkshopInterCfgService(_db); } public string GetMesUrl(string trayCode, string interfaceKey) { if (string.IsNullOrEmpty(trayCode) || string.IsNullOrEmpty(interfaceKey)) return string.Empty; var rule = _ruleService.GetRuleByCode(trayCode); if (rule == null) return string.Empty; var url = _cfgService.GetUrl(rule.Workshop_Code, interfaceKey); return url; } } }