Commit f222fca0 by jiawei.su
parents 1000243c c9e15cb6
......@@ -54,7 +54,7 @@
@click="materialchange(index)"
:class="{ active: d == index }"
>
{{ item.name + "【" + item.pn + "】" }}
{{ item.name }}
</p>
</div>
</div>
......@@ -672,7 +672,7 @@ export default {
axios
.request({
url:
"/acc/AutomationOperate/GetloadStation"
"http://localhost:8105/acc/SectionProperty/GetSections"
,
params,
method: "get",
......@@ -730,10 +730,7 @@ export default {
axios
.request({
url:
"/qms/ManufacturingMaterial/GetMaterialByCell?productId=" +
productid +
"&section=" +
sectionid,
"/acc/SectionProperty/GetRouteByProduct?productId=" + productid,
method: "get",
})
.then((res) => {
......
......@@ -23,7 +23,6 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureToolsCategoryRepository _toolsCategoryRepository;
private readonly IAutomationFixtureToolsRepository _toolsRepository;
private readonly IAutomationLocationRepository _autoLocationRepository;
private readonly ISigerTrMaterialsRepository _materialsRepository;
public AutomationLocationController(IUnitOfWork unitOfWork, IAutomationFixtureToolsCategoryRepository toolsCategoryRepository,
IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository)
......@@ -90,7 +89,7 @@ namespace Siger.ApiACC.Controllers
[HttpPost]
public IActionResult Update([FromBody]RequestUpdateAutomationLocation req)
{
if (string.IsNullOrEmpty(req.locationid) || string.IsNullOrEmpty(req.fixturetoolid) || string.IsNullOrEmpty(req.materialid))
if (string.IsNullOrEmpty(req.locationid) || string.IsNullOrEmpty(req.fixturetoolid))
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
......
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Mvc;
using Siger.ApiCommon.Result;
using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface;
using Siger.Middlelayer.AccRepository.Response;
using Siger.Middlelayer.AccRepository.Request;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Repository.Repositories.Interface;
using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Extensions;
using System.Linq;
using Siger.Middlelayer.Repository.Entities;
namespace Siger.ApiACC.Controllers
{
public class SectionPropertyController : BaseController
{
private readonly IUnitOfWork _unitOfWork;
private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository;
private readonly ISigerProjectLevelSectionRepository _levelSectionRepository;
private readonly IProductionBeatSetRepository _beatSetRepository;
public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IProductionBeatSetRepository beatSetRepository)
{
_unitOfWork = unitOfWork;
_sectionPropertyRepository = sectionPropertyRepository;
_levelSectionRepository = levelSectionRepository;
_beatSetRepository = beatSetRepository;
}
[HttpGet]
public IActionResult GetSections(string line)
{
var sectionIds = _levelSectionRepository.GetLevelSectionIds(line.ToInt(), ProjectId);
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid)).
Select(q => q.sectionid).ToList();
var sections = _levelSectionRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && sectionids.Contains(q.id)).
Select(q => new { q.id, q.title }).ToList();
return new ObjectResult(sections);
}
public IActionResult GetRouteByProduct(string productId)
{
var list = _beatSetRepository.GetList(q => q.projectID == ProjectId && q.status == (int)RowState.Valid && q.product_name.ToInt() == productId.ToInt()).
Select(q => new
{
q.id,
name = q.route_name,
q.route_number
}).ToList();
return new ObjectResult(list);
}
}
}
......@@ -165,21 +165,7 @@ namespace Siger.ApiQMS.Controllers
traceResult = "NG";
}
}
//插入大数据库的trace表
var trace = new SnTrace
{
MaterialID = req.materialid.ToInt(),
ProductID = req.productid,
SectionID = req.sectionid,
MachineID = machine?.id ?? 0,
WorkOrder = req.workorder ?? "",
SN = req.sn ?? "",
Result = traceResult,
UserID = UserId,
RouteID = req.routeid.ToInt(),
CreateTime = DateTime.Now,
CheckType = req.checktype
};
var insertDetailList = new List<SnTraceDetailList>();
foreach (var index in indexs)
{
......@@ -265,6 +251,7 @@ namespace Siger.ApiQMS.Controllers
{
req.result = ((int)SendTestType.Unqualified).ToString();
}
var nowTime = DateTime.Now;
//插入中间层库的trace表
var inspection = new siger_check_sn_trace_inspection
{
......@@ -279,9 +266,9 @@ namespace Siger.ApiQMS.Controllers
check_status = (int)SendCheckStatus.Completed,
result = req.result,
send_mid = UserId,
send_time = trace.CreateTime,
send_time = nowTime,
check_mid = UserId,
check_time = trace.CreateTime,
check_time = nowTime,
inspection_type = (int)InspectionType.ManualCollection,
projectid = ProjectId,
reason = req.reason ?? "",
......@@ -305,7 +292,7 @@ namespace Siger.ApiQMS.Controllers
LowerLimit = detail.LowerLimit,
UpperLimit = detail.UpperLimit,
projectid = ProjectId,
CreateTime = trace.CreateTime
CreateTime = nowTime
};
_traceDetailRepository.Insert(model);
}
......@@ -314,7 +301,7 @@ namespace Siger.ApiQMS.Controllers
{
try
{
AddSnList(req.materialid.ToInt(), trace, product.code, section.parentid);//把二维码插入到 sn_list表
AddSnList(req.materialid.ToInt(), inspection, product.code, section.parentid);//把二维码插入到 sn_list表
var abnormalCheckHelper = new AbnormalCheckHelper(_unitOfWork, _abnormalRuleRepository, _projectUserRepository,
_traceDetailRepository, _inspectStandard, _traceInspectionRepository, _sigerDict, CompanyId, ProjectId, UserId);
......@@ -764,12 +751,9 @@ namespace Siger.ApiQMS.Controllers
req.result = ((int)SendTestType.Unqualified).ToString();
}
else
{
inspection.result = req.result;
inspection.quantity = req.quantity.ToInt();
_traceInspectionRepository.Update(inspection);
}
inspection.result = req.result;
inspection.quantity = req.quantity.ToInt();
_traceInspectionRepository.Update(inspection);
foreach (var delDetail in delTraceDetails)
{
......@@ -808,18 +792,18 @@ namespace Siger.ApiQMS.Controllers
#endregion
}
private void AddSnList(int materialid, SnTrace trace, string code, int lineId)
private void AddSnList(int materialid, siger_check_sn_trace_inspection trace, string code, int lineId)
{
var snEntity = _snListRepository.Get(t => t.projectid == ProjectId && t.status == (int)RowState.Valid &&
t.SN == trace.SN && !string.IsNullOrWhiteSpace(trace.SN));
t.SN == trace.sn && !string.IsNullOrWhiteSpace(trace.sn));
if (snEntity == null)
{
var stateCode = "000";
var eventNoObj = _snListRepository.GetEventNoByResult(trace.SN, ProjectId);
var eventNoObj = _snListRepository.GetEventNoByResult(trace.sn, ProjectId);
if (eventNoObj != null)
{
//出站信息获取
var outObj = _snListRepository.GetOutStationByEventNo(eventNoObj.EventNo, trace.SectionID, ProjectId);
var outObj = _snListRepository.GetOutStationByEventNo(eventNoObj.EventNo, trace.sectionid, ProjectId);
if (outObj != null)
{
stateCode = outObj.ResultStatus;
......@@ -829,12 +813,12 @@ namespace Siger.ApiQMS.Controllers
t.id == materialid);
var snListObj = new siger_check_sn_list
{
SN = trace.SN,
SN = trace.sn,
BatchNumber = "",
ProductID = trace.ProductID,
ProductID = trace.productid,
ProductCode = code,
LineID = lineId,
WorkOrder = trace.WorkOrder,
WorkOrder = trace.workorder,
MaterialID = material?.id ?? 0,
PartNumber = material?.pn ?? "",
StateCode = stateCode,
......
......@@ -342,20 +342,6 @@ namespace Siger.ApiQMS.Controllers
var machine = _inspectStandard.GetMachineBySectionId(sendTest.sectionid, ProjectId);
var trace = new SnTrace
{
MaterialID = sendTest.materialid,
ProductID = sendTest.productid,
SectionID = sendTest.sectionid,
MachineID = machine?.id ?? 0,
WorkOrder = "",
SN = sendTest.sn ?? "",
Result = (result == (int)SendTestType.Qalified || result == (int)SendTestType.DeviationRelease) ? "OK" : "NG",
UserID = UserId,
RouteID = sendTest.routeid,
CreateTime = DateTime.Now,
CheckType = sendTest.check_type
};
var insertDetailList = new List<SnTraceDetailList>();
foreach (var index in indexs)
{
......@@ -490,7 +476,7 @@ namespace Siger.ApiQMS.Controllers
{
try
{
AddSnList(sendTest, trace);
AddSnList(sendTest);
var abnormalCheckHelper = new AbnormalCheckHelper(_unitOfWork, _abnormalRuleRepository, _projectUserRepository,
_traceDetailRepository, _inspectStandard, _traceInspectionRepository, _sigerDict, CompanyId, ProjectId, UserId);
......@@ -1035,16 +1021,16 @@ namespace Siger.ApiQMS.Controllers
return new ObjectResult(CommonEnum.Succefull);
}
private void AddSnList(siger_check_sn_trace_inspection sendTest, SnTrace trace)
private void AddSnList(siger_check_sn_trace_inspection sendTest)
{
var snEntity = _snListRepository.Get(t => t.projectid == ProjectId && t.status == (int)RowState.Valid &&
t.SN == trace.SN && !string.IsNullOrWhiteSpace(trace.SN));
t.SN == sendTest.sn && !string.IsNullOrWhiteSpace(sendTest.sn));
var stateCode = "000";
var eventNoObj = _snListRepository.GetEventNoByResult(trace.SN, ProjectId);
var eventNoObj = _snListRepository.GetEventNoByResult(sendTest.sn, ProjectId);
if (eventNoObj != null)
{
//出站信息获取
var outObj = _snListRepository.GetOutStationByEventNo(eventNoObj.EventNo, trace.SectionID, ProjectId);
var outObj = _snListRepository.GetOutStationByEventNo(eventNoObj.EventNo, sendTest.sectionid, ProjectId);
if (outObj != null)
{
stateCode = outObj.ResultStatus;
......@@ -1062,12 +1048,12 @@ namespace Siger.ApiQMS.Controllers
{
var snListObj = new siger_check_sn_list
{
SN = trace.SN ?? "",
SN = sendTest.sn ?? "",
BatchNumber = "",
ProductID = trace.ProductID,
ProductID = sendTest.productid,
ProductCode = product.code,
LineID = section.parentid,
WorkOrder = trace.WorkOrder,
WorkOrder = sendTest.workorder,
MaterialID = material?.id ?? 0,
PartNumber = material?.pn ?? "",
StateCode = stateCode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment