Browse Source

1. 修正條碼生產履歷:日期格式及版型調整

2. 工單資料修改:出貨序號變更,當按鈕取出貨序號有資料時,就先Insert出貨序號到DB
PTD
Ray 3 years ago
parent
commit
6d3bca8e7a
  1. 54
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 13
      AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
  3. 28
      AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml
  4. 15
      AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs
  5. 20
      AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs

54
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -1358,14 +1358,15 @@ namespace AMESCoreStudio.Web.Controllers
/// <summary> /// <summary>
/// 取出貨序號 /// 取出貨序號 取到資料先儲存出貨序號
/// </summary> /// </summary>
/// <param name="itemNo">料號</param> /// <param name="itemNo">料號</param>
/// <param name="lotNo">生產序號</param> /// <param name="lotNo">生產序號</param>
/// <param name="num">生產數量</param> /// <param name="num">生產數量</param>
/// <param name="wipNo">工單號碼</param>
/// <returns>RuleStation </returns> /// <returns>RuleStation </returns>
[HttpPost] [HttpPost]
public async Task<JsonResult> GetBarcodeOther(string itemNo, string lotNo, int num) public async Task<JsonResult> GetBarcodeOther(string itemNo, string lotNo, int num ,string wipNo)
{ {
var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num); var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num);
string StartNO = ""; string StartNO = "";
@ -1375,6 +1376,24 @@ namespace AMESCoreStudio.Web.Controllers
{ {
StartNO = result.Msg.Split('~')[0]; StartNO = result.Msg.Split('~')[0];
EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0]; EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0];
if (!string.IsNullOrWhiteSpace(StartNO) && !string.IsNullOrWhiteSpace(EndNO))
{
var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間");
if (type_no != null)
{
WipBarcodeOther wipBarcodeOther = new WipBarcodeOther
{
WipNO = wipNo,
TypeNO = type_no.TypeNo,
StartNO = StartNO,
EndNO = EndNO,
CreateUserID = GetLogInUserID(),
UpdateUserID = GetLogInUserID()
};
await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(wipBarcodeOther));
}
}
} }
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 } });
@ -2232,20 +2251,20 @@ namespace AMESCoreStudio.Web.Controllers
} }
// 出貨序號 //// 出貨序號 改換點出貨序號時有資料就先儲存
if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) //if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO))
{ //{
var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); // var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間");
if (type_no != null) // if (type_no != null)
{ // {
model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; // model.wipBarcodeOther.WipNO = model.wipInfo.WipNO;
model.wipBarcodeOther.TypeNO = type_no.TypeNo; // model.wipBarcodeOther.TypeNO = type_no.TypeNo;
if (model.wipBarcodeOther.OtherID != 0) // if (model.wipBarcodeOther.OtherID != 0)
result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); // result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther));
else // else
result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); // result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther));
} // }
} //}
// MAC // MAC
if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO)) if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO))
@ -4556,7 +4575,8 @@ namespace AMESCoreStudio.Web.Controllers
} }
} }
WipReturn wipReturn = new WipReturn{ WipReturn wipReturn = new WipReturn
{
WipNo = model.WipNo.Trim().ToUpper(), WipNo = model.WipNo.Trim().ToUpper(),
GoruleStationId = model.GoByRuleStation, GoruleStationId = model.GoByRuleStation,
ReruleStationId = model.RetrueRuleStation, ReruleStationId = model.RetrueRuleStation,

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

@ -273,11 +273,11 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">出貨序號</label> <label class="layui-form-label">出貨序號</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input asp-for="wipBarcodeOther.StartNO" class="layui-input" /> <input asp-for="wipBarcodeOther.StartNO" class="layui-input" readonly="readonly" />
</div> </div>
<div class="layui-form-mid">-</div> <div class="layui-form-mid">-</div>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input asp-for="wipBarcodeOther.EndNO" class="layui-input" /> <input asp-for="wipBarcodeOther.EndNO" class="layui-input" readonly="readonly" />
</div> </div>
<div id="barcodeOtherDiv" style="display:inline;"> <div id="barcodeOtherDiv" style="display:inline;">
<label class="layui-form-label">lotNo</label> <label class="layui-form-label">lotNo</label>
@ -310,7 +310,7 @@
<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">
<input asp-for="wipBarcode.Remarks" class="layui-input" type="text" /> <textarea asp-for="wipBarcode.Remarks" class="layui-textarea" type="text"></textarea>
</div> </div>
</div> </div>
</div> </div>
@ -1178,7 +1178,7 @@
$.ajax({ $.ajax({
url: '@Url.Action("GetBarcodeOther", "PCS")', url: '@Url.Action("GetBarcodeOther", "PCS")',
dataType: 'json', dataType: 'json',
data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY }, data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY ,"wipNo":'@Model.wipInfo.WipNO'},
cache: false, cache: false,
type: "POST", type: "POST",
success: function (result) { success: function (result) {
@ -1220,8 +1220,13 @@
if (data._msg != undefined) { if (data._msg != undefined) {
parent.hg.msg(data._msg); parent.hg.msg(data._msg);
} }
else
{
$("#wipMAC_StartNO").val(data.mix); $("#wipMAC_StartNO").val(data.mix);
$("#wipMAC_EndNO").val(data.max); $("#wipMAC_EndNO").val(data.max);
$("#wipMAC_StartNO").attr("readonly", "readonly");
$("#wipMAC_EndNO").attr("readonly", "readonly");
}
}, },
error: function (jqXHR, textStatus, errorThrown) { error: function (jqXHR, textStatus, errorThrown) {
alert("Found error when using Ajax!!"); alert("Found error when using Ajax!!");

28
AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml

@ -57,7 +57,7 @@
<div class="layui-col-xs2"> <div class="layui-col-xs2">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block" style="margin-left:auto;"> <div class="layui-input-block" style="margin-left:auto;">
<input asp-for="StatusNo" type="text" class="layui-input"> <label class="layui-form-label" style="text-align: left; width: 150px;">@Model.StatusNo</label>
</div> </div>
</div> </div>
</div> </div>
@ -67,7 +67,7 @@
<div class="layui-col-xs2"> <div class="layui-col-xs2">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block" style="margin-left:auto;"> <div class="layui-input-block" style="margin-left:auto;">
<input asp-for="InhouseNo" type="text" class="layui-input"> <label class="layui-form-label" style="text-align: left; width: 150px;">@Model.InhouseNo</label>
</div> </div>
</div> </div>
</div> </div>
@ -77,7 +77,7 @@
<div class="layui-col-xs2"> <div class="layui-col-xs2">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block" style="margin-left:auto;"> <div class="layui-input-block" style="margin-left:auto;">
<input asp-for="Wight" type="text" class="layui-input"> <label class="layui-form-label" style="text-align: left; width: 150px;">@Model.Wight</label>
</div> </div>
</div> </div>
</div> </div>
@ -91,7 +91,7 @@
@foreach (var index in Model.WinInfos) @foreach (var index in Model.WinInfos)
{ {
<tr> <tr>
<td> <td style="width:70px;">
工單號碼: 工單號碼:
</td> </td>
<td> <td>
@ -140,7 +140,7 @@
建置日期: 建置日期:
</td> </td>
<td> <td>
@index.CreateDate @DateTime.Parse(index.CreateDate).ToString("yyyy/MM/dd HH:mm:ss")
</td> </td>
<td> <td>
DATE CODE: DATE CODE:
@ -216,7 +216,7 @@
@index.User @index.User
</td> </td>
<td> <td>
@index.InputDate @DateTime.Parse(index.InputDate).ToString("yyyy/MM/dd HH:mm:ss")
</td> </td>
</tr> </tr>
} }
@ -243,7 +243,10 @@
組件料號 組件料號
</th> </th>
<th> <th>
過站時間 綁入人員
</th>
<th>
綁入時間
</th> </th>
</tr> </tr>
</thead> </thead>
@ -264,7 +267,7 @@
@index.KpItemNo @index.KpItemNo
</td> </td>
<td> <td>
@index.CreateDate @index.CreateDate.ToString("yyyy/MM/dd HH:mm:ss")
</td> </td>
</tr> </tr>
} }
@ -287,6 +290,9 @@
<th> <th>
零件位置 零件位置
</th> </th>
<th>
維修代碼
</th>
<th> <th>
維修狀態 維修狀態
</th> </th>
@ -318,7 +324,7 @@
@index.ReplyUser @index.ReplyUser
</td> </td>
<td> <td>
@index.ReplyDate @DateTime.Parse(index.ReplyDate).ToString("yyyy/MM/dd HH:mm:ss")
</td> </td>
</tr> </tr>
} }
@ -354,7 +360,7 @@
@index.OutfitNo @index.OutfitNo
</td> </td>
<td> <td>
@index.InputDate @DateTime.Parse(index.InputDate).ToString("yyyy/MM/dd HH:mm:ss")
</td> </td>
</tr> </tr>
} }
@ -407,7 +413,7 @@
@index.CreateUser @index.CreateUser
</td> </td>
<td> <td>
@index.CreateDate @index.CreateDate.ToString("yyyy/MM/dd HH:mm:ss")
</td> </td>
</tr> </tr>
} }

