Commit a3993cc5 by yiyu.li
parents 06281e07 1d7315b5
......@@ -139,7 +139,7 @@
<div>正在上传...</div>
</Spin>
<div class="filter">
<label>父工装类</label>
<label>父工装类</label>
<Cascader
class="searchSelect"
:data="typeTree"
......@@ -172,7 +172,7 @@
<div style="padding-left: 50px">
<div class="filter">
<label>子工装类</label>
<label>子工装类</label>
<Cascader
class="searchSelect"
:data="typeTree"
......@@ -432,35 +432,6 @@ export default {
},
},
{
title: "备注",
key: "remark",
},
{
title: "附件",
key: "filename",
render: (h, params) => {
return h(
"span",
{
style: {
color: "#2b85e4",
cursor: "pointer",
},
on: {
click: () => {
let name = params.row.filename;
let url = params.row.fileurl;
if (url) {
this.downFile(url, name);
}
},
},
},
params.row.filename
);
},
},
{
title: "维护人",
key: "updator",
},
......
......@@ -103,7 +103,7 @@ namespace Siger.ApiACC.Controllers
var machintAttr = _sigerProjectMachineAttribution.Get(f => f.station == section.id);
if(machintAttr==null)
{
Logger.WriteLineInfo($"GetloadStation 未配置清洗工站字典");
Logger.WriteLineInfo($"GetloadStation 未配置工站字典");
continue;
}
var loadStatus = (int)Automation.MachineStatus.Waiting;
......@@ -118,8 +118,10 @@ namespace Siger.ApiACC.Controllers
section=section.id,
updatetime=DateTime.Now
});
}else
{
loadStatus = machineStatus.status;
}
data.Add(new ResponseLoadStation {
......@@ -128,6 +130,8 @@ namespace Siger.ApiACC.Controllers
status=loadStatus
});
}
_unitOfWork.Commit();
return new ObjectResult(data);
}
......@@ -145,14 +149,14 @@ namespace Siger.ApiACC.Controllers
var monitor = _automationFixtureMonitor.Get(f => f.section == section);
var result = new ResponsePlanlFixtureInfo
{
OrderNumber = monitor.ordernumber,
FixtureGuid=monitor.fixtureguid,
FixtureName=monitor.fixturename,
ProductCode=monitor.productCode,
ProductName=monitor.productName,
Sn=monitor.sn,
status=monitor.status,
Location=monitor.locationId,
OrderNumber = monitor!=null? monitor.ordernumber:"",
FixtureGuid = monitor != null ? monitor.fixtureguid:"",
FixtureName = monitor != null ? monitor.fixturename:"",
ProductCode = monitor != null ? monitor.productCode:"",
ProductName = monitor != null ? monitor.productName:"",
Sn = monitor != null ? monitor.sn:"",
status = monitor != null ? monitor.status:(int)Automation.MachineStatus.Waiting,
Location = monitor != null ? monitor.locationId:0,
};
return new ObjectResult(result);
}
......@@ -200,7 +204,7 @@ namespace Siger.ApiACC.Controllers
section = loading.section,
machineid = machineAttr.machine,
projectId = ProjectId,
status = (int)Automation.MachineStatus.Produce,
status = (int)Automation.MachineStatus.Waiting,
updatetime = DateTime.Now
});
}
......@@ -281,6 +285,7 @@ namespace Siger.ApiACC.Controllers
createtime=DateTime.Now,
updatetime=DateTime.Now,
status=(int)Automation.MachineStatus.Produce,
productId=plan.product_id,
productCode=plan.product_code,
productName=plan.product_name,
ordernumber=plandts.OrderNumber,
......@@ -293,6 +298,7 @@ namespace Siger.ApiACC.Controllers
monitor.section = loading.section;
monitor.updatetime = DateTime.Now;
monitor.status = (int)Automation.MachineStatus.Produce;
monitor.productId = plan.product_id;
monitor.productName = plan.product_name;
monitor.productCode = plan.product_code;
monitor.ordernumber = plandts.OrderNumber;
......@@ -334,10 +340,10 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MachineOnFree);
}
if (machineStatus.status == (int)Automation.MachineStatus.Complated)
{
throw new BadRequestException(AccEnum.MachineProCompalate);
}
//if (machineStatus.status == (int)Automation.MachineStatus.Complated)
//{
// throw new BadRequestException(AccEnum.MachineProCompalate);
//}
if (!_automationTaskList.CanTask(ProjectId, assemble.section))
{
......@@ -349,6 +355,8 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MonitorNotfound);
}
//移出 上料位
monitor.status = (int)Automation.MachineStatus.Waiting;
......@@ -368,7 +376,7 @@ namespace Siger.ApiACC.Controllers
completetime = DateTime.MinValue,
trigger = Automation.TaskTrigerType.Manual,
projectId = ProjectId,
productid = 0,
productid = monitor.productId,
sn = monitor.sn,
ordercode = monitor.ordernumber,
fixtureguid = monitor.fixtureguid,
......
......@@ -69,6 +69,7 @@ namespace Siger.ApiACC.Controllers
item.sn = fixture.sn;
item.fixtureCode = fixture.fixtureguid;
item.fixtureName = fixture.fixturename;
item.status = fixture.status;
}
result.Add(item);
......
......@@ -41,7 +41,7 @@ namespace Siger.ApiACC.Controllers
[HttpGet]
public IActionResult GetPageList(string category, string code, string name, string state, int page, int pagesize, string toexcel = "")
{
var data = _toolsAssemblyRepository.GetPagedList(category.ToInt(), code, name,state.ToInt(), ProjectId, page, pagesize, toexcel);
var data = _toolsAssemblyRepository.GetPagedList(category.ToInt(), code, name, state, ProjectId, page, pagesize, toexcel);
var categorys = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid).ToList();
var list = new List<ResponseAumationFixtureToolsAssembly>();
foreach(var item in data.Data)
......@@ -69,6 +69,9 @@ namespace Siger.ApiACC.Controllers
var parentcateIds1 = parentcates1.Select(q => q.id).ToList();
parentcateIds1.Reverse();
model.parentcategoryids = parentcateIds1;
model.fileurl = item.fileurl;
model.filename = item.filename;
model.remark = item.remark;
models.Add(model);
}
item.childrens = models;
......@@ -101,6 +104,7 @@ namespace Siger.ApiACC.Controllers
ParentPartNumber = item.partnumber,
ParentFixtureTool = item.name,
ParentSpecfication = item.specfication,
ParentCode = item.code,
Category = "",
FixtureTool = "",
PartNumber = "",
......@@ -120,10 +124,12 @@ namespace Siger.ApiACC.Controllers
ParentPartNumber = son.parentpartnumber,
ParentFixtureTool = son.parentname,
ParentSpecfication = son.parentspecfication,
ParentCode = item.parentcode,
Category = son.category,
FixtureTool = son.name,
PartNumber = son.partnumber,
Specfication = son.specfication,
Code = son.code,
Status = son.status == (int)RowState.Valid ? "可用" : "停用",
Remark = son.remark,
Updator = son.updator,
......@@ -204,7 +210,28 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.LevelCountError);
}
if (_toolsAssemblyRepository.Get(q => q.projectId == ProjectId && q.son == parentGuid) == null)
if (parentExsit != null)
{
parentExsit.filename = req.filename;
parentExsit.attachment = req.fileurl;
parentExsit.remark = req.remark;
parentExsit.updator = UserId;
parentExsit.updatetime = DateTime.Now;
//var sons = _toolsAssemblyRepository.GetList(q => q.parent == parentExsit.son && q.projectId == ProjectId).ToList();
//if (req.status.ToInt() == (int)RowState.Invalid && sons.Count(q => q.status == (int)RowState.Invalid) == sons.Count)
//{
// parentExsit.status = (int)RowState.Invalid;
//}
//else
//{
// parentExsit.status = (int)RowState.Valid;
//}
_toolsAssemblyRepository.Update(parentExsit);
}
if (parentExsit == null)
{
var parentEntity = new siger_automation_fixture_tools_assembly
{
......@@ -221,6 +248,7 @@ namespace Siger.ApiACC.Controllers
status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid,
remark = req.remark
};
_toolsAssemblyRepository.Insert(parentEntity);
}
......@@ -289,7 +317,28 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.LevelCountError);
}
if (_toolsAssemblyRepository.Get(q => q.projectId == ProjectId && q.son == parentGuid) == null)
if (parentExsit != null)
{
parentExsit.filename = req.filename;
parentExsit.attachment = req.fileurl;
parentExsit.remark = req.remark;
parentExsit.updator = UserId;
parentExsit.updatetime = DateTime.Now;
//var sons = _toolsAssemblyRepository.GetList(q => q.parent == parentExsit.son && q.projectId == ProjectId).ToList();
//if (req.status.ToInt() == (int)RowState.Invalid && sons.Count(q => q.status == (int)RowState.Invalid) == sons.Count)
//{
// parentExsit.status = (int)RowState.Invalid;
//}
//else
//{
// parentExsit.status = (int)RowState.Valid;
//}
_toolsAssemblyRepository.Update(parentExsit);
}
if (parentExsit == null)
{
var parentEntity = new siger_automation_fixture_tools_assembly
{
......
......@@ -79,6 +79,9 @@ namespace Siger.Middlelayer.Utility.ImportEntities
public class FixtureToolsProductTemplate : ImportBase
{
[ExcelColumn("工装类型")]
public string Categroy { get; set; }
[ExcelColumn("*工装名称")]
public string FixtureTool { get; set; }
......@@ -121,9 +124,15 @@ namespace Siger.Middlelayer.Utility.ImportEntities
public class FixtureToolsAssmeblyTemplate : ImportBase
{
[ExcelColumn("父工装类型")]
public string ParentCategory { get; set; }
[ExcelColumn("*父工装名称")]
public string ParentFixtureTool { get; set; }
[ExcelColumn("子工装类型")]
public string Category { get; set; }
[ExcelColumn("*子工装名称")]
public string FixtureTool { get; set; }
......@@ -148,6 +157,9 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("父工装规格")]
public string ParentSpecfication { get; set; }
[ExcelColumn("父工装编号")]
public string ParentCode { get; set; }
[ExcelColumn("子工装类型")]
public string Category { get; set; }
......@@ -160,6 +172,9 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("子工装规格")]
public string Specfication { get; set; }
[ExcelColumn("子工装编号")]
public string Code { get; set; }
[ExcelColumn("状态")]
public string Status { get; set; }
......
......@@ -40,6 +40,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
public DateTime updatetime { get; set; }
public string ordernumber { get; set; }
/// <summary>
/// 产品ID
/// </summary>
public int productId { get; set; }
/// <summary>
///
/// </summary>
public string productCode { get; set; }
......
......@@ -38,6 +38,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public string route { get; set; }
/// <summary>
/// 工序顺序
/// </summary>
public int routenum { get; set; }
/// <summary>
/// 附件
/// </summary>
......
......@@ -24,7 +24,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context = context;
}
public IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, int state, int projectid, int page, int pagesize, string toexcel = "")
public IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, string state, int projectid, int page, int pagesize, string toexcel = "")
{
var query = from q in _context.siger_automation_fixture_tools_assembly
join t1 in _context.siger_automation_fixture_tools on q.parent equals t1.guid into tt1
......@@ -61,7 +61,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
parentcategoryid = c1 == null ? 0 : c1.id,
parentcategory = c1.name ?? "",
parentpartnumber = t1.partnumber ?? "",
parentspecfication = t1.specification ?? ""
parentspecfication = t1.specification ?? "",
parentcode = t1.code ?? ""
};
Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> categoryExpression = f => true;
if (category > 0)
......@@ -79,9 +80,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
nameExpression = q => q.name.Contains(name);
}
Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> stateExpression = f => true;
if (state > 0)
if (!string.IsNullOrEmpty(state))
{
stateExpression = q => q.status == state;
stateExpression = q => q.status == state.ToInt();
}
var expression = categoryExpression.And(codeExpression).And(nameExpression).And(stateExpression);
if (toexcel.ToInt() == 1)
......
......@@ -33,9 +33,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join w in _context.siger_wms_storage on l.storageid equals w.id
join u in _context.siger_project_user on q.updator equals u.mid into uu
from u in uu.DefaultIfEmpty()
join m in _context.siger_automation_fixture_tools_moniter on q.fixturetools equals m.fixtureguid into mm
from m in mm.DefaultIfEmpty()
join r in _context.siger_project_beat_set on m.route equals r.id into rr
join r in _context.siger_project_beat_set on q.routeid equals r.id into rr
from r in rr.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid
select new ResponseAutomationLocation
......@@ -57,7 +55,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
updator = u.name ?? "",
status = q.status,
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : "",
sn = m.sn ?? "",
sn = q.sn ?? "",
route = r.route_name ?? "",
routenumber = r == null ? "" : r.route_number.ToString(),
cate_guid = c.guid ?? "",
......@@ -104,8 +102,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join c in _context.siger_automation_fixture_tools_category on t.category equals c.guid
join l in _context.siger_wms_storage_location on q.locationid equals l.locationid
join w in _context.siger_wms_storage on l.storageid equals w.id
join m in _context.siger_automation_fixture_tools_moniter on q.fixturetools equals m.fixtureguid into mm
from m in mm.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid
select new ResponseAutomationLocationList
{
......@@ -120,7 +116,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
fixturetoolid = t.id,
code = t.code,
name = t.name,
materialsn = m.sn ?? "",
materialsn = q.sn ?? "",
categoryid = c == null ? 0 : c.id
};
var entities = query.AsNoTracking().ToList();
......
......@@ -27,7 +27,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public bool CanTask(int projectId,int section)
{
var taskObj = _context.siger_automation_task_list.FirstOrDefault(f => f.projectId == projectId && f.status >= (int)TaskResultStatus.Cancel && f.status < (int)TaskResultStatus.Complated);
var taskObj = _context.siger_automation_task_list.FirstOrDefault(f => f.projectId == projectId && f.status < (int)TaskResultStatus.Complated);
if (taskObj==null)
return true;
......
......@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public interface IAutomationFixtureToolsAssemblyRepository : IAccRepositoryBase<siger_automation_fixture_tools_assembly>
{
IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, int state, int projectid, int page, int pagesize, string toexcel = "");
IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, string state, int projectid, int page, int pagesize, string toexcel = "");
IEnumerable<ResponseAumationFixtureToolsAssembly> GetDetailList(string parent, int projectid);
......
......@@ -152,5 +152,6 @@ namespace Siger.Middlelayer.AccRepository.Response
public string parentcategory { get; set; }
public string parentpartnumber { get; set; }
public string parentspecfication { get; set; }
public string parentcode { get; set; }
}
}
......@@ -28,4 +28,16 @@ namespace Siger.Middlelayer.AccRepository.Response
/// </summary>
public string fixture { get; set; }
}
public class ResponseAutomationLocationRouteInfo
{
public string fixture { get; set; }
public string ordernumber { get; set; }
public string sn { get; set; }
public int location { get; set; }
public string productCode { get; set; }
public string route { get; set; }
public string pn { get; set; }
}
}
......@@ -267,6 +267,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` (
-- ----------------------------
CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
......@@ -275,6 +276,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`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 '工序',
`routenum` int(11) NULL DEFAULT 0 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 '附件名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
......@@ -401,7 +403,7 @@ CREATE TABLE `siger_automation_produce_history` (
`statusid` int(11) NOT NULL DEFAULT 0 COMMENT '设备状态ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '产线ID',
`projectid` int(11) NOT NULL DEFAULT 0,
`productid` int(1) NOT NULL DEFAULT 1 COMMENT '产品ID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productcode` 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 COMMENT '储位ID',
......@@ -432,6 +434,7 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
`createtime` 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 '工令单',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`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,
......
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