Commit a478442c by yiyu.li
parents 9c5a7d93 2da17f65
...@@ -742,6 +742,7 @@ export default { ...@@ -742,6 +742,7 @@ export default {
'9000517': '请填写子工装编号', '9000517': '请填写子工装编号',
'9000518': '请填写储位ID', '9000518': '请填写储位ID',
'9000519': '请填写仓库名称', '9000519': '请填写仓库名称',
'9000520': '请输入工件编号',
'9100000': 'Departments cannot be empty', '9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty', '9100001': 'Position cannot be empty',
......
...@@ -769,6 +769,7 @@ export default { ...@@ -769,6 +769,7 @@ export default {
'9000517': '请填写子工装编号', '9000517': '请填写子工装编号',
'9000518': '请填写储位ID', '9000518': '请填写储位ID',
'9000519': '请填写仓库名称', '9000519': '请填写仓库名称',
'9000520': '请输入工件编号',
'9100000': '部门不能为空', '9100000': '部门不能为空',
......
...@@ -295,7 +295,7 @@ export default { ...@@ -295,7 +295,7 @@ export default {
}, },
{ {
title: "储位编号", title: "储位编号",
key: "locationcode", key: "locationid",
}, },
{ {
title: "工装编号", title: "工装编号",
...@@ -318,7 +318,7 @@ export default { ...@@ -318,7 +318,7 @@ export default {
}, },
{ {
title: "储位编号", title: "储位编号",
key: "locationcode", key: "locationid",
}, },
{ {
title: "工装编号", title: "工装编号",
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
> >
<Option <Option
v-for="(item, index) in productList" v-for="(item, index) in productList"
:value="item.id" :value="item.code"
:key="index" :key="index"
:label=" :label="
item.name + item.name +
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
clearable clearable
filterable filterable
class="searchSelect" class="searchSelect"
v-model="state" v-model="status"
> >
<Option :value="1">待执行</Option> <Option :value="1">待执行</Option>
<Option :value="2">执行中</Option> <Option :value="2">执行中</Option>
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
productList: [], productList: [],
taskNumber: "", taskNumber: "",
sn: "", sn: "",
state: 0, status: 0,
performType: 0, performType: 0,
startTime: [], startTime: [],
endTime: [], endTime: [],
...@@ -326,6 +326,7 @@ export default { ...@@ -326,6 +326,7 @@ export default {
complatend: this.endTime.length > 0 ? this.endTime[1] : "", complatend: this.endTime.length > 0 ? this.endTime[1] : "",
page: page, page: page,
pageSize: pagesize, pageSize: pagesize,
TaskNo: this.taskNumber,
}; };
this.axios this.axios
.request({ .request({
...@@ -399,20 +400,6 @@ export default { ...@@ -399,20 +400,6 @@ export default {
} }
); );
}, },
exportExcel() {
// this.axios.request({
// url: "/config/Download/GetTemplate?name=StorageLocation",
// method: "get",
// })
// .then((res) => {
// if (res.data.ret === 1) {
// window.location.href =
// this.axios.publicPath + "" + res.data.data;
// } else {
// this.$Message.error(this.$t(res.data.msg));
// }
// });
},
initlevel() { initlevel() {
// 初始化产线层级 // 初始化产线层级
this.axios this.axios
...@@ -454,17 +441,33 @@ export default { ...@@ -454,17 +441,33 @@ export default {
this.endTime = val; this.endTime = val;
}, },
exportExcel() { exportExcel() {
let data = {}; let params = {
section: this.sectionid,
tasktype: this.taskType,
productCode: this.productCode,
sn: this.sn,
status: this.status,
actionType: this.performType,
triggerbegin:
this.startTime.length > 0 ? this.startTime[0] : "",
triggerend: this.startTime.length > 0 ? this.startTime[1] : "",
complatebegin: this.endTime.length > 0 ? this.endTime[0] : "",
complatend: this.endTime.length > 0 ? this.endTime[1] : "",
page: this.page,
pageSize: this.pagesize,
TaskNo: this.taskNumber,
toexcel: '1'
};
this.axios this.axios
.request({ .request({
url: "", url: "/acc/AutomationState/GetTasklist",
data, params,
method: "", method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret === 1) { if (res.data.ret === 1) {
window.location.href = window.location.href =
axios.publicPath + "" + res.data.data; this.axios.publicPath + "" + res.data.data;
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
......
...@@ -690,14 +690,21 @@ export default { ...@@ -690,14 +690,21 @@ export default {
axios axios
.request({ .request({
url: url:
"/qms/InspectStandard/GetProductsBySectionId?sectionid=" + "/acc/SectionProperty/GetMonitorSnProduct?sectionid=" +
stationid, stationid,
method: "get", method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret == 1 && res.data.data.length > 0) { if (res.data.ret == 1 && res.data.data.id > 0) {
this.productList = res.data.data; this.productList = [
{
id:res.data.data.id,
name:res.data.data.name,
code:res.data.data.code,
}
];
this.product = this.productList[0]; this.product = this.productList[0];
this.qrcode = res.data.data.sn;
this.initmaterial(this.product.id, stationid); this.initmaterial(this.product.id, stationid);
this.inititems(); this.inititems();
} else { } else {
...@@ -715,21 +722,6 @@ export default { ...@@ -715,21 +722,6 @@ export default {
this.initproduct(this.station.id); this.initproduct(this.station.id);
this.initSn(this.station.id) this.initSn(this.station.id)
}, },
initSn(sectionid){
if (sectionid > 0) {
axios
.request({
url:
"/acc/SectionProperty/GetSn?sectionId=" + sectionid,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) {
this.qrcode = res.data.data;
}
});
}
},
productchange(i) { productchange(i) {
this.c = i; this.c = i;
this.product = this.productList[i]; this.product = this.productList[i];
......
...@@ -12,6 +12,11 @@ using Siger.Middlelayer.Common; ...@@ -12,6 +12,11 @@ using Siger.Middlelayer.Common;
using Siger.Middlelayer.Share.Enum.ModuleEnum; using Siger.Middlelayer.Share.Enum.ModuleEnum;
using Siger.Middlelayer.Repository; using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Log; using Siger.Middlelayer.Log;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Common.Helpers;
using Siger.Middlelayer.Utility.Helpers;
using Siger.Middlelayer.Utility.ImportEntities;
using System.IO;
// 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
...@@ -95,17 +100,79 @@ namespace Siger.ApiACC.Controllers ...@@ -95,17 +100,79 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(output); return new ObjectResult(output);
} }
[HttpGet] [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) 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>();
if (section != 0) if (section != 0)
{ {
ids = _sigerProjectLevelSection.GetLevelSectionIds(section, ProjectId).ToList(); ids = _sigerProjectLevelSection.GetLevelSectionIds(section, ProjectId).ToList();
} }
var resulst = _automationTaskList.GetTasklistPagedList(ids, tasktype, productCode, taskno, sn, status, actionType, triggerbegin, triggerend, complatebegin, complatend, ProjectId,page,pageSize); var resulst = _automationTaskList.GetTasklistPagedList(ids, tasktype, productCode, taskno, sn, status, actionType, triggerbegin, triggerend, complatebegin, complatend, ProjectId,page,pageSize,toexcel);
if(toexcel.ToInt() == 1)
{
return ExportExcel(resulst.Data);
}
return new PagedObjectResult(resulst, resulst.Total, page, pageSize); return new PagedObjectResult(resulst, resulst.Total, page, pageSize);
} }
public IActionResult ExportExcel(IEnumerable<ResponseAutomationTasklist> data)
{
var rootDir = FileSystemHelper.GetPhysicalFolders(FileSystemHelper.CommonFileSetting.PhysicalFolder, FileSystemHelper.ExportFileName);
if (!data.Any())
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var dataList = new List<AutomationStateList>();
foreach (var item in data)
{
var model = Mapper<ResponseAutomationTasklist, AutomationStateList>.Map(item);
switch (item.status)
{
case 1:
model.status_value = "待执行";
break;
case 2:
model.status_value = "执行中";
break;
case 3:
model.status_value = "执行完成";
break;
case 4:
model.status_value = "取消";
break;
default:
model.status_value = "";
break;
}
dataList.Add(model);
}
if (dataList.Any())
{
EpPlusExcelHelper<AutomationStateList> helper = null;
try
{
helper = new EpPlusExcelHelper<AutomationStateList>();
var temporaryFileName = $"任务清单管理_AutomationTaskData_{DateTime.Now:yyyyMMddHHmmss}.xlsx";
helper.GenerateExcel(dataList, Path.Combine(rootDir, temporaryFileName));
return new ObjectResult($"{FileSystemHelper.CommonFileSetting.RequestPath}/{FileSystemHelper.ExportFileName}/{temporaryFileName}");
}
catch (Exception e)
{
Logger.WriteLineError("Export Fixture Automation Task Data failed, error:" + e);
throw new BadRequestException(RequestEnum.ExportFailed);
}
finally
{
helper?.Dispose();
}
}
throw new BadRequestException(CommonEnum.Fail);
}
public IActionResult DeleteTask(int id) public IActionResult DeleteTask(int id)
{ {
var record = _automationTaskList.Get(f => f.id == id); var record = _automationTaskList.Get(f => f.id == id);
......
...@@ -135,12 +135,12 @@ namespace Siger.ApiACC.Controllers ...@@ -135,12 +135,12 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ProductNotFound); throw new BadRequestException(RequestEnum.ProductNotFound);
} }
//var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid || var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.fixturetools == fixtureTool.guid &&
// q.productid == req.productid.ToInt())); q.productid == req.productid.ToInt());
//if (data != null) if (data != null)
//{ {
// throw new BadRequestException(RequestEnum.DataExist); throw new BadRequestException(RequestEnum.DataExist);
//} }
var entity = new siger_automation_fixture_tools_product var entity = new siger_automation_fixture_tools_product
{ {
...@@ -190,8 +190,8 @@ namespace Siger.ApiACC.Controllers ...@@ -190,8 +190,8 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ProductNotFound); throw new BadRequestException(RequestEnum.ProductNotFound);
} }
var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid || var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.fixturetools == fixtureTool.guid &&
q.productid == req.productid.ToInt()) && q.id != req.id); q.productid == req.productid.ToInt() && q.id != req.id);
if (data != null) if (data != null)
{ {
throw new BadRequestException(RequestEnum.DataExist); throw new BadRequestException(RequestEnum.DataExist);
......
...@@ -68,6 +68,10 @@ namespace Siger.ApiACC.Controllers ...@@ -68,6 +68,10 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ProductNotFound); throw new BadRequestException(RequestEnum.ProductNotFound);
} }
if (string.IsNullOrEmpty(req.sn))
{
throw new BadRequestException(RequestEnum.PleaseInputPartSerialNumber);
}
var maxLevel = _levelRepository.GetList(t => t.status == (int)RowState.Valid && t.projectid == ProjectId).Max(q => q.id); var maxLevel = _levelRepository.GetList(t => t.status == (int)RowState.Valid && t.projectid == ProjectId).Max(q => q.id);
var section = _levelSectionRepository.Get(t => t.status == (int)RowState.Valid && t.projectid == ProjectId && t.id == req.sectionid); var section = _levelSectionRepository.Get(t => t.status == (int)RowState.Valid && t.projectid == ProjectId && t.id == req.sectionid);
if (section == null || section.levelid != maxLevel) if (section == null || section.levelid != maxLevel)
...@@ -262,6 +266,7 @@ namespace Siger.ApiACC.Controllers ...@@ -262,6 +266,7 @@ namespace Siger.ApiACC.Controllers
{ {
try try
{ {
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表
} }
...@@ -324,9 +329,16 @@ namespace Siger.ApiACC.Controllers ...@@ -324,9 +329,16 @@ namespace Siger.ApiACC.Controllers
if (monitor==null) if (monitor==null)
{ {
Logger.WriteLineInfo($"检验工站{section} monitor 为空"); Logger.WriteLineInfo($"检验工站{section} monitor 为空");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
//找到上下料位
var tasklst = _automationTaskList.Get(f => f.no == monitor.taskno);
if (tasklst==null)
{
Logger.WriteLineInfo($"检验工站{section} tasklst 为空");
throw new BadRequestException(CommonEnum.RecordNotFound);
} }
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual); var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
_automationTaskList.Insert(new siger_automation_task_list _automationTaskList.Insert(new siger_automation_task_list
{ {
no = taskNo, no = taskNo,
...@@ -350,7 +362,8 @@ namespace Siger.ApiACC.Controllers ...@@ -350,7 +362,8 @@ namespace Siger.ApiACC.Controllers
productcode = productcode, productcode = productcode,
processid = routeid, processid = routeid,
programnumber = "", programnumber = "",
remark = "质量检验", remark = "质量检验->上下料位置",
extend1=tasklst.sectionid.ToString(),//上下料位发起到检验的工站
}); });
monitor.taskno = taskNo; monitor.taskno = taskNo;
......
...@@ -14,6 +14,7 @@ using Siger.Middlelayer.Repository; ...@@ -14,6 +14,7 @@ using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Extensions; using Siger.Middlelayer.Repository.Extensions;
using System.Linq; using System.Linq;
using Siger.Middlelayer.Repository.Entities; using Siger.Middlelayer.Repository.Entities;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
namespace Siger.ApiACC.Controllers namespace Siger.ApiACC.Controllers
{ {
...@@ -22,50 +23,61 @@ namespace Siger.ApiACC.Controllers ...@@ -22,50 +23,61 @@ namespace Siger.ApiACC.Controllers
private readonly IUnitOfWork _unitOfWork; private readonly IUnitOfWork _unitOfWork;
private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository; private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository;
private readonly ISigerProjectLevelSectionRepository _levelSectionRepository; private readonly ISigerProjectLevelSectionRepository _levelSectionRepository;
private readonly IProductionBeatSetRepository _beatSetRepository;
private readonly IAutomationFixtureMonitor _fixtureMonitor; private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductRouteRepository _routeRepository;
private readonly IAutomationTaskListRepository _taskListRepository;
private readonly ISigerProjectProductRepository _productRepository;
public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository, public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IProductionBeatSetRepository beatSetRepository, ISigerProjectLevelSectionRepository levelSectionRepository, IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository,
IAutomationFixtureMonitor fixtureMonitor) IAutomationTaskListRepository taskListRepository, ISigerProjectProductRepository productRepository)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sectionPropertyRepository = sectionPropertyRepository; _sectionPropertyRepository = sectionPropertyRepository;
_levelSectionRepository = levelSectionRepository; _levelSectionRepository = levelSectionRepository;
_beatSetRepository = beatSetRepository;
_fixtureMonitor = fixtureMonitor; _fixtureMonitor = fixtureMonitor;
_routeRepository = routeRepository;
_productRepository = productRepository;
} }
[HttpGet] [HttpGet]
public IActionResult GetSections(string line) public IActionResult GetSections(string line)
{ {
var sectionIds = _levelSectionRepository.GetLevelSectionIds(line.ToInt(), ProjectId); var sectionIds = _levelSectionRepository.GetLevelSectionIds(line.ToInt(), ProjectId);
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid)). var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid) &&
Select(q => q.sectionid).ToList(); q.propertytype == (int)Automation.SectionPropertyEnum.Check).Select(q => q.sectionid).ToList();
var sections = _levelSectionRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && sectionids.Contains(q.id)). 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(); Select(q => new { q.id, q.title }).ToList();
return new ObjectResult(sections); return new ObjectResult(sections);
} }
[HttpGet] [HttpGet]
public IActionResult GetRouteByProduct(string productId, int sectionId) public IActionResult GetRouteByProduct(string productId)
{ {
var list = _beatSetRepository.GetList(q => q.projectID == ProjectId && q.status == (int)RowState.Valid && q.product_name.ToInt() == productId.ToInt() && var list = _routeRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.productId == productId.ToInt()).Select(q => new
q.section_id == sectionId).Select(q => new {
{ q.id,
q.id, q.name,
name = q.route_name, route_number = q.serialNumber
q.route_number }).ToList();
}).ToList();
return new ObjectResult(list); return new ObjectResult(list);
} }
[HttpGet] [HttpGet]
public IActionResult GetSn(int sectionid) public IActionResult GetMonitorSnProduct(int sectionid)
{ {
var monitor = _fixtureMonitor.Get(sectionid); var res = new ResponseMonitorSnProduct();
return new ObjectResult(monitor?.sn ?? ""); var monitor = _fixtureMonitor.Get(q => q.section == sectionid);
if(monitor != null)
{
var product = _productRepository.Get(monitor.productId);
res.id = monitor.productId;
res.name = product?.name ?? "";
res.code = monitor.productCode;
res.sn = monitor.sn;
}
return new ObjectResult(res);
} }
} }
} }
...@@ -3,8 +3,10 @@ using Newtonsoft.Json; ...@@ -3,8 +3,10 @@ using Newtonsoft.Json;
using Siger.Middlelayer.AccRepository.Request; using Siger.Middlelayer.AccRepository.Request;
using Siger.Middlelayer.Common; using Siger.Middlelayer.Common;
using Siger.Middlelayer.Common.Configuration; using Siger.Middlelayer.Common.Configuration;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Common.Helpers; using Siger.Middlelayer.Common.Helpers;
using Siger.Middlelayer.Common.Log; using Siger.Middlelayer.Common.Log;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -43,10 +45,17 @@ namespace Siger.ApiACC.Tasks ...@@ -43,10 +45,17 @@ namespace Siger.ApiACC.Tasks
var task = tasks.FirstOrDefault(); var task = tasks.FirstOrDefault();
if (task.send == 1) if (task.send == 1)
return; return;
var levelsction = dbhelper.GetLevelsection(task.sectionid);
var section = task.sectionid;
//抽检台-》上料位特殊逻辑
if (task.action== Automation.TaskAction.Step_CJT_SXLW)
{
section = task.extend1.ToInt();
}
var levelsction = dbhelper.GetLevelsection(section);
if (levelsction == null) if (levelsction == null)
return; return;
var attr = dbhelper.GetAttribution(task.sectionid); var attr = dbhelper.GetAttribution(section);
if (attr == null) if (attr == null)
return; return;
...@@ -66,7 +75,8 @@ namespace Siger.ApiACC.Tasks ...@@ -66,7 +75,8 @@ namespace Siger.ApiACC.Tasks
RobotStep = (int)task.action, RobotStep = (int)task.action,
StorageNo = task.locationid, StorageNo = task.locationid,
SN = task.sn, SN = task.sn,
Program = task.programnumber Program = task.programnumber,
TaskType = (int)task.tasktype
}; };
Logger.WriteLineError($"TASK 开始下发 : {EnumHelper.GetEnumDesc(task.action)}"); Logger.WriteLineError($"TASK 开始下发 : {EnumHelper.GetEnumDesc(task.action)}");
......
...@@ -344,6 +344,8 @@ namespace Siger.Middlelayer.Common.ModuleEnum ...@@ -344,6 +344,8 @@ namespace Siger.Middlelayer.Common.ModuleEnum
TaskIsSend, TaskIsSend,
[Description("该储位无工件")] [Description("该储位无工件")]
LocationNoSn, LocationNoSn,
[Description("工站属性为空")]
SectionPropertyNull
} }
public enum SeriNumCfg public enum SeriNumCfg
......
...@@ -15,11 +15,13 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum ...@@ -15,11 +15,13 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary> /// <summary>
/// 手动任务 /// 手动任务
/// </summary> /// </summary>
Manual=1, [Description("手动任务")]
Manual =1,
/// <summary> /// <summary>
/// 自动任务 /// 自动任务
/// </summary> /// </summary>
Auto=2 [Description("自动任务")]
Auto =2
} }
/// <summary> /// <summary>
/// 执行任务 任务发方式 0,未执行 1 手动执行 2 自动执行 /// 执行任务 任务发方式 0,未执行 1 手动执行 2 自动执行
...@@ -29,14 +31,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum ...@@ -29,14 +31,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary> /// <summary>
/// 未执行 /// 未执行
/// </summary> /// </summary>
[Description("未执行")]
None=0, None=0,
/// <summary> /// <summary>
/// 手动执行 /// 手动执行
/// </summary> /// </summary>
[Description("手动执行")]
Manual = 1, Manual = 1,
/// <summary> /// <summary>
/// 自动执行 /// 自动执行
/// </summary> /// </summary>
[Description("自动执行")]
Auto = 2 Auto = 2
} }
/// <summary> /// <summary>
...@@ -71,14 +76,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum ...@@ -71,14 +76,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary> /// <summary>
/// 待生产 /// 待生产
/// </summary> /// </summary>
[Description("待生产")]
Waiting = 1, Waiting = 1,
/// <summary> /// <summary>
/// 生产中 /// 生产中
/// </summary> /// </summary>
[Description("生产中")]
Produce = 2, Produce = 2,
/// <summary> /// <summary>
/// 生产完成 /// 生产完成
/// </summary> /// </summary>
[Description("生产完成")]
Complated = 3 Complated = 3
} }
...@@ -156,5 +164,22 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum ...@@ -156,5 +164,22 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
[Description("不在库内")] [Description("不在库内")]
Out =2 Out =2
} }
/// <summary>
/// 1:上下料工位2:加工工位3:检验工位4:清洗5:存储工位
/// </summary>
public enum SectionPropertyEnum
{
[Description("上下料工位")]
UpDownLoad = 1,
[Description("加工工位")]
Machining = 2,
[Description("检验工位")]
Check = 3,
[Description("清洗")]
Clean = 3,
[Description("存储工位")]
Storage = 3,
}
} }
} }
...@@ -1544,5 +1544,8 @@ namespace Siger.Middlelayer.Common ...@@ -1544,5 +1544,8 @@ namespace Siger.Middlelayer.Common
[Description("请填写仓库名称")] [Description("请填写仓库名称")]
PleaseInputWarehouseName, PleaseInputWarehouseName,
[Description("请输入工件编号")]
PleaseInputPartSerialNumber,
} }
} }
...@@ -249,4 +249,45 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -249,4 +249,45 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("维护时间")] [ExcelColumn("维护时间")]
public string UpdateTime { get; set; } public string UpdateTime { get; set; }
} }
public class AutomationStateList : ImportBase
{
[ExcelColumn("任务编号")]
public string taskno { get; set; }
[ExcelColumn("产线层级")]
public string section { get; set; }
[ExcelColumn("触发方")]
public string trigger { get; set; }
[ExcelColumn("任务类型")]
public string tasktype { get; set; }
[ExcelColumn("工件编号")]
public string sn { get; set; }
[ExcelColumn("工单编号")]
public string ordernumber { get; set; }
[ExcelColumn("产品编号")]
public string productCode { get; set; }
[ExcelColumn("工序编号")]
public string routeNo { get; set; }
[ExcelColumn("工序名称")]
public string route { get; set; }
[ExcelColumn("程序号")]
public string program { get; set; }
[ExcelColumn("储位位置")]
public string location { get; set; }
[ExcelColumn("工装编号")]
public string fixtureCode { get; set; }
[ExcelColumn("动作")]
public string action { get; set; }
[ExcelColumn("执行类型")]
public string actionType { get; set; }
[ExcelColumn("状态")]
public string status_value { get; set; }
[ExcelColumn("触发时间")]
public string triggerTime { get; set; }
[ExcelColumn("完成时间")]
public string complatetime { get; set; }
}
} }
...@@ -169,5 +169,7 @@ namespace Siger.Middlelayer.AccRepository ...@@ -169,5 +169,7 @@ namespace Siger.Middlelayer.AccRepository
public DbSet<siger_automation_fixture_tools_monitor> siger_automation_fixture_tools_moniter { get; set; } public DbSet<siger_automation_fixture_tools_monitor> siger_automation_fixture_tools_moniter { get; set; }
public DbSet<siger_check_sn_trace_inspection> siger_check_sn_trace_inspection { get; set; } public DbSet<siger_check_sn_trace_inspection> siger_check_sn_trace_inspection { get; set; }
public DbSet<siger_check_sn_trace_detail> siger_check_sn_trace_detail { get; set; }
} }
} }
...@@ -15,17 +15,17 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -15,17 +15,17 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public int sectionid { get; set; } public int sectionid { get; set; }
/// <summary> /// <summary>
/// 1:上下料工位2:加工工位3:检验工位4:装配工位5:存储工位 /// 1:上下料工位2:加工工位3:检验工位4:清洗5:存储工位
/// </summary> /// </summary>
public int propertytype { get; set; } public int propertytype { get; set; }
/// <summary> /// <summary>
/// 0:不是上料1:是上料 /// 0:不是上料1:是上料
/// </summary> /// </summary>
public string upload { get; set; } public int upload { get; set; }
/// <summary> /// <summary>
/// 0:不是下料1:是下料 /// 0:不是下料1:是下料
/// </summary> /// </summary>
public string down { get; set; } public int down { get; set; }
public DateTime createtime { get; set; } public DateTime createtime { get; set; }
......
...@@ -102,6 +102,9 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -102,6 +102,9 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public string remark { get; set; } public string remark { get; set; }
/// <summary>
/// 准备前往下一个工站ID
/// </summary>
public string extend1 { get; set; } public string extend1 { get; set; }
public int route { get; set; } public int route { get; set; }
......
...@@ -171,15 +171,15 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -171,15 +171,15 @@ namespace Siger.Middlelayer.AccRepository.Repositories
} }
if(fixtureTool != null && product != null) if(fixtureTool != null && product != null)
{ {
var data = _context.siger_automation_fixture_tools_product.FirstOrDefault(q => q.projectId == projectid && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid || var data = _context.siger_automation_fixture_tools_product.FirstOrDefault(q => q.projectId == projectid && q.status == (int)RowState.Valid && q.fixturetools == fixtureTool.guid &&
q.productid == product.id)); q.productid == product.id);
if (data != null) if (data != null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}"); errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
} }
} }
if(list.Count(q => q.FixtureTool == item.FixtureTool || q.Product == item.Product) > 1) if(list.Count(q => q.FixtureTool == item.FixtureTool && q.Product == item.Product) > 1)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}"); errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
} }
......
...@@ -89,7 +89,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -89,7 +89,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
} }
public IPagedCollectionResult<ResponseAutomationTasklist> GetTasklistPagedList(List<int> sections, int taskType, string productCode, string TaskNo, string sn, int status, int actionType, string tirbeigin, string triend, string compbegin, string compend, int projectid, int page, int pagesize) public IPagedCollectionResult<ResponseAutomationTasklist> GetTasklistPagedList(List<int> sections, int taskType, string productCode, string TaskNo, string sn, int status, int actionType, string tirbeigin, string triend, string compbegin, string compend, int projectid, int page, int pagesize, string toexcel)
{ {
var query = from q in _context.siger_automation_task_list var query = from q in _context.siger_automation_task_list
join t in _context.siger_automation_fixture_tools on q.fixtureguid equals t.guid join t in _context.siger_automation_fixture_tools on q.fixtureguid equals t.guid
...@@ -121,8 +121,10 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -121,8 +121,10 @@ namespace Siger.Middlelayer.AccRepository.Repositories
route=r!=null?$"{r.serialNumber}-{r.name}":"", route=r!=null?$"{r.serialNumber}-{r.name}":"",
send=q.send, send=q.send,
tasktype=EnumHelper.GetEnumDesc(q.tasktype), tasktype=EnumHelper.GetEnumDesc(q.tasktype),
tasktypeid = Convert.ToInt32(q.tasktype),
status=q.status, status=q.status,
actionTypeid = Convert.ToInt32(q.actiontype)
}; };
Expression<Func<ResponseAutomationTasklist, bool>> sectonsExpression = f => true; Expression<Func<ResponseAutomationTasklist, bool>> sectonsExpression = f => true;
if (sections.Any()) if (sections.Any())
...@@ -165,14 +167,26 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -165,14 +167,26 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
comptimeExpression = q => q.complatevalue >= compbegin.ToDateTime() && q.complatevalue <= compend.ToDateTime(); comptimeExpression = q => q.complatevalue >= compbegin.ToDateTime() && q.complatevalue <= compend.ToDateTime();
} }
Expression<Func<ResponseAutomationTasklist, bool>> statusExpression = f => true;
if (status != 0)
{
statusExpression = q => q.status == status;
}
var expression = sectonsExpression.And(taskTypeExpression).And(productCodeExpression).And(tasknoExpression).And(snExpression) var expression = sectonsExpression.And(taskTypeExpression).And(productCodeExpression).And(tasknoExpression).And(snExpression)
.And(actionTypeExpression).And(triggerTimeTypeExpression).And(comptimeExpression); .And(actionTypeExpression).And(triggerTimeTypeExpression).And(comptimeExpression).And(statusExpression);
if (toexcel.ToInt() == 1)
var entities = query.Where(expression).Skip((page - 1) * pagesize).Take(pagesize).AsNoTracking().ToList(); {
var totalCount = query.Where(expression).Count(); var entities = query.Where(expression).AsNoTracking().ToList();
return new PagedCollectionResult<ResponseAutomationTasklist>(entities, totalCount); return new PagedCollectionResult<ResponseAutomationTasklist>(entities, entities.Count);
}
else
{
var entities = query.Where(expression).Skip((page - 1) * pagesize).Take(pagesize).AsNoTracking().ToList();
var totalCount = query.Where(expression).Count();
return new PagedCollectionResult<ResponseAutomationTasklist>(entities, totalCount);
}
} }
} }
} }
...@@ -26,6 +26,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -26,6 +26,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
string CreateRandonSn(string productCode); string CreateRandonSn(string productCode);
IPagedCollectionResult<ResponseAutomationTasklist> GetTasklistPagedList(List<int> sections, int taskType, string productCode, string TaskNo, string sn, int status, int actionType, string tirbeigin,string triend,string compbegin, string compend, int projectid, int page, int pagesize); IPagedCollectionResult<ResponseAutomationTasklist> GetTasklistPagedList(List<int> sections, int taskType, string productCode, string TaskNo, string sn, int status, int actionType, string tirbeigin,string triend,string compbegin, string compend, int projectid, int page, int pagesize, string toexcel);
} }
} }
...@@ -37,6 +37,8 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -37,6 +37,8 @@ namespace Siger.Middlelayer.AccRepository.Request
public string Program { get; set; } public string Program { get; set; }
public int LineID { get; set; } public int LineID { get; set; }
public int TaskType { get; set; }
} }
public class ResponsePlC public class ResponsePlC
......
...@@ -162,4 +162,16 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -162,4 +162,16 @@ namespace Siger.Middlelayer.AccRepository.Response
public int son_categoryid { get; set; } public int son_categoryid { get; set; }
public int son_status { get; set; } public int son_status { get; set; }
} }
public class ResponseMonitorSnProduct
{
public string sn { get; set; } = string.Empty;
public int id { get; set; } = 0;
public string name { get; set; } = string.Empty;
public string code { get; set; } = string.Empty;
}
} }
...@@ -56,6 +56,7 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -56,6 +56,7 @@ namespace Siger.Middlelayer.AccRepository.Response
public int Machine { get; set; } public int Machine { get; set; }
public string Pn { get; set; } public string Pn { get; set; }
public int ProductId { get; set; } public int ProductId { get; set; }
public string ProductCode { get; set; }
public string ProductName { get; set; } public string ProductName { get; set; }
public int Route { get; set; } public int Route { get; set; }
public string RouteName { get; set; } public string RouteName { get; set; }
......
...@@ -38,7 +38,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -38,7 +38,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
from m in mm.DefaultIfEmpty() from m in mm.DefaultIfEmpty()
join s in _context.siger_project_level_section on q.sectionid equals s.id into ss join s in _context.siger_project_level_section on q.sectionid equals s.id into ss
from s in ss.DefaultIfEmpty() from s in ss.DefaultIfEmpty()
join r in _context.siger_project_beat_set 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()
join u1 in _context.siger_project_user on q.send_mid equals u1.mid into uu1 join u1 in _context.siger_project_user on q.send_mid equals u1.mid into uu1
from u1 in uu1.DefaultIfEmpty() from u1 in uu1.DefaultIfEmpty()
...@@ -60,7 +60,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -60,7 +60,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
check_time = (q.check_time.HasValue && q.check_time != DateTime.Now) ? check_time = (q.check_time.HasValue && q.check_time != DateTime.Now) ?
q.check_time.Value.ToString(ParameterConstant.DateTimeFormat) : "", q.check_time.Value.ToString(ParameterConstant.DateTimeFormat) : "",
routeid = q.routeid, routeid = q.routeid,
routename = r.route_name ?? "", routename = r.name ?? "",
materialid = q.materialid, materialid = q.materialid,
materialname = m.name ?? "", materialname = m.name ?? "",
materialpn = m.pn ?? "", materialpn = m.pn ?? "",
......
...@@ -34,7 +34,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -34,7 +34,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
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 m in _context.siger_tr_materials on q.materialid equals m.id into mm join m in _context.siger_tr_materials on q.materialid equals m.id into mm
from m in mm.DefaultIfEmpty() from m in mm.DefaultIfEmpty()
join r in _context.siger_project_beat_set 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()
join u1 in _context.siger_user on q.send_mid equals u1.id into uu1 join u1 in _context.siger_user on q.send_mid equals u1.id into uu1
from u1 in uu1.DefaultIfEmpty() from u1 in uu1.DefaultIfEmpty()
...@@ -58,7 +58,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories ...@@ -58,7 +58,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
sectionid = q.sectionid, sectionid = q.sectionid,
sectionname = s.title ?? "", sectionname = s.title ?? "",
routeid = q.routeid, routeid = q.routeid,
routename = r.route_name ?? "", routename = r.name ?? "",
testroom = q.testroom, testroom = q.testroom,
sn = q.sn, sn = q.sn,
checktype = q.check_type, checktype = q.check_type,
......
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