Commit a478442c by yiyu.li
parents 9c5a7d93 2da17f65
......@@ -742,6 +742,7 @@ export default {
'9000517': '请填写子工装编号',
'9000518': '请填写储位ID',
'9000519': '请填写仓库名称',
'9000520': '请输入工件编号',
'9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty',
......
......@@ -769,6 +769,7 @@ export default {
'9000517': '请填写子工装编号',
'9000518': '请填写储位ID',
'9000519': '请填写仓库名称',
'9000520': '请输入工件编号',
'9100000': '部门不能为空',
......
......@@ -295,7 +295,7 @@ export default {
},
{
title: "储位编号",
key: "locationcode",
key: "locationid",
},
{
title: "工装编号",
......@@ -318,7 +318,7 @@ export default {
},
{
title: "储位编号",
key: "locationcode",
key: "locationid",
},
{
title: "工装编号",
......
......@@ -37,7 +37,7 @@
>
<Option
v-for="(item, index) in productList"
:value="item.id"
:value="item.code"
:key="index"
:label="
item.name +
......@@ -75,7 +75,7 @@
clearable
filterable
class="searchSelect"
v-model="state"
v-model="status"
>
<Option :value="1">待执行</Option>
<Option :value="2">执行中</Option>
......@@ -296,7 +296,7 @@ export default {
productList: [],
taskNumber: "",
sn: "",
state: 0,
status: 0,
performType: 0,
startTime: [],
endTime: [],
......@@ -326,6 +326,7 @@ export default {
complatend: this.endTime.length > 0 ? this.endTime[1] : "",
page: page,
pageSize: pagesize,
TaskNo: this.taskNumber,
};
this.axios
.request({
......@@ -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() {
// 初始化产线层级
this.axios
......@@ -454,17 +441,33 @@ export default {
this.endTime = val;
},
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
.request({
url: "",
data,
method: "",
url: "/acc/AutomationState/GetTasklist",
params,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) {
window.location.href =
axios.publicPath + "" + res.data.data;
this.axios.publicPath + "" + res.data.data;
} else {
this.$Message.error(this.$t(res.data.msg));
}
......
......@@ -690,14 +690,21 @@ export default {
axios
.request({
url:
"/qms/InspectStandard/GetProductsBySectionId?sectionid=" +
"/acc/SectionProperty/GetMonitorSnProduct?sectionid=" +
stationid,
method: "get",
})
.then((res) => {
if (res.data.ret == 1 && res.data.data.length > 0) {
this.productList = res.data.data;
if (res.data.ret == 1 && res.data.data.id > 0) {
this.productList = [
{
id:res.data.data.id,
name:res.data.data.name,
code:res.data.data.code,
}
];
this.product = this.productList[0];
this.qrcode = res.data.data.sn;
this.initmaterial(this.product.id, stationid);
this.inititems();
} else {
......@@ -715,21 +722,6 @@ export default {
this.initproduct(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) {
this.c = i;
this.product = this.productList[i];
......
......@@ -12,6 +12,11 @@ using Siger.Middlelayer.Common;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
using Siger.Middlelayer.Repository;
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
namespace Siger.ApiACC.Controllers
......@@ -95,17 +100,79 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(output);
}
[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>();
if (section != 0)
{
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);
}
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)
{
var record = _automationTaskList.Get(f => f.id == id);
......
......@@ -135,12 +135,12 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.ProductNotFound);
}
//var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid ||
// q.productid == req.productid.ToInt()));
//if (data != null)
//{
// throw new BadRequestException(RequestEnum.DataExist);
//}
var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.fixturetools == fixtureTool.guid &&
q.productid == req.productid.ToInt());
if (data != null)
{
throw new BadRequestException(RequestEnum.DataExist);
}
var entity = new siger_automation_fixture_tools_product
{
......@@ -190,8 +190,8 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.ProductNotFound);
}
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);
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);
if (data != null)
{
throw new BadRequestException(RequestEnum.DataExist);
......
......@@ -68,6 +68,10 @@ namespace Siger.ApiACC.Controllers
{
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 section = _levelSectionRepository.Get(t => t.status == (int)RowState.Valid && t.projectid == ProjectId && t.id == req.sectionid);
if (section == null || section.levelid != maxLevel)
......@@ -262,6 +266,7 @@ namespace Siger.ApiACC.Controllers
{
try
{
CreateTaskList(req.sectionid, req.productid, product.code, req.sn, req.routeid.ToInt());
AddSnList(req.materialid.ToInt(), inspection, product.code, section.parentid);//把二维码插入到 sn_list表
}
......@@ -324,9 +329,16 @@ namespace Siger.ApiACC.Controllers
if (monitor==null)
{
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);
_automationTaskList.Insert(new siger_automation_task_list
{
no = taskNo,
......@@ -350,7 +362,8 @@ namespace Siger.ApiACC.Controllers
productcode = productcode,
processid = routeid,
programnumber = "",
remark = "质量检验",
remark = "质量检验->上下料位置",
extend1=tasklst.sectionid.ToString(),//上下料位发起到检验的工站
});
monitor.taskno = taskNo;
......
......@@ -14,6 +14,7 @@ using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Extensions;
using System.Linq;
using Siger.Middlelayer.Repository.Entities;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
namespace Siger.ApiACC.Controllers
{
......@@ -22,50 +23,61 @@ namespace Siger.ApiACC.Controllers
private readonly IUnitOfWork _unitOfWork;
private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository;
private readonly ISigerProjectLevelSectionRepository _levelSectionRepository;
private readonly IProductionBeatSetRepository _beatSetRepository;
private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductRouteRepository _routeRepository;
private readonly IAutomationTaskListRepository _taskListRepository;
private readonly ISigerProjectProductRepository _productRepository;
public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IProductionBeatSetRepository beatSetRepository,
IAutomationFixtureMonitor fixtureMonitor)
ISigerProjectLevelSectionRepository levelSectionRepository, IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository,
IAutomationTaskListRepository taskListRepository, ISigerProjectProductRepository productRepository)
{
_unitOfWork = unitOfWork;
_sectionPropertyRepository = sectionPropertyRepository;
_levelSectionRepository = levelSectionRepository;
_beatSetRepository = beatSetRepository;
_fixtureMonitor = fixtureMonitor;
_routeRepository = routeRepository;
_productRepository = productRepository;
}
[HttpGet]
public IActionResult GetSections(string line)
{
var sectionIds = _levelSectionRepository.GetLevelSectionIds(line.ToInt(), ProjectId);
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid)).
Select(q => q.sectionid).ToList();
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid) &&
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)).
Select(q => new { q.id, q.title }).ToList();
return new ObjectResult(sections);
}
[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() &&
q.section_id == sectionId).Select(q => new
{
q.id,
name = q.route_name,
q.route_number
}).ToList();
var list = _routeRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.productId == productId.ToInt()).Select(q => new
{
q.id,
q.name,
route_number = q.serialNumber
}).ToList();
return new ObjectResult(list);
}
[HttpGet]
public IActionResult GetSn(int sectionid)
public IActionResult GetMonitorSnProduct(int sectionid)
{
var monitor = _fixtureMonitor.Get(sectionid);
return new ObjectResult(monitor?.sn ?? "");
var res = new ResponseMonitorSnProduct();
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;
using Siger.Middlelayer.AccRepository.Request;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Common.Configuration;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Common.Helpers;
using Siger.Middlelayer.Common.Log;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -43,10 +45,17 @@ namespace Siger.ApiACC.Tasks
var task = tasks.FirstOrDefault();
if (task.send == 1)
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)
return;
var attr = dbhelper.GetAttribution(task.sectionid);
var attr = dbhelper.GetAttribution(section);
if (attr == null)
return;
......@@ -66,7 +75,8 @@ namespace Siger.ApiACC.Tasks
RobotStep = (int)task.action,
StorageNo = task.locationid,
SN = task.sn,
Program = task.programnumber
Program = task.programnumber,
TaskType = (int)task.tasktype
};
Logger.WriteLineError($"TASK 开始下发 : {EnumHelper.GetEnumDesc(task.action)}");
......
......@@ -344,6 +344,8 @@ namespace Siger.Middlelayer.Common.ModuleEnum
TaskIsSend,
[Description("该储位无工件")]
LocationNoSn,
[Description("工站属性为空")]
SectionPropertyNull
}
public enum SeriNumCfg
......
......@@ -15,11 +15,13 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary>
/// 手动任务
/// </summary>
Manual=1,
[Description("手动任务")]
Manual =1,
/// <summary>
/// 自动任务
/// </summary>
Auto=2
[Description("自动任务")]
Auto =2
}
/// <summary>
/// 执行任务 任务发方式 0,未执行 1 手动执行 2 自动执行
......@@ -29,14 +31,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary>
/// 未执行
/// </summary>
[Description("未执行")]
None=0,
/// <summary>
/// 手动执行
/// </summary>
[Description("手动执行")]
Manual = 1,
/// <summary>
/// 自动执行
/// </summary>
[Description("自动执行")]
Auto = 2
}
/// <summary>
......@@ -71,14 +76,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary>
/// 待生产
/// </summary>
[Description("待生产")]
Waiting = 1,
/// <summary>
/// 生产中
/// </summary>
[Description("生产中")]
Produce = 2,
/// <summary>
/// 生产完成
/// </summary>
[Description("生产完成")]
Complated = 3
}
......@@ -156,5 +164,22 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
[Description("不在库内")]
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
[Description("请填写仓库名称")]
PleaseInputWarehouseName,
[Description("请输入工件编号")]
PleaseInputPartSerialNumber,
}
}
......@@ -249,4 +249,45 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("维护时间")]
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
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_detail> siger_check_sn_trace_detail { get; set; }
}
}
......@@ -15,17 +15,17 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public int sectionid { get; set; }
/// <summary>
/// 1:上下料工位2:加工工位3:检验工位4:装配工位5:存储工位
/// 1:上下料工位2:加工工位3:检验工位4:清洗5:存储工位
/// </summary>
public int propertytype { get; set; }
/// <summary>
/// 0:不是上料1:是上料
/// </summary>
public string upload { get; set; }
public int upload { get; set; }
/// <summary>
/// 0:不是下料1:是下料
/// </summary>
public string down { get; set; }
public int down { get; set; }
public DateTime createtime { get; set; }
......
......@@ -102,6 +102,9 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public string remark { get; set; }
/// <summary>
/// 准备前往下一个工站ID
/// </summary>
public string extend1 { get; set; }
public int route { get; set; }
......
......@@ -171,15 +171,15 @@ namespace Siger.Middlelayer.AccRepository.Repositories
}
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 ||
q.productid == product.id));
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);
if (data != null)
{
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}");
}
......
......@@ -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
join t in _context.siger_automation_fixture_tools on q.fixtureguid equals t.guid
......@@ -121,8 +121,10 @@ namespace Siger.Middlelayer.AccRepository.Repositories
route=r!=null?$"{r.serialNumber}-{r.name}":"",
send=q.send,
tasktype=EnumHelper.GetEnumDesc(q.tasktype),
tasktypeid = Convert.ToInt32(q.tasktype),
status=q.status,
actionTypeid = Convert.ToInt32(q.actiontype)
};
Expression<Func<ResponseAutomationTasklist, bool>> sectonsExpression = f => true;
if (sections.Any())
......@@ -165,14 +167,26 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
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)
.And(actionTypeExpression).And(triggerTimeTypeExpression).And(comptimeExpression);
.And(actionTypeExpression).And(triggerTimeTypeExpression).And(comptimeExpression).And(statusExpression);
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);
if (toexcel.ToInt() == 1)
{
var entities = query.Where(expression).AsNoTracking().ToList();
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
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
public string Program { get; set; }
public int LineID { get; set; }
public int TaskType { get; set; }
}
public class ResponsePlC
......
......@@ -162,4 +162,16 @@ namespace Siger.Middlelayer.AccRepository.Response
public int son_categoryid { 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
public int Machine { get; set; }
public string Pn { get; set; }
public int ProductId { get; set; }
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int Route { get; set; }
public string RouteName { get; set; }
......
......@@ -38,7 +38,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
from m in mm.DefaultIfEmpty()
join s in _context.siger_project_level_section on q.sectionid equals s.id into ss
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()
join u1 in _context.siger_project_user on q.send_mid equals u1.mid into uu1
from u1 in uu1.DefaultIfEmpty()
......@@ -60,7 +60,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
check_time = (q.check_time.HasValue && q.check_time != DateTime.Now) ?
q.check_time.Value.ToString(ParameterConstant.DateTimeFormat) : "",
routeid = q.routeid,
routename = r.route_name ?? "",
routename = r.name ?? "",
materialid = q.materialid,
materialname = m.name ?? "",
materialpn = m.pn ?? "",
......
......@@ -34,7 +34,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
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
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()
join u1 in _context.siger_user on q.send_mid equals u1.id into uu1
from u1 in uu1.DefaultIfEmpty()
......@@ -58,7 +58,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
sectionid = q.sectionid,
sectionname = s.title ?? "",
routeid = q.routeid,
routename = r.route_name ?? "",
routename = r.name ?? "",
testroom = q.testroom,
sn = q.sn,
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