Commit 196f1c67 by xin.yang
parents 252958ef 8dae8a1b
...@@ -42,13 +42,8 @@ ...@@ -42,13 +42,8 @@
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle">3.操作</p> <p class="selectTitle">3.操作</p>
<Tabs type="card" :value="tabindex"> <Tabs type="card" :value="tabindex" @on-click="getIndex">
<TabPane <TabPane label="上料" :disabled="attr1" name="1">
label="上料"
:disabled="attr1"
name="1"
@click="getStorages()"
>
<div class="filter"> <div class="filter">
<label style="font-size: 16px" <label style="font-size: 16px"
>上料信息:</label >上料信息:</label
...@@ -113,8 +108,11 @@ ...@@ -113,8 +108,11 @@
}}</span> }}</span>
</p> </p>
<Button type="primary" @click="modal = true" <Button
@on-click="getStorages()">储位选择</Button type="primary"
@click="modal = true"
@on-click="getStorages()"
>储位选择</Button
> >
</div> </div>
<div class="flex"> <div class="flex">
...@@ -136,11 +134,7 @@ ...@@ -136,11 +134,7 @@
> >
</div> </div>
</TabPane> </TabPane>
<TabPane <TabPane label="下料" :disabled="attr2" name="2"
label="下料"
:disabled="attr2"
name="2"
@click="getStorages()"
><div class="flex"> ><div class="flex">
<div> <div>
<Table <Table
...@@ -160,7 +154,7 @@ ...@@ -160,7 +154,7 @@
>工单信息:</span >工单信息:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.orderNumber orderDetail2.orderNumber
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -168,7 +162,7 @@ ...@@ -168,7 +162,7 @@
>产品编号:</span >产品编号:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.productCode orderDetail2.productCode
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -176,7 +170,7 @@ ...@@ -176,7 +170,7 @@
>产品名称:</span >产品名称:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.productName orderDetail2.productName
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -184,7 +178,7 @@ ...@@ -184,7 +178,7 @@
>工件编号:</span >工件编号:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.sn orderDetail2.sn
}}</span> }}</span>
</p> </p>
</div> </div>
...@@ -194,11 +188,11 @@ ...@@ -194,11 +188,11 @@
>状态:</span >状态:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.status == 1 orderDetail2.status == 1
? "待上料" ? "待上料"
: orderDetail.status == 2 : orderDetail2.status == 2
? "运行中" ? "运行中"
: orderDetail.status == 3 : orderDetail2.status == 3
? "待下料" ? "待下料"
: "" : ""
}}</span> }}</span>
...@@ -208,7 +202,7 @@ ...@@ -208,7 +202,7 @@
>储位编号:</span >储位编号:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.location orderDetail2.location
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -216,7 +210,7 @@ ...@@ -216,7 +210,7 @@
>工装编号:</span >工装编号:</span
> >
<span class="info">{{ <span class="info">{{
orderDetail.fixtureGuid orderDetail2.fixtureGuid
}}</span> }}</span>
</p> </p>
</div> </div>
...@@ -337,6 +331,7 @@ export default { ...@@ -337,6 +331,7 @@ export default {
], ],
data2: [], data2: [],
orderDetail: {}, orderDetail: {},
orderDetail2: {},
detailobj: {}, detailobj: {},
sectionid: 0, sectionid: 0,
tabindex: "1", tabindex: "1",
...@@ -390,18 +385,26 @@ export default { ...@@ -390,18 +385,26 @@ 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;
// status = 2;
// 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) {
// this.getRunningDetail(index); // this.getRunningDetail(index);
// } // }
}, },
getIndex(name) {
this.tabindex = name;
if(this.tabindex == '2'){
this.orderDetail2 = {};
}
this.getStorages();
},
//获取储位 //获取储位
getStorages() { getStorages() {
let code = ""; let code = "";
...@@ -431,22 +434,27 @@ export default { ...@@ -431,22 +434,27 @@ export default {
this.request("/acc/AutomationOperate/ScanCode", data, "get") this.request("/acc/AutomationOperate/ScanCode", data, "get")
.then((res) => { .then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
let obj = res.data.data; if (this.tabindex == "2") {
if ( this.orderDetail = {};
obj.url == null ||
obj.url == "" ||
obj.url == undefined
) {
obj.url = "";
} else { } else {
obj.url = this.axios.publicPath + obj.url.slice(4); let obj = res.data.data;
if (
obj.url == null ||
obj.url == "" ||
obj.url == undefined
) {
obj.url = "";
} else {
obj.url =
this.axios.publicPath + obj.url.slice(4);
}
this.orderDetail = Object.assign(
{},
this.orderDetail,
obj
);
this.getStorages();
} }
this.orderDetail = Object.assign(
{},
this.orderDetail,
obj
);
this.getStorages();
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
this.orderDetail = {}; this.orderDetail = {};
...@@ -482,6 +490,10 @@ export default { ...@@ -482,6 +490,10 @@ export default {
this.orderDetail, this.orderDetail,
obj obj
); );
if (this.tabindex == "2") {
this.orderDetail2 = res.data.data;
this.getStorages();
}
} else { } else {
this.$Message.error(this.$t(res.data, msg)); this.$Message.error(this.$t(res.data, msg));
} }
...@@ -585,11 +597,12 @@ export default { ...@@ -585,11 +597,12 @@ export default {
this.orderDetail.location = this.detailobj.locationid; this.orderDetail.location = this.detailobj.locationid;
}, },
handleRowChange1(currentRow, oldCurrentRow) { handleRowChange1(currentRow, oldCurrentRow) {
console.log(currentRow); // console.log(currentRow);
this.locationobj = currentRow; this.locationobj = currentRow;
this.orderDetail.fixtureGuid = this.detailobj.fixtureguid; this.orderDetail.fixtureGuid = this.detailobj.fixtureguid;
this.orderDetail.location = this.detailobj.locationid; this.orderDetail.location = this.detailobj.locationid;
if (this.locationobj.id) { if (this.locationobj.id) {
// this.getRunningDetail();
this.request( this.request(
"/acc/AutomationOperate/ScanCode?id=" + this.locationobj.id, "/acc/AutomationOperate/ScanCode?id=" + this.locationobj.id,
"", "",
...@@ -598,9 +611,9 @@ export default { ...@@ -598,9 +611,9 @@ export default {
.then((res) => { .then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
let obj = res.data.data; let obj = res.data.data;
this.orderDetail = Object.assign( this.orderDetail2 = Object.assign(
{}, {},
this.orderDetail, this.orderDetail2,
obj obj
); );
} else { } else {
......
...@@ -355,12 +355,23 @@ namespace Siger.ApiACC.Controllers ...@@ -355,12 +355,23 @@ namespace Siger.ApiACC.Controllers
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="productcode"></param>
/// <param name="fillsn">0:全部 1: 储位有SN</param> /// <param name="fillsn">0:全部 1: 储位有SN</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public IActionResult GetLocationList(int fillsn=0) public IActionResult GetLocationList(string productcode, int fillsn=0)
{ {
return new ObjectResult(_autoLocationRepository.GetDataList(ProjectId, fillsn).ToList()); var locations = _autoLocationRepository.GetFulllocation(ProjectId, fillsn);
return new ObjectResult(locations);
//if (fillsn == 1)
//{
// var locations = _autoLocationRepository.GetFulllocation(ProjectId,fillsn);
// return new ObjectResult(locations);
//}
//else
//{
// return new ObjectResult(_autoLocationRepository.GetDataList(ProjectId, fillsn, productcode).ToList());
//}
} }
} }
} }
...@@ -535,21 +535,21 @@ namespace Siger.ApiACC.Controllers ...@@ -535,21 +535,21 @@ namespace Siger.ApiACC.Controllers
// return new ObjectResult(CommonEnum.RecordNotFound); // return new ObjectResult(CommonEnum.RecordNotFound);
//} //}
var location = _automationLocation.Get(f => f.locationid == unloading.locationid); var location = _automationLocation.Get(f => f.id == unloading.locationid);
if (location==null) if (location==null)
{ {
return new ObjectResult(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
if (string.IsNullOrEmpty( location.sn)) if (string.IsNullOrEmpty( location.sn))
{ {
return new ObjectResult(AccEnum.LocationNoSn); throw new BadRequestException(AccEnum.LocationNoSn);
} }
var levelSection = _sigerProjectLevelSection.Get(f => f.id == unloading.section); var levelSection = _sigerProjectLevelSection.Get(f => f.id == unloading.section);
var lineMode = _automationLine.Get(f => f.section ==levelSection.parentid); var lineMode = _automationLine.Get(f => f.section ==levelSection.parentid);
if (lineMode==null) if (lineMode==null)
{ {
return new ObjectResult(AccEnum.LineModeNotfound); throw new BadRequestException(AccEnum.LineModeNotfound);
} }
//TODO //TODO
......
...@@ -135,12 +135,12 @@ namespace Siger.ApiACC.Controllers ...@@ -135,12 +135,12 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ProductNotFound); throw new BadRequestException(RequestEnum.ProductNotFound);
} }
var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid || //var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid ||
q.productid == req.productid.ToInt())); // q.productid == req.productid.ToInt()));
if (data != null) //if (data != null)
{ //{
throw new BadRequestException(RequestEnum.DataExist); // throw new BadRequestException(RequestEnum.DataExist);
} //}
var entity = new siger_automation_fixture_tools_product var entity = new siger_automation_fixture_tools_product
{ {
......
...@@ -37,6 +37,8 @@ namespace Siger.ApiACC.Tasks ...@@ -37,6 +37,8 @@ namespace Siger.ApiACC.Tasks
var tasks = tasklist.OrderBy(s => s.actiontype); var tasks = tasklist.OrderBy(s => s.actiontype);
var task = tasks.FirstOrDefault(); var task = tasks.FirstOrDefault();
if (task.send == 1)
return;
var levelsction = dbhelper.GetLevelsection(task.sectionid); var levelsction = dbhelper.GetLevelsection(task.sectionid);
if (levelsction == null) if (levelsction == null)
return; return;
...@@ -56,6 +58,7 @@ namespace Siger.ApiACC.Tasks ...@@ -56,6 +58,7 @@ namespace Siger.ApiACC.Tasks
Program = task.programnumber Program = task.programnumber
}; };
Logger.WriteLineError($"TASK 开始下发 : {EnumHelper.GetEnumDesc(task.action)}");
var result = PushTask(hostDic,sendToPLC, out string message); var result = PushTask(hostDic,sendToPLC, out string message);
if (!result) if (!result)
{ {
......
...@@ -95,17 +95,20 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -95,17 +95,20 @@ namespace Siger.Middlelayer.AccRepository.Repositories
return _context.siger_wms_storage_location.Where(q => q.projectId == projectid && q.status == (int)RowState.Valid); return _context.siger_wms_storage_location.Where(q => q.projectId == projectid && q.status == (int)RowState.Valid);
} }
public IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid,int hasMaterial) public IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid,int hasMaterial,string productcode)
{ {
var query = from q in _context.siger_automation_location var query = from q in _context.siger_automation_location
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
join c in _context.siger_automation_fixture_tools_category on t.category equals c.guid join c in _context.siger_automation_fixture_tools_category on t.category equals c.guid
join tp in _context.siger_automation_fixture_tools_product on t.guid equals tp.fixturetools into tptemp
from tp in tptemp.DefaultIfEmpty()
join l in _context.siger_wms_storage_location on q.location_cid equals l.id join l in _context.siger_wms_storage_location on q.location_cid equals l.id
join w in _context.siger_wms_storage on l.storageid equals w.id join w in _context.siger_wms_storage on l.storageid equals w.id
where q.projectId == projectid && q.status == (int)RowState.Valid where q.projectId == projectid && q.status == (int)RowState.Valid
select new ResponseAutomationLocationList select new ResponseAutomationLocationList
{ {
id = q.id, id = q.id,
typeid=t.id,
fixtureguid = t.guid, fixtureguid = t.guid,
locationid = l.locationid, locationid = l.locationid,
location = l.realname, location = l.realname,
...@@ -117,14 +120,21 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -117,14 +120,21 @@ namespace Siger.Middlelayer.AccRepository.Repositories
code = t.code, code = t.code,
name = t.name, name = t.name,
materialsn = q.sn ?? "", materialsn = q.sn ?? "",
categoryid = c == null ? 0 : c.id categoryid = c == null ? 0 : c.id,
productcode=tp!=null?tp.productcode:""
}; };
Expression<Func<ResponseAutomationLocationList, bool>> locationidExpression = f => true; Expression<Func<ResponseAutomationLocationList, bool>> locationidExpression = f => true;
if (hasMaterial != 0) if (hasMaterial != 0)
{ {
locationidExpression = q =>!string.IsNullOrEmpty(q.materialsn); locationidExpression = q =>!string.IsNullOrEmpty(q.materialsn);
} }
var entities = query.Where(locationidExpression).AsNoTracking().ToList(); Expression<Func<ResponseAutomationLocationList, bool>> producExpression = f => true;
if (!string.IsNullOrEmpty(productcode))
{
producExpression = q => q.productcode==productcode;
}
var expression = locationidExpression.And(producExpression);
var entities = query.Where(expression);
return entities; return entities;
} }
...@@ -200,5 +210,33 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -200,5 +210,33 @@ namespace Siger.Middlelayer.AccRepository.Repositories
throw; throw;
} }
} }
public IEnumerable<ResponseAutomationLocationList> GetFulllocation(int projectId,int full)
{
var query = from q in _context.siger_automation_location
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
where q.projectId==projectId && !string.IsNullOrEmpty(q.sn)
select new ResponseAutomationLocationList
{
id = q.id,
typeid = t.id,
fixtureguid = t.guid,
locationid = q.locationid,
fixturetoolid = t.id,
code = t.code,
name = t.name,
materialsn =q.sn
};
Expression<Func<ResponseAutomationLocationList, bool>> locationidExpression = f => true;
if (full != 0)
{
locationidExpression = q => !string.IsNullOrEmpty(q.materialsn);
}else
{
locationidExpression = q => string.IsNullOrEmpty(q.materialsn);
}
return query.Where(locationidExpression);
}
} }
} }
...@@ -20,10 +20,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -20,10 +20,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <param name="projectid">项目ID</param> /// <param name="projectid">项目ID</param>
/// <param name="hasMaterial">只查有SN</param> /// <param name="hasMaterial">只查有SN</param>
/// <returns></returns> /// <returns></returns>
IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid, int hasMaterial); IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid, int hasMaterial, string productcode);
IEnumerable<siger_wms_storage_location> GetLocationList(int projectid); IEnumerable<siger_wms_storage_location> GetLocationList(int projectid);
CommonImportResult ImportData(IEnumerable<AutomationLocationTemplate> list, int projectid, int userid); CommonImportResult ImportData(IEnumerable<AutomationLocationTemplate> list, int projectid, int userid);
IEnumerable<ResponseAutomationLocationList> GetFulllocation(int projectId, int full);
} }
} }
...@@ -62,6 +62,10 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -62,6 +62,10 @@ namespace Siger.Middlelayer.AccRepository.Response
{ {
public int id { get; set; } public int id { get; set; }
/// <summary> /// <summary>
/// 工装ID
/// </summary>
public int typeid { get; set; }
/// <summary>
/// 储位位置 /// 储位位置
/// </summary> /// </summary>
public int locationid { get; set; } public int locationid { get; set; }
...@@ -80,11 +84,16 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -80,11 +84,16 @@ namespace Siger.Middlelayer.AccRepository.Response
/// 工装ID /// 工装ID
/// </summary> /// </summary>
public int fixturetoolid { get; set; } public int fixturetoolid { get; set; }
/// <summary>
/// 工装GUID
/// </summary>
public string fixtureguid { get; set; } public string fixtureguid { get; set; }
public string code { get; set; } public string code { get; set; }
public string name { get; set; } public string name { get; set; }
public string materialsn { get; set; } public string materialsn { get; set; }
public int categoryid { get; set; } public int categoryid { get; set; }
//产品CODE
public string productcode { 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