Browse Source

1. 加入工單確認後寄信

2. 工單新增欄位 認證LOGO加入CE/FCC,DMI燒入說明,標籤工單性質:非標96工單 則必填欄位
PTD
ray 3 years ago
parent
commit
18e21ff1a0
  1. 62
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 5
      AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml
  3. 7
      AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
  4. 6
      AMESCoreStudio.WebApi/Enums/EnumPCS.cs
  5. 10
      AMESCoreStudio.WebApi/Models/AMES/WipLabel.cs
  6. 9
      AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs

62
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -38,6 +38,7 @@ namespace AMESCoreStudio.Web.Controllers
public readonly IPPS _ppsApi; public readonly IPPS _ppsApi;
public readonly IFQC _fqcApi; public readonly IFQC _fqcApi;
public readonly IKCS _kcsApi; public readonly IKCS _kcsApi;
public readonly IBLL _bllApi;
public readonly IFileServerProvider _fileServerProvider; public readonly IFileServerProvider _fileServerProvider;
private readonly IWebHostEnvironment _env; private readonly IWebHostEnvironment _env;
private readonly IStringLocalizer _sharedLocalizer; private readonly IStringLocalizer _sharedLocalizer;
@ -50,7 +51,7 @@ namespace AMESCoreStudio.Web.Controllers
public PCSController(ILogger<PCSController> logger, ILogger<LoginController> log, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi, IFQC fqcApi public PCSController(ILogger<PCSController> logger, ILogger<LoginController> log, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi, IFQC fqcApi
, IFileServerProvider fileServerProvider, IWebHostEnvironment env, IKCS kcsApi, IStringLocalizer<SharedResource> sharedLocalizer , IFileServerProvider fileServerProvider, IWebHostEnvironment env, IKCS kcsApi, IStringLocalizer<SharedResource> sharedLocalizer
, IConfiguration configuration) , IConfiguration configuration, IBLL bllApi)
{ {
_logger = logger; _logger = logger;
_log = log; _log = log;
@ -64,7 +65,7 @@ namespace AMESCoreStudio.Web.Controllers
_env = env; _env = env;
_sharedLocalizer = sharedLocalizer; _sharedLocalizer = sharedLocalizer;
_configuration = configuration; _configuration = configuration;
_bllApi = bllApi;
} }
#region Funcion BLL #region Funcion BLL
@ -177,8 +178,8 @@ namespace AMESCoreStudio.Web.Controllers
!string.IsNullOrWhiteSpace(model.Ec) || !string.IsNullOrWhiteSpace(model.Ec) ||
!string.IsNullOrWhiteSpace(model.OsVer) || !string.IsNullOrWhiteSpace(model.OsVer) ||
!string.IsNullOrWhiteSpace(model.Jumper) || !string.IsNullOrWhiteSpace(model.Jumper) ||
!string.IsNullOrWhiteSpace(model.BabMemo)|| !string.IsNullOrWhiteSpace(model.BabMemo) ||
!string.IsNullOrWhiteSpace(model.TestMemo)|| !string.IsNullOrWhiteSpace(model.TestMemo) ||
!string.IsNullOrWhiteSpace(model.PackingMemo)) !string.IsNullOrWhiteSpace(model.PackingMemo))
{ {
@ -1457,14 +1458,14 @@ namespace AMESCoreStudio.Web.Controllers
//public async Task<JsonResult> GetKeyPartTypeByWip(string KeyPartMaterial, string KeyPartsType) //public async Task<JsonResult> GetKeyPartTypeByWip(string KeyPartMaterial, string KeyPartsType)
//{ //{
// var result = await _kcsApi.GetItems(); // var result = await _kcsApi.GetItems();
// if (KeyPartMaterial.ToUpper().Trim().StartsWith()) // if (KeyPartMaterial.ToUpper().Trim().StartsWith())
// return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } }); // return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } });
//} //}
//#endregion #endregion
[ResponseCache(Duration = 0)] [ResponseCache(Duration = 0)]
[HttpGet] [HttpGet]
@ -2625,6 +2626,13 @@ namespace AMESCoreStudio.Web.Controllers
return View("PCS003", model); return View("PCS003", model);
} }
// 判斷標籤 工單性質選擇 WipAttr非標96工單時,則旁邊欄位必填
if (model.wipLabel.WipAttr == "B" && string.IsNullOrWhiteSpace(model.wipLabel.NonstandardWoMemo))
{
ModelState.AddModelError("error", "標籤:工單性質選擇非標96工單時,需填入資料");
return View("PCS003", model);
}
// 判斷治具中生產單位與作業站吻合 // 判斷治具中生產單位與作業站吻合
var result_wipNo = await _pcsApi.GetWipInfoByWipNO(model.wipInfo.WipNO); var result_wipNo = await _pcsApi.GetWipInfoByWipNO(model.wipInfo.WipNO);
foreach (var item in result_wipNo) foreach (var item in result_wipNo)
@ -2894,11 +2902,13 @@ namespace AMESCoreStudio.Web.Controllers
if (action == "生管確認") if (action == "生管確認")
{ {
wipCheck.PMCUserID = UserID; wipCheck.PMCUserID = UserID;
await CheckPCS003ToMail(model.wipInfo.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO, model.wipInfo.WipScheduleDate.ToString(), action);
await _pcsApi.PutWipCheckByPMC(JsonConvert.SerializeObject(wipCheck)); await _pcsApi.PutWipCheckByPMC(JsonConvert.SerializeObject(wipCheck));
} }
else if (action == "工程確認") else if (action == "工程確認")
{ {
wipCheck.PEUserID = UserID; wipCheck.PEUserID = UserID;
await CheckPCS003ToMail(model.wipInfo.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO, model.wipInfo.WipScheduleDate.ToString(), action);
await _pcsApi.PutWipCheckByPE(JsonConvert.SerializeObject(wipCheck)); await _pcsApi.PutWipCheckByPE(JsonConvert.SerializeObject(wipCheck));
} }
else if (action == "製造確認") else if (action == "製造確認")
@ -2932,6 +2942,42 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
#region 自動寄信
/// <summary>
/// 工單維護儲存時寄信通知
/// </summary>
/// <param name="WipNo">工單號碼</param>
/// <param name="Material">工單料號</param>
/// <param name="Process">製程</param>
/// <param name="StrDate">預計開工日期</param>
/// <param name="ReviewType">確認狀態</param>
/// <returns></returns>
private async Task CheckPCS003ToMail(string WipNo, string Material, string Process, string StrDate, string ReviewType)
{
//工單Review,生管確認,完成後通知工程,mail群組名稱,請建立為[WOVIEW_PE]
//工單Review,工程確認,完成後通知製造,mail群組名稱,請建立為[WOVIEW_MF]
string MailGroup = string.Empty;
if (ReviewType == "生管確認")
MailGroup = "WOVIEW_PE";
else
MailGroup = "WOVIEW_MF";
var result = await _basApi.GetFactoryUnits();
Process = result.Where(w => w.UnitNo == Process).FirstOrDefault().UnitName;
string Subject = $"[AMES系統通知] 工單:{WipNo},請工程單位進行確認";
string Body = $@"說明:<br/>
{WipNo}<br/>
{Material}<br/>
{Process}<br/>
{StrDate}<br/>
<br/>{ReviewType}review完畢";
await _bllApi.PostToMail(Subject, Body, MailGroup, "", false);
}
#endregion
/// <summary> /// <summary>
/// 工單資料畫面 Select All /// 工單資料畫面 Select All
/// </summary> /// </summary>
@ -5309,7 +5355,7 @@ namespace AMESCoreStudio.Web.Controllers
// 工程工單備註 // 工程工單備註
var wipsystem = await _pcsApi.GetWipSystem(model.WipNO); var wipsystem = await _pcsApi.GetWipSystem(model.WipNO);
if (wipsystem != null) if (wipsystem != null)
{ {
model.SystemMemo = wipsystem.BabMemo; model.SystemMemo = wipsystem.BabMemo;
} }

