Commit bfb10777 by xin.yang

fix bug

parent 92407c33
......@@ -654,7 +654,6 @@ export default {
});
},
linechange(i) {
console.log(1111111111);
this.a = i;
this.line = this.lineList[i];
this.initstations(this.line.id);
......@@ -672,7 +671,7 @@ export default {
axios
.request({
url:
"http://localhost:8105/acc/SectionProperty/GetSections"
"/acc/SectionProperty/GetSections"
,
params,
method: "get",
......@@ -715,6 +714,22 @@ export default {
this.b = i;
this.station = this.stationList[i];
this.initproduct(this.station.id);
this.initSn(this.station.id)
},
initSn(sectionid){
if (sectionid > 0) {
axios
.request({
url:
"/acc/SectionProperty/GetSn?productId=" + productid + "&sectionId=" + sectionid,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) {
this.qrcode = res.data.data;
}
});
}
},
productchange(i) {
this.c = i;
......@@ -730,7 +745,7 @@ export default {
axios
.request({
url:
"/acc/SectionProperty/GetRouteByProduct?productId=" + productid,
"/acc/SectionProperty/GetRouteByProduct?productId=" + productid + "&sectionId=" + sectionid,
method: "get",
})
.then((res) => {
......
......@@ -23,19 +23,56 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureToolsCategoryRepository _toolsCategoryRepository;
private readonly IAutomationFixtureToolsRepository _toolsRepository;
private readonly IAutomationLocationRepository _autoLocationRepository;
private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductRouteRepository _routeRepository;
public AutomationLocationController(IUnitOfWork unitOfWork, IAutomationFixtureToolsCategoryRepository toolsCategoryRepository,
IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository)
IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository,
IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository)
{
_unitOfWork = unitOfWork;
_toolsCategoryRepository = toolsCategoryRepository;
_toolsRepository = toolsRepository;
_autoLocationRepository = autoLocationRepository;
_fixtureMonitor = fixtureMonitor;
_routeRepository = routeRepository;
}
public IActionResult GetPageList(string wavehouseid, string locationid, int page, int pagesize)
{
var data = _autoLocationRepository.GetPagedList(wavehouseid.ToInt(), locationid.ToInt(), ProjectId, page, pagesize);
var list = new List<ResponseAutomationLocation>();
foreach(var item in data.Data)
{
if(item.fixturetoolid > 0 && string.IsNullOrEmpty(item.sn))
{
item.materialstate = 1;//有工装无工件
}
else if(item.fixturetoolid > 0 && !string.IsNullOrEmpty(item.sn))
{
item.materialstate = 2;//有工装有工件
}
else if (item.fixturetoolid <= 0 && string.IsNullOrEmpty(item.sn))
{
item.materialstate = 3;//无工装无工件
}
else if (item.fixturetoolid <= 0 && string.IsNullOrEmpty(item.sn))
{
item.materialstate = 4;//无工装有工件
}
var monitor = _fixtureMonitor.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.locationId == item.locationid).
OrderByDescending(q => q.updatetime).FirstOrDefault();
if(monitor != null)
{
item.sn = monitor.sn;
var route = _routeRepository.Get(q => q.id == monitor.route && q.projectId == ProjectId && q.status == (int)RowState.Valid);
if(route != null)
{
item.route = route.name;
item.routenumber = route.serialNumber.ToString();
}
}
}
return new PagedObjectResult(data.Data, data.Total, page, pagesize);
}
......
......@@ -72,6 +72,7 @@ namespace Siger.ApiACC.Controllers
fixturetools = fixtureTool.guid,
remark = req.remark,
productid = req.productid.ToInt(),
productcode = product.code,
projectId = ProjectId,
createtime = DateTime.Now,
updatetime = DateTime.Now,
......@@ -123,6 +124,7 @@ namespace Siger.ApiACC.Controllers
entity.fixturetools = fixtureTool.guid;
entity.remark = req.remark;
entity.productid = req.productid.ToInt();
entity.productcode = product.code;
entity.updatetime = DateTime.Now;
entity.updator = UserId;
entity.filename = req.filename;
......
......@@ -23,14 +23,17 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository;
private readonly ISigerProjectLevelSectionRepository _levelSectionRepository;
private readonly IProductionBeatSetRepository _beatSetRepository;
private readonly IAutomationFixtureMonitor _fixtureMonitor;
public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IProductionBeatSetRepository beatSetRepository)
ISigerProjectLevelSectionRepository levelSectionRepository, IProductionBeatSetRepository beatSetRepository,
IAutomationFixtureMonitor fixtureMonitor)
{
_unitOfWork = unitOfWork;
_sectionPropertyRepository = sectionPropertyRepository;
_levelSectionRepository = levelSectionRepository;
_beatSetRepository = beatSetRepository;
_fixtureMonitor = fixtureMonitor;
}
[HttpGet]
......@@ -44,10 +47,11 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(sections);
}
public IActionResult GetRouteByProduct(string productId)
[HttpGet]
public IActionResult GetRouteByProduct(string productId, int sectionId)
{
var list = _beatSetRepository.GetList(q => q.projectID == ProjectId && q.status == (int)RowState.Valid && q.product_name.ToInt() == productId.ToInt()).
Select(q => new
var list = _beatSetRepository.GetList(q => q.projectID == ProjectId && q.status == (int)RowState.Valid && q.product_name.ToInt() == productId.ToInt() &&
q.section_id == sectionId).Select(q => new
{
q.id,
name = q.route_name,
......@@ -56,5 +60,13 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(list);
}
[HttpGet]
public IActionResult GetSn(int sectionid)
{
var monitor = _fixtureMonitor.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.section == sectionid).OrderByDescending(q => q.updatetime).
FirstOrDefault();
return new ObjectResult(monitor?.sn ?? "");
}
}
}
......@@ -269,9 +269,6 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`materialid` int(11) NOT NULL DEFAULT 0 COMMENT '物料ID',
`processid` int(11) NOT NULL DEFAULT 0 COMMENT '工序ID',
`materialstate` int(11) NOT NULL DEFAULT 0 COMMENT '物料状态',
`attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
......
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