Commit 7c623c3d by jiawei.su

someupdate

parent f2c648f0
...@@ -44,10 +44,11 @@ namespace Siger.ApiACC.Controllers ...@@ -44,10 +44,11 @@ namespace Siger.ApiACC.Controllers
private readonly IProductRouteRepository _productRoute; private readonly IProductRouteRepository _productRoute;
private readonly IAutomationSectionPropertyRepository _automationSectionProperty; private readonly IAutomationSectionPropertyRepository _automationSectionProperty;
private readonly IAutomationProduceHistoryRepository _automationProduceHistory; private readonly IAutomationProduceHistoryRepository _automationProduceHistory;
private readonly ISigerProjectProductReport _sigerProjectProduct;
public AutomationController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationLineMode automationLineMode, IAutomationMachineStatus automationMachineStatus, ISigerDict sigerDict, IAutomationTaskListRepository automationTaskList, public AutomationController(IUnitOfWork unitOfWork, ISigerProjectLevelSectionRepository sigerProjectLevelSection, IAutomationLineMode automationLineMode, IAutomationMachineStatus automationMachineStatus, ISigerDict sigerDict, IAutomationTaskListRepository automationTaskList,
ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution, IAutomationFixtureMonitor automationFixtureMonitor, IAutomationLocationRepository automationLocation, IProductionBeatSetRepository productionBeatSet, IAutomationFixtureToolsProductRepository automationFixtureToolsProduct, ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution, IAutomationFixtureMonitor automationFixtureMonitor, IAutomationLocationRepository automationLocation, IProductionBeatSetRepository productionBeatSet, IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,
IAutomationFixtureToolsRepository automationFixtureTools, IProductRouteRepository productRoute, IAutomationSectionPropertyRepository automationSectionProperty, IAutomationProduceHistoryRepository automationProduceHistory) IAutomationFixtureToolsRepository automationFixtureTools, IProductRouteRepository productRoute, IAutomationSectionPropertyRepository automationSectionProperty, IAutomationProduceHistoryRepository automationProduceHistory, ISigerProjectProductReport sigerProjectProduct)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -64,6 +65,7 @@ namespace Siger.ApiACC.Controllers ...@@ -64,6 +65,7 @@ namespace Siger.ApiACC.Controllers
_productRoute = productRoute; _productRoute = productRoute;
_automationSectionProperty = automationSectionProperty; _automationSectionProperty = automationSectionProperty;
_automationProduceHistory = automationProduceHistory; _automationProduceHistory = automationProduceHistory;
_sigerProjectProduct = sigerProjectProduct;
} }
/// <summary> /// <summary>
...@@ -335,7 +337,11 @@ namespace Siger.ApiACC.Controllers ...@@ -335,7 +337,11 @@ namespace Siger.ApiACC.Controllers
sectionProperty.down = 0; sectionProperty.down = 0;
_automationSectionProperty.Update(sectionProperty); _automationSectionProperty.Update(sectionProperty);
if (machineStatusObj != null)
{
machineStatusObj.status = (int)Automation.MachineStatus.Waiting;
_automationMachineStatus.Update(machineStatusObj);
}
} }
//从立库储位拿SN 工件到上料位 //从立库储位拿SN 工件到上料位
if (taskObj.action == TaskAction.Step_LK_SXLW) if (taskObj.action == TaskAction.Step_LK_SXLW)
...@@ -387,6 +393,37 @@ namespace Siger.ApiACC.Controllers ...@@ -387,6 +393,37 @@ namespace Siger.ApiACC.Controllers
location.status = (int)LocationStatus.Out; location.status = (int)LocationStatus.Out;
_automationLocation.Update(location); _automationLocation.Update(location);
} }
if(taskObj.action== TaskAction.Step_JGZX_QXJ)
{
var planDts=_
//插入报工记录
var entity = new siger_project_product_report
{
draw_number = "",
plan_id = 0,
product_name = taskObj.productname,
code = taskObj.ordercode,
end_time = UnixTimeHelper.GetNow(),
station = taskObj.sectionid,
industrial_waste = 0,
material_waste = 0,
start_time = UnixTimeHelper.GetNow(),
worker_code = "",
worker_name = "",
uid = 0,
projectid = PID,
time = UnixTimeHelper.GetNow(),
processid = 0,
nok_number = 0,
output = 1,
actual_output = 1,
product_code = taskObj.productcode
};
if (_sigerProjectProduct.InsertProductReportData(entity) < 0)
{
throw new BadRequestException(AccEnum.SyncSnReportErro);
}
}
} }
//抽检台 //抽检台
......
...@@ -46,10 +46,11 @@ namespace Siger.ApiACC.Controllers ...@@ -46,10 +46,11 @@ namespace Siger.ApiACC.Controllers
private readonly IProductRouteRepository _productRoute; private readonly IProductRouteRepository _productRoute;
private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository; private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository;
private readonly IAutomationProduceHistoryRepository _automationProduceHistory; private readonly IAutomationProduceHistoryRepository _automationProduceHistory;
private readonly ISigerProjectProductRepository _sigerProjectProduct;
public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList, public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList,
IProductPlanDetails planDetails,IProductPlanRepository productPlan,IAutomationFixtureMonitor automationFixtureMonitor ,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,IAutomationFixtureToolsRepository automationFixtureTools, IAutomationLocationRepository automationLocation, IProductPlanDetails planDetails,IProductPlanRepository productPlan,IAutomationFixtureMonitor automationFixtureMonitor ,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,IAutomationFixtureToolsRepository automationFixtureTools, IAutomationLocationRepository automationLocation,
IAutomationLineMode automationLine, IProductRouteRepository productRoute, IAutomationSectionPropertyRepository sectionPropertyRepository,IAutomationProduceHistoryRepository automationProduceHistory) IAutomationLineMode automationLine, IProductRouteRepository productRoute, IAutomationSectionPropertyRepository sectionPropertyRepository,IAutomationProduceHistoryRepository automationProduceHistory,ISigerProjectProductRepository sigerProjectProduct )
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -67,6 +68,7 @@ namespace Siger.ApiACC.Controllers ...@@ -67,6 +68,7 @@ namespace Siger.ApiACC.Controllers
_productRoute = productRoute; _productRoute = productRoute;
_sectionPropertyRepository = sectionPropertyRepository; _sectionPropertyRepository = sectionPropertyRepository;
_automationProduceHistory = automationProduceHistory; _automationProduceHistory = automationProduceHistory;
_sigerProjectProduct = sigerProjectProduct;
} }
/// <summary> /// <summary>
...@@ -151,6 +153,12 @@ namespace Siger.ApiACC.Controllers ...@@ -151,6 +153,12 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
var monitor = _automationTaskList.GetList(f =>f.sectionid==section ,"id",true).FirstOrDefault(); var monitor = _automationTaskList.GetList(f =>f.sectionid==section ,"id",true).FirstOrDefault();
var img = string.Empty;
if (monitor!=null)
{
var pd = _sigerProjectProduct.Get(f => f.code == monitor.productcode);
img = pd != null ? pd.image : "";
}
var result = new ResponsePlanlFixtureInfo var result = new ResponsePlanlFixtureInfo
{ {
OrderNumber = monitor!=null? monitor.ordercode:"", OrderNumber = monitor!=null? monitor.ordercode:"",
...@@ -161,6 +169,7 @@ namespace Siger.ApiACC.Controllers ...@@ -161,6 +169,7 @@ namespace Siger.ApiACC.Controllers
Sn = monitor != null ? monitor.sn:"", Sn = monitor != null ? monitor.sn:"",
status = monitor != null ? monitor.status : 0, status = monitor != null ? monitor.status : 0,
Location = monitor != null ? monitor.locationid:0, Location = monitor != null ? monitor.locationid:0,
Url=img
}; };
return new ObjectResult(result); return new ObjectResult(result);
} }
......
...@@ -101,6 +101,17 @@ namespace Siger.ApiACC.Controllers ...@@ -101,6 +101,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>();
......
...@@ -357,7 +357,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum ...@@ -357,7 +357,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[Description("工序加工未完成")] [Description("工序加工未完成")]
RouteProcessing, RouteProcessing,
[Description("工序未开始加工")] [Description("工序未开始加工")]
RouteNotStart RouteNotStart,
[Description("同步报工记录失败")]
SyncSnReportErro
} }
public enum SeriNumCfg public enum SeriNumCfg
......
...@@ -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>
......
...@@ -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; }
}
}
...@@ -49,5 +49,9 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -49,5 +49,9 @@ namespace Siger.Middlelayer.AccRepository.Response
public int send { get; set; } public int send { get; set; }
//0 自动,1,手动执行 //0 自动,1,手动执行
public int excute { get; set; } public int excute { get; set; }
/// <summary>
/// 发起工站
/// </summary>
public string fromsection { 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