Browse Source

1. 加入安勤 虛擬目錄設定

2. 修正過站SOP顯示
3. 過站API判斷修正
4. Mail寄信修改方式
PTD
ray 2 years ago
parent
commit
d14f92c1b8
  1. 5
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 12
      AMESCoreStudio.Web/Startup.cs
  3. 4
      AMESCoreStudio.Web/Views/PCS/PCS021.cshtml
  4. 7
      AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs
  5. 36
      AMESCoreStudio.WebApi/Controllers/BLL/MailController.cs
  6. 7
      AMESCoreStudio.WebApi/DTO/AMES/BarcodeItemKPDto.cs
  7. 1
      AMESCoreStudio.WebApi/Startup.cs

5
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -5380,7 +5380,8 @@ namespace AMESCoreStudio.Web.Controllers
model.Sops.Add(new PCS021ViewModel_SOP model.Sops.Add(new PCS021ViewModel_SOP
{ {
SopName = "SOP文件", SopName = "SOP文件",
SopPath = @$"\\qasrv-n\Web\ISOZone\{Esop.FirstOrDefault().file_path}" SopPath = $@"/DocEsop/{Esop.FirstOrDefault().file_path}"
//SopPath = @$"\\qasrv-n\Web\ISOZone\{Esop.FirstOrDefault().file_path}"
}); });
} }
} }
@ -6314,7 +6315,7 @@ namespace AMESCoreStudio.Web.Controllers
// await formFile.CopyToAsync(stream); // await formFile.CopyToAsync(stream);
// } // }
// //var fileProvider = _fileServerProvider.GetProvider("/aa"); // var fileProvider = _fileServerProvider.GetProvider("/aa");
// //var fileInfo = fileProvider.GetFileInfo(formFile.FileName); // //var fileInfo = fileProvider.GetFileInfo(formFile.FileName);
// //fileInfo = fileProvider.GetFileInfo(formFile.FileName); // //fileInfo = fileProvider.GetFileInfo(formFile.FileName);
// ////遠端目錄 // ////遠端目錄

12
AMESCoreStudio.Web/Startup.cs

@ -45,12 +45,12 @@ namespace AMESCoreStudio.Web
// RequestPath = new PathString("/aa"), // RequestPath = new PathString("/aa"),
// EnableDirectoryBrowsing = true // EnableDirectoryBrowsing = true
//} //}
////new FileServerOptions new FileServerOptions
//{ {
// FileProvider = new PhysicalFileProvider(@"\\server\path"), FileProvider = new PhysicalFileProvider(@"//qasrv-n/Web/ISOZone/"),
// RequestPath = new PathString("/MyPath"), RequestPath = new PathString("/DocEsop"),
// EnableDirectoryBrowsing = true EnableDirectoryBrowsing = true
//} }
})); }));

4
AMESCoreStudio.Web/Views/PCS/PCS021.cshtml

@ -349,14 +349,14 @@
if (!sopfirst) if (!sopfirst)
{ {
<div class="layui-tab-item layui-show" style="height:90vh"> <div class="layui-tab-item layui-show" style="height:90vh">
<iframe frameborder="0" style="width:100%;height:100%;" src=@index.SopPath></iframe> <iframe frameborder="0" style="width:100%;height:100%;" src='@index.SopPath'></iframe>
</div> </div>
sopfirst = true; sopfirst = true;
} }
else else
{ {
<div class="layui-tab-item" style="height:90vh"> <div class="layui-tab-item" style="height:90vh">
<iframe frameborder="0" style="width:100%;height:100%;" src=@index.SopPath></iframe> <iframe frameborder="0" style="width:100%;height:100%;" src='@index.SopPath'></iframe>
</div> </div>
} }
} }

7
AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs

