Commit 26bc8367 by xin.yang
parents d4ba33b9 f997f0e1
...@@ -370,11 +370,12 @@ export default { ...@@ -370,11 +370,12 @@ export default {
this.b = index; this.b = index;
let status = this.stationList[index].status; let status = this.stationList[index].status;
this.sectionid = this.stationList[index].section; this.sectionid = this.stationList[index].section;
// if (status == 3) { if (status == 3) {
// this.attr1 = true; // this.attr1 = true;
// this.tabindex = "2"; // this.tabindex = "2";
// this.getRunningDetail(index); this.getRunningDetail(index);
// } else { }
// else {
// this.attr2 = true; // this.attr2 = true;
// } // }
if (status == 2) { if (status == 2) {
......
...@@ -352,10 +352,10 @@ export default { ...@@ -352,10 +352,10 @@ export default {
bgc = "#ff9900"; bgc = "#ff9900";
} }
if (ele.status == 2) { if (ele.status == 2) {
bgc = "#2db7f5"; bgc = "#19be6b";
} }
if (ele.status == 3) { if (ele.status == 3) {
bgc = "#19be6b"; bgc = "#2db7f5";
} }
ele.bgc = bgc; ele.bgc = bgc;
}); });
......
...@@ -124,20 +124,22 @@ ...@@ -124,20 +124,22 @@
>{{ $t("1001") }}</Button >{{ $t("1001") }}</Button
> >
<!-- --> <!-- -->
<Button <!-- <Button
type="warning" type="warning"
class="twoWord" class="twoWord"
icon="ios-search" icon="ios-search"
@click="cancel()" @click="cancel()"
>取消</Button >取消</Button
><!--只有状态是待执行的可以改成取消--> > -->
<Button <!--只有状态是待执行的可以改成取消-->
<!-- <Button
type="primary" type="primary"
class="twoWord" class="twoWord"
icon="ios-search" icon="ios-search"
@click="manual()" @click="manual()"
>手动</Button >手动</Button
><!--当生产线的模式是手动是才可以进行手动任务执行--> > -->
<!--当生产线的模式是手动是才可以进行手动任务执行-->
<Button <Button
type="primary" type="primary"
class="twoWord" class="twoWord"
......
...@@ -30,10 +30,11 @@ namespace Siger.ApiACC.Controllers ...@@ -30,10 +30,11 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationLocationRepository _autoLocationRepository; private readonly IAutomationLocationRepository _autoLocationRepository;
private readonly IAutomationFixtureMonitor _fixtureMonitor; private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductRouteRepository _routeRepository; private readonly IProductRouteRepository _routeRepository;
private readonly IAutomationFixtureToolsProductRepository _automationFixtureToolsProduct;
public AutomationLocationController(IUnitOfWork unitOfWork, IAutomationFixtureToolsCategoryRepository toolsCategoryRepository, public AutomationLocationController(IUnitOfWork unitOfWork, IAutomationFixtureToolsCategoryRepository toolsCategoryRepository,
IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository, IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository,
IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository) IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_toolsCategoryRepository = toolsCategoryRepository; _toolsCategoryRepository = toolsCategoryRepository;
...@@ -41,6 +42,7 @@ namespace Siger.ApiACC.Controllers ...@@ -41,6 +42,7 @@ namespace Siger.ApiACC.Controllers
_autoLocationRepository = autoLocationRepository; _autoLocationRepository = autoLocationRepository;
_fixtureMonitor = fixtureMonitor; _fixtureMonitor = fixtureMonitor;
_routeRepository = routeRepository; _routeRepository = routeRepository;
_automationFixtureToolsProduct = automationFixtureToolsProduct;
} }
[HttpGet] [HttpGet]
...@@ -192,6 +194,8 @@ namespace Siger.ApiACC.Controllers ...@@ -192,6 +194,8 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.FixtureToolNotFound); throw new BadRequestException(RequestEnum.FixtureToolNotFound);
} }
var fixturetoolProduct = _automationFixtureToolsProduct.Get(f => f.fixturetools == fixturetool.guid);
var location = _autoLocationRepository.GetLocation(req.locationid.ToInt(), ProjectId); var location = _autoLocationRepository.GetLocation(req.locationid.ToInt(), ProjectId);
if (location == null) if (location == null)
{ {
...@@ -209,6 +213,8 @@ namespace Siger.ApiACC.Controllers ...@@ -209,6 +213,8 @@ namespace Siger.ApiACC.Controllers
guid = Guid.NewGuid().ToString(), guid = Guid.NewGuid().ToString(),
locationid = location.locationid, locationid = location.locationid,
fixturetools = fixturetool.guid, fixturetools = fixturetool.guid,
productid= fixturetoolProduct != null ? fixturetoolProduct.productid : 0,
productcode = fixturetoolProduct!=null? fixturetoolProduct.productcode:"",
attachment = req.fileurl, attachment = req.fileurl,
filename = req.filename, filename = req.filename,
remark = req.remark, remark = req.remark,
...@@ -244,6 +250,7 @@ namespace Siger.ApiACC.Controllers ...@@ -244,6 +250,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.FixtureToolNotFound); throw new BadRequestException(RequestEnum.FixtureToolNotFound);
} }
var fixturetoolProduct = _automationFixtureToolsProduct.Get(f => f.fixturetools == fixturetool.guid);
var location = _autoLocationRepository.GetLocation(req.locationid.ToInt(), ProjectId); var location = _autoLocationRepository.GetLocation(req.locationid.ToInt(), ProjectId);
if (location == null) if (location == null)
{ {
...@@ -263,6 +270,9 @@ namespace Siger.ApiACC.Controllers ...@@ -263,6 +270,9 @@ namespace Siger.ApiACC.Controllers
entity.remark = req.remark; entity.remark = req.remark;
entity.updatetime = DateTime.Now; entity.updatetime = DateTime.Now;
entity.updator = UserId; entity.updator = UserId;
entity.productid = fixturetoolProduct != null ? fixturetoolProduct.productid : 0;
entity.productcode = fixturetoolProduct != null ? fixturetoolProduct.productcode : "";
_autoLocationRepository.Update(entity); _autoLocationRepository.Update(entity);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{ {
......
...@@ -35,9 +35,10 @@ namespace Siger.ApiACC.Controllers ...@@ -35,9 +35,10 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureMonitor _automationFixtureMonitor; private readonly IAutomationFixtureMonitor _automationFixtureMonitor;
private readonly IAutomationFixtureToolsProductRepository _automationFixtureToolsProduct; private readonly IAutomationFixtureToolsProductRepository _automationFixtureToolsProduct;
private readonly IAutomationFixtureToolsRepository _automationFixtureTools; private readonly IAutomationFixtureToolsRepository _automationFixtureTools;
private readonly IAutomationLocationRepository _automationLocation;
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) IProductPlanDetails planDetails,IProductPlanRepository productPlan,IAutomationFixtureMonitor automationFixtureMonitor ,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,IAutomationFixtureToolsRepository automationFixtureTools, IAutomationLocationRepository automationLocation)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -50,6 +51,7 @@ namespace Siger.ApiACC.Controllers ...@@ -50,6 +51,7 @@ namespace Siger.ApiACC.Controllers
_automationFixtureMonitor = automationFixtureMonitor; _automationFixtureMonitor = automationFixtureMonitor;
_automationFixtureToolsProduct = automationFixtureToolsProduct; _automationFixtureToolsProduct = automationFixtureToolsProduct;
_automationFixtureTools = automationFixtureTools; _automationFixtureTools = automationFixtureTools;
_automationLocation = automationLocation;
} }
/// <summary> /// <summary>
...@@ -173,7 +175,7 @@ namespace Siger.ApiACC.Controllers ...@@ -173,7 +175,7 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(result); return new ObjectResult(result);
} }
/// <summary> /// <summary>
/// 准备上料 -生成指令 load /// 准备上料 -生成指令 load (立库->上料位)
/// </summary> /// </summary>
/// <param name="loading"></param> /// <param name="loading"></param>
/// <returns></returns> /// <returns></returns>
...@@ -348,6 +350,8 @@ namespace Siger.ApiACC.Controllers ...@@ -348,6 +350,8 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(AccEnum.MonitorNotfound); throw new BadRequestException(AccEnum.MonitorNotfound);
} }
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
{ {
...@@ -376,7 +380,6 @@ namespace Siger.ApiACC.Controllers ...@@ -376,7 +380,6 @@ namespace Siger.ApiACC.Controllers
}); });
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{ {
Logger.WriteLineError($"手动任务创建成功-{Siger.Middlelayer.Common.Helpers.EnumHelper.GetEnumDesc(Automation.TaskAction.Step_SXLW_LK)}"); Logger.WriteLineError($"手动任务创建成功-{Siger.Middlelayer.Common.Helpers.EnumHelper.GetEnumDesc(Automation.TaskAction.Step_SXLW_LK)}");
......
...@@ -38,5 +38,10 @@ namespace Siger.Middlelayer.Share.Constant ...@@ -38,5 +38,10 @@ namespace Siger.Middlelayer.Share.Constant
/// </summary> /// </summary>
public const string UploadloadStation = "LoadStation"; public const string UploadloadStation = "LoadStation";
/// <summary>
/// 立库
/// </summary>
public const string WarehouseStation = "WarehouseStation";
} }
} }
...@@ -334,7 +334,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum ...@@ -334,7 +334,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[Description("设备已经生产完成")] [Description("设备已经生产完成")]
MachineProCompalate, MachineProCompalate,
[Description("该设备当前无工装状态")] [Description("该设备当前无工装状态")]
MonitorNotfound MonitorNotfound,
[Description("未配置字典信息")]
AutomationDictNotfound
} }
public enum SeriNumCfg public enum SeriNumCfg
......
...@@ -18,6 +18,26 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -18,6 +18,26 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 工装GUID /// 工装GUID
/// </summary> /// </summary>
public string fixturetools { get; set; } public string fixturetools { get; set; }
public int productid { get; set; }
public string productcode { get; set; }
/// <summary>
/// 工件对应的工单号
/// </summary>
public string ordernumber { get; set; }
/// <summary>
/// 工装工件
/// </summary>
public string sn { get; set; }
/// <summary>
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public int routeid { get; set; }
/// <summary>
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public string route { get; set; }
/// <summary> /// <summary>
/// 附件 /// 附件
/// </summary> /// </summary>
......
...@@ -97,6 +97,28 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -97,6 +97,28 @@ namespace Siger.Middlelayer.AccRepository.Repositories
} }
} }
/// <summary>
/// 获取 交期最早的订单
/// </summary>
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public IEnumerable<ResponseAutomationPlanOrder> GetDeliveryOrder(List<int>productIds,int projectId)
{
var query = from d in _context.siger_project_product_plan_detail
join p in _context.siger_project_product_plan on d.PlanId equals p.id
where d.projectId == projectId && productIds.Contains(p.product_id) && d.status != (int)RowState.Invalid && p.status != (int)RowState.Invalid
select new ResponseAutomationPlanOrder
{
productId=p.product_id,
ordernumber=d.OrderNumber,
productCode=p.product_code,
productName=p.product_name,
delvery=p.delivery_time,
};
return query.OrderBy(f => f.delvery);
}
public ResponsePlanlFixtureInfo GetPlanFixtureInfo(int projectId, string ordernumber) public ResponsePlanlFixtureInfo GetPlanFixtureInfo(int projectId, string ordernumber)
{ {
......
...@@ -23,5 +23,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -23,5 +23,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
CommonImportResult ImportData(IEnumerable<FixtureToolsProductTemplate> list, int projectid, int userid); CommonImportResult ImportData(IEnumerable<FixtureToolsProductTemplate> list, int projectid, int userid);
/// <summary>
/// 获取交期最近的订单
/// </summary>
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
IEnumerable<ResponseAutomationPlanOrder> GetDeliveryOrder(List<int> productIds, int projectId);
} }
} }
...@@ -40,4 +40,15 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -40,4 +40,15 @@ namespace Siger.Middlelayer.AccRepository.Response
public int Location { get; set; } public int Location { get; set; }
public string Sn { get; set; } public string Sn { get; set; }
} }
public class ResponseAutomationPlanOrder
{
public string ordernumber { get; set; }
public int productId { get; set; }
public string productCode { get; set; }
public string productName { get; set; }
public int delvery { get; set; }
}
} }
...@@ -269,6 +269,12 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` ( ...@@ -269,6 +269,12 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置', `locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID', `fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productcode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工件对应工单号',
`sn` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工件',
`routeid` int(11) NULL DEFAULT 0,
`route` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工序',
`attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件', `attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称', `filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
......
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