Commit ac9f9fc6 by yucheng.jiang
parents 69010208 92407c33
...@@ -975,7 +975,7 @@ export default { ...@@ -975,7 +975,7 @@ export default {
savedata() { savedata() {
this.resultData.details = []; this.resultData.details = [];
this.resultData.productid = this.product.id; this.resultData.productid = this.product.id;
this.resultData.materialid = this.material.id; this.resultData.routeid = this.material.id;
this.resultData.sectionid = this.station.id; this.resultData.sectionid = this.station.id;
this.resultData.sn = this.qrcode; this.resultData.sn = this.qrcode;
this.resultData.checktype = this.checktype.id; this.resultData.checktype = this.checktype.id;
......
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
page: this.page, page: this.page,
pageSize: this.pagesize, pageSize: this.pagesize,
id: this.whid, // 仓库id id: this.whid, // 仓库id
isWarehouse: 1, isWavehouse: 1,
}; };
this.detailobj = {}; this.detailobj = {};
this.request("/wms/Location/GetLocationList", data, "get").then( this.request("/wms/Location/GetLocationList", data, "get").then(
......
...@@ -135,15 +135,38 @@ namespace Siger.ApiACC.Controllers ...@@ -135,15 +135,38 @@ namespace Siger.ApiACC.Controllers
[HttpGet] [HttpGet]
public IActionResult GetLoadingState(int section) public IActionResult GetLoadingState(int section)
{ {
var data = new ResponseAutomationInfo var monitor = _automationFixtureMonitor.Get(f => f.section == section);
var result = new ResponsePlanlFixtureInfo
{ {
sn = "sn0001", OrderNumber = monitor.ordernumber,
wo = "wo123123" ProductCode=monitor.productCode,
ProductName=monitor.productName,
Sn=monitor.sn,
status=monitor.status,
Location=monitor.locationId,
}; };
return new ObjectResult(data); return new ObjectResult(result);
}
/// <summary>
/// 扫描
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet]
public IActionResult ScanCode(string code)
{
var result = _automationFixtureToolsProduct.GetPlanFixtureInfo(ProjectId, code);
if (result==null)
{
throw new BadRequestException(CncEnum.PlanHasExist);
}
var sn = _automationTaskList.CreateRandonSn(result.ProductCode);
result.Sn = sn;
return new ObjectResult(result);
} }
/// <summary> /// <summary>
/// 准备上料 -生成指令 /// 准备上料 -生成指令 load
/// </summary> /// </summary>
/// <param name="loading"></param> /// <param name="loading"></param>
/// <returns></returns> /// <returns></returns>
...@@ -231,7 +254,10 @@ namespace Siger.ApiACC.Controllers ...@@ -231,7 +254,10 @@ namespace Siger.ApiACC.Controllers
createtime=DateTime.Now, createtime=DateTime.Now,
updatetime=DateTime.Now, updatetime=DateTime.Now,
status=(int)Automation.MachineStatus.Produce, status=(int)Automation.MachineStatus.Produce,
productCode=plan.product_code,
productName=plan.product_name,
ordernumber=plandts.OrderNumber,
locationId= fixtureToolsObj.Location
}); });
} }
else else
...@@ -240,6 +266,10 @@ namespace Siger.ApiACC.Controllers ...@@ -240,6 +266,10 @@ namespace Siger.ApiACC.Controllers
monitor.section = loading.section; monitor.section = loading.section;
monitor.updatetime = DateTime.Now; monitor.updatetime = DateTime.Now;
monitor.status = (int)Automation.MachineStatus.Produce; monitor.status = (int)Automation.MachineStatus.Produce;
monitor.productName = plan.product_name;
monitor.productCode = plan.product_code;
monitor.ordernumber = plandts.OrderNumber;
monitor.locationId = fixtureToolsObj.Location;
_automationFixtureMonitor.Update(monitor); _automationFixtureMonitor.Update(monitor);
} }
...@@ -251,7 +281,7 @@ namespace Siger.ApiACC.Controllers ...@@ -251,7 +281,7 @@ namespace Siger.ApiACC.Controllers
} }
/// <summary> /// <summary>
/// 安装完成 -生成指令 /// 安装完成 -生成指令 unload
/// </summary> /// </summary>
/// <param name="assemble"></param> /// <param name="assemble"></param>
/// <returns></returns> /// <returns></returns>
......
...@@ -34,5 +34,12 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -34,5 +34,12 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 更新时间 /// 更新时间
/// </summary> /// </summary>
public DateTime updatetime { get; set; } public DateTime updatetime { get; set; }
public string ordernumber { get; set; }
/// <summary>
///
/// </summary>
public string productCode { get; set; }
public string productName { get; set; }
public int locationId { get; set; }
} }
} }
...@@ -31,7 +31,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -31,7 +31,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
FixtureId=t.id, FixtureId=t.id,
FixtureGuid=t.guid, FixtureGuid=t.guid,
ProductCode=q.productcode, ProductCode=q.productcode,
Location=l.locationid.ToString(), Location=l.locationid,
}; };
return query.FirstOrDefault(); return query.FirstOrDefault();
} }
...@@ -83,5 +83,25 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -83,5 +83,25 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var totalCount = query.Where(expression).Count(); var totalCount = query.Where(expression).Count();
return new PagedCollectionResult<ResponseAumationFixtureToolsProduct>(entities, totalCount); return new PagedCollectionResult<ResponseAumationFixtureToolsProduct>(entities, totalCount);
} }
public ResponsePlanlFixtureInfo GetPlanFixtureInfo(int projectId, string ordernumber)
{
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
join q in _context.siger_automation_fixture_tools_product on p.product_code equals q.productcode
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
join l in _context.siger_automation_location on t.guid equals l.fixturetools
where q.projectId == projectId && d.OrderNumber == ordernumber && q.status == (int)RowState.Valid && t.status == (int)RowState.Valid
select new ResponsePlanlFixtureInfo
{
OrderNumber = ordernumber,
ProductName = p.product_name,
ProductCode = q.productcode,
Location = l.locationid,
};
return query.FirstOrDefault();
}
} }
} }
...@@ -11,5 +11,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -11,5 +11,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
ResponseProductFixtureInfo GetFixtureInfoByProductCode(int projectId, string productCode); ResponseProductFixtureInfo GetFixtureInfoByProductCode(int projectId, string productCode);
/// <summary>
/// 工令单获取 工装信息
/// </summary>
/// <param name="ordernumber"></param>
/// <returns></returns>
ResponsePlanlFixtureInfo GetPlanFixtureInfo(int projectId, string ordernumber);
} }
} }
...@@ -23,4 +23,18 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -23,4 +23,18 @@ namespace Siger.Middlelayer.AccRepository.Response
/// </summary> /// </summary>
public int Location { get; set; } public int Location { get; set; }
} }
public class ResponsePlanlFixtureInfo
{
/// <summary>
/// 工令单号
/// </summary>
public string OrderNumber { get; set; }
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int status { get; set; }
public int Location { get; set; }
public string Sn { get; set; }
}
} }
...@@ -423,6 +423,10 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` ( ...@@ -423,6 +423,10 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
`routedesc` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前工序', `routedesc` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前工序',
`createtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间', `createtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
`updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间', `updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工令单',
`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 '产品名称',
`locationId` int(11) NOT NULL DEFAULT 0,
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