Commit 99679107 by yiyu.li
parents 4dde11b9 7de3387d
...@@ -620,7 +620,7 @@ export default { ...@@ -620,7 +620,7 @@ export default {
getRoutesByProduct(val) { getRoutesByProduct(val) {
// 选择产品查询工艺路径 // 选择产品查询工艺路径
let id = 0; let id = 0;
id = val.value?val.value:0; id = val&&val.value?val.value:0;
var params = { var params = {
productId: id, productId: id,
page: 1, page: 1,
......
...@@ -256,7 +256,6 @@ ...@@ -256,7 +256,6 @@
</label> </label>
<DatePicker <DatePicker
class="searchInput" class="searchInput"
:disabled="type == 2 ? true : false"
v-model="addobj.deliverydate" v-model="addobj.deliverydate"
type="date" type="date"
></DatePicker> ></DatePicker>
......
...@@ -396,13 +396,12 @@ export default { ...@@ -396,13 +396,12 @@ export default {
handleSuccess(res, file) { handleSuccess(res, file) {
if (res.ret == 1) { if (res.ret == 1) {
this.$Message.success(this.$t("950398")); this.$Message.success(this.$t("950398"));
this.getCategory(); this.tosearch();
this.search(1, 10);
} else { } else {
if ((res.msg + "").indexOf(",") != -1) { if ((res.msg + "").indexOf(",") != -1) {
inittip(res.msg); inittip(res.msg);
} else { } else {
this.$Message.error(this.$t(res.data)); this.$Message.error(this.$t(res.msg));
} }
} }
}, },
......
...@@ -10,19 +10,23 @@ using Siger.Middlelayer.AccRepository.Response; ...@@ -10,19 +10,23 @@ using Siger.Middlelayer.AccRepository.Response;
using Siger.ApiCommon.Result; using Siger.ApiCommon.Result;
using Siger.Middlelayer.Common; using Siger.Middlelayer.Common;
using Siger.Middlelayer.Share.Enum.ModuleEnum; using Siger.Middlelayer.Share.Enum.ModuleEnum;
using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Log;
// 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
{ {
public class AutomationStateController : BaseController public class AutomationStateController : BaseController
{ {
private readonly IUnitOfWork _unitOfWork;
private readonly ISigerProjectLevelSectionRepository _sigerProjectLevelSection; private readonly ISigerProjectLevelSectionRepository _sigerProjectLevelSection;
private readonly IAutomationMachineStatus _automationMachineStatus; private readonly IAutomationMachineStatus _automationMachineStatus;
private readonly IAutomationTaskListRepository _automationTaskList; private readonly IAutomationTaskListRepository _automationTaskList;
private readonly IAutomationFixtureMonitor _automationFixtureMonitor; private readonly IAutomationFixtureMonitor _automationFixtureMonitor;
public AutomationStateController(ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationMachineStatus automationMachineStatus, IAutomationTaskListRepository automationTaskList, IAutomationFixtureMonitor automationFixtureMonitor) public AutomationStateController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationMachineStatus automationMachineStatus, IAutomationTaskListRepository automationTaskList, IAutomationFixtureMonitor automationFixtureMonitor)
{ {
_unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
_automationMachineStatus = automationMachineStatus; _automationMachineStatus = automationMachineStatus;
_automationTaskList = automationTaskList; _automationTaskList = automationTaskList;
...@@ -102,5 +106,24 @@ namespace Siger.ApiACC.Controllers ...@@ -102,5 +106,24 @@ namespace Siger.ApiACC.Controllers
return new PagedObjectResult(resulst, resulst.Total, page, pageSize); return new PagedObjectResult(resulst, resulst.Total, page, pageSize);
} }
public IActionResult DeleteTask(int id)
{
var record = _automationTaskList.Get(f => f.id == id);
if (record == null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
_automationTaskList.Delete(record);
if (_unitOfWork.Commit() > 0)
{
Logger.WriteLineError($"手动任务创建成功-{Siger.Middlelayer.Common.Helpers.EnumHelper.GetEnumDesc(Automation.TaskAction.Step_LK_SXLW)}");
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
}
} }
} }
...@@ -320,16 +320,11 @@ namespace Siger.ApiACC.Controllers ...@@ -320,16 +320,11 @@ namespace Siger.ApiACC.Controllers
private void CreateTaskList(int section, int productid, string productcode, string sn, int routeid) private void CreateTaskList(int section, int productid, string productcode, string sn, int routeid)
{ {
if (section <= 0 || string.IsNullOrEmpty(sn) || string.IsNullOrEmpty(productcode) || productid <= 0) var monitor = _fixtureMonitor.Get(f => f.section == section);
if (monitor==null)
{ {
return; Logger.WriteLineInfo($"检验工站{section} monitor 为空");
} }
var monitor = _fixtureMonitor.GetList(q => q.section == section && q.sn == sn).OrderByDescending(q => q.updatetime).FirstOrDefault();
if (monitor == null)
{
return;
}
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
...@@ -357,6 +352,7 @@ namespace Siger.ApiACC.Controllers ...@@ -357,6 +352,7 @@ namespace Siger.ApiACC.Controllers
programnumber = "", programnumber = "",
remark = "质量检验", remark = "质量检验",
}); });
monitor.taskno = taskNo;
_unitOfWork.Commit(); _unitOfWork.Commit();
} }
......
...@@ -64,8 +64,7 @@ namespace Siger.ApiACC.Controllers ...@@ -64,8 +64,7 @@ namespace Siger.ApiACC.Controllers
[HttpGet] [HttpGet]
public IActionResult GetSn(int sectionid) public IActionResult GetSn(int sectionid)
{ {
var monitor = _fixtureMonitor.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.section == sectionid).OrderByDescending(q => q.updatetime). var monitor = _fixtureMonitor.Get(sectionid);
FirstOrDefault();
return new ObjectResult(monitor?.sn ?? ""); return new ObjectResult(monitor?.sn ?? "");
} }
} }
......
...@@ -50,11 +50,18 @@ namespace Siger.ApiACC.Tasks ...@@ -50,11 +50,18 @@ namespace Siger.ApiACC.Tasks
if (attr == null) if (attr == null)
return; return;
var fixtrue = dbhelper.GetFixture(task.fixtureguid);
if (fixtrue==null)
{
Logger.WriteLineError($"自动工装未找到");
return;
}
var sendToPLC = new RequestPLC var sendToPLC = new RequestPLC
{ {
ProductCode=task.productcode,
LineID= levelsction.parentid, LineID= levelsction.parentid,
RStation = attr.machine, RStation = attr.machine,
Fixture = task.fixtureguid, Fixture = fixtrue.code,
RequestForm = task.no, RequestForm = task.no,
RobotStep = (int)task.action, RobotStep = (int)task.action,
StorageNo = task.locationid, StorageNo = task.locationid,
......
...@@ -70,6 +70,10 @@ namespace Siger.ApiACC.Tasks ...@@ -70,6 +70,10 @@ namespace Siger.ApiACC.Tasks
{ {
return AccDbContext.siger_project_machine_attribution.FirstOrDefault(f => f.station==section && f.status==1); return AccDbContext.siger_project_machine_attribution.FirstOrDefault(f => f.station==section && f.status==1);
} }
public siger_automation_fixture_tools GetFixture(string guid)
{
return AccDbContext.siger_automation_fixture_tools.FirstOrDefault(f => f.guid==guid && f.status == 1);
}
public void Dispose() public void Dispose()
{ {
CncDbContext?.Dispose(); CncDbContext?.Dispose();
......
...@@ -16,6 +16,7 @@ using Siger.Middlelayer.Utility.Helpers; ...@@ -16,6 +16,7 @@ using Siger.Middlelayer.Utility.Helpers;
using Siger.Middlelayer.Utility.ImportEntities; using Siger.Middlelayer.Utility.ImportEntities;
using Siger.Middlelayer.WmsRepository.Entities; using Siger.Middlelayer.WmsRepository.Entities;
using Siger.Middlelayer.WmsRepository.Repositories.Interface; using Siger.Middlelayer.WmsRepository.Repositories.Interface;
using Siger.Middlelayer.Common.Extensions;
namespace Siger.ApiWMS.Controllers namespace Siger.ApiWMS.Controllers
{ {
...@@ -116,10 +117,19 @@ namespace Siger.ApiWMS.Controllers ...@@ -116,10 +117,19 @@ namespace Siger.ApiWMS.Controllers
var locationTypes = _location_TypeRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid).ToList(); var locationTypes = _location_TypeRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid).ToList();
if (!locationTypes.Any()) if (!locationTypes.Any())
{ {
throw new BadRequestException(RequestEnum.LocationTypeNotFound); return new CommonImportResult(0, string.Join(';', (int)RequestEnum.LocationTypeNotFound));
} }
var sonLocationTypes = GetSonTypes(0, locationTypes).Select(q => new Tuple<int, string>(q.id, q.name)).ToList(); var sonLocationTypes = GetSonTypes(0, locationTypes).Select(q => new Tuple<int, string>(q.id, q.name)).ToList();
var checkResult = excelHelper.CheckExcel(sonLocationTypes);
if (checkResult.Any())
{
return new CommonImportResult(0, string.Join(';', checkResult));
}
var data = excelHelper.ConvertSheetToList(sonLocationTypes); var data = excelHelper.ConvertSheetToList(sonLocationTypes);
if (!data.Any())
{
return new CommonImportResult(0, string.Join(';', (int)CommonEnum.NoData));
}
var result = _locationRepository.ImportStorageLocations(data, ProjectId, UserId); var result = _locationRepository.ImportStorageLocations(data, ProjectId, UserId);
return result; return result;
} }
......
...@@ -148,5 +148,13 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum ...@@ -148,5 +148,13 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
[Description("清洗机->加工中心")] [Description("清洗机->加工中心")]
Step_QXJ_JGZX = 10, Step_QXJ_JGZX = 10,
} }
public enum LocationStatus
{
[Description("在库内")]
In =1,
[Description("不在库内")]
Out =2
}
} }
} }
...@@ -6,6 +6,7 @@ using System.Reflection; ...@@ -6,6 +6,7 @@ using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using OfficeOpenXml; using OfficeOpenXml;
using OfficeOpenXml.Style; using OfficeOpenXml.Style;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Utility.ExcelImport; using Siger.Middlelayer.Utility.ExcelImport;
using Siger.Middlelayer.Utility.ImportEntities; using Siger.Middlelayer.Utility.ImportEntities;
using ExcelColumn = Siger.Middlelayer.Utility.ExcelImport.ExcelColumn; using ExcelColumn = Siger.Middlelayer.Utility.ExcelImport.ExcelColumn;
...@@ -117,6 +118,94 @@ namespace Siger.Middlelayer.Utility.Helpers ...@@ -117,6 +118,94 @@ namespace Siger.Middlelayer.Utility.Helpers
return collection; return collection;
} }
public List<string> CheckExcel(List<Tuple<int, string>> locationTypes)
{
if (Sheet == null)
{
throw new ArgumentNullException(nameof(Sheet));
}
var messages = new List<string>();
var columns = new List<string> { "ID", "仓库名称" };
foreach (var item in locationTypes)
{
columns.Add(item.Item2);
}
var endRow = 2;
for (var row = 2; row <= Sheet.Dimension.Rows; row++)
{
var columnValues = new List<string>();
for (var i = 1; i <= columns.Count; i++)
{
var val = Sheet.Cells[row, i];
if (val != null)
{
columnValues.Add(val.Text);
}
}
if (columnValues.All(string.IsNullOrWhiteSpace))
{
endRow = row - 1;
break;
}
endRow = row;
}
IList<int> rows = new List<int>();
for (var i = 2; i <= endRow; i++)
{
rows.Add(i);
}
foreach (var row in rows)
{
var tnew = new ImportStorageLocations();
int i = 1;
foreach (var col in columns)
{
var cell = Sheet.Cells[row, i];
var val = cell == null ? "" : cell.Value?.ToString() ?? "";
if (i == 1)
{
if (string.IsNullOrEmpty(val))
{
messages.Add($"{row},{(int)RequestEnum.PleaseInputNotZeroIntID}");
return messages;
}
tnew.ID = val;
}
if (i == 2)
{
if (string.IsNullOrEmpty(val))
{
messages.Add($"{row},{(int)RequestEnum.PleaseInputStorageName}");
return messages;
}
tnew.StorageName = val;
}
if (i > 2)
{
var typeId = locationTypes.FirstOrDefault(q => q.Item2 == col);
if (string.IsNullOrEmpty(val))
{
messages.Add(typeId != null ? $"{row}, 请填写{typeId.Item2}" : $"{row}, {(int)RequestEnum.LocationImportFormatError}");
return messages;
}
tnew.Locations.Add(new LocationModels
{
LocationType = typeId == null ? 0 : typeId.Item1,
Location = val
});
}
i++;
}
}
return messages;
}
public void Dispose() public void Dispose()
{ {
Sheet?.Dispose(); Sheet?.Dispose();
......
...@@ -167,5 +167,7 @@ namespace Siger.Middlelayer.AccRepository ...@@ -167,5 +167,7 @@ namespace Siger.Middlelayer.AccRepository
public DbSet<siger_automation_produce_history> siger_automation_produce_history { get; set; } public DbSet<siger_automation_produce_history> siger_automation_produce_history { get; set; }
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; }
} }
} }
...@@ -11,7 +11,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -11,7 +11,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public string fixtureguid { get; set; } public string fixtureguid { get; set; }
/// <summary> /// <summary>
/// 工装名称 /// 工装编号
/// </summary> /// </summary>
public string fixturename { get; set; } public string fixturename { get; set; }
/// <summary> /// <summary>
...@@ -50,5 +50,9 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -50,5 +50,9 @@ namespace Siger.Middlelayer.AccRepository.Entities
public string productName { get; set; } public string productName { get; set; }
public int locationId { get; set; } public int locationId { get; set; }
public int unixtime { get; set; } public int unixtime { get; set; }
/// <summary>
/// 当前任务
/// </summary>
public string taskno { get; set; }
} }
} }
...@@ -30,5 +30,10 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -30,5 +30,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public string program { get; set; } public string program { get; set; }
/// <summary>
/// 1: 自动设备 0:上下料设备
/// </summary>
public int auto { get; set; }
} }
} }
...@@ -186,28 +186,34 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -186,28 +186,34 @@ namespace Siger.Middlelayer.AccRepository.Repositories
if (string.IsNullOrEmpty(item.ParentFixtureTool)) if (string.IsNullOrEmpty(item.ParentFixtureTool))
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputParentFixtureCode}"); errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputParentFixtureCode}");
return new CommonImportResult(0, string.Join(";", errors));
} }
if (string.IsNullOrEmpty(item.FixtureTool)) if (string.IsNullOrEmpty(item.FixtureTool))
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputSonFixtureCode}"); errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputSonFixtureCode}");
return new CommonImportResult(0, string.Join(";", errors));
} }
if (string.IsNullOrEmpty(item.Status)) if (string.IsNullOrEmpty(item.Status))
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputStatus}"); errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputStatus}");
return new CommonImportResult(0, string.Join(";", errors));
} }
if (item.ParentFixtureTool == item.FixtureTool) if (item.ParentFixtureTool == item.FixtureTool)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.ParentSonSame}"); errors.Add($"{rowIndex},{(int)RequestEnum.ParentSonSame}");
return new CommonImportResult(0, string.Join(";", errors));
} }
var parent = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.ParentFixtureTool && q.projectId == projectid); var parent = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.ParentFixtureTool && q.projectId == projectid);
if (parent == null) if (parent == null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}"); errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
return new CommonImportResult(0, string.Join(";", errors));
} }
var son = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.FixtureTool && q.projectId == projectid); var son = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.FixtureTool && q.projectId == projectid);
if (son == null) if (son == null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}"); errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
return new CommonImportResult(0, string.Join(";", errors));
} }
var parentGuid = parent.guid; var parentGuid = parent.guid;
if(son != null && parent != null) if(son != null && parent != null)
...@@ -216,16 +222,19 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -216,16 +222,19 @@ namespace Siger.Middlelayer.AccRepository.Repositories
if (exsit != null) if (exsit != null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}"); errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
return new CommonImportResult(0, string.Join(";", errors));
} }
} }
if (list.Count(q => q.FixtureTool == item.FixtureTool && q.ParentFixtureTool == item.ParentFixtureTool) > 1) if (list.Count(q => q.FixtureTool == item.FixtureTool && q.ParentFixtureTool == item.ParentFixtureTool) > 1)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}"); errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
return new CommonImportResult(0, string.Join(";", errors));
} }
var parentExsit = _context.siger_automation_fixture_tools_assembly.FirstOrDefault(q => q.projectId == projectid && q.son == parentGuid); var parentExsit = _context.siger_automation_fixture_tools_assembly.FirstOrDefault(q => q.projectId == projectid && q.son == parentGuid);
if (parentExsit != null && !string.IsNullOrEmpty(parentExsit.parent)) if (parentExsit != null && !string.IsNullOrEmpty(parentExsit.parent))
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.LevelCountError}"); errors.Add($"{rowIndex},{(int)RequestEnum.LevelCountError}");
return new CommonImportResult(0, string.Join(";", errors));
} }
if (errors.Any()) if (errors.Any())
......
...@@ -121,7 +121,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -121,7 +121,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
var query = from q in _context.siger_automation_fixture_tools var query = from q in _context.siger_automation_fixture_tools
join l in _context.siger_automation_location on q.guid equals l.fixturetools join l in _context.siger_automation_location on q.guid equals l.fixturetools
where q.projectId ==projectId && q.guid==guid && l.locationid==loactionId where q.projectId == projectId && q.guid == guid && l.locationid == loactionId
&& l.status == 1
select new ResponseProductFixtureInfo select new ResponseProductFixtureInfo
{ {
FixtureGuid=q.guid, FixtureGuid=q.guid,
......
...@@ -212,7 +212,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -212,7 +212,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var entity = new siger_automation_location var entity = new siger_automation_location
{ {
guid = Guid.NewGuid().ToString(), guid = Guid.NewGuid().ToString(),
locationid = location.id, location_cid = location.id,
locationid = location.locationid,
fixturetools = fixturetool.guid, fixturetools = fixturetool.guid,
attachment = "", attachment = "",
filename = "", filename = "",
......
...@@ -29,7 +29,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -29,7 +29,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
//已经下发,并且任务完成 //已经下发,并且任务完成
var taskObjs = _context.siger_automation_task_list.Where(f => f.projectId == projectId && f.send==0 ); var taskObjs = _context.siger_automation_task_list.Where(f => f.projectId == projectId && f.send==0 );
if (taskObjs.Any()) if (taskObjs.Any())
{ {
return false; return false;
...@@ -90,7 +89,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -90,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 tiggertime, string comptime, 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)
{ {
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
...@@ -120,7 +119,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -120,7 +119,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
productCode=q.productcode, productCode=q.productcode,
program=q.programnumber, program=q.programnumber,
route=r!=null?$"{r.serialNumber}-{r.name}":"", route=r!=null?$"{r.serialNumber}-{r.name}":"",
send=q.send,
tasktype=EnumHelper.GetEnumDesc(q.tasktype), tasktype=EnumHelper.GetEnumDesc(q.tasktype),
status=q.status, status=q.status,
...@@ -156,15 +155,15 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -156,15 +155,15 @@ namespace Siger.Middlelayer.AccRepository.Repositories
actionTypeExpression = q => q.actionTypeid==actionType; actionTypeExpression = q => q.actionTypeid==actionType;
} }
Expression<Func<ResponseAutomationTasklist, bool>> triggerTimeTypeExpression = f => true; Expression<Func<ResponseAutomationTasklist, bool>> triggerTimeTypeExpression = f => true;
if (!string.IsNullOrEmpty(tiggertime)) if (!string.IsNullOrEmpty(triend) && !string.IsNullOrEmpty(tirbeigin))
{ {
triggerTimeTypeExpression = q => q.triggervalue == tiggertime.ToDateTime(); triggerTimeTypeExpression = q => q.triggervalue >= tirbeigin.ToDateTime() && q.triggervalue<=triend.ToDateTime();
} }
Expression<Func<ResponseAutomationTasklist, bool>> comptimeExpression = f => true; Expression<Func<ResponseAutomationTasklist, bool>> comptimeExpression = f => true;
if (!string.IsNullOrEmpty(comptime)) if (!string.IsNullOrEmpty(compbegin) && !string.IsNullOrEmpty(compend))
{ {
comptimeExpression = q => q.complatevalue == comptime.ToDateTime(); comptimeExpression = q => q.complatevalue >= compbegin.ToDateTime() && q.complatevalue <= compend.ToDateTime();
} }
var expression = sectonsExpression.And(taskTypeExpression).And(productCodeExpression).And(tasknoExpression).And(snExpression) var expression = sectonsExpression.And(taskTypeExpression).And(productCodeExpression).And(tasknoExpression).And(snExpression)
......
...@@ -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 tiggertime, string comptime, 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);
} }
} }
...@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Request
{ {
[Required(ErrorMessage = "guidNotNull")] [Required(ErrorMessage = "guidNotNull")]
/// <summary> /// <summary>
/// 任务列表GUID /// 任务列表taskNo
/// </summary> /// </summary>
public string guid { get; set; } public string guid { get; set; }
[Required(ErrorMessage = "status")] [Required(ErrorMessage = "status")]
......
...@@ -6,6 +6,7 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -6,6 +6,7 @@ namespace Siger.Middlelayer.AccRepository.Request
{ {
public class RequestPLC public class RequestPLC
{ {
public string ProductCode { get; set; }
/// <summary> /// <summary>
/// 工件唯一识别SN /// 工件唯一识别SN
/// </summary> /// </summary>
......
...@@ -46,5 +46,6 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -46,5 +46,6 @@ namespace Siger.Middlelayer.AccRepository.Response
public string triggerTime { get; set; } public string triggerTime { get; set; }
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; }
} }
} }
...@@ -375,6 +375,7 @@ CREATE TABLE `siger_automation_machine_status` ( ...@@ -375,6 +375,7 @@ CREATE TABLE `siger_automation_machine_status` (
`machineid` int NOT NULL DEFAULT '0' COMMENT '工位对应设备ID', `machineid` int NOT NULL DEFAULT '0' COMMENT '工位对应设备ID',
`projectid` int NOT NULL DEFAULT '0', `projectid` int NOT NULL DEFAULT '0',
`enable` int NOT NULL DEFAULT '1' COMMENT '设备可用状态 0:不可用 1:可用', `enable` int NOT NULL DEFAULT '1' COMMENT '设备可用状态 0:不可用 1:可用',
`auto` int NOT NULL DEFAULT '1' COMMENT '设备可用状态 0:上下料设备 1:自动设备',
`status` int NOT NULL DEFAULT '1' COMMENT '完工状态 0:取消 1:待生产 2:生产中 3:生产完成 ', `status` int NOT NULL DEFAULT '1' COMMENT '完工状态 0:取消 1:待生产 2:生产中 3:生产完成 ',
`updatetime` datetime DEFAULT NULL COMMENT '操作时间', `updatetime` datetime DEFAULT NULL COMMENT '操作时间',
`program` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '程序号', `program` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '程序号',
...@@ -445,6 +446,8 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` ( ...@@ -445,6 +446,8 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
`productCode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE', `productCode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`productName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称', `productName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`locationId` int(11) NOT NULL DEFAULT 0, `locationId` int(11) NOT NULL DEFAULT 0,
`unixtime` int(1) NOT NULL DEFAULT 1 COMMENT 'task时间',
`taskno` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务单',
`status` int(1) NOT NULL DEFAULT 1 COMMENT '', `status` int(1) NOT NULL DEFAULT 1 COMMENT '',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
......
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