5
AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml

@ -868,6 +868,10 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<select disabled asp-for="wipSystem.DmiBi" asp-items="@ViewBag.GetWipSystemDMITypeSelect" class=""></select> <select disabled asp-for="wipSystem.DmiBi" asp-items="@ViewBag.GetWipSystemDMITypeSelect" class=""></select>
</div> </div>
<label class="layui-form-label" asp-for="wipSystem.DmiBiMemo"></label>
<div class="layui-input-inline" style="width: 500px;">
<input class="layui-input" asp-for="wipSystem.DmiBiMemo" readonly="readonly" />
</div>
</div> </div>
</div> </div>
@ -1010,6 +1014,7 @@
<label class="layui-form-label">工單屬性</label> <label class="layui-form-label">工單屬性</label>
<div class="layui-input-block"> <div class="layui-input-block">
<cl-radio asp-items="@ViewBag.GetCheckboxWipAttr" asp-for="wipLabel.WipAttr"></cl-radio> <cl-radio asp-items="@ViewBag.GetCheckboxWipAttr" asp-for="wipLabel.WipAttr"></cl-radio>
<input class="layui-input" style="width:200px;display:inline;" asp-for="wipLabel.NonstandardWoMemo" readonly="readonly" />
</div> </div>
</div> </div>

