Commit b9a88432 by xin.yang
parents 4cf60917 77fcff6a
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
</div> </div>
</div> </div>
<div slot="footer"> <div slot="footer">
<Button type="text" size="large" @click="this.addmodal=false">{{$t('1033')}}</Button> <Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button> <Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div> </div>
</Modal> </Modal>
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
</div> </div>
</div> </div>
<div slot="footer"> <div slot="footer">
<Button type="text" size="large" @click="this.addmodal=false">{{$t('1033')}}</Button> <Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button> <Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div> </div>
</Modal> </Modal>
......
...@@ -9,18 +9,24 @@ ...@@ -9,18 +9,24 @@
:value="item.id" :value="item.id"
:key="index" :key="index"
:label="item.name" :label="item.name"
>{{ item.name }}</Option >{{ item.name }}</Option>
>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>{{ $t(5500316) }}</label> <label>{{ $t(5500316) }}</label>
<Cascader class="searchSelect" :data="storageTree" change-on-select v-model="storageValue" @on-change="changeStorage"></Cascader> <Select v-model="storageid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option
v-for="(item,index) in storageList"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button> <Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button>
<!-- <Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button> <Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button>
<Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button> <!-- <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button>
<Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button> <Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button>
<Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button> <Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button>
<Upload <Upload
...@@ -68,47 +74,80 @@ ...@@ -68,47 +74,80 @@
</div> </div>
</div> </div>
<Modal class="newModalClass" v-model="addmodal" :styles="{width:'400px'}"> <Modal class="newModalClass" v-model="addmodal" :styles="{width:'650px'}">
<p slot="header"> <p slot="header">
<span v-show="type==1">{{$t('1002')}}</span> <span v-show="type==1">{{$t('1002')}}</span>
<span v-show="type==2">{{$t('1003')}}</span> <span v-show="type==2">{{$t('1003')}}</span>
</p> </p>
<div style=""> <div class="demo-spin-col">
<Spin fix v-if="spinShow">
<div>正在上传...</div>
</Spin>
<div class="filter"> <div class="filter">
<label><i>*</i>{{ $t(8070) }}</label> <label><i>*</i>{{ $t(8070) }}</label>
<Select v-model="warehouseid1" label-in-value clearable filterable filter-by-label class="searchSelect"> <Select v-model="addwarehouseid" label-in-value clearable filterable filter-by-label @on-change="changeWarehouse1" class="searchSelect">
<Option <Option
v-for="(item,index) in whdata1" v-for="(item,index) in whdata"
:value="item.id" :value="item.id"
:key="index" :key="index"
:label="item.name" :label="item.name"
>{{ item.name }}</Option >{{ item.name }}</Option>
>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>储位信息:</label> <label><i>*</i>{{ $t(5500316) }}</label>
<Input type="text" class="searchInput" v-model="warehouseid1" /> <Select v-model="addstorageid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option
v-for="(item,index) in storageList1"
:value="item.id"
:key="index"
:label="item.name"
>{{ item.name }}</Option>
</Select>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装类</label> <label><i>*</i>工装类</label>
<Input type="text" class="searchInput" v-model="warehouseid1" /> <Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>工装编号:</label> <label><i>*</i>工装名称:</label>
<Input type="text" class="searchInput" v-model="warehouseid1" /> <Select v-model="addfrockid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option
v-for="(item,index) in addfrockList"
:value="item.id"
:key="index"
:label="item.name+'#'+item.code"
>{{ item.name+'#'+item.code }}</Option>
</Select>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>附件</label> <label>备注</label>
<Input type="text" class="searchInput" v-model="warehouseid1" /> <Input type="text" class="searchInput" v-model="addremark" />
</div> </div>
<div class="filter"> <div>
<label><i>*</i>备注:</label> <label>上传文件:</label>
<Input type="text" class="searchInput" v-model="warehouseid1" /> <div class="accountInfoUploadFile">
<Upload
ref="upload"
:show-upload-list="false"
:on-success="handleSuccess1"
:before-upload="handleBeforeUpload"
:on-error="handleError1"
type="drag"
:headers="headers"
:action="UploadAction">
<div class="descicon" style="">
<Icon type="md-cloud-upload" size="15"></Icon>
<span>上传文件</span>
</div>
</Upload>
<div v-show="filename" class="hasfile">{{filename}}<Icon @click.native="delfile" type="ios-close-circle" size="15" /></div>
</div>
</div> </div>
</div> </div>
<div slot="footer"> <div slot="footer">
<Button type="text" size="large" @click="this.modal=false">{{$t('1033')}}</Button> <Button type="text" size="large" @click="addmodal=false">{{$t('1033')}}</Button>
<Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button> <Button type="primary" size="large" @click="addPost()">{{$t('1011')}}</Button>
</div> </div>
</Modal> </Modal>
...@@ -121,11 +160,11 @@ export default { ...@@ -121,11 +160,11 @@ export default {
return{ return{
whdata:[],//仓库列表 whdata:[],//仓库列表
warehouseid:"",//仓库id warehouseid:"",//仓库id
//储位树形结构 //储位
storageTree:[], storageList:[],
storageValue:[],//储位数据
storageid:"",//储位id storageid:"",//储位id
//列表
total:0, total:0,
page:1, page:1,
pagesize:10, pagesize:10,
...@@ -204,14 +243,33 @@ export default { ...@@ -204,14 +243,33 @@ export default {
} }
], ],
addmodal:true, //添加弹窗 //弹窗
whdata1:[],//仓库数据集合 addmodal:false, //添加弹窗
warehouseid1:'',//仓库id addwarehouseid:'',//仓库id
type:1,
storageList1:[],//储位列表
addstorageid:'',//储位id
frockTypeTree:[],//工装类型
parentType:[],
addfrockList:[],//工装列表
addfrockid:'',//工装名称
addremark:'',//备注
filename:'',
fileurl:'',
UploadAction: this.axios.publicPath + "config/upload/UploadImage",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
nonce: localStorage.getItem("nonce"),
sign: localStorage.getItem("sign"),
},
spinShow:false,
} }
}, },
created(){ created(){
this.initWarehouse();//仓库 this.initWarehouse();//仓库
this.initStorage();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1); this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
}, },
methods:{ methods:{
...@@ -240,52 +298,127 @@ export default { ...@@ -240,52 +298,127 @@ export default {
}, },
//切换仓库 //切换仓库
changeWarehouse(value){ changeWarehouse(value){
this.storageTree = []; this.storageList = [];
this.storageid = ""; this.storageid = "";
if(value != undefined){ if(value != undefined){
this.warehouseid = value.value; this.warehouseid = value.value;
this.initStorage(); this.initStorage();
} }
}, },
changeWarehouse1(value){
this.storageList1 = [];
this.addstorageid = "";
if(value != undefined){
this.warehouseid = value.value;
this.addinitStorage();
}
},
//储位 //储位
initStorage(){ initStorage(){
let params = { let params = {
id:this.warehouseid?this.warehouseid:0 page: 1,
} pageSize: 1000000,
id: this.warehouseid, // 仓库id
isWarehouse: 1,
};
this.axios.request({
url: "/wms/Location/GetLocationList",
params,
method: "get",
})
.then(
(res) => {
this.storageList = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.storageList = res.data.data;
}
}
);
},
addinitStorage(){
let params = {
page: 1,
pageSize: 1000000,
id: this.addwarehouseid, // 仓库id
isWarehouse: 1,
};
this.axios.request({ this.axios.request({
url: "/wms/Location/GetLocationTypeListNoPage", url: "/wms/Location/GetLocationList",
params, params,
method: "get", method: "get",
}) })
.then(
(res) => {
this.storageList1 = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.storageList1 = res.data.data;
}
}
);
},
//工装类型
initFrockType(){
this.axios.request({
url: "/acc/FixtureTools/GetCategoryList",
method: "get",
})
.then((res) => { .then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
let arr = res.data.data.children; let arr = res.data.data;
this.storageTree = arr;
this.contentTree(arr); this.contentTree(arr);
this.frockTypeTree = arr;
} }
}); });
}, },
contentTree (arr) { contentTree (arr) {
arr.forEach(ele => { arr.forEach(ele => {
ele.disabled = false; ele.disabled = false;
ele.value = ele.id;
ele.label = ele.name;
if ( if (
ele.children.length != 0 &&
ele.children != undefined && ele.children != undefined &&
ele.children != null ele.children != null &&
ele.children.length != 0
) { ) {
this.contentTree(ele.children); this.contentTree(ele.children);
}else{
ele.children = []
} }
}); });
}, },
//切换储位 changeFrockType1(value){
changeStorage(value){ this.parentTypeid = "";
this.storageid = ""; this.parentType = [];
if(value!=undefined && value.length){ if(value!=undefined && value.length){
this.storageid = value[value.length - 1]; this.parentTypeid = value[value.length - 1];
this.parentType = value;
this.getFrocksChange();
} }
}, },
getFrocksChange(){
this.addfrockid = '';
let params = {
category:this.parentTypeid,//工装类型id
code:'',
name:'',
state:1, //0停用 1可用
page:1,
pagesize:1000000,
toexcel:0 //0查询 1导出
}
this.axios.request({
url: "/acc/FixtureTools/GetPageList",
params,
method: "get",
})
.then((res) => {
this.addfrockList = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.addfrockList = res.data.data;
}
});
},
tosearch(){ tosearch(){
this.page = 1; this.page = 1;
this.pagesize = 10; this.pagesize = 10;
...@@ -293,15 +426,15 @@ export default { ...@@ -293,15 +426,15 @@ export default {
}, },
search(toexcel){ search(toexcel){
let params = { let params = {
warehouseid:this.warehouseid,//仓库id wavehouseid:this.warehouseid,//仓库id
storageid:this.storageid,//储位id locationid:this.storageid,//储位id
page:this.page, page:this.page,
pagesize:this.pagesize, pagesize:this.pagesize,
toexcel:toexcel //0查询 1导出 toexcel:toexcel //0查询 1导出
} }
this.detailobj = {}; this.detailobj = {};
this.axios.request({ this.axios.request({
url: "/wms/storageInfoQuery/search", url: "/acc/AutomationLocation/GetPageList",
params, params,
method: "get", method: "get",
}) })
...@@ -309,7 +442,7 @@ export default { ...@@ -309,7 +442,7 @@ export default {
if(toexcel === 1){ if(toexcel === 1){
if (res.data.ret === 1) { if (res.data.ret === 1) {
window.location.href = window.location.href =
axios.publicPath + "" + res.data.data; this.axios.publicPath + "" + res.data.data;
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
...@@ -325,6 +458,37 @@ export default { ...@@ -325,6 +458,37 @@ export default {
} }
}); });
}, },
add(){
this.type = 1;
this.addmodal = true;
},
/*********文件上传 start******** */
handleBeforeUpload(file){
this.spinShow = true;
if(!file){
this.spinShow = false;
return false;
}
},
handleSuccess1 (res,file) {
this.spinShow = false;
if (res.ret == 1) {
this.$Message.success(this.$t("100378"));
this.filename = file.name;
this.fileurl = res.data;
} else {
this.$Message.error(this.$t(res.msg+''));
}
},
handleError1(){
this.spinShow = false;
this.$Message.error(this.$t("600512") + "!");
},
delfile(){
this.filename = '';
this.fileurl = '';
},
/*********文件上传 end******** */
handleRowChange(currentRow, oldCurrentRow) { handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow; this.detailobj = currentRow;
}, },
...@@ -340,6 +504,39 @@ export default { ...@@ -340,6 +504,39 @@ export default {
} }
} }
</script> </script>
<style> <style lang="less">
.accountInfoUploadFile{
display:inline-block;
position: relative;
left: 5px;
.ivu-upload{
display: inline-block;
width: 140px;
height: 29px;
vertical-align: middle;
.descicon{
width: 140px;
height:29px;
line-height: 29px;
}
}
.ivu-upload-drag{
border:1px solid #dcdee2!important;
}
.ivu-upload-drag:hover {
border: 1px solid #2d8cf0!important;
}
.hasfile{
display: inline-block;
position: relative;
left: -140px;
top: 29px;
i{
color: red;
font-size: 15px;
cursor: pointer;
vertical-align: top;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using Siger.Middlelayer.AccRepository.Entities; using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface; using Siger.Middlelayer.AccRepository.Repositories.Interface;
using Siger.Middlelayer.AccRepository.Request; using Siger.Middlelayer.AccRepository.Request;
...@@ -30,9 +31,11 @@ namespace Siger.ApiACC.Controllers ...@@ -30,9 +31,11 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationTaskListRepository _automationTaskList; private readonly IAutomationTaskListRepository _automationTaskList;
private readonly IProductPlanDetails _planDetails; private readonly IProductPlanDetails _planDetails;
private readonly IProductPlanRepository _productPlan; private readonly IProductPlanRepository _productPlan;
private readonly IAutomationFixtureMonitor _automationFixtureMonitor;
private readonly IAutomationFixtureToolsProductRepository _automationFixtureToolsProduct;
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) IProductPlanDetails planDetails,IProductPlanRepository productPlan,IAutomationFixtureMonitor automationFixtureMonitor ,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -42,6 +45,8 @@ namespace Siger.ApiACC.Controllers ...@@ -42,6 +45,8 @@ namespace Siger.ApiACC.Controllers
_automationTaskList = automationTaskList; _automationTaskList = automationTaskList;
_planDetails = planDetails; _planDetails = planDetails;
_productPlan = productPlan; _productPlan = productPlan;
_automationFixtureMonitor = automationFixtureMonitor;
_automationFixtureToolsProduct = automationFixtureToolsProduct;
} }
/// <summary> /// <summary>
...@@ -130,15 +135,38 @@ namespace Siger.ApiACC.Controllers ...@@ -130,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>
...@@ -179,13 +207,18 @@ namespace Siger.ApiACC.Controllers ...@@ -179,13 +207,18 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(CncEnum.PlanHasExist); throw new BadRequestException(CncEnum.PlanHasExist);
} }
//检查工装
var fixtureToolsObj = _automationFixtureToolsProduct.GetFixtureInfoByProductCode(ProjectId, plan.product_code);
if (fixtureToolsObj == null)
{
throw new BadRequestException(AccEnum.FixtureToolsIsNone);
}
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual); var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
var sn = _automationTaskList.CreateRandonSn(plan.product_code); var sn = _automationTaskList.CreateRandonSn(plan.product_code);
_automationTaskList.Insert(new siger_automation_task_list _automationTaskList.Insert(new siger_automation_task_list
{ {
guid=taskNo, no=taskNo,
action= Automation.TaskAction.Step_LK_SXLW, action= Automation.TaskAction.Step_LK_SXLW,
actiontype= Automation.ExcueType.None, actiontype= Automation.ExcueType.None,
triggertime=DateTime.MinValue, triggertime=DateTime.MinValue,
...@@ -201,10 +234,46 @@ namespace Siger.ApiACC.Controllers ...@@ -201,10 +234,46 @@ namespace Siger.ApiACC.Controllers
productid=plan.product_id, productid=plan.product_id,
sn=sn, sn=sn,
ordercode=plandts.OrderNumber, ordercode=plandts.OrderNumber,
remark="手动任务", fixtureguid= fixtureToolsObj.FixtureGuid,
locationid=fixtureToolsObj.Location,
remark ="手动任务",
}); });
var monitor = _automationFixtureMonitor.Get(f => f.fixtureguid == fixtureToolsObj.FixtureGuid);
if (monitor==null)
{
_automationFixtureMonitor.Insert(new siger_automation_fixture_tools_monitor
{
fixtureguid=fixtureToolsObj.FixtureGuid,
projectId=ProjectId,
section=loading.section,
sn=sn,
createtime=DateTime.Now,
updatetime=DateTime.Now,
status=(int)Automation.MachineStatus.Produce,
productCode=plan.product_code,
productName=plan.product_name,
ordernumber=plandts.OrderNumber,
locationId= fixtureToolsObj.Location
});
}
else
{
monitor.sn = sn;
monitor.section = loading.section;
monitor.updatetime = DateTime.Now;
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);
}
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
return new ObjectResult(CommonEnum.Succefull); return new ObjectResult(CommonEnum.Succefull);
else else
...@@ -212,7 +281,7 @@ namespace Siger.ApiACC.Controllers ...@@ -212,7 +281,7 @@ namespace Siger.ApiACC.Controllers
} }
/// <summary> /// <summary>
/// 安装完成 -生成指令 /// 安装完成 -生成指令 unload
/// </summary> /// </summary>
/// <param name="assemble"></param> /// <param name="assemble"></param>
/// <returns></returns> /// <returns></returns>
......
...@@ -324,7 +324,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum ...@@ -324,7 +324,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[Description("设备正在使用中")] [Description("设备正在使用中")]
MachineBusy, MachineBusy,
[Description("任务进行中")] [Description("任务进行中")]
TaskProcessing TaskProcessing,
[Description("产品工装未找到")]
FixtureToolsIsNone,
} }
public enum SeriNumCfg public enum SeriNumCfg
......
...@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary> /// <summary>
/// 工装ID /// 工装ID
/// </summary> /// </summary>
public int fixtureId { get; set; } public string fixtureguid { get; set; }
/// <summary> /// <summary>
/// 当前工站ID /// 当前工站ID
/// </summary> /// </summary>
...@@ -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; }
} }
} }
...@@ -19,6 +19,10 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -19,6 +19,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public int productid { get; set; } public int productid { get; set; }
/// <summary> /// <summary>
/// 产品CODE
/// </summary>
public string productcode { get; set; }
/// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string remark { get; set; } public string remark { get; set; }
......
...@@ -10,7 +10,11 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -10,7 +10,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public class siger_automation_task_list : AccEntityBase public class siger_automation_task_list : AccEntityBase
{ {
public string guid { get; set; } /// <summary>
/// 任务编号
/// </summary>
public string no { get; set; }
/// <summary> /// <summary>
/// 工位ID /// 工位ID
/// </summary> /// </summary>
...@@ -50,7 +54,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -50,7 +54,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary> /// <summary>
/// 工装GUID /// 工装GUID
/// </summary> /// </summary>
public int fixturetools { get; set; } public string fixtureguid { get; set; }
/// <summary> /// <summary>
/// Task 执行动作类型 1 手动 2 自动 /// Task 执行动作类型 1 手动 2 自动
......
...@@ -20,6 +20,22 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -20,6 +20,22 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context = context; _context = context;
} }
public ResponseProductFixtureInfo GetFixtureInfoByProductCode(int projectId, string productCode)
{
var query = from q in _context.siger_automation_fixture_tools_product
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 && q.productcode==productCode && q.status == (int)RowState.Valid && t.status == (int)RowState.Valid
select new ResponseProductFixtureInfo
{
FixtureId=t.id,
FixtureGuid=t.guid,
ProductCode=q.productcode,
Location=l.locationid,
};
return query.FirstOrDefault();
}
public IPagedCollectionResult<ResponseAumationFixtureToolsProduct> GetPagedList(int category, int tool, int product, int projectid, int page, int pagesize) public IPagedCollectionResult<ResponseAumationFixtureToolsProduct> GetPagedList(int category, int tool, int product, int projectid, int page, int pagesize)
{ {
var query = from q in _context.siger_automation_fixture_tools_product var query = from q in _context.siger_automation_fixture_tools_product
...@@ -67,5 +83,25 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -67,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();
}
} }
} }
...@@ -8,5 +8,16 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -8,5 +8,16 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
public interface IAutomationFixtureToolsProductRepository : IAccRepositoryBase<siger_automation_fixture_tools_product> public interface IAutomationFixtureToolsProductRepository : IAccRepositoryBase<siger_automation_fixture_tools_product>
{ {
IPagedCollectionResult<ResponseAumationFixtureToolsProduct> GetPagedList(int category, int tool, int product, int projectid, int page, int pagesize); IPagedCollectionResult<ResponseAumationFixtureToolsProduct> GetPagedList(int category, int tool, int product, int projectid, int page, int pagesize);
ResponseProductFixtureInfo GetFixtureInfoByProductCode(int projectId, string productCode);
/// <summary>
/// 工令单获取 工装信息
/// </summary>
/// <param name="ordernumber"></param>
/// <returns></returns>
ResponsePlanlFixtureInfo GetPlanFixtureInfo(int projectId, string ordernumber);
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Response
{
public class ResponseProductFixtureInfo
{
/// <summary>
/// 工装ID
/// </summary>
public int FixtureId { get; set; }
/// <summary>
/// GUID
/// </summary>
public string FixtureGuid { get; set; }
/// <summary>
/// 产品名称
/// </summary>
public string ProductCode { get; set; }
/// <summary>
/// 储位
/// </summary>
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; }
}
}
...@@ -247,6 +247,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` ( ...@@ -247,6 +247,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` (
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'siger_automation_fixture_tools.guid', `fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'siger_automation_fixture_tools.guid',
`productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID', `productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID',
`productcode` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`remark` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', `remark` varchar(45) 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 '附件名称',
...@@ -325,7 +326,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_section_route` ( ...@@ -325,7 +326,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_section_route` (
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS `siger_automation_task_list` ( CREATE TABLE IF NOT EXISTS `siger_automation_task_list` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `no` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`fixtureguid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`sectionid` int(11) NOT NULL DEFAULT 0 COMMENT '工位ID', `sectionid` int(11) NOT NULL DEFAULT 0 COMMENT '工位ID',
`trigger` int(1) NOT NULL DEFAULT 0 COMMENT '触发方', `trigger` int(1) NOT NULL DEFAULT 0 COMMENT '触发方',
`tasktype` int(1) NOT NULL DEFAULT 0 COMMENT '任务类型', `tasktype` int(1) NOT NULL DEFAULT 0 COMMENT '任务类型',
...@@ -382,7 +384,7 @@ CREATE TABLE `siger_automation_line_mode` ( ...@@ -382,7 +384,7 @@ CREATE TABLE `siger_automation_line_mode` (
) 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;
-- ---------------------------- -- ----------------------------
-- 生产线模式 -- 生产操作记录
-- Table structure for siger_automation_produce_history -- Table structure for siger_automation_produce_history
-- ---------------------------- -- ----------------------------
...@@ -404,4 +406,28 @@ CREATE TABLE `siger_automation_produce_history` ( ...@@ -404,4 +406,28 @@ CREATE TABLE `siger_automation_produce_history` (
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;
-- ----------------------------
-- 工装实时状态
-- Table structure for siger_automation_fixture_tools_moniter
-- ----------------------------
DROP TABLE IF EXISTS `siger_automation_fixture_tools_moniter`;
CREATE TABLE `siger_automation_fixture_tools_moniter` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`projectid` int(11) NOT NULL DEFAULT 0,
`fixtureguid` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工装ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '当前工站ID',
`sn` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前绑定工件',
`route` int(1) NOT NULL DEFAULT 1 COMMENT '工序ID',
`routedesc` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前工序',
`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 '工令单',
`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
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
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