15
AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs

@ -141,12 +141,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
var q = from q1 in _context.BarcodeInfoes.Where(w => w.BarcodeNo == id) var q = from q1 in _context.BarcodeInfoes.Where(w => w.BarcodeNo == id)
join q2 in _context.NgInfos on q1.BarcodeID equals q2.BarcodeID join q2 in _context.NgInfos on q1.BarcodeID equals q2.BarcodeID
join q3 in _context.NgComponents on q2.NgID equals q3.NgID join q3 in _context.NgComponents on q2.NgID equals q3.NgID
join q4 in _context.NGReasons on q3.NgNo.Replace("$","") equals q4.NGReasonNo
into s
from q4 in s.DefaultIfEmpty()
join q5 in _context.NgRepairs on q3.ComponentID equals q5.ComponentID
into s1
from q5 in s1.DefaultIfEmpty()
join q6 in _context.RMAReasons on q5.RepairNo equals q6.RMAReasonNo
into s2
from q6 in s2.DefaultIfEmpty()
select new NGInfoDto select new NGInfoDto
{ {
StationName = q2.Station.StationName, StationName = q2.Station.StationName,
LocationNo = q3.LocationNo, LocationNo = q3.LocationNo,
NGNo = q3.NgNo, NGNo = q3.NgNo.Replace("$",""),
NGNoDesc = q4.NGReasonDesc,
Status = q3.Status == 0 ? "尚未處理" : q3.Status == 1 ? "已維修處理" : "誤判", Status = q3.Status == 0 ? "尚未處理" : q3.Status == 1 ? "已維修處理" : "誤判",
RepairNo = q5.RepairNo,
RepairDesc = q5.RepairDesc,
RepairNoDesc = q6.RMAReasonDesc,
ReplyUser = q3.ReplyUserID.ToString(), ReplyUser = q3.ReplyUserID.ToString(),
ReplyDate = q3.ReplyDate.ToString("yyyy/MM/dd") ReplyDate = q3.ReplyDate.ToString("yyyy/MM/dd")
}; };

20
AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs

@ -25,6 +25,11 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public string NGNo { get; set; } public string NGNo { get; set; }
/// <summary>
/// 不良代碼說明
/// </summary>
public string NGNoDesc { get; set; }
/// <summary> /// <summary>
/// 零件位置 /// 零件位置
/// </summary> /// </summary>
@ -35,6 +40,21 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public string Status { get; set; } public string Status { get; set; }
/// <summary>
/// 維修代碼
/// </summary>
public string RepairNo { get; set; }
/// <summary>
/// 維修代碼說明
/// </summary>
public string RepairNoDesc { get; set; }
/// <summary>
/// 維修說明
/// </summary>
public string RepairDesc { get; set; }
/// <summary> /// <summary>
/// 回覆人員 /// 回覆人員
/// </summary> /// </summary>

Loading…
Cancel
Save