Commit f2c648f0 by jiawei.su

someupdate

parent 9991952f
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
{{ {{
item.status == 1 item.status == 1
? "待上料" ? "待上料"
: orderDetail.status == 2 : item.status == 2
? "运行中" ? "运行中"
: "待下料" : "待下料"
}} }}
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
? "执行中" ? "执行中"
: orderDetail.status == 3 : orderDetail.status == 3
? "执行完毕" ? "执行完毕"
: "未下发" : ""
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
? "执行中" ? "执行中"
: orderDetail2.status == 3 : orderDetail2.status == 3
? "执行完毕" ? "执行完毕"
: "未下发" : ""
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -403,6 +403,7 @@ export default { ...@@ -403,6 +403,7 @@ export default {
this.sectionid = this.stationList[index].section; this.sectionid = this.stationList[index].section;
this.orderDetail = {}; this.orderDetail = {};
this.code="";
// status = 2; // status = 2;
// if (status == 3) { // if (status == 3) {
// this.attr1 = true; // this.attr1 = true;
...@@ -449,6 +450,7 @@ export default { ...@@ -449,6 +450,7 @@ export default {
getWorkOrderInfo() { getWorkOrderInfo() {
let data = { let data = {
code: this.code, code: this.code,
section:this.sectionid
}; };
this.request("/acc/AutomationOperate/ScanCode", data, "get") this.request("/acc/AutomationOperate/ScanCode", data, "get")
.then((res) => { .then((res) => {
...@@ -625,7 +627,7 @@ export default { ...@@ -625,7 +627,7 @@ export default {
if (this.locationobj.id) { if (this.locationobj.id) {
// this.getRunningDetail(); // this.getRunningDetail();
this.request( this.request(
"/acc/AutomationOperate/ScanCode?id=" + this.locationobj.id, "/acc/AutomationOperate/ScanCode?id=" + this.locationobj.id +"&section="+this.sectionids,
"", "",
"get" "get"
) )
......
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
}, },
{ {
title: "最后更新时间", title: "最后更新时间",
key: "workpiece_sn", key: "lastupdate",
}, },
], ],
data1: [], data1: [],
......
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
params.index + (this.page - 1) * this.pagesize + 1 params.index + (this.page - 1) * this.pagesize + 1
); );
}, },
width: 70, width: 50,
}, },
{ {
title: "任务编号", title: "任务编号",
...@@ -203,48 +203,55 @@ export default { ...@@ -203,48 +203,55 @@ export default {
{ {
title: "产线层级", title: "产线层级",
key: "section", key: "section",
width: 150, width: 170,
}, },
{ {
title: "触发方", title: "触发方",
key: "trigger", key: "trigger",
width: 100,
}, },
{ {
title: "任务类型", title: "任务类型",
key: "tasktype", key: "tasktype",
width: 100,
}, },
{ {
title: "工件编号", title: "工件编号",
key: "sn", key: "sn",
width: 150, width: 230,
}, },
{ {
title: "工单编号", title: "工单编号",
key: "ordernumber", key: "ordernumber",
width: 100,
}, },
{ {
title: "产品编号", title: "产品编号",
key: "productCode", key: "productCode",
width: 130,
}, },
{ // {
title: "工序编号", // title: "工序编号",
key: "routeNo", // key: "routeNo",
}, // },
{ {
title: "工序名称", title: "工序名称",
key: "route", key: "route",
width: 90,
}, },
{ {
title: "程序号", title: "程序号",
key: "program", key: "program",
}, },
{ {
title: "储位位置", title: "储位",
key: "location", key: "location",
width: 70,
}, },
{ {
title: "工装编号", title: "工装编号",
key: "fixtureCode", key: "fixtureCode",
width: 160,
}, },
{ {
title: "动作", title: "动作",
...@@ -256,6 +263,11 @@ export default { ...@@ -256,6 +263,11 @@ export default {
key: "actionType", key: "actionType",
}, },
{ {
title: "下发状态",
key: "send",
width: 100,
},
{
title: "状态", title: "状态",
key: "status", key: "status",
render: (h, params) => { render: (h, params) => {
...@@ -280,10 +292,12 @@ export default { ...@@ -280,10 +292,12 @@ export default {
{ {
title: "触发时间", title: "触发时间",
key: "triggerTime", key: "triggerTime",
width: 160,
}, },
{ {
title: "完成时间", title: "完成时间",
key: "complatetime", key: "complatetime",
width: 160,
}, },
], ],
data1: [], data1: [],
......
...@@ -308,6 +308,9 @@ namespace Siger.ApiACC.Controllers ...@@ -308,6 +308,9 @@ namespace Siger.ApiACC.Controllers
// 业务入口: 上料位-》 入库 如果是上料工装 安装完成 ,绑定 储位与装配 // 业务入口: 上料位-》 入库 如果是上料工装 安装完成 ,绑定 储位与装配
if (sectionProperty.propertytype == 1) if (sectionProperty.propertytype == 1)
{ {
//上下料位状态 为后台控制
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
var download = false; var download = false;
if (sectionProperty.down > 2) if (sectionProperty.down > 2)
{ {
...@@ -347,6 +350,20 @@ namespace Siger.ApiACC.Controllers ...@@ -347,6 +350,20 @@ namespace Siger.ApiACC.Controllers
location.status = (int)LocationStatus.Out; location.status = (int)LocationStatus.Out;
_automationLocation.Update(location); _automationLocation.Update(location);
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Produce;
_automationMachineStatus.Update(machineStatusObj);
}
}
//需要抽检时(准备下料) ,立库到抽检台
if(taskObj.action== TaskAction.Step_LK_CJT)
{
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Produce;
_automationMachineStatus.Update(machineStatusObj);
}
} }
//上料中 //上料中
...@@ -375,6 +392,8 @@ namespace Siger.ApiACC.Controllers ...@@ -375,6 +392,8 @@ namespace Siger.ApiACC.Controllers
//抽检台 //抽检台
if (sectionProperty.propertytype == 3) if (sectionProperty.propertytype == 3)
{ {
var machineStatusObj = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
if (taskObj.action == TaskAction.Step_LK_CJT) if (taskObj.action == TaskAction.Step_LK_CJT)
{ {
location.status = (int)LocationStatus.Out; location.status = (int)LocationStatus.Out;
...@@ -382,7 +401,11 @@ namespace Siger.ApiACC.Controllers ...@@ -382,7 +401,11 @@ namespace Siger.ApiACC.Controllers
} }
if (taskObj.action == TaskAction.Step_CJT_SXLW) if (taskObj.action == TaskAction.Step_CJT_SXLW)
{ {
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Produce;
_automationMachineStatus.Update(machineStatusObj);
}
} }
} }
......
...@@ -82,7 +82,7 @@ namespace Siger.ApiACC.Controllers ...@@ -82,7 +82,7 @@ namespace Siger.ApiACC.Controllers
//上下料 //上下料
if (type==0) if (type==0)
{ {
var sectionProperty = _sectionPropertyRepository.GetList(f => f.propertytype == 1); var sectionProperty = _sectionPropertyRepository.GetList(f => f.propertytype == 1).ToList();
var sections = sectionProperty.Select(s => s.sectionid).ToList(); var sections = sectionProperty.Select(s => s.sectionid).ToList();
var levelSection = _sigerProjectLevelSection.GetList(f => f.parentid == line && sections.Contains(f.id)); var levelSection = _sigerProjectLevelSection.GetList(f => f.parentid == line && sections.Contains(f.id));
if (!levelSection.Any()) if (!levelSection.Any())
...@@ -92,12 +92,16 @@ namespace Siger.ApiACC.Controllers ...@@ -92,12 +92,16 @@ namespace Siger.ApiACC.Controllers
var result = new List<ResponseLoadStation>(); var result = new List<ResponseLoadStation>();
foreach (var lv in levelSection) foreach (var lv in levelSection)
{ {
var machineStatus = _automationMachineStatus.Get(f => f.section == lv.id);
var _property = sectionProperty.Find(f => f.sectionid == lv.id);
result.Add(new ResponseLoadStation result.Add(new ResponseLoadStation
{ {
section=lv.id, section=lv.id,
status=1, status= machineStatus != null? machineStatus.status:1,
title=lv.title, title=lv.title,
upload=_property!=null? _property.upload:0,
download= _property != null ? _property.down:0,
}); });
} }
return new ObjectResult(result); return new ObjectResult(result);
...@@ -229,6 +233,7 @@ namespace Siger.ApiACC.Controllers ...@@ -229,6 +233,7 @@ namespace Siger.ApiACC.Controllers
return new ImportObjectResult((int)CommonEnum.Fail, message); return new ImportObjectResult((int)CommonEnum.Fail, message);
} }
taskobj.send = 1; taskobj.send = 1;
taskobj.actiontype = ExcueType.Manual;
_automationTaskList.Update(taskobj); _automationTaskList.Update(taskobj);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{ {
...@@ -277,8 +282,9 @@ namespace Siger.ApiACC.Controllers ...@@ -277,8 +282,9 @@ namespace Siger.ApiACC.Controllers
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public IActionResult ScanCode(string code,int id) public IActionResult ScanCode(string code,int id,int section)
{ {
var monitor = _automationFixtureMonitor.Get(f => f.section == section);
if (!string.IsNullOrEmpty(code)) if (!string.IsNullOrEmpty(code))
{ {
var result = _automationFixtureToolsProduct.GetPlanFixtureInfo(ProjectId, code); var result = _automationFixtureToolsProduct.GetPlanFixtureInfo(ProjectId, code);
...@@ -288,6 +294,7 @@ namespace Siger.ApiACC.Controllers ...@@ -288,6 +294,7 @@ namespace Siger.ApiACC.Controllers
} }
var sn = _automationTaskList.CreateRandonSn(result.ProductCode); var sn = _automationTaskList.CreateRandonSn(result.ProductCode);
result.Sn = sn; result.Sn = sn;
result.status = monitor != null ? monitor.status : 1;
return new ObjectResult(result); return new ObjectResult(result);
} }
if (id==0) if (id==0)
...@@ -296,7 +303,7 @@ namespace Siger.ApiACC.Controllers ...@@ -296,7 +303,7 @@ namespace Siger.ApiACC.Controllers
} }
//下料 //下料
var unload = _automationFixtureToolsProduct.GetPlanFixtureInfoByLocation(ProjectId, id); var unload = _automationFixtureToolsProduct.GetPlanFixtureInfoByLocation(ProjectId, id);
unload.status = monitor != null ? monitor.status : 1;
return new ObjectResult(unload); return new ObjectResult(unload);
} }
...@@ -638,6 +645,7 @@ namespace Siger.ApiACC.Controllers ...@@ -638,6 +645,7 @@ namespace Siger.ApiACC.Controllers
fixturename=location.fixturename, fixturename=location.fixturename,
locationid = location.locationid, locationid = location.locationid,
productcode = location.productcode, productcode = location.productcode,
productname=location.productname,
processid = 0, processid = 0,
programnumber = "", programnumber = "",
remark =lineMode.inspect==1? "准备下料-》抽检台":"准备下料", remark =lineMode.inspect==1? "准备下料-》抽检台":"准备下料",
...@@ -678,7 +686,7 @@ namespace Siger.ApiACC.Controllers ...@@ -678,7 +686,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(AccEnum.MachineOnFree); throw new BadRequestException(AccEnum.MachineOnFree);
} }
if (upload.down != 2) if (upload.down < 2)
{ {
throw new BadRequestException(AccEnum.TaskProcessing); throw new BadRequestException(AccEnum.TaskProcessing);
} }
......
...@@ -82,6 +82,7 @@ namespace Siger.ApiACC.Controllers ...@@ -82,6 +82,7 @@ namespace Siger.ApiACC.Controllers
item.fixtureName = fixture.fixturename; item.fixtureName = fixture.fixturename;
item.machineStatus = d.status; item.machineStatus = d.status;
item.status = fixture.status; item.status = fixture.status;
item.lastupdate = fixture.createtime.ToString();
} }
result.Add(item); result.Add(item);
......
...@@ -21,6 +21,7 @@ using System.IO; ...@@ -21,6 +21,7 @@ using System.IO;
using Siger.Middlelayer.Log; using Siger.Middlelayer.Log;
using Siger.Middlelayer.Common.ModuleEnum; using Siger.Middlelayer.Common.ModuleEnum;
using Siger.Middlelayer.Share.Enum.ModuleEnum; using Siger.Middlelayer.Share.Enum.ModuleEnum;
using static Siger.Middlelayer.Share.Enum.ModuleEnum.Automation;
namespace Siger.ApiACC.Controllers namespace Siger.ApiACC.Controllers
{ {
...@@ -267,10 +268,17 @@ namespace Siger.ApiACC.Controllers ...@@ -267,10 +268,17 @@ namespace Siger.ApiACC.Controllers
try try
{ {
//还有未完成任务 退出 等待任务下发 //还有未完成任务 退出 等待任务下发
if (!_automationTaskList.CanTask(ProjectId, req.sectionid)) //if (!_automationTaskList.CanTask(ProjectId, req.sectionid))
//{
// return new ObjectResult(CommonEnum.Succefull);
//}
var lastTask = _automationTaskList.GetList(f => f.projectId == ProjectId, "id", true).FirstOrDefault();
if (lastTask.extend1 == section.ToStr() && lastTask.action == TaskAction.Step_CJT_SXLW && lastTask.status != (int)TaskResultStatus.Complated)
{ {
return new ObjectResult(CommonEnum.Succefull); return new ObjectResult(CommonEnum.Succefull);
} }
CreateTaskList(req.sectionid, req.productid, product.code, req.sn, req.routeid.ToInt()); CreateTaskList(req.sectionid, req.productid, product.code, req.sn, req.routeid.ToInt());
AddSnList(req.materialid.ToInt(), inspection, product.code, section.parentid);//把二维码插入到 sn_list表 AddSnList(req.materialid.ToInt(), inspection, product.code, section.parentid);//把二维码插入到 sn_list表
} }
......
...@@ -11,6 +11,7 @@ using System; ...@@ -11,6 +11,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using static Siger.Middlelayer.Share.Enum.ModuleEnum.Automation;
namespace Siger.ApiACC.Tasks namespace Siger.ApiACC.Tasks
{ {
...@@ -87,6 +88,7 @@ namespace Siger.ApiACC.Tasks ...@@ -87,6 +88,7 @@ namespace Siger.ApiACC.Tasks
return; return;
} }
task.send = 1; task.send = 1;
task.actiontype = ExcueType.Auto;
if (!dbhelper.UpdateTask(task)) if (!dbhelper.UpdateTask(task))
{ {
Logger.WriteLineError($"更新TASK 下发状态失败"); Logger.WriteLineError($"更新TASK 下发状态失败");
......
...@@ -233,6 +233,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -233,6 +233,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
&& q.status == (int)RowState.Valid && t.status == (int)RowState.Valid && q.status == (int)RowState.Valid && t.status == (int)RowState.Valid
select new ResponsePlanlFixtureInfo select new ResponsePlanlFixtureInfo
{ {
OrderNumber = d.OrderNumber, OrderNumber = d.OrderNumber,
ProductName = p.product_name, ProductName = p.product_name,
Url = pd.image, Url = pd.image,
......
...@@ -47,5 +47,7 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -47,5 +47,7 @@ namespace Siger.Middlelayer.AccRepository.Response
public DateTime? complatevalue { get; set; } public DateTime? complatevalue { get; set; }
public string complatetime { get; set; } public string complatetime { get; set; }
public int send { get; set; } public int send { get; set; }
//0 自动,1,手动执行
public int excute { get; set; }
} }
} }
...@@ -20,8 +20,13 @@ namespace Siger.Middlelayer.Repository.Response ...@@ -20,8 +20,13 @@ namespace Siger.Middlelayer.Repository.Response
public int status { get; set; } public int status { get; set; }
/// <summary> /// <summary>
/// 1 :可以上料 2:可以下料 /// 上料状态
/// </summary> /// </summary>
public int upload { get; set; } public int upload { get; set; }
/// <summary>
/// 下料状态
/// </summary>
public int download { get; set; }
} }
} }
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