@ -185,7 +185,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
{ {
WipNo = barCodeCheckDto.wipNo, WipNo = barCodeCheckDto.wipNo,
barcode = barCodeCheckDto.barcode, barcode = barCodeCheckDto.barcode,
unitNo = station.Value.Where(w => w.StationID == barCodeCheckDto.stationID).FirstOrDefault().UnitNo, unitNo = barCodeCheckDto.unitNo,
ststionUnitNo = station.Value.Where(w => w.StationID == barCodeCheckDto.stationID).FirstOrDefault().UnitNo,
inputKP = barCodeCheckDto.inputItems.Where(w => !w.inputType.Contains("NG")).ToList() inputKP = barCodeCheckDto.inputItems.Where(w => !w.inputType.Contains("NG")).ToList()
}; };
@ -1782,7 +1783,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
#region 確認是否有設定key Parts資料 #region 確認是否有設定key Parts資料
WipKpsController wipKpsController = new WipKpsController(_context); WipKpsController wipKpsController = new WipKpsController(_context);
var wipKps = (await wipKpsController.GetWipKpByWipNo(barcodeItemKPDto.WipNo)).Value.ToList(); var wipKps = (await wipKpsController.GetWipKpByWipNo(barcodeItemKPDto.WipNo)).Value.ToList();
wipKps = wipKps.Where(w => w.UnitNo == barcodeItemKPDto.unitNo).OrderBy(o => o.KpSeq).ToList(); wipKps = wipKps.Where(w => w.UnitNo == barcodeItemKPDto.ststionUnitNo).OrderBy(o => o.KpSeq).ToList();
if (wipKps.Count != 0) if (wipKps.Count != 0)
{ {
#region 判斷內部序號是否有過站紀錄 #region 判斷內部序號是否有過站紀錄
@ -1798,7 +1799,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
BarcodeItemsController barcodeItemsController = new BarcodeItemsController(_context); BarcodeItemsController barcodeItemsController = new BarcodeItemsController(_context);
var BarCodeItems = (await barcodeItemsController.GetBarcodeItemByBarCodeID(BarCodeID)).Value.ToList(); var BarCodeItems = (await barcodeItemsController.GetBarcodeItemByBarCodeID(BarCodeID)).Value.ToList();
BarCodeItems = BarCodeItems.Where(w => w.WipID == q.Value.FirstOrDefault().WipID BarCodeItems = BarCodeItems.Where(w => w.WipID == q.Value.FirstOrDefault().WipID
&& w.S.UnitNo == barcodeItemKPDto.unitNo).ToList(); && w.S.UnitNo == barcodeItemKPDto.ststionUnitNo).ToList();
#endregion #endregion
// 計算過站時刷的組件數量與已經存BarCodeItems // 計算過站時刷的組件數量與已經存BarCodeItems

36
AMESCoreStudio.WebApi/Controllers/BLL/MailController.cs

@ -27,9 +27,9 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL
/// 建構式 /// 建構式
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context"></param>
public MailController(AMESContext context) public MailController(AMESContext context, IConfiguration config)
{ {
_config = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory).AddJsonFile("appsettings.json").Build(); _config = config;
_context = context; _context = context;
} }
@ -49,11 +49,11 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL
ResultModel<dynamic> result = new ResultModel<dynamic>(); ResultModel<dynamic> result = new ResultModel<dynamic>();
// Mail 基本設定資料 // Mail 基本設定資料
string mailFrom = _config["MailFrom"].ToString(); string mailFrom = _config.GetSection("MailFrom").Value;
string mailSmtpServer = _config["MailSmtpServer"].ToString(); string mailSmtpServer = _config.GetSection("MailSmtpServer").Value;
int mailSmtpPort = int.Parse(_config["MailSmtpPort"].ToString()); int mailSmtpPort = int.Parse(_config.GetSection("MailSmtpPort").Value);
string mailUser = _config["MailUser"].ToString(); string mailUser = _config.GetSection("MailUser").Value;
string mailPassword = _config["MailUserPassword"].ToString(); string mailPassword = _config.GetSection("MailUserPassword").Value;
MailMessage mesMail = new MailMessage(); MailMessage mesMail = new MailMessage();
mesMail.From = new MailAddress(mailFrom); mesMail.From = new MailAddress(mailFrom);
@ -151,7 +151,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL
} }
// 是否有附件檔案 // 是否有附件檔案
if (Attachment != null) if (!string.IsNullOrWhiteSpace(Attachment))
{ {
mesMail.Attachments.Add(new Attachment(Attachment)); mesMail.Attachments.Add(new Attachment(Attachment));
} }
@ -179,5 +179,25 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL
return result; return result;
} }
/// <summary>
/// 用ID获取该單位资料
/// </summary>
/// <returns></returns>
// GET: api/FactoryUnits/5
[HttpGet]
public async Task<string> GetFactoryUnit()
{
// Mail 基本設定資料
string mailFrom = _config.GetSection("MailFrom").Value;
string mailSmtpServer = _config.GetSection("MailSmtpServer").Value;
int mailSmtpPort = int.Parse(_config.GetSection("MailSmtpPort").Value);
string mailUser = _config.GetSection("MailUser").Value;
string mailPassword = _config.GetSection("MailUserPassword").Value;
var aa = $"{mailFrom} {mailSmtpServer} {mailSmtpPort} {mailUser} {mailPassword}";
return aa;
}
} }
} }

7
AMESCoreStudio.WebApi/DTO/AMES/BarcodeItemKPDto.cs

@ -22,10 +22,15 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
public string barcode { get; set; } public string barcode { get; set; }
/// <summary> /// <summary>
/// 生產單位 /// 工單-生產單位
/// </summary> /// </summary>
public string unitNo { get; set; } public string unitNo { get; set; }
/// <summary>
/// 作業站-生產單位
/// </summary>
public string ststionUnitNo { get; set; }
/// <summary> /// <summary>
/// List BarCodeCheckDto.inputItem /// List BarCodeCheckDto.inputItem
/// </summary> /// </summary>

1
AMESCoreStudio.WebApi/Startup.cs

@ -46,6 +46,7 @@ namespace AMESCoreStudio.WebApi
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddSingleton<IConfiguration>(Configuration);
//services.AddDbContext<AMESContext>( //services.AddDbContext<AMESContext>(
// opt => opt.UseLazyLoadingProxies().UseOracle(Configuration.GetConnectionString("AMESContext"), b => b.UseOracleSQLCompatibility("11"))); // opt => opt.UseLazyLoadingProxies().UseOracle(Configuration.GetConnectionString("AMESContext"), b => b.UseOracleSQLCompatibility("11")));

Loading…
Cancel
Save