7
AMESCoreStudio.Web/Views/PCS/PCS003.cshtml

@ -885,6 +885,10 @@
<div class="layui-input-inline "> <div class="layui-input-inline ">
<select style="background-color: #acdbe36b" asp-for="wipSystem.DmiBi" asp-items="@ViewBag.GetWipSystemDMITypeSelect" class=""></select> <select style="background-color: #acdbe36b" asp-for="wipSystem.DmiBi" asp-items="@ViewBag.GetWipSystemDMITypeSelect" class=""></select>
</div> </div>
<label class="layui-form-label" asp-for="wipSystem.DmiBiMemo"></label>
<div class="layui-input-inline" style="width: 500px;">
<input class="layui-input" asp-for="wipSystem.DmiBiMemo"/>
</div>
</div> </div>
</div> </div>
@ -895,7 +899,7 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">組裝備註</label> <label class="layui-form-label">組裝備註</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea class="layui-textarea" asp-for="wipSystem.BabMemo"></textarea> <textarea class="layui-textarea" asp-for="wipSystem.BabMemo"></textarea>
@ -1052,6 +1056,7 @@
<label class="layui-form-label">工單屬性</label> <label class="layui-form-label">工單屬性</label>
<div class="layui-input-block"> <div class="layui-input-block">
<cl-radio asp-items="@ViewBag.GetCheckboxWipAttr" asp-for="wipLabel.WipAttr"></cl-radio> <cl-radio asp-items="@ViewBag.GetCheckboxWipAttr" asp-for="wipLabel.WipAttr"></cl-radio>
<input class="layui-input" style="width:200px;display:inline;" asp-for="wipLabel.NonstandardWoMemo" />
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">

6
AMESCoreStudio.WebApi/Enums/EnumPCS.cs

@ -54,6 +54,12 @@ namespace AMESCoreStudio.WebApi.Enum
[Display(Name = "FCC")] [Display(Name = "FCC")]
FCC, FCC,
/// <summary>
/// CE/FCC
/// </summary>
[Display(Name = "CE/FCC")]
CE_FCC,
/// <summary> /// <summary>
/// ROHS /// ROHS
/// </summary> /// </summary>

10
AMESCoreStudio.WebApi/Models/AMES/WipLabel.cs

@ -67,6 +67,16 @@ namespace AMESCoreStudio.WebApi.Models.AMES
public string Remarks { get; set; } public string Remarks { get; set; }
/// <summary>
/// 非標96工單說明
/// </summary>
[Column("NONSTANDARD_WO_MEMO")]
[DataMember]
public string NonstandardWoMemo { get; set; }
/// <summary> /// <summary>
/// 建立UserID /// 建立UserID
/// </summary> /// </summary>

9
AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs

@ -253,6 +253,15 @@ namespace AMESCoreStudio.WebApi.Models.AMES
[Display(Name = "DMI燒入")] [Display(Name = "DMI燒入")]
public string DmiBi { get; set; } public string DmiBi { get; set; }
/// <summary>
/// DMI燒入說明
/// </summary>
[Column("DMI_BI_MEMO")]
[StringLength(200)]
[DataMember]
[Display(Name = "DMI燒入說明")]
public string DmiBiMemo { get; set; }
/// <summary> /// <summary>
/// JUMPER設定 /// JUMPER設定
/// </summary> /// </summary>

Loading…
Cancel
Save