|
|
@ -1,31 +1,21 @@ |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using AMESCoreStudio.CommonTools.Result; |
|
|
|
using AMESCoreStudio.Web.Models; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using AMESCoreStudio.WebApi; |
|
|
|
using System.Collections.Generic; |
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering; |
|
|
|
using AMESCoreStudio.WebApi.Models.AMES; |
|
|
|
using AMESCoreStudio.WebApi.Models.BAS; |
|
|
|
using AMESCoreStudio.Web.ViewModels; |
|
|
|
using AMESCoreStudio.Web.ViewModels.PCS; |
|
|
|
using AMESCoreStudio.Web.ViewModels.PCB; |
|
|
|
using AMESCoreStudio.WebApi.DTO.AMES; |
|
|
|
using System.Linq; |
|
|
|
using AMESCoreStudio.CommonTools.Result; |
|
|
|
using System; |
|
|
|
using System.IO; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using AspNetCore.Reporting; |
|
|
|
using System.Text.Encodings; |
|
|
|
using AMESCoreStudio.WebApi.Enum; |
|
|
|
using AMESCoreStudio.WebApi.Controllers.AMES; |
|
|
|
using System.Data.Common; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using AMESCoreStudio.WebApi.Models.AMES; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Data; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace AMESCoreStudio.Web.Controllers |
|
|
|
{ |
|
|
@ -39,13 +29,15 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
private readonly IWebHostEnvironment _env; |
|
|
|
public readonly IPCS _pcsApi; |
|
|
|
public readonly IBLL _bllApi; |
|
|
|
public PCBController(ILogger<PCBController> logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi, IBLL bllApi) |
|
|
|
public readonly ISYS _sysApi; |
|
|
|
public PCBController(ILogger<PCBController> logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi, IBLL bllApi, ISYS sysApi) |
|
|
|
{ |
|
|
|
_logger = logger; |
|
|
|
_pcbApi = pcbApi; |
|
|
|
_env = env; |
|
|
|
_pcsApi = pcsApi; |
|
|
|
_bllApi = bllApi; |
|
|
|
_sysApi = sysApi; |
|
|
|
} |
|
|
|
|
|
|
|
//#region 下拉選單
|
|
|
@ -77,11 +69,15 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
return View(); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<IActionResult> PCB013QueryAsync(string steelPlateNo, string pcbPartNo |
|
|
|
, string side, string status, int page = 0, int limit = 10) |
|
|
|
public async Task<IActionResult> PCB013QueryAsync(string steelPlateNo, string storageLocation, string item, |
|
|
|
string date_str, string date_end, string side, string status, string checkOff, int page = 0, int limit = 10) |
|
|
|
{ |
|
|
|
IResultModel<SteelPlateInfoDto> result = await _pcbApi.GetSteelPlateInfoQuery(steelPlateNo: steelPlateNo, pcbPartNo: pcbPartNo |
|
|
|
, side: side, status: status, page: page, limit: limit); |
|
|
|
if (checkOff == "on") |
|
|
|
checkOff = "Y"; |
|
|
|
|
|
|
|
IResultModel<SteelPlateInfoDto> result = await _pcbApi.GetSteelPlateInfoQuery(steelPlateNo: steelPlateNo, storageLocation: storageLocation, |
|
|
|
item: item, date_str: date_str, date_end: date_end, side: side, status: status, |
|
|
|
checkOff: checkOff, page: page, limit: limit); |
|
|
|
|
|
|
|
if (result.Data.Count() != 0) |
|
|
|
{ |
|
|
@ -110,6 +106,9 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
{ |
|
|
|
if (ModelState.IsValid) |
|
|
|
{ |
|
|
|
model.SteelPlateNo = model.SteelPlateNo.Trim(); |
|
|
|
model.Items = model.Items.Trim(); |
|
|
|
|
|
|
|
IResultModel result; |
|
|
|
if (model.SteelPlateID == 0) |
|
|
|
{ |
|
|
@ -146,12 +145,37 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public IActionResult PCB013A(int steelPlateID, string steelPlateNo) |
|
|
|
public async Task<IActionResult> PCB013A(int steelPlateID, string steelPlateNo) |
|
|
|
{ |
|
|
|
GetSteelPlateStatusSelect(); |
|
|
|
ViewBag.steelPlateID = steelPlateID; |
|
|
|
ViewBag.steelPlateNo = steelPlateNo; |
|
|
|
return View(); |
|
|
|
var result = new PCB013ViewModel(); |
|
|
|
result.SteelPlateID = steelPlateID; |
|
|
|
result.SteelPlateNo = steelPlateNo; |
|
|
|
|
|
|
|
var resultSteel = await _pcbApi.GetSteelPlateMeasureBySteelPlateID(steelPlateID); |
|
|
|
|
|
|
|
// 鋼板編號沒有量測資料
|
|
|
|
if (resultSteel.Data.Count() == 0) |
|
|
|
{ |
|
|
|
result.SpMeasureID = 0; |
|
|
|
result.Status = "上線"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var item = resultSteel.Data.OrderByDescending(o => o.SpMeasureID).FirstOrDefault(); |
|
|
|
// 下線資料空白
|
|
|
|
if (string.IsNullOrWhiteSpace(item.OffTension1)) |
|
|
|
{ |
|
|
|
result.SpMeasureID = item.SpMeasureID; |
|
|
|
result.Status = "下線"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
result.SpMeasureID = 0; |
|
|
|
result.Status = "上線"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return View(result); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -160,48 +184,117 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
public async Task<IActionResult> PCB013ASave(SteelPlateMeasure model) |
|
|
|
public async Task<IActionResult> PCB013ASave(PCB013ViewModel model) |
|
|
|
{ |
|
|
|
|
|
|
|
IResultModel result; |
|
|
|
// 量測基準 35 小於通知寄信
|
|
|
|
if (double.Parse(model.Tension1) < 35 || double.Parse(model.Tension2) < 35 || double.Parse(model.Tension3) < 35 || |
|
|
|
double.Parse(model.Tension4) < 35 || double.Parse(model.Tension5) < 35) |
|
|
|
{ |
|
|
|
model.MeasureResult = "F"; |
|
|
|
//string Subject = $"FQC自動派送發信 FQC單號:{inhouseNo} 料號:{Material}";
|
|
|
|
//string Body = $@"FQC單號:{inhouseNo} 料號:{Material} <br/>
|
|
|
|
// 檢驗結果為:{Result}";
|
|
|
|
|
|
|
|
//await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup), "", false, path);
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
model.MeasureResult = "P"; |
|
|
|
} |
|
|
|
model.CreateUserID = GetLogInUserID(); |
|
|
|
model.CreateDate = DateTime.Now; |
|
|
|
model.UpdateUserID = GetLogInUserID(); |
|
|
|
model.UpdateDate = DateTime.Now; |
|
|
|
result = await _pcbApi.PostSteelPlateMeasure(JsonConvert.SerializeObject(model)); |
|
|
|
#region 紀錄log及改狀態
|
|
|
|
var SteelPlateMeasureNg = new SteelPlateMeasureNg |
|
|
|
{ |
|
|
|
SteelPlateID = model.SteelPlateID, |
|
|
|
Status = model.Status, |
|
|
|
Tension1 = model.Tension1, |
|
|
|
Tension2 = model.Tension2, |
|
|
|
Tension3 = model.Tension3, |
|
|
|
Tension4 = model.Tension4, |
|
|
|
Tension5 = model.Tension5, |
|
|
|
CreateUserID = GetLogInUserID() |
|
|
|
}; |
|
|
|
await _pcbApi.PostSteelPlateMeasureNg(JsonConvert.SerializeObject(SteelPlateMeasureNg)); |
|
|
|
|
|
|
|
var data = new SteelPlateInfo |
|
|
|
{ |
|
|
|
SteelPlateID = model.SteelPlateID, |
|
|
|
Status = "0", |
|
|
|
UpdateUserID = GetLogInUserID(), |
|
|
|
}; |
|
|
|
await _pcbApi.PutSteelPlateInfoByStatus(JsonConvert.SerializeObject(data)); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 寄通知信
|
|
|
|
string NgMsg = $"{model.Status}量測"; |
|
|
|
if (double.Parse(model.Tension1) < 35) |
|
|
|
NgMsg += $"第一點量測值({model.Tension1})、"; |
|
|
|
if (double.Parse(model.Tension2) < 35) |
|
|
|
NgMsg += $"第二點量測值({model.Tension2})、"; |
|
|
|
if (double.Parse(model.Tension3) < 35) |
|
|
|
NgMsg += $"第三點量測值({model.Tension3})、"; |
|
|
|
if (double.Parse(model.Tension4) < 35) |
|
|
|
NgMsg += $"第四點量測值({model.Tension4})、"; |
|
|
|
if (double.Parse(model.Tension5) < 35) |
|
|
|
NgMsg += $"第五點量測值({model.Tension5})、"; |
|
|
|
|
|
|
|
NgMsg = NgMsg.Substring(0, NgMsg.Length - 1) + "小於告警值"; |
|
|
|
|
|
|
|
string MailGroup = "STEEL_ALARM"; |
|
|
|
string Subject = $"[AMES系統通知] 鋼板量測值告警通知"; |
|
|
|
string Body = $"鋼板編號:{model.SteelPlateNo}<br/>" + |
|
|
|
$"量測日期[{DateTime.Now:yyyy/MM/dd}]<br/>" + |
|
|
|
$"量測時間[{DateTime.Now:HH:mm:ss}]<br/>" + |
|
|
|
$"量測人員[{await GetUserName()}]<br/>{NgMsg}"; |
|
|
|
|
|
|
|
await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup), ""); |
|
|
|
|
|
|
|
|
|
|
|
WipAlarm wipAlarm = new WipAlarm(); |
|
|
|
wipAlarm.AlarmTypeID = (int)EnumWipAlarm.EnumTypeId.SteelPlateNg; |
|
|
|
wipAlarm.WipNO = model.SteelPlateNo; |
|
|
|
wipAlarm.AlarmParam = model.Status; |
|
|
|
wipAlarm.AlarmValue = "1"; |
|
|
|
wipAlarm.AlarmDesc = Subject; |
|
|
|
wipAlarm.AlarmDateTime = DateTime.Now; |
|
|
|
await _pcbApi.PostWipAlarm(JsonConvert.SerializeObject(wipAlarm)); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
if (result.Success) |
|
|
|
{ |
|
|
|
var _msg = "新增量測記錄成功!"; |
|
|
|
return RedirectToAction("Refresh", "Home", new { msg = _msg }); |
|
|
|
return RedirectToAction("Refresh", "Home", new { msg = "量測張力低於基準35,不做紀錄" }); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var data = new SteelPlateMeasure(); |
|
|
|
// 新增一筆 上線
|
|
|
|
if (model.SpMeasureID == 0) |
|
|
|
{ |
|
|
|
data.SteelPlateID = model.SteelPlateID; |
|
|
|
data.OnTension1 = model.Tension1; |
|
|
|
data.OnTension2 = model.Tension2; |
|
|
|
data.OnTension3 = model.Tension3; |
|
|
|
data.OnTension4 = model.Tension4; |
|
|
|
data.OnTension5 = model.Tension5; |
|
|
|
data.OnUserID = GetLogInUserID(); |
|
|
|
data.OnDate = DateTime.Now; |
|
|
|
|
|
|
|
result = await _pcbApi.PostSteelPlateMeasure(JsonConvert.SerializeObject(data)); |
|
|
|
} |
|
|
|
// 更新一筆 下線
|
|
|
|
else |
|
|
|
{ |
|
|
|
data.SpMeasureID = model.SpMeasureID; |
|
|
|
data.SteelPlateID = model.SteelPlateID; |
|
|
|
data.OffTension1 = model.Tension1; |
|
|
|
data.OffTension2 = model.Tension2; |
|
|
|
data.OffTension3 = model.Tension3; |
|
|
|
data.OffTension4 = model.Tension4; |
|
|
|
data.OffTension5 = model.Tension5; |
|
|
|
data.OffUserID = GetLogInUserID(); |
|
|
|
data.OffDate = DateTime.Now; |
|
|
|
|
|
|
|
result = await _pcbApi.PutSteelPlateMeasure(JsonConvert.SerializeObject(data)); |
|
|
|
} |
|
|
|
|
|
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
|
if (result.Success) |
|
|
|
{ |
|
|
|
var _msg = "新增量測記錄成功!"; |
|
|
|
return RedirectToAction("Refresh", "Home", new { msg = _msg }); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ModelState.AddModelError("error", result.Msg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (model.SteelPlateID == 0) |
|
|
|
{ |
|
|
|
return View("PCB013A", model); |
|
|
|
} |
|
|
|
return View("PCB013A", model); |
|
|
|
} |
|
|
|
|
|
|
@ -219,6 +312,27 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
return View(); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public IActionResult PCB016() |
|
|
|
{ |
|
|
|
return View(); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<IActionResult> PCB016QueryAsync(string steelPlateNo, string storageLocation, string item, |
|
|
|
string date_str, string date_end, string wipNo, int page = 0, int limit = 10) |
|
|
|
{ |
|
|
|
|
|
|
|
IResultModel<PCB016ViewDto> result = await _pcbApi.GetSteelPlateInfoReport(steelPlateNo: steelPlateNo, storageLocation: storageLocation, |
|
|
|
item: item, date_str: date_str, date_end: date_end, wipNo: wipNo, page: page, limit: limit); |
|
|
|
|
|
|
|
if (result.Data.Count() != 0) |
|
|
|
{ |
|
|
|
return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); |
|
|
|
} |
|
|
|
return Json(new Table() { count = 0, data = null }); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public async Task<IActionResult> PCB013VQuery(int steelPlateID, string steelPlateNo, int page = 0, int limit = 10) |
|
|
|
{ |
|
|
@ -312,7 +426,6 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region PCB015連板綁定作業
|
|
|
|
|
|
|
|
public async Task<IActionResult> PCB015(int WipID) |
|
|
@ -335,14 +448,14 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO, model.wipInfo.FlowRuleID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return View("PCB015V", model); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<IActionResult> PCB015GetGroupAsync(string id, string groupID =null , int page = 0, int limit = 10) |
|
|
|
public async Task<IActionResult> PCB015GetGroupAsync(string id, string groupID = null, int page = 0, int limit = 10) |
|
|
|
{ |
|
|
|
var result = await _pcbApi.GetBarcodeGroupsByWipNO(id: id , groupID : groupID, page: page, limit: limit); |
|
|
|
var result = await _pcbApi.GetBarcodeGroupsByWipNO(id: id, groupID: groupID, page: page, limit: limit); |
|
|
|
//groupID = '' 抓全部
|
|
|
|
//groupID = 0 不抓資料
|
|
|
|
|
|
|
@ -352,7 +465,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
return Json(new Table() { count = 0, data = null }); |
|
|
|
} |
|
|
|
public async Task<IActionResult> GetWipInfoAsync(string id,string unit_No) |
|
|
|
public async Task<IActionResult> GetWipInfoAsync(string id, string unit_No) |
|
|
|
{ |
|
|
|
|
|
|
|
var result = await _pcsApi.GetWipAtt(id); |
|
|
@ -369,7 +482,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
if (result != null) |
|
|
|
{ |
|
|
|
return Json(new Result() { success = true, msg = "", data = result }); |
|
|
|
// return Json(new Table() { code = 0, msg = "", data = result, count = 1 });
|
|
|
|
// return Json(new Table() { code = 0, msg = "", data = result, count = 1 });
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -384,18 +497,18 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<IActionResult> PCB015DAsync(int id) |
|
|
|
{ |
|
|
|
var result = await _pcsApi.DeleteBarcodeGroupByGroupID(id); |
|
|
|
var result = await _pcsApi.DeleteBarcodeGroupByGroupID(id); |
|
|
|
return Json(new Result() { success = true, msg = "刪除成功" }); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<IActionResult> CheckBarcodeNOandGroupAsync(string BarcodeNo, string WipNo,int WipID,int Boards,string PlanQTY) |
|
|
|
public async Task<IActionResult> CheckBarcodeNOandGroupAsync(string BarcodeNo, string WipNo, int WipID, int Boards, string PlanQTY) |
|
|
|
{ |
|
|
|
//生產序號不在工單區間
|
|
|
|
var WipBarcode = await _pcbApi.GetWipBarcodesCheckInRange(WipNo, BarcodeNo); |
|
|
|
int snLen = PlanQTY.Length; |
|
|
|
if (snLen < 4) snLen = 4; |
|
|
|
if (WipBarcode.Count > 0 ) |
|
|
|
if (WipBarcode.Count > 0) |
|
|
|
{ |
|
|
|
#region 取區間內最大號
|
|
|
|
int Maxnumber = 0; |
|
|
@ -417,7 +530,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
List<string> serialNumbers = Enumerable.Range(0, Boards) |
|
|
|
.Select(i => |
|
|
|
{ |
|
|
|
string newSerialNumber = $"{BarcodeNo.Substring(0, BarcodeNo.Length - snLen)}{(int.Parse(BarcodeNo.Substring(BarcodeNo.Length - snLen)) + i).ToString().PadLeft(snLen, '0')}"; |
|
|
|
string newSerialNumber = $"{BarcodeNo.Substring(0, BarcodeNo.Length - snLen)}{(int.Parse(BarcodeNo.Substring(BarcodeNo.Length - snLen)) + i).ToString().PadLeft(snLen, '0')}"; |
|
|
|
return newSerialNumber; |
|
|
|
}) |
|
|
|
.TakeWhile(serialNumber => int.Parse(serialNumber.Substring(serialNumber.Length - snLen)) <= Maxnumber) |
|
|
@ -439,12 +552,12 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
var BarcodeGroup = await _pcsApi.GetBarcodeGroupByBarCodeID(BarCodeinto.Select(s => s.BarcodeID).FirstOrDefault()); |
|
|
|
if (BarcodeGroup.Count() > 0) |
|
|
|
{ |
|
|
|
return Json(new Result() { success = false, msg = "生產序號" + item + "已綁定群組"+ BarcodeGroup.Select(s=>s.GroupID).FirstOrDefault()+ ",不可重覆綁定", data = null }); |
|
|
|
return Json(new Result() { success = false, msg = "生產序號" + item + "已綁定群組" + BarcodeGroup.Select(s => s.GroupID).FirstOrDefault() + ",不可重覆綁定", data = null }); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var barcodeInfo = new BarcodeInfo |
|
|
|
var barcodeInfo = new BarcodeInfo |
|
|
|
{ |
|
|
|
BarcodeNo = item, |
|
|
|
StationID = -1, |
|
|
@ -455,19 +568,19 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
SysType = "S", |
|
|
|
StatusNo = "-1", |
|
|
|
CreateUserID = GetLogInUserID() |
|
|
|
}; |
|
|
|
|
|
|
|
var PostResult = await _pcsApi.PostBarcodeInfoes(JsonConvert.SerializeObject(barcodeInfo)); |
|
|
|
}; |
|
|
|
|
|
|
|
var PostResult = await _pcsApi.PostBarcodeInfoes(JsonConvert.SerializeObject(barcodeInfo)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 綁定Group
|
|
|
|
|
|
|
|
|
|
|
|
var barcodeinfo = await _pcbApi.PostDapperByListBarcodeNO(JsonConvert.SerializeObject(serialNumbers)); |
|
|
|
int UserID = GetLogInUserID(); |
|
|
|
|
|
|
|
|
|
|
|
List<BarcodeGroup> barcodeGroups = barcodeinfo |
|
|
|
.Select((b, index) => new BarcodeGroup |
|
|
|
{ |
|
|
@ -481,7 +594,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
var BarCodeGroup = await _pcbApi.PostBarcodeGroupList(JsonConvert.SerializeObject(barcodeGroups)); |
|
|
|
|
|
|
|
return Json(new Result() { success = true, msg = "綁定成功", data = BarCodeGroup.Data.Select(s=>s.GroupID).FirstOrDefault() }); |
|
|
|
return Json(new Result() { success = true, msg = "綁定成功", data = BarCodeGroup.Data.Select(s => s.GroupID).FirstOrDefault() }); |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
@ -510,5 +623,21 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
return user_id; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 登入User名稱
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<string> GetUserName() |
|
|
|
{ |
|
|
|
int userId = GetLogInUserID(); |
|
|
|
|
|
|
|
var user = await _sysApi.GetUserInfo(userId); |
|
|
|
if (!user.Any()) |
|
|
|
return ""; |
|
|
|
else |
|
|
|
return user.FirstOrDefault().UserName; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|