Commit 245ebee1 by yiyu.li
parents 510acdf2 853b014c
...@@ -6661,6 +6661,8 @@ export default { ...@@ -6661,6 +6661,8 @@ export default {
'8220': '未备模', '8220': '未备模',
'8221': '备模中', '8221': '备模中',
'8222': '备模完成', '8222': '备模完成',
'8223': '请填写项次',
'8224': '项次必须是正整数',
'120001': '模具未找到', '120001': '模具未找到',
'120002': '模具类型不能为空', '120002': '模具类型不能为空',
......
...@@ -2109,6 +2109,8 @@ export default { ...@@ -2109,6 +2109,8 @@ export default {
'3000174': '储位不存在', '3000174': '储位不存在',
'3000175': '工序加工未完成', '3000175': '工序加工未完成',
'3000176': '工序未开始加工', '3000176': '工序未开始加工',
'3000177': '同步报表记录失败',
'3000178': '请勿重复提交任务',
'400000': '设备状态', '400000': '设备状态',
'400002': '更改状态', '400002': '更改状态',
...@@ -6952,6 +6954,8 @@ export default { ...@@ -6952,6 +6954,8 @@ export default {
'8220': '未备模', '8220': '未备模',
'8221': '备模中', '8221': '备模中',
'8222': '备模完成', '8222': '备模完成',
'8223': '请填写项次',
'8224': '项次必须是正整数',
// ims专用,不要接着写 // ims专用,不要接着写
'120001': '模具未找到', '120001': '模具未找到',
......
...@@ -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">
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
:data="data2" :data="data2"
:columns="columns2" :columns="columns2"
:max-height="200" :max-height="200"
style="width: 500px" style="width: 680px"
highlight-row highlight-row
@on-current-change="handleRowChange1" @on-current-change="handleRowChange1"
></Table> ></Table>
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
? "执行中" ? "执行中"
: orderDetail2.status == 3 : orderDetail2.status == 3
? "执行完毕" ? "执行完毕"
: "未下发" : ""
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -324,18 +324,30 @@ export default { ...@@ -324,18 +324,30 @@ export default {
}, },
width: 70, width: 70,
}, },
{
title: "仓库",
key: "wavehouse",
width: 70,
},
{ {
title: "储位编号", title: "储位",
key: "locationid", key: "locationid",
width: 70,
}, },
{ {
title: "工装编号", title: "工装编号",
key: "code", key: "code",
width: 160,
}, },
{ {
title: "工件编号", title: "工件编号",
key: "materialsn", key: "materialsn",
}, },
{
title: "下一工序",
key: "route",
width: 100,
},
], ],
data2: [], data2: [],
orderDetail: {}, orderDetail: {},
...@@ -403,6 +415,7 @@ export default { ...@@ -403,6 +415,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;
...@@ -421,6 +434,7 @@ export default { ...@@ -421,6 +434,7 @@ export default {
this.tabindex = name; this.tabindex = name;
if (this.tabindex == "2") { if (this.tabindex == "2") {
this.orderDetail2 = {}; this.orderDetail2 = {};
} }
this.getStorages(); this.getStorages();
}, },
...@@ -432,7 +446,8 @@ export default { ...@@ -432,7 +446,8 @@ export default {
: ""; : "";
let data = { let data = {
fillsn: this.tabindex == "1" ? 0 : 1, fillsn: this.tabindex == "1" ? 0 : 1,
productcode: code, // productcode: code,
productcode: this.tabindex == "1" ? code:"",
}; };
this.request("/acc/AutomationLocation/GetLocationList", data, "get") this.request("/acc/AutomationLocation/GetLocationList", data, "get")
.then((res) => { .then((res) => {
...@@ -449,6 +464,7 @@ export default { ...@@ -449,6 +464,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) => {
...@@ -640,7 +656,7 @@ export default { ...@@ -640,7 +656,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"
) )
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
@click="search()" @click="search()"
>{{ $t("1001") }}</Button >{{ $t("1001") }}</Button
> >
<Button <!-- <Button
type="primary" type="primary"
class="twoWord" class="twoWord"
icon="ios-search" icon="ios-search"
@click="exportExcel()" @click="exportExcel()"
>导出</Button >导出</Button
> > -->
</div> </div>
</div> </div>
</div> </div>
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
}, },
{ {
title: "最后更新时间", title: "最后更新时间",
key: "workpiece_sn", key: "lastupdate",
}, },
], ],
data1: [], data1: [],
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<Option :value="1">待执行</Option> <Option :value="1">待执行</Option>
<Option :value="2">执行中</Option> <Option :value="2">执行中</Option>
<Option :value="3">执行完成</Option> <Option :value="3">执行完成</Option>
<Option :value="4">取消</Option>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
...@@ -193,58 +193,70 @@ export default { ...@@ -193,58 +193,70 @@ export default {
params.index + (this.page - 1) * this.pagesize + 1 params.index + (this.page - 1) * this.pagesize + 1
); );
}, },
width: 70, width: 50,
}, },
{ {
title: "任务编号", title: "任务编号",
key: "taskno", key: "taskno",
width: 150, width: 150,
}, },
{
title: "发起工站",
key: "fromsection",
width: 100,
},
{ {
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,34 +268,69 @@ export default { ...@@ -256,34 +268,69 @@ export default {
key: "actionType", key: "actionType",
}, },
{ {
title: "下发状态",
key: "send",
width: 100,
render: (h, params) => {
let str = "",bgc="";
switch (params.row.send) {
case 0:
str = "未下发";
bgc='Olive'
break;
case 1:
str = "已下发";
bgc='Green'
break;
}
return h("div",{
style:{
'background':bgc,
'color':'#fff'
}
} ,str);
},
},
{
title: "状态", title: "状态",
key: "status", key: "status",
render: (h, params) => { render: (h, params) => {
let str = ""; let str = "",bgc="";
switch (params.row.status) { switch (params.row.status) {
case 1: case 1:
str = "待执行"; str = "待执行";
bgc='Olive'
break; break;
case 2: case 2:
str = "执行中"; str = "执行中";
bgc='Orange'
break; break;
case 3: case 3:
str = "执行完成"; str = "执行完成";
bgc='Green'
break; break;
case 4: case 4:
str = "取消"; str = "取消";
bgc='Silver'
break; break;
} }
return h("div", str); return h("div",{
style:{
'background':bgc,
'color':'#fff'
}
} ,str);
}, },
}, },
{ {
title: "触发时间", title: "触发时间",
key: "triggerTime", key: "triggerTime",
width: 160,
}, },
{ {
title: "完成时间", title: "完成时间",
key: "complatetime", key: "complatetime",
width: 160,
}, },
], ],
data1: [], data1: [],
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
IIS configuration sections. IIS configuration sections.
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
</site> </site>
<site name="Siger.ApiConfig" id="2"> <site name="Siger.ApiConfig" id="2">
<application path="/" applicationPool="Siger.ApiConfig AppPool"> <application path="/" applicationPool="Siger.ApiConfig AppPool">
<virtualDirectory path="/" physicalPath="E:\gitlabcode\Laisi_AutoMES2\Server\Apis\Siger.ApiConfig" /> <virtualDirectory path="/" physicalPath="D:\Code\20210208\Laisi_AutoMES2\Server\Apis\Siger.ApiConfig" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:9002:localhost" /> <binding protocol="http" bindingInformation="*:9002:localhost" />
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
</site> </site>
<site name="Siger.ApiQMS" id="3"> <site name="Siger.ApiQMS" id="3">
<application path="/" applicationPool="Siger.ApiQMS AppPool"> <application path="/" applicationPool="Siger.ApiQMS AppPool">
<virtualDirectory path="/" physicalPath="D:\Code\20201209\siger-main\Server\Apis\Siger.ApiQMS" /> <virtualDirectory path="/" physicalPath="D:\Code\20210208\Laisi_AutoMES2\Server\Apis\Siger.ApiQMS" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:9013:localhost" /> <binding protocol="http" bindingInformation="*:9013:localhost" />
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
</site> </site>
<site name="Siger.ApiACC" id="4"> <site name="Siger.ApiACC" id="4">
<application path="/" applicationPool="Siger.ApiACC AppPool"> <application path="/" applicationPool="Siger.ApiACC AppPool">
<virtualDirectory path="/" physicalPath="D:\Code\20201209\siger-main\Server\Apis\Siger.ApiACC" /> <virtualDirectory path="/" physicalPath="D:\Code\20210208\Laisi_AutoMES2\Server\Apis\Siger.ApiACC" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:9003:localhost" /> <binding protocol="http" bindingInformation="*:9003:localhost" />
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
</site> </site>
<site name="Siger.ApiCNC" id="5"> <site name="Siger.ApiCNC" id="5">
<application path="/" applicationPool="Siger.ApiCNC AppPool"> <application path="/" applicationPool="Siger.ApiCNC AppPool">
<virtualDirectory path="/" physicalPath="D:\Code\20201209\siger-main\Server\Apis\Siger.ApiCNC" /> <virtualDirectory path="/" physicalPath="D:\Code\20210208\Laisi_AutoMES2\Server\Apis\Siger.ApiCNC" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:9008:localhost" /> <binding protocol="http" bindingInformation="*:9008:localhost" />
...@@ -1030,7 +1030,7 @@ ...@@ -1030,7 +1030,7 @@
<handlers> <handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers> </handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" stdoutLogEnabled="false" hostingModel="InProcess" startupTimeLimit="3600" requestTimeout="23:00:00" /> <aspNetCore processPath="%LAUNCHER_PATH%" stdoutLogEnabled="false" hostingModel="InProcess" startupTimeLimit="3600" requestTimeout="23:00:00" arguments="%LAUNCHER_ARGS%" />
<httpCompression> <httpCompression>
<dynamicTypes> <dynamicTypes>
<add mimeType="text/event-stream" enabled="false" /> <add mimeType="text/event-stream" enabled="false" />
......
...@@ -19,6 +19,7 @@ using Siger.Middlelayer.Utility.ImportEntities; ...@@ -19,6 +19,7 @@ using Siger.Middlelayer.Utility.ImportEntities;
using Siger.Middlelayer.Utility.Helpers; using Siger.Middlelayer.Utility.Helpers;
using System.IO; using System.IO;
using Siger.Middlelayer.Log; using Siger.Middlelayer.Log;
using Siger.Middlelayer.Common.ModuleEnum;
namespace Siger.ApiACC.Controllers namespace Siger.ApiACC.Controllers
{ {
...@@ -267,6 +268,10 @@ namespace Siger.ApiACC.Controllers ...@@ -267,6 +268,10 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
if (!string.IsNullOrEmpty(entity.sn))
{
throw new BadRequestException(AccEnum.LocationSnExits);
}
var fixturetool = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId); var fixturetool = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId);
if (fixturetool == null) if (fixturetool == null)
{ {
...@@ -315,7 +320,10 @@ namespace Siger.ApiACC.Controllers ...@@ -315,7 +320,10 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
if (!string.IsNullOrEmpty(entity.sn))
{
throw new BadRequestException(AccEnum.LocationSnExits);
}
entity.status = (int)RowState.Invalid; entity.status = (int)RowState.Invalid;
_autoLocationRepository.Update(entity); _autoLocationRepository.Update(entity);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
......
...@@ -17,6 +17,8 @@ using Siger.Middlelayer.Common.Helpers; ...@@ -17,6 +17,8 @@ using Siger.Middlelayer.Common.Helpers;
using Siger.Middlelayer.Utility.Helpers; using Siger.Middlelayer.Utility.Helpers;
using Siger.Middlelayer.Utility.ImportEntities; using Siger.Middlelayer.Utility.ImportEntities;
using System.IO; using System.IO;
using Siger.Middlelayer.Common.ModuleEnum;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Siger.ApiACC.Controllers namespace Siger.ApiACC.Controllers
...@@ -28,14 +30,19 @@ namespace Siger.ApiACC.Controllers ...@@ -28,14 +30,19 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationMachineStatus _automationMachineStatus; private readonly IAutomationMachineStatus _automationMachineStatus;
private readonly IAutomationTaskListRepository _automationTaskList; private readonly IAutomationTaskListRepository _automationTaskList;
private readonly IAutomationFixtureMonitor _automationFixtureMonitor; private readonly IAutomationFixtureMonitor _automationFixtureMonitor;
private readonly IAutomationLineMode _automationLineMode;
private readonly IAutomationSectionPropertyRepository _automationSectionProperty;
public AutomationStateController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationMachineStatus automationMachineStatus, IAutomationTaskListRepository automationTaskList, IAutomationFixtureMonitor automationFixtureMonitor) public AutomationStateController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationMachineStatus automationMachineStatus, IAutomationTaskListRepository automationTaskList, IAutomationFixtureMonitor automationFixtureMonitor
, IAutomationLineMode automationLineMode, IAutomationSectionPropertyRepository automationSectionProperty)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
_automationMachineStatus = automationMachineStatus; _automationMachineStatus = automationMachineStatus;
_automationTaskList = automationTaskList; _automationTaskList = automationTaskList;
_automationFixtureMonitor = automationFixtureMonitor; _automationFixtureMonitor = automationFixtureMonitor;
_automationLineMode = automationLineMode;
_automationSectionProperty = automationSectionProperty;
} }
/// <summary> /// <summary>
...@@ -82,6 +89,7 @@ namespace Siger.ApiACC.Controllers ...@@ -82,6 +89,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);
...@@ -100,6 +108,17 @@ namespace Siger.ApiACC.Controllers ...@@ -100,6 +108,17 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(output); return new ObjectResult(output);
} }
[HttpGet] [HttpGet]
public IActionResult GetSnDts(string sn)
{
return new ObjectResult(1);
}
[HttpGet]
public IActionResult GetFixtureDts(string fixture)
{
return new ObjectResult(1);
}
[HttpGet]
public IActionResult GetTasklist(int section, int tasktype, string productCode, string taskno, string sn, int status, int actionType, string triggerbegin,string triggerend, string complatebegin,string complatend,int page,int pageSize, string toexcel) public IActionResult GetTasklist(int section, int tasktype, string productCode, string taskno, string sn, int status, int actionType, string triggerbegin,string triggerend, string complatebegin,string complatend,int page,int pageSize, string toexcel)
{ {
var ids = new List<int>(); var ids = new List<int>();
...@@ -148,7 +167,7 @@ namespace Siger.ApiACC.Controllers ...@@ -148,7 +167,7 @@ namespace Siger.ApiACC.Controllers
model.status_value = ""; model.status_value = "";
break; break;
} }
model.send = item.send==0 ? "未下发" : "已下发";
dataList.Add(model); dataList.Add(model);
} }
if (dataList.Any()) if (dataList.Any())
...@@ -182,6 +201,44 @@ namespace Siger.ApiACC.Controllers ...@@ -182,6 +201,44 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
if (record.send != 0)
{
throw new BadRequestException(AccEnum.TaskIsSend);
}
var _property = _automationSectionProperty.GetList(f => f.propertytype == 1 && (f.upload > 0 || f.down > 0));
if (_property.Any())
{
foreach (var perperty in _property)
{
if (perperty.upload > 0)
{
//重置上料位状态
if (record.sectionid==perperty.sectionid && record.action == Automation.TaskAction.Step_LK_SXLW)
{
perperty.upload = 0;
_automationSectionProperty.Update(perperty);
}
}
if (perperty.down > 0)
{
//重置下料位置
//去抽检台
if (record.extend1.ToInt()==perperty.sectionid && record.action == Automation.TaskAction.Step_LK_CJT)
{
perperty.upload = 0;
_automationSectionProperty.Update(perperty);
}
//去下料位
if (record.extend1.ToInt()==perperty.sectionid && record.action== Automation.TaskAction.Step_LK_SXLW)
{
perperty.upload = 0;
_automationSectionProperty.Update(perperty);
}
}
}
}
_automationTaskList.Delete(record); _automationTaskList.Delete(record);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
......
...@@ -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,11 +268,27 @@ namespace Siger.ApiACC.Controllers ...@@ -267,11 +268,27 @@ 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 && f.action == TaskAction.Step_CJT_SXLW, "id", true).FirstOrDefault();
if (lastTask != null)
{ {
return new ObjectResult(CommonEnum.Succefull); if (lastTask.status != (int)TaskResultStatus.Complated)
{
Logger.WriteLineError($"重复检验提交数据,无需创建Task任务");
return new ObjectResult(CommonEnum.Succefull);
}
}
var tasklist = _automationTaskList.GetList(f => f.sectionid == req.sectionid && f.action == Automation.TaskAction.Step_LK_CJT).LastOrDefault();
if (tasklist == null)
{
throw new BadRequestException(CommonEnum.Fail);
} }
CreateTaskList(req.sectionid, req.productid, product.code, req.sn, req.routeid.ToInt());
inspection.workorder = tasklist.ordercode;
CreateTaskList(tasklist, 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表
} }
catch(Exception ex) catch(Exception ex)
...@@ -327,13 +344,9 @@ namespace Siger.ApiACC.Controllers ...@@ -327,13 +344,9 @@ namespace Siger.ApiACC.Controllers
} }
} }
private void CreateTaskList(int section, int productid, string productcode, string sn, int routeid) private void CreateTaskList(siger_automation_task_list tasklist, int section, int productid, string productcode, string sn, int routeid)
{ {
var tasklist = _automationTaskList.GetList(f => f.sectionid == section && f.action == Automation.TaskAction.Step_LK_CJT).LastOrDefault();
if (tasklist == null)
{
throw new BadRequestException(CommonEnum.Fail);
}
//找到上下料位 //找到上下料位
...@@ -344,7 +357,7 @@ namespace Siger.ApiACC.Controllers ...@@ -344,7 +357,7 @@ namespace Siger.ApiACC.Controllers
action = Automation.TaskAction.Step_CJT_SXLW, action = Automation.TaskAction.Step_CJT_SXLW,
actiontype = Automation.ExcueType.None, actiontype = Automation.ExcueType.None,
triggertime = DateTime.Now, triggertime = DateTime.Now,
tasktype = Automation.TaskActionType.Unload, tasktype = TaskActionType.Unload,
operater = UserId, operater = UserId,
operatetime = DateTime.Now, operatetime = DateTime.Now,
sectionid = tasklist.extend1.ToInt(), sectionid = tasklist.extend1.ToInt(),
......
...@@ -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
{ {
...@@ -48,7 +49,7 @@ namespace Siger.ApiACC.Tasks ...@@ -48,7 +49,7 @@ namespace Siger.ApiACC.Tasks
var section = task.extend1.ToInt(); var section = task.extend1.ToInt();
//抽检台-》上料位特殊逻辑 //抽检台-》上料位特殊逻辑
if (task.action==Automation.TaskAction.Step_LK_CJT || task.action == Automation.TaskAction.Step_CJT_SXLW) if (task.action==Automation.TaskAction.Step_LK_CJT || task.action == Automation.TaskAction.Step_CJT_SXLW || task.action==TaskAction.Step_LK_JGZX || task.action==TaskAction.Step_LK_SXLW)
{ {
section = task.sectionid; section = task.sectionid;
} }
...@@ -58,7 +59,7 @@ namespace Siger.ApiACC.Tasks ...@@ -58,7 +59,7 @@ namespace Siger.ApiACC.Tasks
var attr = dbhelper.GetAttribution(section); var attr = dbhelper.GetAttribution(section);
if (attr == null) if (attr == null)
return; return;
Logger.WriteLineInfo($"自动下发->PLC : {EnumHelper.GetEnumDesc(task.action)}Section:{section} machine:{attr.machine}");
var fixtrue = dbhelper.GetFixture(task.fixtureguid); var fixtrue = dbhelper.GetFixture(task.fixtureguid);
if (fixtrue==null) if (fixtrue==null)
{ {
...@@ -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 下发状态失败");
......
...@@ -357,7 +357,11 @@ namespace Siger.Middlelayer.Common.ModuleEnum ...@@ -357,7 +357,11 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[Description("工序加工未完成")] [Description("工序加工未完成")]
RouteProcessing, RouteProcessing,
[Description("工序未开始加工")] [Description("工序未开始加工")]
RouteNotStart RouteNotStart,
[Description("同步报工记录失败")]
SyncSnReportErro,
[Description("请勿重复提交任务")]
TaskCreateDone
} }
public enum SeriNumCfg public enum SeriNumCfg
......
...@@ -257,9 +257,11 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -257,9 +257,11 @@ namespace Siger.Middlelayer.Utility.ImportEntities
{ {
[ExcelColumn("任务编号")] [ExcelColumn("任务编号")]
public string taskno { get; set; } public string taskno { get; set; }
[ExcelColumn("产线层级")] [ExcelColumn("发起工站")]
public string fromsection { get; set; }
[ExcelColumn("目标工站")]
public string section { get; set; } public string section { get; set; }
[ExcelColumn("触发方")] [ExcelColumn("触发方")]
public string trigger { get; set; } public string trigger { get; set; }
[ExcelColumn("任务类型")] [ExcelColumn("任务类型")]
public string tasktype { get; set; } public string tasktype { get; set; }
...@@ -269,8 +271,8 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -269,8 +271,8 @@ namespace Siger.Middlelayer.Utility.ImportEntities
public string ordernumber { get; set; } public string ordernumber { get; set; }
[ExcelColumn("产品编号")] [ExcelColumn("产品编号")]
public string productCode { get; set; } public string productCode { get; set; }
[ExcelColumn("工序编号")] //[ExcelColumn("工序编号")]
public string routeNo { get; set; } //public string routeNo { get; set; }
[ExcelColumn("工序名称")] [ExcelColumn("工序名称")]
public string route { get; set; } public string route { get; set; }
[ExcelColumn("程序号")] [ExcelColumn("程序号")]
...@@ -281,6 +283,8 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -281,6 +283,8 @@ namespace Siger.Middlelayer.Utility.ImportEntities
public string fixtureCode { get; set; } public string fixtureCode { get; set; }
[ExcelColumn("动作")] [ExcelColumn("动作")]
public string action { get; set; } public string action { get; set; }
[ExcelColumn("下发状态")]
public string send { get; set; }
[ExcelColumn("执行类型")] [ExcelColumn("执行类型")]
public string actionType { get; set; } public string actionType { get; set; }
[ExcelColumn("状态")] [ExcelColumn("状态")]
......
...@@ -221,7 +221,7 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -221,7 +221,7 @@ namespace Siger.Middlelayer.Utility.ImportEntities
public string unhealthy_code { get; set; } public string unhealthy_code { get; set; }
[ExcelColumn("项次*")] [ExcelColumn("项次*")]
public int seq { get; set; } public string seq { get; set; }
[ExcelColumn("是否送检*(1=>人工检验2=>送检检验)*")] [ExcelColumn("是否送检*(1=>人工检验2=>送检检验)*")]
public string isinpect { get; set; } public string isinpect { get; set; }
......
...@@ -19,11 +19,11 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -19,11 +19,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public int propertytype { get; set; } public int propertytype { get; set; }
/// <summary> /// <summary>
/// 上料状态 1 当前是上料 2 上料中 3 安装完成 /// 上料状态 1 当前是上料 2 安装完成
/// </summary> /// </summary>
public int upload { get; set; } public int upload { get; set; }
/// <summary> /// <summary>
/// 下料状态 1 当前是下料 2 下料中 3 拆卸完成 /// 下料状态 1 当前是下料 2 拆卸完成
/// </summary> /// </summary>
public int down { get; set; } public int down { get; set; }
......
...@@ -88,7 +88,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -88,7 +88,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary> /// <summary>
/// 完成时间 /// 完成时间
/// </summary> /// </summary>
public DateTime? completetime { get; set; } public DateTime completetime { get; set; }
/// <summary> /// <summary>
/// 操作人 /// 操作人
/// </summary> /// </summary>
......
...@@ -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,
......
...@@ -35,7 +35,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -35,7 +35,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
from u in uu.DefaultIfEmpty() from u in uu.DefaultIfEmpty()
join r in _context.siger_project_product_route on q.routeid equals r.id into rr join r in _context.siger_project_product_route on q.routeid equals r.id into rr
from r in rr.DefaultIfEmpty() from r in rr.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid where q.projectId == projectid && q.status != (int)RowState.Invalid
select new ResponseAutomationLocation select new ResponseAutomationLocation
{ {
id = q.id, id = q.id,
...@@ -251,7 +251,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -251,7 +251,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join r in _context.siger_project_product_route on q.routeid equals r.id into rtemp join r in _context.siger_project_product_route on q.routeid equals r.id into rtemp
from r in rtemp.DefaultIfEmpty() from r in rtemp.DefaultIfEmpty()
where q.projectId == projectId where q.projectId == projectId
&& q.status == (int)RowState.Valid && t.status == (int)RowState.Valid && q.status == (int)RowState.Valid
&& t.status == (int)RowState.Valid
&& l.status == (int)RowState.Valid && w.status == (int)RowState.Valid && l.status == (int)RowState.Valid && w.status == (int)RowState.Valid
select new ResponseAutomationLocationList select new ResponseAutomationLocationList
......
...@@ -142,6 +142,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -142,6 +142,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
from r in rtemp.DefaultIfEmpty() from r in rtemp.DefaultIfEmpty()
join s in _context.siger_project_level_section on q.sectionid equals s.id join s in _context.siger_project_level_section on q.sectionid equals s.id
join lv in _context.siger_project_level_section on s.parentid equals lv.id join lv in _context.siger_project_level_section on s.parentid equals lv.id
join fs in _context.siger_project_level_section on q.extend1 equals fs.id.ToString() into fstemp
from fs in fstemp.DefaultIfEmpty()
where q.projectId == projectid where q.projectId == projectid
select new ResponseAutomationTasklist select new ResponseAutomationTasklist
{ {
...@@ -153,7 +155,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -153,7 +155,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
triggervalue = q.triggertime, triggervalue = q.triggertime,
triggerTime = q.triggertime == DateTime.MinValue ? "" : q.triggertime.ToString(), triggerTime = q.triggertime == DateTime.MinValue ? "" : q.triggertime.ToString(),
complatevalue = q.completetime, complatevalue = q.completetime,
complatetime = q.completetime == DateTime.MinValue ? "" : q.completetime.ToString(), complatetime = q.completetime == DateTime.MinValue ? "" : q.completetime.ToString(UnixTimeHelper.DateTimeFormat),
action = EnumHelper.GetEnumDesc(q.action), action = EnumHelper.GetEnumDesc(q.action),
actionType = EnumHelper.GetEnumDesc(q.actiontype), actionType = EnumHelper.GetEnumDesc(q.actiontype),
fixtureCode = t.code, fixtureCode = t.code,
...@@ -168,7 +170,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -168,7 +170,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
tasktype = EnumHelper.GetEnumDesc(q.tasktype), tasktype = EnumHelper.GetEnumDesc(q.tasktype),
tasktypeid = Convert.ToInt32(q.tasktype), tasktypeid = Convert.ToInt32(q.tasktype),
status = q.status, status = q.status,
actionTypeid = Convert.ToInt32(q.actiontype) actionTypeid = Convert.ToInt32(q.actiontype),
productName=q.productname,
fromsection = fs != null ? fs.title : "",
}; };
Expression<Func<ResponseAutomationTasklist, bool>> sectonsExpression = f => true; Expression<Func<ResponseAutomationTasklist, bool>> sectonsExpression = f => true;
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Response
{
public class ResponseAutomationFixtureDetails
{
/// <summary>
/// 父工装类别
/// </summary>
public string parentType { get; set; }
/// <summary>
/// 父工装编号
/// </summary>
public string parentCode { get; set; }
/// <summary>
/// 父级工装名称
/// </summary>
public string parentName { get; set; }
/// <summary>
/// 父级工装类别
/// </summary>
public string parentSpecl { get; set; }
public string child { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Response
{
public class ResponseAutomationSnhistory
{
public string productCode { get; set; }
public string productName { get; set; }
public string section { get; set; }
public string fixtureCode { get; set; }
public string sn { get; set; }
public string program { get; set; }
public string route { get; set; }
public string datetime { get; set; }
}
}
...@@ -47,5 +47,11 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -47,5 +47,11 @@ 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; }
/// <summary>
/// 发起工站
/// </summary>
public string fromsection { get; set; }
} }
} }
...@@ -219,6 +219,17 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -219,6 +219,17 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
return new CommonImportResult(0, string.Join(";", errors)); return new CommonImportResult(0, string.Join(";", errors));
} }
if (string.IsNullOrEmpty(item.seq))
{
errors.Add($"{rowIndex},{8223}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (!int.TryParse(item.seq, out int intSeq) || item.seq.ToInt() <= 0)
{
errors.Add($"{rowIndex},{8224}");
return new CommonImportResult(0, string.Join(";", errors));
}
var itemPinYin = PinYinHelper.ToPinYin(item.item); var itemPinYin = PinYinHelper.ToPinYin(item.item);
if (string.IsNullOrWhiteSpace(itemPinYin)) if (string.IsNullOrWhiteSpace(itemPinYin))
{ {
...@@ -262,7 +273,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -262,7 +273,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
errors.Add($"{rowIndex},{(int)RequestEnum.MaxMinError}"); errors.Add($"{rowIndex},{(int)RequestEnum.MaxMinError}");
} }
if ((p.value_category.ToInt() == (int)ValueCategory.Maxmin && string.IsNullOrEmpty(p.range)) || p.seq <= 0 || if ((p.value_category.ToInt() == (int)ValueCategory.Maxmin && string.IsNullOrEmpty(p.range)) || p.seq.ToInt() <= 0 ||
(p.value_type.ToInt() == (int)ValueTypeStatus.V && p.value_category.ToInt() <= 0) || (p.value_type.ToInt() == (int)ValueTypeStatus.V && p.value_category.ToInt() <= 0) ||
string.IsNullOrWhiteSpace(p.lcl) && !string.IsNullOrWhiteSpace(p.ucl) || string.IsNullOrWhiteSpace(p.lcl) && !string.IsNullOrWhiteSpace(p.ucl)) string.IsNullOrWhiteSpace(p.lcl) && !string.IsNullOrWhiteSpace(p.ucl) || string.IsNullOrWhiteSpace(p.lcl) && !string.IsNullOrWhiteSpace(p.ucl))
{ {
...@@ -277,7 +288,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -277,7 +288,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
errors.Add($"{rowIndex},{(int)RequestEnum.InspectItemRepeat}"); errors.Add($"{rowIndex},{(int)RequestEnum.InspectItemRepeat}");
} }
var querySeq = _context.siger_qms_inspection_standard.FirstOrDefault(t => t.seq == p.seq && var querySeq = _context.siger_qms_inspection_standard.FirstOrDefault(t => t.seq == p.seq.ToInt() &&
t.projectid == projectid && t.status == (int)RowState.Valid && t.productid == p.productid && t.projectid == projectid && t.status == (int)RowState.Valid && t.productid == p.productid &&
t.sectionid == p.sectionid && t.standard_type == p.isinpect.ToInt()); t.sectionid == p.sectionid && t.standard_type == p.isinpect.ToInt());
if (querySeq != null || standardList.Count(t => t.seq == p.seq && if (querySeq != null || standardList.Count(t => t.seq == p.seq &&
...@@ -302,10 +313,10 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -302,10 +313,10 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
{ {
if (p.value_type == "3") if (p.value_type == "3")
{ {
var standard = _context.siger_qms_inspection_standard.Where(q => q.value_type == 3 && q.productcode == p.productcode && q.sectionid == p.sectionid && q.seq == p.seq).FirstOrDefault(); var standard = _context.siger_qms_inspection_standard.Where(q => q.value_type == 3 && q.productcode == p.productcode && q.sectionid == p.sectionid && q.seq == p.seq.ToInt()).FirstOrDefault();
if (standard == null) if (standard == null)
{ {
var data = entities.Where(q => q.value_type == 3 && q.productcode == p.productcode && q.sectionid == p.sectionid && q.seq == p.seq).FirstOrDefault(); var data = entities.Where(q => q.value_type == 3 && q.productcode == p.productcode && q.sectionid == p.sectionid && q.seq == p.seq.ToInt()).FirstOrDefault();
if (data != null) if (data != null)
{ {
continue; continue;
...@@ -317,7 +328,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -317,7 +328,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
productcode = p.productcode, productcode = p.productcode,
sectionid = p.sectionid, sectionid = p.sectionid,
standard = p.standard, standard = p.standard,
seq = p.seq, seq = p.seq.ToInt(),
item = p.item ?? "", item = p.item ?? "",
item_en = p.item_en, item_en = p.item_en,
unit = p.unit ?? "", unit = p.unit ?? "",
...@@ -352,7 +363,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -352,7 +363,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
productcode = p.productcode, productcode = p.productcode,
sectionid = p.sectionid, sectionid = p.sectionid,
standard = p.standard, standard = p.standard,
seq = p.seq, seq = p.seq.ToInt(),
item = p.item ?? "", item = p.item ?? "",
item_en = p.item_en, item_en = p.item_en,
unit = p.unit ?? "", unit = p.unit ?? "",
...@@ -386,7 +397,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -386,7 +397,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
{ {
if (p.value_type=="3") if (p.value_type=="3")
{ {
var standard = _context.siger_qms_inspection_standard.Where(q => q.value_type == 3 && q.productcode == p.productcode && q.sectionid == p.sectionid && q.seq == p.seq && q.status==(int)RowState.Valid).FirstOrDefault(); var standard = _context.siger_qms_inspection_standard.Where(q => q.value_type == 3 && q.productcode == p.productcode && q.sectionid == p.sectionid && q.seq == p.seq.ToInt() && q.status==(int)RowState.Valid).FirstOrDefault();
var option = new siger_qms_inspection_standard_option var option = new siger_qms_inspection_standard_option
{ {
standardid= standard.id, standardid= standard.id,
......
...@@ -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