Commit 4081bdb5 by yucheng.jiang
parents a2dc4644 bc381f49
...@@ -41,9 +41,11 @@ ...@@ -41,9 +41,11 @@
<span class="red">*</span> <span class="red">*</span>
</p> </p>
<Tabs type="card"> <Tabs type="card">
<TabPane label="上料"> <TabPane label="上料" :disabled="attr1">
<div class="filter"> <div class="filter">
<label>上料信息:</label> <label style="font-size: 16px"
>上料信息:</label
>
<Input <Input
type="text" type="text"
class="searchInput" class="searchInput"
...@@ -81,20 +83,86 @@ ...@@ -81,20 +83,86 @@
<span class="infoLabel">工装编号:</span> <span class="infoLabel">工装编号:</span>
<span class="info"></span> <span class="info"></span>
</p> </p>
<Button type="primary">储位选择</Button> <Button type="primary" @click="modal = true"
>储位选择</Button
>
</div> </div>
<div> <div>
<Button type="primary">准备上料</Button> <Button type="primary">准备上料</Button>
<Button type="primary">安装完成</Button> <Button type="primary">安装完成</Button>
</div> </div>
</TabPane> </TabPane>
<TabPane label="下料">下料</TabPane> <TabPane label="下料" :disabled="attr2"
><div class="flex">
<div>
<Table
class="tableClass"
:data="data2"
:columns="columns2"
:max-height="200"
style="width: 500px"
></Table>
</div>
<div>
<div class="row">
<p class="flex">
<span class="infoLabel"
>工单信息:</span
>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel"
>产品编号:</span
>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel"
>产品名称:</span
>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel"
>工件编号:</span
>
<span class="info"></span>
</p>
</div>
<div class="row">
<p class="flex">
<span class="infoLabel"
>状态:</span
>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel"
>储位编号:</span
>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel"
>工装编号:</span
>
<span class="info"></span>
</p>
</div>
<div>
<Button type="primary">准备上料</Button>
<Button type="primary">安装完成</Button>
</div>
</div>
</div></TabPane
>
</Tabs> </Tabs>
<Modal <Modal
class="newModalClass" class="newModalClass"
:title="$t(900249)" title="储位选择"
v-model="modal" v-model="modal"
:styles="{ width: '940px' }" :styles="{ width: '700px' }"
> >
<div class="modal_body" style="padding-right: 40px"> <div class="modal_body" style="padding-right: 40px">
<Table <Table
...@@ -115,7 +183,6 @@ ...@@ -115,7 +183,6 @@
<Button <Button
type="primary" type="primary"
size="large" size="large"
v-text="$t('1011')" v-text="$t('1011')"
>提交</Button >提交</Button
> >
...@@ -132,17 +199,153 @@ export default { ...@@ -132,17 +199,153 @@ export default {
data() { data() {
return { return {
productionLine: [], productionLine: [],
a: 0, stationList: [],
modal:false, a: -1,
columns1:[], attr1: false, //上料、下料、上下料
data1:[] attr2: false, //上料、下料、上下料
modal: false,
columns1: [
{
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: 70,
},
{
title: "仓库",
key: "warehouse",
},
{
title: "储位编号",
key: "storage_sn",
},
{
title: "工装编号",
key: "install_sn",
},
{
title: "工件编号",
key: "workpiece_sn",
},
],
data1: [],
columns2: [
{
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: 70,
},
{
title: "储位编号",
key: "storage_sn",
},
{
title: "工装编号",
key: "install_sn",
},
{
title: "工件编号",
key: "workpiece_sn",
},
],
data2: [],
}; };
}, },
created() {}, created() {
this.getProLine();
},
mounted() {
// this.getStations()
},
methods: { methods: {
// 获取生产线
getProLine() {
this.axios
.request({
url: "/qms/RepairPostionSetting/GetChanel",
method: "get",
})
.then((res) => {
this.productionLine = res.data.data;
// this.change(0);
if (this.productionLine.length == 0) {
this.$Message.error(this.$t(950057));
}
});
},
getStations(id) {
this.request(
"/qms/RepairPostionSetting/GetSettingByChanel?Id=" + id,
"",
"get"
).then((res) => {
// console.log(res.data.data);
if (res.data.ret == 1) {
this.stationList = res.data.data;
}
});
},
change(i) { change(i) {
this.a = i; this.a = i;
// 1. 选中产线后自动带出来工位属性中为上下料属性的工位 this.getStations(this.productionLine[i].id);
},
//获取储位
getStorages() {
this.request("", "", "")
.then((res) => {
if (res.data.ret == 1) {
}
})
.catch((err) => {
console.log(err);
});
},
// 获取工单信息
getWorkOrderInfo() {
this.request("", "", "")
.then((res) => {
if (res.data.ret == 1) {
}
})
.catch((err) => {
console.log(err);
});
},
request(url, data, type) {
if (type == "get") {
return this.axios
.request({
url: url,
params: data,
method: type,
})
.then((res) => {
return res;
})
.catch((error) => error);
} else {
return this.axios
.request({
url: url,
data,
method: type,
})
.then((res) => {
return res;
})
.catch((error) => error);
}
}, },
}, },
}; };
...@@ -199,4 +402,10 @@ export default { ...@@ -199,4 +402,10 @@ export default {
width: 200px; width: 200px;
font-size: 20px; font-size: 20px;
} }
.ivu-btn {
margin: 10px;
}
.m010 {
margin: 0 10px;
}
</style> </style>
\ No newline at end of file
<template> <template>
<div> <div>
产线监控管理 <div class="divborder">
<h2>基本信息</h2>
<div class="newSearchDiv">
<div class="filter">
<label>{{ $t("1950574") }}</label>
<Cascader trigger="click" class="searchSelect"></Cascader>
</div>
<div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search">{{
$t("1001")
}}</Button>
<Button type="primary" class="twoWord" icon="ios-search"
>导出</Button
>
</div>
</div>
</div>
<div class="divborder">
<div class="stateTitle flex">
<p><span>4</span>生产中</p>
<p><span>4</span>待下料</p>
<p><span>4</span>待上料</p>
<p><span>4</span>不可用</p>
</div>
<div class="stateWrap">
<div class="stateItem">
<p class="flex">
<span class="infoLabel">工位:</span>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel">产品:</span>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel">工装:</span>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel">储位:</span>
<span class="info"></span>
</p>
<p class="flex">
<span class="infoLabel">工件:</span>
<span class="info"></span>
</p>
</div>
</div>
<Table
class="tableClass"
:data="data1"
:columns="columns1"
:max-height="200"
></Table>
<Table
class="tableClass"
:data="data2"
:columns="columns2"
:max-height="200"
></Table>
<Table
class="tableClass"
:data="data3"
:columns="columns3"
:max-height="200"
></Table>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() {
} return {
productionLine: [],
a: 0,
modal: false,
columns1: [
{
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: 70,
},
{
title: "产线层级",
key: "warehouse",
},
{
title: "设备",
key: "storage_sn",
},
{
title: "工装编号",
key: "install_sn",
},
{
title: "产品编号",
key: "workpiece_sn",
},
{
title: "工件编号",
key: "storage_sn",
},
{
title: "状态",
key: "install_sn",
},
{
title: "最后更新时间",
key: "workpiece_sn",
},
],
data1: [],
columns2: [
{
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: 70,
},
{
title: "父工装类别",
key: "warehouse",
},
{
title: "父工装编号",
key: "storage_sn",
},
{
title: "父工装名称",
key: "install_sn",
},
{
title: "父工装规格",
key: "workpiece_sn",
},
{
title: "父工装编号",
key: "storage_sn",
},
{
title: "子工装类别",
key: "install_sn",
},
{
title: "最后更新时间",
key: "workpiece_sn",
},
],
data1: [],
columns3: [
{
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: 70,
},
{
title: "产线层级",
key: "warehouse",
},
{
title: "设备",
key: "storage_sn",
},
{
title: "工装编号",
key: "install_sn",
},
{
title: "产品编号",
key: "workpiece_sn",
},
{
title: "工件编号",
key: "storage_sn",
},
{
title: "状态",
key: "install_sn",
},
{
title: "最后更新时间",
key: "workpiece_sn",
},
],
data1: [],
};
},
created() {},
};
</script> </script>
<style> <style lang="less" scoped>
.flex {
display: flex;
}
.stateWrap {
margin: 20px 10px;
}
.stateItem {
border: 1px solid #000;
width: 200px;
height: 150px;
padding-left: 10px;
p {
height: 30px;
line-height: 30px;
font-size: 16px;
}
}
.stateTitle {
p {
font-size: 20px;
width: 150px;
height: 40px;
line-height: 40px;
span {
display: inline-block;
margin: 0 10px;
text-align: center;
width: 40px;
height: 40px;
color: #fff;
// border: 1px solid #333;
}
}
p:nth-child(1) span {
background-color: #2db7f5;
}
p:nth-child(2) span {
background-color: #19be6b;
}
p:nth-child(3) span {
background-color: #ff9900;
}
p:nth-child(4) span {
background-color: #ed4014;
}
}
</style> </style>
\ No newline at end of file
<template> <template>
<div class="testdiv"> <div class="testdiv">
\任务清单管理
<div class="divborder"> <div class="divborder">
<h2>基本信息</h2> <h2>基本信息</h2>
<div class="newSearchDiv"> <div class="newSearchDiv">
<div class="filter"> <div class="filter">
<label>{{ $t("1950574") }}</label> <label>{{ $t("1132") }}</label>
<Cascader trigger="click" class="searchSelect"></Cascader> <Cascader
trigger="click"
class="searchSelect"
:data="datalevel"
:value="leveldata"
></Cascader>
</div> </div>
<div class="filter"> <div class="filter">
<label>任务类型:</label> <label>任务类型:</label>
...@@ -83,17 +87,33 @@ ...@@ -83,17 +87,33 @@
></DatePicker> ></DatePicker>
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search">{{ <Button
$t("1001") type="primary"
}}</Button> class="twoWord"
icon="ios-search"
@click="search()"
>{{ $t("1001") }}</Button
>
<!-- --> <!-- -->
<Button type="primary" class="twoWord" icon="ios-search" <Button
type="warning"
class="twoWord"
icon="ios-search"
@click="cancel()"
>取消</Button >取消</Button
><!--只有状态是待执行的可以改成取消--> ><!--只有状态是待执行的可以改成取消-->
<Button type="primary" class="twoWord" icon="ios-search" <Button
type="primary"
class="twoWord"
icon="ios-search"
@click="manual()"
>手动</Button >手动</Button
><!--当生产线的模式是手动是才可以进行手动任务执行--> ><!--当生产线的模式是手动是才可以进行手动任务执行-->
<Button type="primary" class="twoWord" icon="ios-search" <Button
type="primary"
class="twoWord"
icon="ios-search"
@click="exportExcel()"
>导出</Button >导出</Button
> >
</div> </div>
...@@ -121,22 +141,91 @@ ...@@ -121,22 +141,91 @@
export default { export default {
data() { data() {
return { return {
leveldata: [], // 产线层级插件所需数据
datalevel: [], // 产线层级选中数据
columns1: [ columns1: [
{ {
title: this.$t('1008'), title: this.$t("1008"),
key: 'xuhao', key: "xuhao",
render: (h, params) => { render: (h, params) => {
return h( return h(
'span', "span",
params.index + (this.page - 1) * this.pagesize + 1 params.index + (this.page - 1) * this.pagesize + 1
); );
}, },
width: 70 width: 70,
},
{
title: "任务清单",
key: "productcode",
},
{
title: "产线层级",
key: "productcode",
},
{
title: "触发方",
key: "productcode",
},
{
title: "任务类型",
key: "productcode",
},
{
title: "发起地",
key: "productcode",
},
{
title: "工件编号",
key: "productcode",
},
{
title: "工单编号",
key: "productcode",
},
{
title: "产品编号",
key: "productcode",
},
{
title: "工序编号",
key: "productcode",
},
{
title: "工序",
key: "productcode",
},
{
title: "程序号",
key: "productcode",
}, },
{ {
title: this.$t('100089'), title: "储位位置",
key: 'productcode', key: "productcode",
minWidth: 150 },
{
title: "工装编号",
key: "productcode",
},
{
title: "动作",
key: "productcode",
},
{
title: "执行类型",
key: "productcode",
},
{
title: "状态",
key: "productcode",
},
{
title: "触发时间",
key: "productcode",
},
{
title: "完成时间",
key: "productcode",
}, },
], ],
data1: [], data1: [],
...@@ -147,8 +236,30 @@ export default { ...@@ -147,8 +236,30 @@ export default {
}, },
created() { created() {
this.columns1 = this.$time.initTableTitle(this.columns1); this.columns1 = this.$time.initTableTitle(this.columns1);
this.initlevel()
},
methods: {
search() {},
cancel() {},
manual() {},
exportExcel() {},
initlevel() {
// 初始化产线层级
this.axios
.request({
url: "config/ProjectLevelSection/GetSectionTree",
method: "get",
})
.then((res) => {
const arr = [];
if (res.data.data.length > 0) {
this.datalevel = res.data.data;
arr.push(res.data.data[0].value);
this.leveldata = arr;
}
});
},
}, },
methods: {},
}; };
</script> </script>
......
...@@ -6,117 +6,136 @@ ...@@ -6,117 +6,136 @@
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle"> <p class="selectTitle">
1.{{$t(90000016)}} 1.{{ $t(90000016) }}
<span class="red">*</span> <span class="red">*</span>
</p> </p>
<div class="row"> <div class="row">
<p <p
:key="index" :key="index"
class="options" class="options"
v-for="(item,index) in passageList" v-for="(item, index) in passageList"
@click="change(index)" @click="change(index)"
:class="{active:a==index}" :class="{ active: a == index }"
>{{item.title}}</p> >
{{ item.title }}
</p>
</div> </div>
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle"> <p class="selectTitle">
2.{{$t('1052')}} 2.{{ $t("1052") }}
<span class="red">*</span> <span class="red">*</span>
({{$t('1220')}}) ({{ $t("1220") }})
</p> </p>
<div class="row"> <div class="row">
<p <p
class="options" class="options"
:key="index" :key="index"
v-for="(item,index) in stationList" v-for="(item, index) in stationList"
@click="change1(index)" @click="change1(index)"
:class="{active:b==index}" :class="{ active: b == index }"
>{{item.item}}</p> >
{{ item.item }}
</p>
</div> </div>
</div> </div>
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle"> <p class="selectTitle">
3.{{$t('100217')}} 3.{{ $t("100217") }}
<span class="red">*</span> <span class="red">*</span>
</p> </p>
<div class="row"> <div class="row">
<p <p
:key="index" :key="index"
class="options" class="options"
v-for="(item,index) in productList" v-for="(item, index) in productList"
@click="change2(index)" @click="change2(index)"
:class="{active:c==index}" :class="{ active: c == index }"
>{{item.productName}}</p> >
{{ item.productName }}
</p>
</div> </div>
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle">4.{{$t(1950603)}}</p> <p class="selectTitle">4.{{ $t(1950603) }}</p>
<div class="row"> <div class="row">
<p <p
:key="index" :key="index"
class="options" class="options"
v-for="(item,index) in materialList" v-for="(item, index) in materialList"
@click="change3(index)" @click="change3(index)"
:class="{active:d==index && must==true}" :class="{ active: d == index && must == true }"
>{{item.name +"【"+item.pn+"】"}}</p> >
{{ item.name + "【" + item.pn + "】" }}
</p>
</div> </div>
</div> </div>
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">5.{{$t(90000048)}}</p> <p class="selectTitle">5.{{ $t(90000048) }}</p>
<div class="row"> <div class="row">
<p <p
:key="index" :key="index"
class="options" class="options"
v-for="(item,index) in projectList" v-for="(item, index) in projectList"
@click="change4(index)" @click="change4(index)"
:class="{active:e==index && pmust==true}" :class="{ active: e == index && pmust == true }"
>{{item.item}}</p> >
{{ item.item }}
</p>
</div> </div>
</div> </div>
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">6.{{$t(5500006)}}</p> <p class="selectTitle">6.{{ $t(5500006) }}</p>
<div class="row"> <div class="row">
<p <p
:key="index" :key="index"
class="options" class="options"
v-for="(item,index) in referType" v-for="(item, index) in referType"
@click="change5(index)" @click="change5(index)"
:class="{active:f==index && tmust==true}" :class="{ active: f == index && tmust == true }"
>{{item.name}}</p> >
{{ item.name }}
</p>
</div> </div>
</div> </div>
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">7.{{$t(5500005)}}</p> <p class="selectTitle">7.{{ $t(5500005) }}</p>
<div class="row"> <div class="row">
<p <p
:key="index" :key="index"
class="options" class="options"
v-for="(item,index) in reference" v-for="(item, index) in reference"
@click="change6(index)" @click="change6(index)"
:class="{active:g==index && rmust==true}" :class="{ active: g == index && rmust == true }"
>{{item.remark}}</p> >
{{ item.remark }}
</p>
</div> </div>
</div> </div>
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">8.{{$t(90000049)}}</p> <p class="selectTitle">8.{{ $t(90000049) }}</p>
<div class="row"> <div class="row">
<div class="number row"> <div class="number row">
<p class="minus" @click="reduce">-</p> <p class="minus" @click="reduce">-</p>
<input type="text" class="digit" v-model="number" /> <input type="text" class="digit" v-model="number" />
<p class="plus" @click="add">+</p> <p class="plus" @click="add">+</p>
</div> </div>
<input class="erweima" type="text" v-model="qrcode" @keyup.enter="save()" /> <input
class="erweima"
type="text"
v-model="qrcode"
@keyup.enter="save()"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -129,12 +148,12 @@ ...@@ -129,12 +148,12 @@
</template> </template>
<script> <script>
import axios from '@/libs/api.request'; import axios from "@/libs/api.request";
export default { export default {
data () { data() {
return { return {
passageList: ['CH3.3', 'CH3.3fsgfdgd', 'CH3.3', 'CH3.3', 'CH3.3'], passageList: ["CH3.3", "CH3.3fsgfdgd", "CH3.3", "CH3.3", "CH3.3"],
stationList: [], stationList: [],
productList: [], productList: [],
materialList: [], materialList: [],
...@@ -148,9 +167,9 @@ export default { ...@@ -148,9 +167,9 @@ export default {
material: 0, // 物料 material: 0, // 物料
project: 0, // 不良项目 project: 0, // 不良项目
typeid: 0, typeid: 0,
reason: '', reason: "",
number: 0, // 返工数量 number: 0, // 返工数量
qrcode: '', // 二维码 qrcode: "", // 二维码
settingId: 0, // 返工设置ID settingId: 0, // 返工设置ID
a: 0, a: 0,
b: 0, b: 0,
...@@ -170,20 +189,20 @@ export default { ...@@ -170,20 +189,20 @@ export default {
arr2: [], arr2: [],
arr3: [], arr3: [],
array: [], array: [],
showMsg: '' showMsg: "",
}; };
}, },
created () { created() {
this.init(); this.init();
this.loadReferType(); this.loadReferType();
// this.change(0); // this.change(0);
}, },
methods: { methods: {
init () { init() {
axios axios
.request({ .request({
url: '/qms/RepairPostionSetting/GetChanel', url: "/qms/RepairPostionSetting/GetChanel",
method: 'get' method: "get",
}) })
.then((res) => { .then((res) => {
this.passageList = res.data.data; this.passageList = res.data.data;
...@@ -193,7 +212,7 @@ export default { ...@@ -193,7 +212,7 @@ export default {
} }
}); });
}, },
initData () { initData() {
this.station = 0; this.station = 0;
this.product = 0; this.product = 0;
this.material = 0; this.material = 0;
...@@ -204,7 +223,7 @@ export default { ...@@ -204,7 +223,7 @@ export default {
this.tip = false; this.tip = false;
}, },
// 选择通道 // 选择通道
change (i) { change(i) {
this.a = i; this.a = i;
this.initData(); this.initData();
this.passage = this.passageList[i].id; this.passage = this.passageList[i].id;
...@@ -214,8 +233,9 @@ export default { ...@@ -214,8 +233,9 @@ export default {
axios axios
.request({ .request({
url: url:
'/qms/RepairPostionSetting/GetSettingByChanel?Id=' + this.passage, "/qms/RepairPostionSetting/GetSettingByChanel?Id=" +
method: 'get' this.passage,
method: "get",
}) })
.then((res) => { .then((res) => {
// console.log(res.data.data); // console.log(res.data.data);
...@@ -229,7 +249,7 @@ export default { ...@@ -229,7 +249,7 @@ export default {
}); });
}, },
// 选择工位 // 选择工位
change1 (i) { change1(i) {
this.tip = false; this.tip = false;
this.material = 0; this.material = 0;
this.project = 0; this.project = 0;
...@@ -243,8 +263,9 @@ export default { ...@@ -243,8 +263,9 @@ export default {
axios axios
.request({ .request({
url: url:
'/qms/InspectStandard/GetOQCItemProduct?sectionId=' + this.station, "/qms/InspectStandard/GetOQCItemProduct?sectionId=" +
method: 'get' this.station,
method: "get",
}) })
.then((res) => { .then((res) => {
this.productList = res.data.data; this.productList = res.data.data;
...@@ -261,14 +282,14 @@ export default { ...@@ -261,14 +282,14 @@ export default {
// 根据产品选择物料 // 根据产品选择物料
var params = { var params = {
productId: this.product, productId: this.product,
section: this.station section: this.station,
}; };
if (this.productList.length > 0) { if (this.productList.length > 0) {
axios axios
.request({ .request({
url: '/qms/ManufacturingMaterial/GetMaterialByCell', url: "/qms/ManufacturingMaterial/GetMaterialByCell",
params, params,
method: 'get' method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret === 1) { if (res.data.ret === 1) {
...@@ -280,11 +301,11 @@ export default { ...@@ -280,11 +301,11 @@ export default {
axios axios
.request({ .request({
url: url:
'/qms/InspectStandard/GetItems?productid=' + "/qms/InspectStandard/GetItems?productid=" +
this.product + this.product +
'&sectionid=' + "&sectionid=" +
this.station, this.station,
method: 'get' method: "get",
}) })
.then((res) => { .then((res) => {
this.projectList = res.data.data; this.projectList = res.data.data;
...@@ -295,7 +316,7 @@ export default { ...@@ -295,7 +316,7 @@ export default {
} }
}, },
// 选择产品 // 选择产品
change2 (i) { change2(i) {
this.project = 0; this.project = 0;
this.material = 0; this.material = 0;
this.must = false; this.must = false;
...@@ -305,13 +326,13 @@ export default { ...@@ -305,13 +326,13 @@ export default {
// 根据产品选择物料 // 根据产品选择物料
var params = { var params = {
productId: this.productList[i].productId, productId: this.productList[i].productId,
section: this.station section: this.station,
}; };
axios axios
.request({ .request({
url: '/qms/ManufacturingMaterial/GetMaterialByCell', url: "/qms/ManufacturingMaterial/GetMaterialByCell",
params, params,
method: 'get' method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret == 1 && res.data.data.length > 0) { if (res.data.ret == 1 && res.data.data.length > 0) {
...@@ -326,11 +347,11 @@ export default { ...@@ -326,11 +347,11 @@ export default {
axios axios
.request({ .request({
url: url:
'/qms/InspectStandard/GetItems?productid=' + "/qms/InspectStandard/GetItems?productid=" +
this.product + this.product +
'&sectionid=' + "&sectionid=" +
this.station, this.station,
method: 'get' method: "get",
}) })
.then((res) => { .then((res) => {
this.projectList = res.data.data; this.projectList = res.data.data;
...@@ -338,7 +359,7 @@ export default { ...@@ -338,7 +359,7 @@ export default {
}); });
}, },
// 选择物料 // 选择物料
change3 (i) { change3(i) {
this.tip = false; this.tip = false;
// this.must = true; // this.must = true;
// this.d = i; // this.d = i;
...@@ -362,7 +383,7 @@ export default { ...@@ -362,7 +383,7 @@ export default {
}, },
// 选择不良项目 // 选择不良项目
change4 (i) { change4(i) {
this.tip = false; this.tip = false;
let arrIndex = this.arr2.indexOf(i); let arrIndex = this.arr2.indexOf(i);
...@@ -381,7 +402,7 @@ export default { ...@@ -381,7 +402,7 @@ export default {
} }
}, },
// 选择返工类型 // 选择返工类型
change5 (i) { change5(i) {
this.tip = false; this.tip = false;
let arrIndex = this.arr3.indexOf(i); let arrIndex = this.arr3.indexOf(i);
...@@ -389,7 +410,7 @@ export default { ...@@ -389,7 +410,7 @@ export default {
this.arr3 = []; this.arr3 = [];
this.tmust = true; this.tmust = true;
this.f = -1; this.f = -1;
this.remark = ''; this.remark = "";
this.reasonList = []; this.reasonList = [];
} else { } else {
this.arr3 = []; this.arr3 = [];
...@@ -402,14 +423,14 @@ export default { ...@@ -402,14 +423,14 @@ export default {
} }
}, },
// 选择返工原因 // 选择返工原因
change6 (i) { change6(i) {
let arrIndex = this.array.indexOf(i); let arrIndex = this.array.indexOf(i);
if (arrIndex > -1) { if (arrIndex > -1) {
this.array = []; this.array = [];
this.rmust = false; this.rmust = false;
this.g = -1; this.g = -1;
this.reason = ''; this.reason = "";
} else { } else {
this.array = []; this.array = [];
this.g = -1; this.g = -1;
...@@ -420,7 +441,7 @@ export default { ...@@ -420,7 +441,7 @@ export default {
} }
// console.log(this.reason); // console.log(this.reason);
}, },
reduce () { reduce() {
this.tip = false; this.tip = false;
if (this.number > 1) { if (this.number > 1) {
...@@ -429,11 +450,11 @@ export default { ...@@ -429,11 +450,11 @@ export default {
this.number = 1; this.number = 1;
} }
}, },
add () { add() {
this.tip = false; this.tip = false;
this.number++; this.number++;
}, },
save () { save() {
if (this.number < 1) { if (this.number < 1) {
// window_warning('返工数量不能小于1') // window_warning('返工数量不能小于1')
this.showMsg = this.$t(930026) + this.$t(930058); this.showMsg = this.$t(930026) + this.$t(930058);
...@@ -466,27 +487,28 @@ export default { ...@@ -466,27 +487,28 @@ export default {
QID: this.project, QID: this.project,
Remark: this.reason, Remark: this.reason,
Count: this.number, Count: this.number,
SettingId: this.settingId SettingId: this.settingId,
}; };
axios axios
.request({ .request({
url: '/qms/RepairData/AddRepair', url: "/qms/RepairData/AddRepair",
data, data,
method: 'post' method: "post",
}) })
.then((res) => { .then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
this.tip = true; this.tip = true;
this.number = 0; this.number = 0;
this.qrcode = ''; this.qrcode = "";
this.showMsg = this.$t(930059) + this.successnum + this.$t(930060); this.showMsg =
this.$t(930059) + this.successnum + this.$t(930060);
} }
// 成功后显示提示 // 成功后显示提示
}); });
}, },
// 全屏事件 // 全屏事件
handleFullScreen () { handleFullScreen() {
let element = document.getElementById('entry'); let element = document.getElementById("entry");
// 判断是否已经是全屏 // 判断是否已经是全屏
// 如果是全屏,退出 // 如果是全屏,退出
if (this.fullscreen) { if (this.fullscreen) {
...@@ -515,14 +537,16 @@ export default { ...@@ -515,14 +537,16 @@ export default {
// 改变当前全屏状态 // 改变当前全屏状态
this.fullscreen = !this.fullscreen; this.fullscreen = !this.fullscreen;
}, },
submitqr () { submitqr() {
if (this.qrcode == '') { if (this.qrcode == "") {
this.$Message.error(this.$t(9000436)); this.$Message.error(this.$t(9000436));
} else { } else {
axios axios
.request({ .request({
url: "'/qms/RepairData/GetProductRoute?sn=" + this.qrcode, url:
method: 'post' "'/qms/RepairData/GetProductRoute?sn=" +
this.qrcode,
method: "post",
}) })
.then((res) => { .then((res) => {
if (res.data.ret == 1) { if (res.data.ret == 1) {
...@@ -533,11 +557,11 @@ export default { ...@@ -533,11 +557,11 @@ export default {
}); });
} }
}, },
loadReferType () { loadReferType() {
axios axios
.request({ .request({
url: '/qms/ReworkReferenceType/GetItem?type=1', url: "/qms/ReworkReferenceType/GetItem?type=1",
method: 'get' method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret === 1) { if (res.data.ret === 1) {
...@@ -547,11 +571,13 @@ export default { ...@@ -547,11 +571,13 @@ export default {
} }
}); });
}, },
loadRefer () { loadRefer() {
axios axios
.request({ .request({
url: '/qms/ReworkReference/GetItem?type=1&referType=' + this.typeid, url:
method: 'get' "/qms/ReworkReference/GetItem?type=1&referType=" +
this.typeid,
method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret === 1) { if (res.data.ret === 1) {
...@@ -561,8 +587,8 @@ export default { ...@@ -561,8 +587,8 @@ export default {
console.log(this.$t(res.data.msg)); console.log(this.$t(res.data.msg));
} }
}); });
} },
} },
}; };
</script> </script>
......
[DbSetting]
UseOneDb=false
DbConnection=Server=mysql.siger-data.com;port=3306;database=sigerlaisi;charset=utf8;uid=siger;password=Siger_123
DbConnectionKM=Server=mysql.siger-data.com;port=3306;charset=utf8;uid=siger;password=Siger_123
DbConnectionTrace=Server=mysql.siger-data.com;port=3306;database=155_155;charset=utf8;uid=siger;password=Siger_123;Allow User Variables=True;
[RedisSetting]
ConnectionString=redis.siger-data.com,password=ky701@YH.com,ssl=false,writeBuffer=10240
PoolSize=1
DefaultDatabase=0
TokenExpiryMinutes=130
[DbClusterSetting]
ClusterConnection=Server=172.8.10.109;port=3306;database=siger;charset=utf8;uid=siger;password=Siger_123
ClusterConnectionKM=Server=172.8.10.109;port=3306;charset=utf8;uid=siger;password=Siger_123
RedisHost=172.8.10.105:7000;172.8.10.105:7001;172.8.10.106:7002;172.8.10.106:7003;172.8.10.107:7004;172.8.10.107:7005
[Task]
Start=0
[LogSetting]
Type=1
[FileSetting]
PhysicalFolder=TemporaryFiles
RequestPath=Files
[ConsulEnabledSetting]
Enabled=0
[PythonPathSetting]
PyPath=/root/miniconda3/bin/python3.7
[Register]
License=a7OIdILhmFICTay3U+952Fx1vl6vzT4T5E/Fto5zrNgoK49j3zOoU/H2ppaP/Jd8xLR6tJY7jgXCoXJCe09PNN7sjDTpRRCUkxWgCIuDhWRGERvo7HTEPA==
AppKey="123123"
\ No newline at end of file
[program:9MiddlerServer]
command=dotnet Siger.Middlelayer.ApiGateway.dll --port 8100
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9ConfigServer]
command=dotnet Siger.ApiConfig.dll --port 8101
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9CncServer]
command=dotnet Siger.ApiCNC.dll --port 8102
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9DncServer]
command=dotnet Siger.ApiDNC.dll --port 8103
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9EsopServer]
command=dotnet Siger.ApiEsop.dll --port 8104
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
[program:9TpmServer]
command=dotnet Siger.ApiTPM.dll --port 8105
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9ACCServer]
command=dotnet Siger.ApiACC.dll --port 8106
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9QMSServer]
command=dotnet Siger.ApiQMS.dll --port 8107
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9WMSServer]
command=dotnet Siger.ApiWMS.dll --port 8108
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2MiddlerServer]
command=dotnet Siger.Middlelayer.ApiGateway.dll --port 7405
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2ConfigServer]
command=dotnet Siger.ApiConfig.dll --port 7402
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2TpmServer]
command=dotnet Siger.ApiTPM.dll --port 7415
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2QMSServer]
command=dotnet Siger.ApiQMS.dll --port 7416
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2DashboardServer]
command=dotnet Siger.ApiDashboard.dll --port 7417
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2CNCServer]
command=dotnet Siger.ApiCNC.dll --port 7401
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2ChanglingServer]
command=dotnet Siger.ApiChangLing.dll --port 7408
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:CL2DNCServer]
command=dotnet Siger.ApiDNC.dll --port 7406
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9MiddlerServer]
command=dotnet Siger.Middlelayer.ApiGateway.dll --port 8100
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9ConfigServer]
command=dotnet Siger.ApiConfig.dll --port 8101
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9CncServer]
command=dotnet Siger.ApiCNC.dll --port 8102
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9DncServer]
command=dotnet Siger.ApiDNC.dll --port 8103
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9EsopServer]
command=dotnet Siger.ApiEsop.dll --port 8104
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
[program:9ACCServer]
command=dotnet Siger.ApiACC.dll --port 8106
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9QMSServer]
command=dotnet Siger.ApiQMS.dll --port 8107
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
[program:9WMSServer]
command=dotnet Siger.ApiWMS.dll --port 8108
directory=/usr/local/server
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
\ No newline at end of file
user root;
worker_processes 2;
error_log /usr/local/nginx/logs/nginx_error.log crit;
worker_rlimit_nofile 51200;
pid /usr/local/nginx/conf/nginx.pid;
events {
use epoll;
worker_connections 8000;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 3526;
server_names_hash_max_size 4096;
log_format combined_realip '$remote_addr $http_x_forwarded_for [$time_local]'
'$host "$request_uri" $status'
'"$http_referer" "$http_user_agent"';
sendfile on;
tcp_nopush on;
keepalive_timeout 300;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
connection_pool_size 256;
client_header_buffer_size 16k;
large_client_header_buffers 8 4k;
fastcgi_buffers 8 128k;
request_pool_size 4k;
output_buffers 4 32k;
postpone_output 1460;
client_max_body_size 200m;
client_body_buffer_size 256k;
fastcgi_intercept_errors on;
tcp_nodelay on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 8k;
gzip_comp_level 5;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript text/css text/htm application/xml;
#servers
upstream node{
server 127.0.0.1:8100;
}
upstream hehong{
server 127.0.0.1:18105;
}
server {
listen 80;
location / {
root html;
index index.html index.html;
}
location /onestop {
alias /usr/local/nginx/html;
index index.html index.html;
}
location ~^/apis/{
rewrite ^/apis/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://node;
}
location /onestop/apis{
rewrite ^/onestop/apis/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://node;
}
}
server {
listen 8080;
location / {
root /usr/local/nginx/hehong_html;
}
location ~^/apis/{
rewrite ^/apis/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://hehong;
}
}
}
...@@ -8,6 +8,7 @@ using Siger.Middlelayer.AccRepository.Entities; ...@@ -8,6 +8,7 @@ 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;
using Siger.Middlelayer.Common; using Siger.Middlelayer.Common;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Common.Log; using Siger.Middlelayer.Common.Log;
using Siger.Middlelayer.Common.ModuleEnum; using Siger.Middlelayer.Common.ModuleEnum;
using Siger.Middlelayer.Repository; using Siger.Middlelayer.Repository;
...@@ -26,8 +27,10 @@ namespace Siger.ApiACC.Controllers ...@@ -26,8 +27,10 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationMachineStatus _automationMachineStatus; private readonly IAutomationMachineStatus _automationMachineStatus;
private readonly ISigerDict _sigerDict; private readonly ISigerDict _sigerDict;
private readonly IAutomationTaskListRepository _automationTaskList; private readonly IAutomationTaskListRepository _automationTaskList;
private readonly ISigerProjectMachineAttributionRepository _sigerProjectMachineAttribution;
public AutomationController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection,IAutomationLineMode automationLineMode,IAutomationMachineStatus automationMachineStatus,ISigerDict sigerDict,IAutomationTaskListRepository automationTaskList) public AutomationController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection,IAutomationLineMode automationLineMode,IAutomationMachineStatus automationMachineStatus,ISigerDict sigerDict,IAutomationTaskListRepository automationTaskList,
ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -35,6 +38,7 @@ namespace Siger.ApiACC.Controllers ...@@ -35,6 +38,7 @@ namespace Siger.ApiACC.Controllers
_automationMachineStatus = automationMachineStatus; _automationMachineStatus = automationMachineStatus;
_sigerDict = sigerDict; _sigerDict = sigerDict;
_automationTaskList = automationTaskList; _automationTaskList = automationTaskList;
_sigerProjectMachineAttribution = sigerProjectMachineAttribution;
} }
/// <summary> /// <summary>
...@@ -45,10 +49,16 @@ namespace Siger.ApiACC.Controllers ...@@ -45,10 +49,16 @@ namespace Siger.ApiACC.Controllers
[HttpPost] [HttpPost]
public IActionResult MachineStatus([FromBody]RequestAutomationMachine request) public IActionResult MachineStatus([FromBody]RequestAutomationMachine request)
{ {
var machineAttr = _sigerProjectMachineAttribution.Get(f => f.projectid == PID && f.machine == request.machineid);
if (machineAttr==null)
{
throw new BadRequestException(ConfigEnum.MachineAttributionNotFound);
}
var exitsObj = _automationMachineStatus.Get(f => f.machineid == request.machineid); var exitsObj = _automationMachineStatus.Get(f => f.machineid == request.machineid);
if (exitsObj==null) if (exitsObj==null)
{ {
_automationMachineStatus.Insert(new siger_automation_machine_status{ _automationMachineStatus.Insert(new siger_automation_machine_status{
section=machineAttr.station,
machineid=request.machineid, machineid=request.machineid,
projectId=PID, projectId=PID,
updatetime=DateTime.Now, updatetime=DateTime.Now,
...@@ -63,10 +73,80 @@ namespace Siger.ApiACC.Controllers ...@@ -63,10 +73,80 @@ namespace Siger.ApiACC.Controllers
} }
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{
// 设备空闲,或者完成时触发 自动任务
if (request.enable == 1)
{
if (request.status == (int)Automation.MachineStatus.Waiting || request.status == (int)Automation.MachineStatus.Complated)
{
var tasklist = _automationTaskList.GetList(f => f.projectId == PID && f.status >= (int)TaskResultStatus.Cancel && f.status < (int)TaskResultStatus.Complated);
if (!tasklist.Any())
{
var section = _sigerProjectLevelSection.Get(f => f.id == machineAttr.station);
if (section != null)
{
Logger.WriteLineInfo($"MachineStatus 设备状态 触发自动任务检查");
AutoProcess(section.parentid);
}
}
}
}
return new ObjectResult(CommonEnum.Succefull); return new ObjectResult(CommonEnum.Succefull);
}
else else
{
throw new BadRequestException(CommonEnum.Fail); throw new BadRequestException(CommonEnum.Fail);
}
}
/// <summary>
/// 产线模式 0:手动模式 /1:自动模式(产生自动任务)
/// </summary>
/// <param name="line"></param>
/// <param name="mode"></param>
/// <returns></returns>
public IActionResult LineMode(int line, int mode)
{
var exitObj = _automationLineMode.Get(f => f.section == line);
if (exitObj == null)
{
_automationLineMode.Insert(new siger_automation_line_mode
{
section = line,
projectId = PID,
status = 1,
updatetime = DateTime.Now,
mode = mode
});
}
else
{
exitObj.updatetime = DateTime.Now;
exitObj.mode = mode;
}
if (_unitOfWork.Commit() > 0)
{
if (mode == 1)
{
//TODO
//手动-》自动 时
//task 无任务时候 ,根据设备状态创建任务
var tasklist = _automationTaskList.GetList(f => f.projectId == PID && f.status >= (int)TaskResultStatus.Cancel && f.status < (int)TaskResultStatus.Complated);
if (!tasklist.Any())
{
Logger.WriteLineInfo($"LineMode Mode=1 触发自动任务检查");
AutoProcess(line);
}
}
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
} }
/// <summary> /// <summary>
/// 任务状态接口 用于保存PLC 实时任务状态 () /// 任务状态接口 用于保存PLC 实时任务状态 ()
...@@ -107,7 +187,11 @@ namespace Siger.ApiACC.Controllers ...@@ -107,7 +187,11 @@ namespace Siger.ApiACC.Controllers
case (int)TaskResultStatus.Cancel: case (int)TaskResultStatus.Cancel:
case (int)TaskResultStatus.Complated: case (int)TaskResultStatus.Complated:
{ {
CreateAutoTask(taskObj); var section = _sigerProjectLevelSection.Get(f => f.id == taskObj.sectionid);
if (section != null)
{
AutoProcess(section.parentid);
}
break; break;
} }
case (int)TaskResultStatus.Waiting: case (int)TaskResultStatus.Waiting:
...@@ -123,83 +207,110 @@ namespace Siger.ApiACC.Controllers ...@@ -123,83 +207,110 @@ namespace Siger.ApiACC.Controllers
/// <summary> /// <summary>
/// 创建自动 Task任务 /// 创建自动 Task任务
/// </summary> /// </summary>
/// <param name="tasklist"></param> /// <param name="line"></param>
void CreateAutoTask(siger_automation_task_list tasklist) void AutoProcess(int line)
{
var section = _sigerProjectLevelSection.Get(f => f.id == tasklist.startsection);
if (section == null)
{ {
Logger.WriteLineInfo($"CreateAutoTask 工站未找到"); var lineMode = _automationLineMode.Get(f => f.projectId == PID && f.section == line);
throw new BadRequestException(RequestEnum.LevelSectionNotFound);
}
var lineMode = _automationLineMode.Get(f => f.projectId == PID && f.section == section.parentid);
if (lineMode==null) if (lineMode==null)
{ {
Logger.WriteLineInfo($"CreateAutoTask 产线未找到"); Logger.WriteLineInfo($"AutoProcess 产线模式未找到");
throw new BadRequestException(RequestEnum.LevelSectionNotFound); throw new BadRequestException(RequestEnum.LevelSectionNotFound);
} }
if (lineMode.mode==0) if (lineMode.mode==0)
{ {
Logger.WriteLineInfo($"CreateAutoTask 手动模式"); Logger.WriteLineInfo($"AutoProcess 手动模式");
//手动模式时 退出 //手动模式时 退出
return; return;
} }
var machineList= _automationMachineStatus.GetList(f => f.projectId == PID && f.enable == 1); /*
//自动Task任务 顺序 //自动Task任务 顺序
//1.清洗机下料 //1.清洗机下料
//2.其他设备上料 //2.其他设备上料
//3.其他设备下料 //3.其他设备下料
*/
var stationDicts = _sigerDict.GetDataByCat(AccDictCost.Automation, PID); var stationDicts = _sigerDict.GetDataByCat(AccDictCost.Automation, PID);
if (!stationDicts.Any()) if (!stationDicts.Any())
{ {
Logger.WriteLineInfo($"CreateAutoTask 未配置设备类型字典"); Logger.WriteLineInfo($"AutoProcess 未配置设备类型字典");
return; return;
} }
var dictClean = stationDicts.FirstOrDefault(s=>s.dkey==DictKeyValConst.CleanStation); var dictClean = stationDicts.FirstOrDefault(s=>s.dkey==DictKeyValConst.CleanStation);
if (dictClean==null) if (dictClean==null)
{ {
Logger.WriteLineInfo($"CreateAutoTask 未配置清洗机字典"); Logger.WriteLineInfo($"AutoProcess 未配置清洗机字典");
return; return;
} }
// 获取可用 设备状态列表
var machineStatusList = _automationMachineStatus.GetList(f => f.projectId == PID && f.enable == 1);
if (!machineStatusList.Any())
{
Logger.WriteLineInfo($"AutoProcess 无可用状态的设备");
return;
} }
//优先级1 :清洗机完成 。待下料
/// <summary> var cleanMachine = machineStatusList.FirstOrDefault(f => f.machineid == dictClean.dval.ToInt());
/// 产线模式 0:手动模式 /1:自动模式(产生自动任务) if (cleanMachine!=null)
/// </summary>
/// <param name="line"></param>
/// <param name="mode"></param>
/// <returns></returns>
public IActionResult LineMode(int line,int mode)
{ {
var exitObj = _automationLineMode.Get(f => f.section == line); if (cleanMachine.status == (int)Automation.MachineStatus.Complated)
if (exitObj==null)
{ {
_automationLineMode.Insert(new siger_automation_line_mode Logger.WriteLineInfo($"AutoProcess 有清洗机完成,创建清洗剂Task");
CreateTask(cleanMachine, TaskActionType.Unload, TaskAction.Step_QXJ_LK);
return; //完成当前任务 退出
}
}
//优先级2 :其他设备待上料 (立库->加工中心)
var freeMachine = machineStatusList.FirstOrDefault(f=>f.status==(int)Automation.MachineStatus.Waiting);
if (freeMachine != null)
{ {
section = line, Logger.WriteLineInfo($"AutoProcess 普通空闲,创建普通设备上料Task");
projectId = PID, CreateTask(freeMachine, TaskActionType.Load ,TaskAction.Step_LK_JGZX);
status=1, return; //完成当前任务 退出
updatetime=DateTime.Now, }
mode=mode //优先级3:其他设备下料 (加工中心 ->立库)
}) ; if (cleanMachine != null)
}else
{ {
exitObj.updatetime = DateTime.Now; var fullMachine = machineStatusList.FirstOrDefault(f => f.status == (int)Automation.MachineStatus.Complated);
exitObj.mode = mode; if (fullMachine != null && cleanMachine.status==(int)Automation.MachineStatus.Waiting)
{
Logger.WriteLineInfo($"AutoProcess 普通空闲,创建普通设备下料Task ");
CreateTask(fullMachine, TaskActionType.Unload, TaskAction.Step_JGZX_QXJ);
return; //完成当前任务 退出
}
} }
}
void CreateTask(siger_automation_machine_status machineStatus, TaskActionType actionType, TaskAction taskAction)
{
_automationTaskList.Insert(new siger_automation_task_list
{
projectId = PID,
sectionid = machineStatus.section,
trigger = TaskTrigerType.Auto,
action = taskAction,
actiontype = TaskTrigerType.Auto,//默认自动动作
tasktype = actionType,
triggertime = DateTime.Now,
completetime = DateTime.MinValue,
operatetime = DateTime.MinValue,
send = 0,
operater = 0,
status = 1,
});
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
return new ObjectResult(CommonEnum.Succefull); Logger.WriteLineInfo($"CreateTask 工站 完成");
else else
throw new BadRequestException(CommonEnum.Fail); Logger.WriteLineInfo($"CreateTask 工站 失败");
} }
} }
} }
...@@ -36,9 +36,9 @@ namespace Siger.ApiACC.Controllers ...@@ -36,9 +36,9 @@ namespace Siger.ApiACC.Controllers
_materialsRepository = materialsRepository; _materialsRepository = materialsRepository;
} }
public IActionResult GetPageList(string category, string code, string name, string state, int page, int pagesize) public IActionResult GetPageList(string wavehouseid, string locationid, int page, int pagesize)
{ {
var data = _toolsRepository.GetPagedList(category.ToInt(), code, name, string.IsNullOrEmpty(state) ? -1 : state.ToInt(), ProjectId, page, pagesize); var data = _autoLocationRepository.GetPagedList(wavehouseid.ToInt(), locationid.ToInt(), ProjectId, page, pagesize);
return new PagedObjectResult(data.Data, data.Total, page, pagesize); return new PagedObjectResult(data.Data, data.Total, page, pagesize);
} }
...@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Controllers ...@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var fixturetool = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId && q.status == (int)RowState.Valid); var fixturetool = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId);
if (fixturetool == null) if (fixturetool == null)
{ {
throw new BadRequestException(RequestEnum.FixtureToolNotFound); throw new BadRequestException(RequestEnum.FixtureToolNotFound);
...@@ -76,6 +76,14 @@ namespace Siger.ApiACC.Controllers ...@@ -76,6 +76,14 @@ namespace Siger.ApiACC.Controllers
{ {
state = 2;//有工装 有工件 state = 2;//有工装 有工件
} }
else if (fixturetool == null && material == null)
{
state = 3;//无工装 无工件
}
else if (fixturetool == null && material != null)
{
state = 4;//无工装 有工件
}
var entity = new siger_automation_location var entity = new siger_automation_location
{ {
guid = Guid.NewGuid().ToString(), guid = Guid.NewGuid().ToString(),
...@@ -84,7 +92,8 @@ namespace Siger.ApiACC.Controllers ...@@ -84,7 +92,8 @@ namespace Siger.ApiACC.Controllers
materialid = req.materialid.ToInt(), materialid = req.materialid.ToInt(),
processid = req.processid.ToInt(), processid = req.processid.ToInt(),
materialstate = state, materialstate = state,
attachment = req.attachment, attachment = req.fileurl,
filename = req.filename,
remark = req.remark, remark = req.remark,
projectId = ProjectId, projectId = ProjectId,
updatetime = DateTime.Now, updatetime = DateTime.Now,
...@@ -109,7 +118,7 @@ namespace Siger.ApiACC.Controllers ...@@ -109,7 +118,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var entity = _autoLocationRepository.Get(q => q.id == req.id && q.projectId == ProjectId && q.status == (int)RowState.Valid); var entity = _autoLocationRepository.Get(q => q.id == req.id && q.projectId == ProjectId && q.status == (int)RowState.Valid);
var fixturetool = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId && q.status == (int)RowState.Valid); var fixturetool = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId);
if (fixturetool == null) if (fixturetool == null)
{ {
throw new BadRequestException(RequestEnum.FixtureToolNotFound); throw new BadRequestException(RequestEnum.FixtureToolNotFound);
...@@ -136,12 +145,21 @@ namespace Siger.ApiACC.Controllers ...@@ -136,12 +145,21 @@ namespace Siger.ApiACC.Controllers
{ {
state = 2;//有工装 有工件 state = 2;//有工装 有工件
} }
else if (fixturetool == null && material == null)
{
state = 3;//无工装 无工件
}
else if (fixturetool == null && material != null)
{
state = 4;//无工装 有工件
}
entity.locationid = req.locationid.ToInt(); entity.locationid = req.locationid.ToInt();
entity.fixturetools = fixturetool.guid; entity.fixturetools = fixturetool.guid;
entity.materialid = req.materialid.ToInt(); entity.materialid = req.materialid.ToInt();
entity.processid = req.processid.ToInt(); entity.processid = req.processid.ToInt();
entity.materialstate = state; entity.materialstate = state;
entity.attachment = req.attachment; entity.attachment = req.fileurl;
entity.filename = req.filename;
entity.remark = req.remark; entity.remark = req.remark;
entity.updatetime = DateTime.Now; entity.updatetime = DateTime.Now;
entity.updator = UserId; entity.updator = UserId;
......
...@@ -33,10 +33,153 @@ namespace Siger.ApiACC.Controllers ...@@ -33,10 +33,153 @@ namespace Siger.ApiACC.Controllers
_toolsAssemblyRepository = toolsAssemblyRepository; _toolsAssemblyRepository = toolsAssemblyRepository;
} }
public IActionResult GetPageList(string category, int page, int pagesize) [HttpGet]
public IActionResult GetPageList(string category, string code, string name, int projectid, int page, int pagesize)
{ {
var data = _toolsAssemblyRepository.GetPagedList(category.ToInt(), ProjectId, page, pagesize); var data = _toolsAssemblyRepository.GetPagedList(category.ToInt(), code, name, ProjectId, page, pagesize);
return new PagedObjectResult(data.Data, data.Total, page, pagesize); return new PagedObjectResult(data.Data, data.Total, page, pagesize);
} }
[HttpGet]
public IActionResult GetDetail(string id)
{
var data = _toolsAssemblyRepository.GetDetailList(id.ToInt(), ProjectId);
return new ObjectResult(data);
}
[HttpPost]
public IActionResult Add([FromBody]RequestAddFixtureToolAssembly req)
{
if (string.IsNullOrEmpty(req.fixturetoolid))
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
var parent = _toolsRepository.Get(q => q.id == req.parentid.ToInt() && q.projectId == ProjectId);
var son = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId);
if (son == null)
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
}
if (parent == null)
{
}
var parentGuid = parent?.guid ?? "";
var exsit = _toolsAssemblyRepository.Get(q => q.projectId == ProjectId && q.son == son.guid && q.parent == parentGuid);
if (exsit != null)
{
throw new BadRequestException(RequestEnum.DataExist);
}
var entity = new siger_automation_fixture_tools_assembly
{
guid = Guid.NewGuid().ToString(),
parent = parent?.guid ?? "",
son = son.guid,
creator = UserId,
createtime = DateTime.Now,
attachment = req.fileurl,
filename = req.filename,
projectId = ProjectId,
updatetime = DateTime.Now,
updator = UserId,
status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid,
};
_toolsAssemblyRepository.Insert(entity);
if (_unitOfWork.Commit() > 0)
{
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
}
[HttpPost]
public IActionResult Update([FromBody]RequestUpdateFixtureToolAssembly req)
{
if (string.IsNullOrEmpty(req.fixturetoolid))
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
var entity = _toolsAssemblyRepository.Get(q => q.projectId == ProjectId && q.id == req.id);
if(entity == null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var parent = _toolsRepository.Get(q => q.id == req.parentid.ToInt() && q.projectId == ProjectId);
var son = _toolsRepository.Get(q => q.id == req.fixturetoolid.ToInt() && q.projectId == ProjectId);
if (son == null)
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
}
var parentGuid = parent?.guid ?? "";
var exsit = _toolsAssemblyRepository.Get(q => q.projectId == ProjectId && q.son == son.guid && q.parent == parentGuid &&
q.id != req.id);
if (exsit != null)
{
throw new BadRequestException(RequestEnum.DataExist);
}
entity.parent = parent?.guid ?? "";
entity.son = son.guid;
entity.attachment = req.fileurl;
entity.filename = req.filename;
entity.updatetime = DateTime.Now;
entity.updator = UserId;
entity.status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid;
_toolsAssemblyRepository.Update(entity);
if (_unitOfWork.Commit() > 0)
{
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
}
[HttpGet]
public IActionResult Delete(int id)
{
var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == id);
if (entity == null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
_toolsAssemblyRepository.Delete(entity);
if (_unitOfWork.Commit() > 0)
{
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
}
[HttpPost]
public IActionResult Deletes([FromBody]RequestDeleteRange req)
{
if (req.ids == null || !req.ids.Any())
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
var entities = _toolsAssemblyRepository.GetList(t => req.ids.Contains(t.id) && t.projectId == ProjectId).ToList();
if (!entities.Any())
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
foreach (var entity in entities)
{
_toolsAssemblyRepository.Delete(entity);
}
if (_unitOfWork.Commit() > 0)
return new ObjectResult(CommonEnum.Succefull);
throw new BadRequestException(CommonEnum.Fail);
}
} }
} }
...@@ -34,7 +34,24 @@ namespace Siger.ApiACC.Controllers ...@@ -34,7 +34,24 @@ namespace Siger.ApiACC.Controllers
public IActionResult GetPageList(string category, string code, string name, string state, int page, int pagesize) public IActionResult GetPageList(string category, string code, string name, string state, int page, int pagesize)
{ {
var data = _toolsRepository.GetPagedList(category.ToInt(), code, name, string.IsNullOrEmpty(state) ? -1 : state.ToInt(), ProjectId, page, pagesize); var data = _toolsRepository.GetPagedList(category.ToInt(), code, name, string.IsNullOrEmpty(state) ? -1 : state.ToInt(), ProjectId, page, pagesize);
return new PagedObjectResult(data.Data, data.Total, page, pagesize); var list = new List<ResponseFixtureTools>();
var categorys = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid).ToList();
foreach(var item in data.Data)
{
var cates = GetParentCategoryList(item.cate_guid, categorys);
var cateIds = cates.Select(q => q.id).ToList();
cateIds.Reverse();
item.categoryids = cateIds;
list.Add(item);
}
return new PagedObjectResult(list, data.Total, page, pagesize);
}
private IEnumerable<siger_automation_fixture_tools_category> GetParentCategoryList(string parentId, List<siger_automation_fixture_tools_category> sections)
{
var query = from c in sections where c.guid == parentId select c;
return query.ToList().Concat(query.ToList().SelectMany(t => GetParentCategoryList(t.parent, sections)));
} }
[HttpPost] [HttpPost]
...@@ -45,8 +62,7 @@ namespace Siger.ApiACC.Controllers ...@@ -45,8 +62,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var data = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.name == req.name || var data = _toolsRepository.Get(q => q.projectId == ProjectId && (q.name == req.name || q.code == req.code || q.partnumber == req.partnumber));
q.code == req.code || q.partnumber == req.partnumber));
if (data != null) if (data != null)
{ {
throw new BadRequestException(RequestEnum.DataExist); throw new BadRequestException(RequestEnum.DataExist);
...@@ -68,9 +84,11 @@ namespace Siger.ApiACC.Controllers ...@@ -68,9 +84,11 @@ namespace Siger.ApiACC.Controllers
specification = req.specifition, specification = req.specifition,
number = req.number.ToInt(), number = req.number.ToInt(),
remark = req.remark, remark = req.remark,
attachment = req.attachment, attachment = req.fileurl,
filename = req.filename,
code = req.code, code = req.code,
projectId = ProjectId, projectId = ProjectId,
status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid,
createtime = DateTime.Now, createtime = DateTime.Now,
updatetime = DateTime.Now, updatetime = DateTime.Now,
creator = UserId, creator = UserId,
...@@ -95,9 +113,8 @@ namespace Siger.ApiACC.Controllers ...@@ -95,9 +113,8 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.id == req.id); var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == req.id);
var data = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.name == req.name || var data = _toolsRepository.Get(q => q.projectId == ProjectId && (q.name == req.name || q.code == req.code || q.partnumber == req.partnumber) && q.id != req.id);
q.code == req.code || q.partnumber == req.partnumber) && q.id != req.id);
if (data != null) if (data != null)
{ {
throw new BadRequestException(RequestEnum.DataExist); throw new BadRequestException(RequestEnum.DataExist);
...@@ -116,10 +133,12 @@ namespace Siger.ApiACC.Controllers ...@@ -116,10 +133,12 @@ namespace Siger.ApiACC.Controllers
entity.specification = req.specifition; entity.specification = req.specifition;
entity.number = req.number.ToInt(); entity.number = req.number.ToInt();
entity.remark = req.remark; entity.remark = req.remark;
entity.attachment = req.attachment; entity.attachment = req.fileurl;
entity.filename = req.filename;
entity.code = req.code; entity.code = req.code;
entity.updatetime = DateTime.Now; entity.updatetime = DateTime.Now;
entity.updator = UserId; entity.updator = UserId;
entity.status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid;
_toolsRepository.Update(entity); _toolsRepository.Update(entity);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{ {
...@@ -134,14 +153,12 @@ namespace Siger.ApiACC.Controllers ...@@ -134,14 +153,12 @@ namespace Siger.ApiACC.Controllers
[HttpGet] [HttpGet]
public IActionResult Delete(int id) public IActionResult Delete(int id)
{ {
var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.id == id); var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == id);
if (entity == null) if (entity == null)
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
_toolsRepository.Delete(entity);
entity.status = (int)RowState.Invalid;
_toolsRepository.Update(entity);
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
{ {
return new ObjectResult(CommonEnum.Succefull); return new ObjectResult(CommonEnum.Succefull);
...@@ -159,16 +176,14 @@ namespace Siger.ApiACC.Controllers ...@@ -159,16 +176,14 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var entities = _toolsRepository.GetList(t => var entities = _toolsRepository.GetList(t => req.ids.Contains(t.id) && t.projectId == ProjectId).ToList();
req.ids.Contains(t.id) && t.projectId == ProjectId && t.status == (int)RowState.Valid).ToList();
if (!entities.Any()) if (!entities.Any())
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
foreach (var entity in entities) foreach (var entity in entities)
{ {
entity.status = (int)RowState.Invalid; _toolsRepository.Delete(entity);
_toolsRepository.Update(entity);
} }
if (_unitOfWork.Commit() > 0) if (_unitOfWork.Commit() > 0)
...@@ -176,6 +191,23 @@ namespace Siger.ApiACC.Controllers ...@@ -176,6 +191,23 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(CommonEnum.Fail); throw new BadRequestException(CommonEnum.Fail);
} }
[HttpGet]
public IActionResult GetFxitureTooolList()
{
var list = _toolsRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid).Select(
q => new
{
q.id,
q.code,
q.partnumber,
q.name,
q.specification,
q.number
}).ToList();
return new ObjectResult(list);
}
[HttpGet] [HttpGet]
......
...@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Controllers ...@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var fixtureTool = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.id == req.fixturetoolid.ToInt()); var fixtureTool = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == req.fixturetoolid.ToInt());
if(fixtureTool == null) if(fixtureTool == null)
{ {
throw new BadRequestException(RequestEnum.FixtureToolNotFound); throw new BadRequestException(RequestEnum.FixtureToolNotFound);
...@@ -101,7 +101,7 @@ namespace Siger.ApiACC.Controllers ...@@ -101,7 +101,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
var fixtureTool = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.id == req.fixturetoolid.ToInt()); var fixtureTool = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == req.fixturetoolid.ToInt());
if (fixtureTool == null) if (fixtureTool == null)
{ {
throw new BadRequestException(RequestEnum.FixtureToolNotFound); throw new BadRequestException(RequestEnum.FixtureToolNotFound);
......
...@@ -80,38 +80,53 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum ...@@ -80,38 +80,53 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary> /// <summary>
/// 立库->上下料工站 /// 立库->上下料工站
/// </summary> /// </summary>
[Description("立库->上下料工站")] [Description("立库->上下料")]
FirstStep=1, Step_LK_SXLW=1,
/// <summary> /// <summary>
/// 上下料工站->立库 /// 上下料工站->立库
/// </summary> /// </summary>
[Description("上下料工站->立库")] [Description("上下料->立库")]
SecondStep =2, Step_SXLW_LK =2,
/// <summary> /// <summary>
/// 立库->加工中心 /// 立库->加工中心
/// </summary> /// </summary>
[Description("立库->加工中心")] [Description("立库->加工中心")]
ThirdStep =3, Step_LK_JGZX =3,
/// <summary> /// <summary>
/// 加工中心->清洗机 /// 加工中心->清洗机
/// </summary> /// </summary>
[Description("加工中心->清洗机")] [Description("加工中心->清洗机")]
FourStep =4, Step_JGZX_QXJ =4,
/// <summary> /// <summary>
/// 立库->抽检工位 /// 立库->抽检工位
/// </summary> /// </summary>
[Description("立库->抽检工位")] [Description("立库->抽检")]
FiveStep =5, Step_LK_CJT =5,
/// <summary> /// <summary>
/// 抽检工位->上下料工站 /// 抽检工位->上下料工站
/// </summary> /// </summary>
[Description("抽检工位->上下料工站")] [Description("抽检台->上下料位")]
SixStep =6, Step_CJT_SXLW =6,
/// <summary> /// <summary>
/// 清洗->立库 /// 清洗->立库
/// </summary> /// </summary>
[Description("清洗剂->立库")] [Description("清洗机->立库")]
SevenStep =7 Step_QXJ_LK =7,
/// <summary>
/// 加工中心->立库
/// </summary>
[Description("加工中心->立库")]
Step_JGZX_LK =8,
/// <summary>
/// 抽检台->立库
/// </summary>
[Description("抽检台->立库")]
Step_CJT_LK = 9,
/// <summary>
/// 清洗机->加工中心
/// </summary>
[Description("清洗机->加工中心")]
Step_QXJ_JGZX = 10,
} }
} }
} }
...@@ -42,6 +42,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -42,6 +42,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 附件 /// 附件
/// </summary> /// </summary>
public string attachment { get; set; } public string attachment { get; set; }
public string filename { get; set; }
/// <summary> /// <summary>
/// 工装编号 /// 工装编号
/// </summary> /// </summary>
......
...@@ -18,6 +18,15 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -18,6 +18,15 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 工装GUID /// 工装GUID
/// </summary> /// </summary>
public string son { get; set; } public string son { get; set; }
/// <summary>
/// 附件
/// </summary>
public string attachment { get; set; }
public string fileurl { get; set; }
/// <summary>
/// 附件名称
/// </summary>
public string filename { get; set; }
public int creator { get; set; } public int creator { get; set; }
public DateTime createtime { get; set; } public DateTime createtime { get; set; }
public int updator { get; set; } public int updator { get; set; }
......
...@@ -34,6 +34,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -34,6 +34,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 附件 /// 附件
/// </summary> /// </summary>
public string attachment { get; set; } public string attachment { get; set; }
public string filename { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
......
...@@ -9,7 +9,13 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -9,7 +9,13 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public class siger_automation_machine_status:AccEntityBase public class siger_automation_machine_status:AccEntityBase
{ {
public string guid { get; set; } /// <summary>
/// 工位ID
/// </summary>
public int section { get; set; }
/// <summary>
/// 设备ID
/// </summary>
public int machineid { get; set; } public int machineid { get; set; }
/// <summary> /// <summary>
/// 1可用 0不可用 /// 1可用 0不可用
......
...@@ -14,7 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -14,7 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary> /// <summary>
/// 工位ID /// 工位ID
/// </summary> /// </summary>
public string sectionid { get; set; } public int sectionid { get; set; }
/// <summary> /// <summary>
/// 触发方式 /// 触发方式
/// </summary> /// </summary>
...@@ -24,10 +24,6 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -24,10 +24,6 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary> /// </summary>
public TaskActionType tasktype { get; set; } public TaskActionType tasktype { get; set; }
/// <summary> /// <summary>
/// 发起工位
/// </summary>
public int startsection { get; set; }
/// <summary>
/// 工件ID /// 工件ID
/// </summary> /// </summary>
public int materialid { get; set; } public int materialid { get; set; }
......
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
...@@ -20,7 +21,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -20,7 +21,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context = context; _context = context;
} }
public IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int categor, int projectid, int page, int pagesize) public IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, int projectid, int page, int pagesize)
{ {
var query = from q in _context.siger_automation_fixture_tools_assembly 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 join t1 in _context.siger_automation_fixture_tools on q.parent equals t1.guid into tt1
...@@ -30,21 +31,77 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -30,21 +31,77 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join c2 in _context.siger_automation_fixture_tools_category on t2.category equals c2.guid join c2 in _context.siger_automation_fixture_tools_category on t2.category equals c2.guid
join u in _context.siger_project_user on q.updator equals u.mid into uu join u in _context.siger_project_user on q.updator equals u.mid into uu
from u in uu.DefaultIfEmpty() from u in uu.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid && string.IsNullOrEmpty(q.parent) where q.projectId == projectid && string.IsNullOrEmpty(q.parent)
select new ResponseAumationFixtureToolsAssembly select new ResponseAumationFixtureToolsAssembly
{ {
id = q.id, id = q.id,
parentid = t1 == null ? 0 : t1.id, parentid = t1 == null ? 0 : t1.id,
parentname = t1.name ?? "", parentname = t1.name ?? "",
sonid = t2.id, fixturetoolid = t2.id,
sonname = t2.name ??"", name = t2.name,
code = t2.code,
partnumber = t2.partnumber,
specfication = t2.specification,
updator = u.name ?? "", updator = u.name ?? "",
status = q.status, status = q.status,
fileurl = q.attachment,
filename = q.filename,
categoryid = c2.id,
category = c2.name,
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : "" updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : ""
}; };
var entities = query.OrderByDescending(q => q.id).Skip((page - 1) * pagesize).Take(pagesize).AsNoTracking().ToList(); Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> categoryExpression = f => true;
var totalCount = query.Count(); if (category > 0)
{
categoryExpression = q => q.categoryid == category;
}
Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> codeExpression = f => true;
if (!string.IsNullOrEmpty(code))
{
categoryExpression = q => q.code.Contains(code);
}
Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> nameExpression = f => true;
if (!string.IsNullOrEmpty(name))
{
nameExpression = q => q.name.Contains(name);
}
var expression = categoryExpression.And(codeExpression).And(nameExpression);
var entities = query.Where(expression).OrderByDescending(q => q.id).Skip((page - 1) * pagesize).Take(pagesize).AsNoTracking().ToList();
var totalCount = query.Where(expression).Count();
return new PagedCollectionResult<ResponseAumationFixtureToolsAssembly>(entities, totalCount); return new PagedCollectionResult<ResponseAumationFixtureToolsAssembly>(entities, totalCount);
} }
public IEnumerable<ResponseAumationFixtureToolsAssembly> GetDetailList(int id, int projectid)
{
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
from t1 in tt1.DefaultIfEmpty()
join c1 in _context.siger_automation_fixture_tools_category on t1.category equals c1.guid
join t2 in _context.siger_automation_fixture_tools on q.son equals t2.guid
join c2 in _context.siger_automation_fixture_tools_category on t2.category equals c2.guid
join u in _context.siger_project_user on q.updator equals u.mid into uu
from u in uu.DefaultIfEmpty()
where q.projectId == projectid && q.id == id
select new ResponseAumationFixtureToolsAssembly
{
id = q.id,
parentid = t1 == null ? 0 : t1.id,
parentname = t1.name ?? "",
fixturetoolid = t2.id,
name = t2.name,
code = t2.code,
partnumber = t2.partnumber,
specfication = t2.specification,
updator = u.name ?? "",
status = q.status,
fileurl = q.attachment,
filename = q.filename,
categoryid = c2.id,
category = c2.name,
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : ""
};
var entities = query.OrderByDescending(q => q.id).AsNoTracking().ToList();
return entities;
}
} }
} }
...@@ -27,12 +27,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -27,12 +27,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join p in _context.siger_automation_fixture_tools_category on q.category equals p.guid join p in _context.siger_automation_fixture_tools_category on q.category equals p.guid
join u in _context.siger_project_user on q.updator equals u.mid into uu join u in _context.siger_project_user on q.updator equals u.mid into uu
from u in uu.DefaultIfEmpty() from u in uu.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid where q.projectId == projectid
select new ResponseFixtureTools select new ResponseFixtureTools
{ {
id = q.id, id = q.id,
name = q.name, name = q.name,
guid = q.guid, guid = q.guid,
cate_guid = p.guid,
categoryid = p.id, categoryid = p.id,
category = p.name, category = p.name,
managetype = q.managetype, managetype = q.managetype,
...@@ -40,7 +41,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -40,7 +41,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
specification = q.specification, specification = q.specification,
number = q.number, number = q.number,
remark = q.remark, remark = q.remark,
attachment = q.attachment, fileurl = q.attachment ?? "",
filename = q.filename ?? "",
code = q.code, code = q.code,
updator = u.name ?? "", updator = u.name ?? "",
status = q.status, status = q.status,
......
...@@ -36,23 +36,24 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -36,23 +36,24 @@ namespace Siger.Middlelayer.AccRepository.Repositories
select new ResponseAutomationLocation select new ResponseAutomationLocation
{ {
id = q.id, id = q.id,
locationid=l.id, locationid = l.id,
location=l.name, location = l.name,
wavehouseid=w.id, wavehouseid = w.id,
wavehouse=w.name, wavehouse = w.name,
fixturetoolid=t.id, fixturetoolid = t.id,
fixturetool=t.name, fixturetool = t.name,
category=c.name, category = c.name,
code=t.code, code = t.code,
specfication=t.specification, specfication = t.specification,
materialid=q.materialid, materialid = q.materialid,
materialcode=m.pn, materialcode = m.pn,
processid = q.processid, processid = q.processid,
processnumber = p == null ? 0 : p.Process_Seq, processnumber = p == null ? 0 : p.Process_Seq,
processname = p.Process_name??"", processname = p.Process_name ?? "",
materialstate = q.materialstate, materialstate = q.materialstate,
attachment=q.attachment, fileurl = q.attachment ?? "",
remark=q.remark, filename = q.filename ?? "",
remark = q.remark,
updator = u.name ?? "", updator = u.name ?? "",
status = q.status, status = q.status,
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : "" updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : ""
......
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
using Siger.Middlelayer.AccRepository.Response; using Siger.Middlelayer.AccRepository.Response;
using Siger.Middlelayer.Repository.Data.Acc; using Siger.Middlelayer.Repository.Data.Acc;
using Siger.Middlelayer.Repository.Paged; using Siger.Middlelayer.Repository.Paged;
using System.Collections.Generic;
namespace Siger.Middlelayer.AccRepository.Repositories.Interface namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{ {
public interface IAutomationFixtureToolsAssemblyRepository : IAccRepositoryBase<siger_automation_fixture_tools_assembly> public interface IAutomationFixtureToolsAssemblyRepository : IAccRepositoryBase<siger_automation_fixture_tools_assembly>
{ {
IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int categor, int projectid, int page, int pagesize); IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, int projectid, int page, int pagesize);
IEnumerable<ResponseAumationFixtureToolsAssembly> GetDetailList(int id, int projectid);
} }
} }
...@@ -57,11 +57,14 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -57,11 +57,14 @@ namespace Siger.Middlelayer.AccRepository.Request
/// <summary> /// <summary>
/// 附件 /// 附件
/// </summary> /// </summary>
public string attachment { get; set; } public string fileurl { get; set; }
public string filename { get; set; }
/// <summary> /// <summary>
/// 工装编号 /// 工装编号
/// </summary> /// </summary>
public string code { get; set; } public string code { get; set; }
public string status { get; set; }
} }
public class RequestUpdateFixtureTools : RequestAddFixtureTools public class RequestUpdateFixtureTools : RequestAddFixtureTools
...@@ -114,7 +117,8 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -114,7 +117,8 @@ namespace Siger.Middlelayer.AccRepository.Request
/// <summary> /// <summary>
/// 附件 /// 附件
/// </summary> /// </summary>
public string attachment { get; set; } public string fileurl { get; set; }
public string filename { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
...@@ -125,4 +129,19 @@ namespace Siger.Middlelayer.AccRepository.Request ...@@ -125,4 +129,19 @@ namespace Siger.Middlelayer.AccRepository.Request
{ {
public int id { get; set; } public int id { get; set; }
} }
public class RequestAddFixtureToolAssembly
{
public string parentid { get; set; }
public string fixturetoolid { get; set; }
public string fileurl { get; set; }
public string filename { get; set; }
public string status { get; set; }
}
public class RequestUpdateFixtureToolAssembly : RequestAddFixtureToolAssembly
{
public int id { get; set; }
}
} }
...@@ -30,6 +30,7 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -30,6 +30,7 @@ namespace Siger.Middlelayer.AccRepository.Response
{ {
public int id { get; set; } public int id { get; set; }
public string guid { get; set; } public string guid { get; set; }
public string cate_guid { get; set; }
/// <summary> /// <summary>
/// 工装类别ID /// 工装类别ID
/// </summary> /// </summary>
...@@ -65,7 +66,8 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -65,7 +66,8 @@ namespace Siger.Middlelayer.AccRepository.Response
/// <summary> /// <summary>
/// 附件 /// 附件
/// </summary> /// </summary>
public string attachment { get; set; } public string fileurl { get; set; }
public string filename { get; set; }
/// <summary> /// <summary>
/// 工装编号 /// 工装编号
/// </summary> /// </summary>
...@@ -76,6 +78,8 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -76,6 +78,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public int status { get; set; } public int status { get; set; }
public string updatetime { get; set; } public string updatetime { get; set; }
public List<int> categoryids { get; set; } = new List<int>();
} }
...@@ -109,8 +113,9 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -109,8 +113,9 @@ namespace Siger.Middlelayer.AccRepository.Response
public int id { get; set; } public int id { get; set; }
public int parentid { get; set; } public int parentid { get; set; }
public string parentname { get; set; } public string parentname { get; set; }
public int sonid { get; set; } public int categoryid { get; set; }
public string sonname { get; set; } public string category { get; set; }
public int fixturetoolid { get; set; }
public string partnumber { get; set; } public string partnumber { get; set; }
public string name { get; set; } public string name { get; set; }
public string specfication { get; set; } public string specfication { get; set; }
...@@ -118,5 +123,7 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -118,5 +123,7 @@ namespace Siger.Middlelayer.AccRepository.Response
public string updator { get; set; } public string updator { get; set; }
public string updatetime { get; set; } public string updatetime { get; set; }
public int status { get; set; } public int status { get; set; }
public string fileurl { get; set; }
public string filename { get; set; }
} }
} }
...@@ -40,7 +40,8 @@ namespace Siger.Middlelayer.AccRepository.Response ...@@ -40,7 +40,8 @@ namespace Siger.Middlelayer.AccRepository.Response
/// <summary> /// <summary>
/// 附件 /// 附件
/// </summary> /// </summary>
public string attachment { get; set; } public string fileurl { get; set; }
public string filename { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
......
...@@ -204,8 +204,10 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools` ( ...@@ -204,8 +204,10 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools` (
`specification` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格型号', `specification` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格型号',
`number` int(11) NOT NULL DEFAULT 0 COMMENT '数量', `number` int(11) NOT NULL DEFAULT 0 COMMENT '数量',
`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(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 '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`code` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装编号', `code` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装编号',
`projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态', `status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`createtime` datetime(0) NOT NULL, `createtime` datetime(0) NOT NULL,
`creator` int(11) NOT NULL DEFAULT 0, `creator` int(11) NOT NULL DEFAULT 0,
...@@ -224,6 +226,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_assembly` ( ...@@ -224,6 +226,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_assembly` (
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`parent` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '父类工装GUID', `parent` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '父类工装GUID',
`son` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID', `son` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`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 '附件名称',
`projectid` int(11) NOT NULL DEFAULT 0, `projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1, `status` int(11) NOT NULL DEFAULT 1,
`creator` int(11) NOT NULL DEFAULT 0, `creator` int(11) NOT NULL DEFAULT 0,
...@@ -266,9 +270,12 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` ( ...@@ -266,9 +270,12 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`processid` int(11) NOT NULL DEFAULT 0 COMMENT '工序ID', `processid` int(11) NOT NULL DEFAULT 0 COMMENT '工序ID',
`materialstate` int(11) NOT NULL DEFAULT 0 COMMENT '物料状态', `materialstate` int(11) NOT NULL DEFAULT 0 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 '附件名称',
`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 '备注',
`updator` int(11) NOT NULL DEFAULT 0, `updator` int(11) NOT NULL DEFAULT 0,
`updatetime` datetime(0) NULL DEFAULT NULL, `updatetime` datetime(0) NULL DEFAULT NULL,
`projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1,
`extend1` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `extend1` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
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;
...@@ -320,7 +327,6 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` ( ...@@ -320,7 +327,6 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` (
`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 '任务类型',
`startsection` int(11) NOT NULL DEFAULT 0 COMMENT '发起工位',
`materialid` int(11) NOT NULL DEFAULT 0 COMMENT '工件ID', `materialid` int(11) NOT NULL DEFAULT 0 COMMENT '工件ID',
`ordercode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工单号', `ordercode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工单号',
`productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID', `productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID',
...@@ -328,7 +334,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` ( ...@@ -328,7 +334,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` (
`programnumber` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '程序号', `programnumber` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '程序号',
`locationid` int(11) NOT NULL COMMENT '储位位置', `locationid` int(11) NOT NULL 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',
`action` int(1) int(11) NOT NULL DEFAULT 0 COMMENT '动作', `action` int(1) NOT NULL DEFAULT 0 COMMENT '动作',
`actiontype` int(11) NOT NULL DEFAULT 0 COMMENT '动作类型', `actiontype` int(11) NOT NULL DEFAULT 0 COMMENT '动作类型',
`projectid` int(11) NOT NULL DEFAULT 0, `projectid` int(11) NOT NULL DEFAULT 0,
`send` int(1) NOT NULL DEFAULT 0 COMMENT '0:未下发 1:已下发', `send` int(1) NOT NULL DEFAULT 0 COMMENT '0:未下发 1:已下发',
...@@ -349,8 +355,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` ( ...@@ -349,8 +355,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` (
DROP TABLE IF EXISTS `siger_automation_machine_status`; DROP TABLE IF EXISTS `siger_automation_machine_status`;
CREATE TABLE `siger_automation_machine_status` ( CREATE TABLE `siger_automation_machine_status` (
`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, `section` int(11) NOT NULL DEFAULT 0 COMMENT '工位ID',
`machineid` int(11) NOT NULL DEFAULT 0 COMMENT '设备ID', `machineid` int(11) NOT NULL DEFAULT 0 COMMENT '工位对应设备ID',
`projectid` int(11) NOT NULL DEFAULT 0, `projectid` int(11) NOT NULL DEFAULT 0,
`enable` int(1) NOT NULL DEFAULT 1 COMMENT '设备可用状态 0:不可用 1:可用', `enable` int(1) NOT NULL DEFAULT 1 COMMENT '设备可用状态 0:不可用 1:可用',
`status` int(1) NOT NULL DEFAULT 1 COMMENT '完工状态 0:取消 1:待生产 2:生产中 3:生产完成 ', `status` int(1) NOT NULL DEFAULT 1 COMMENT '完工状态 0:取消 1:待生产 2:生产中 3:生产完成 ',
......
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