Commit f2c648f0 by jiawei.su

someupdate

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