Commit 4081bdb5 by yucheng.jiang
parents a2dc4644 bc381f49
<template>
<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>
</template>
<script>
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>
<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>
\ No newline at end of file
<template>
<div class="testdiv">
\任务清单管理
<div class="divborder">
<h2>基本信息</h2>
<div class="newSearchDiv">
<div class="filter">
<label>{{ $t("1950574") }}</label>
<Cascader trigger="click" class="searchSelect"></Cascader>
<label>{{ $t("1132") }}</label>
<Cascader
trigger="click"
class="searchSelect"
:data="datalevel"
:value="leveldata"
></Cascader>
</div>
<div class="filter">
<label>任务类型:</label>
......@@ -83,17 +87,33 @@
></DatePicker>
</div>
<div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search">{{
$t("1001")
}}</Button>
<Button
type="primary"
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 type="primary" class="twoWord" icon="ios-search"
<Button
type="primary"
class="twoWord"
icon="ios-search"
@click="manual()"
>手动</Button
><!--当生产线的模式是手动是才可以进行手动任务执行-->
<Button type="primary" class="twoWord" icon="ios-search"
<Button
type="primary"
class="twoWord"
icon="ios-search"
@click="exportExcel()"
>导出</Button
>
</div>
......@@ -121,22 +141,91 @@
export default {
data() {
return {
leveldata: [], // 产线层级插件所需数据
datalevel: [], // 产线层级选中数据
columns1: [
{
title: this.$t('1008'),
key: 'xuhao',
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
return h(
'span',
"span",
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'),
key: 'productcode',
minWidth: 150
title: "储位位置",
key: "productcode",
},
{
title: "工装编号",
key: "productcode",
},
{
title: "动作",
key: "productcode",
},
{
title: "执行类型",
key: "productcode",
},
{
title: "状态",
key: "productcode",
},
{
title: "触发时间",
key: "productcode",
},
{
title: "完成时间",
key: "productcode",
},
],
data1: [],
......@@ -147,8 +236,30 @@ export default {
},
created() {
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>
......
[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;
}
}
}
......@@ -36,9 +36,9 @@ namespace Siger.ApiACC.Controllers
_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);
}
......@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Controllers
{
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)
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
......@@ -76,6 +76,14 @@ namespace Siger.ApiACC.Controllers
{
state = 2;//有工装 有工件
}
else if (fixturetool == null && material == null)
{
state = 3;//无工装 无工件
}
else if (fixturetool == null && material != null)
{
state = 4;//无工装 有工件
}
var entity = new siger_automation_location
{
guid = Guid.NewGuid().ToString(),
......@@ -84,7 +92,8 @@ namespace Siger.ApiACC.Controllers
materialid = req.materialid.ToInt(),
processid = req.processid.ToInt(),
materialstate = state,
attachment = req.attachment,
attachment = req.fileurl,
filename = req.filename,
remark = req.remark,
projectId = ProjectId,
updatetime = DateTime.Now,
......@@ -109,7 +118,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.ParameterMiss);
}
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)
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
......@@ -136,12 +145,21 @@ namespace Siger.ApiACC.Controllers
{
state = 2;//有工装 有工件
}
else if (fixturetool == null && material == null)
{
state = 3;//无工装 无工件
}
else if (fixturetool == null && material != null)
{
state = 4;//无工装 有工件
}
entity.locationid = req.locationid.ToInt();
entity.fixturetools = fixturetool.guid;
entity.materialid = req.materialid.ToInt();
entity.processid = req.processid.ToInt();
entity.materialstate = state;
entity.attachment = req.attachment;
entity.attachment = req.fileurl;
entity.filename = req.filename;
entity.remark = req.remark;
entity.updatetime = DateTime.Now;
entity.updator = UserId;
......
......@@ -33,10 +33,153 @@ namespace Siger.ApiACC.Controllers
_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);
}
[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
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);
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]
......@@ -45,8 +62,7 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
var data = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.name == req.name ||
q.code == req.code || q.partnumber == req.partnumber));
var data = _toolsRepository.Get(q => q.projectId == ProjectId && (q.name == req.name || q.code == req.code || q.partnumber == req.partnumber));
if (data != null)
{
throw new BadRequestException(RequestEnum.DataExist);
......@@ -68,9 +84,11 @@ namespace Siger.ApiACC.Controllers
specification = req.specifition,
number = req.number.ToInt(),
remark = req.remark,
attachment = req.attachment,
attachment = req.fileurl,
filename = req.filename,
code = req.code,
projectId = ProjectId,
status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid,
createtime = DateTime.Now,
updatetime = DateTime.Now,
creator = UserId,
......@@ -95,9 +113,8 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.id == req.id);
var data = _toolsRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.name == req.name ||
q.code == req.code || q.partnumber == req.partnumber) && 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.name == req.name || q.code == req.code || q.partnumber == req.partnumber) && q.id != req.id);
if (data != null)
{
throw new BadRequestException(RequestEnum.DataExist);
......@@ -116,10 +133,12 @@ namespace Siger.ApiACC.Controllers
entity.specification = req.specifition;
entity.number = req.number.ToInt();
entity.remark = req.remark;
entity.attachment = req.attachment;
entity.attachment = req.fileurl;
entity.filename = req.filename;
entity.code = req.code;
entity.updatetime = DateTime.Now;
entity.updator = UserId;
entity.status = req.status.ToInt() == (int)RowState.Valid ? (int)RowState.Valid : (int)RowState.Invalid;
_toolsRepository.Update(entity);
if (_unitOfWork.Commit() > 0)
{
......@@ -134,14 +153,12 @@ namespace Siger.ApiACC.Controllers
[HttpGet]
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)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
entity.status = (int)RowState.Invalid;
_toolsRepository.Update(entity);
_toolsRepository.Delete(entity);
if (_unitOfWork.Commit() > 0)
{
return new ObjectResult(CommonEnum.Succefull);
......@@ -159,16 +176,14 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
var entities = _toolsRepository.GetList(t =>
req.ids.Contains(t.id) && t.projectId == ProjectId && t.status == (int)RowState.Valid).ToList();
var entities = _toolsRepository.GetList(t => req.ids.Contains(t.id) && t.projectId == ProjectId).ToList();
if (!entities.Any())
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
foreach (var entity in entities)
{
entity.status = (int)RowState.Invalid;
_toolsRepository.Update(entity);
_toolsRepository.Delete(entity);
}
if (_unitOfWork.Commit() > 0)
......@@ -176,6 +191,23 @@ namespace Siger.ApiACC.Controllers
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]
......
......@@ -49,7 +49,7 @@ namespace Siger.ApiACC.Controllers
{
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)
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
......@@ -101,7 +101,7 @@ namespace Siger.ApiACC.Controllers
{
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)
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
......
......@@ -80,38 +80,53 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// <summary>
/// 立库->上下料工站
/// </summary>
[Description("立库->上下料工站")]
FirstStep=1,
[Description("立库->上下料")]
Step_LK_SXLW=1,
/// <summary>
/// 上下料工站->立库
/// </summary>
[Description("上下料工站->立库")]
SecondStep =2,
[Description("上下料->立库")]
Step_SXLW_LK =2,
/// <summary>
/// 立库->加工中心
/// </summary>
[Description("立库->加工中心")]
ThirdStep =3,
Step_LK_JGZX =3,
/// <summary>
/// 加工中心->清洗机
/// </summary>
[Description("加工中心->清洗机")]
FourStep =4,
Step_JGZX_QXJ =4,
/// <summary>
/// 立库->抽检工位
/// </summary>
[Description("立库->抽检工位")]
FiveStep =5,
[Description("立库->抽检")]
Step_LK_CJT =5,
/// <summary>
/// 抽检工位->上下料工站
/// </summary>
[Description("抽检工位->上下料工站")]
SixStep =6,
[Description("抽检台->上下料位")]
Step_CJT_SXLW =6,
/// <summary>
/// 清洗->立库
/// 清洗->立库
/// </summary>
[Description("清洗剂->立库")]
SevenStep =7
[Description("清洗机->立库")]
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
/// 附件
/// </summary>
public string attachment { get; set; }
public string filename { get; set; }
/// <summary>
/// 工装编号
/// </summary>
......
......@@ -18,6 +18,15 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 工装GUID
/// </summary>
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 DateTime createtime { get; set; }
public int updator { get; set; }
......
......@@ -34,6 +34,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 附件
/// </summary>
public string attachment { get; set; }
public string filename { get; set; }
/// <summary>
/// 备注
/// </summary>
......
......@@ -9,7 +9,13 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
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; }
/// <summary>
/// 1可用 0不可用
......
......@@ -14,7 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary>
/// 工位ID
/// </summary>
public string sectionid { get; set; }
public int sectionid { get; set; }
/// <summary>
/// 触发方式
/// </summary>
......@@ -24,10 +24,6 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public TaskActionType tasktype { get; set; }
/// <summary>
/// 发起工位
/// </summary>
public int startsection { get; set; }
/// <summary>
/// 工件ID
/// </summary>
public int materialid { get; set; }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
......@@ -20,7 +21,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_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
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
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.status == (int)RowState.Valid && string.IsNullOrEmpty(q.parent)
where q.projectId == projectid && string.IsNullOrEmpty(q.parent)
select new ResponseAumationFixtureToolsAssembly
{
id = q.id,
parentid = t1 == null ? 0 : t1.id,
parentname = t1.name ?? "",
sonid = t2.id,
sonname = t2.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).Skip((page - 1) * pagesize).Take(pagesize).AsNoTracking().ToList();
var totalCount = query.Count();
Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> categoryExpression = f => true;
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);
}
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
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
from u in uu.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid
where q.projectId == projectid
select new ResponseFixtureTools
{
id = q.id,
name = q.name,
guid = q.guid,
cate_guid = p.guid,
categoryid = p.id,
category = p.name,
managetype = q.managetype,
......@@ -40,7 +41,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
specification = q.specification,
number = q.number,
remark = q.remark,
attachment = q.attachment,
fileurl = q.attachment ?? "",
filename = q.filename ?? "",
code = q.code,
updator = u.name ?? "",
status = q.status,
......
......@@ -36,23 +36,24 @@ namespace Siger.Middlelayer.AccRepository.Repositories
select new ResponseAutomationLocation
{
id = q.id,
locationid=l.id,
location=l.name,
wavehouseid=w.id,
wavehouse=w.name,
fixturetoolid=t.id,
fixturetool=t.name,
category=c.name,
code=t.code,
specfication=t.specification,
materialid=q.materialid,
materialcode=m.pn,
locationid = l.id,
location = l.name,
wavehouseid = w.id,
wavehouse = w.name,
fixturetoolid = t.id,
fixturetool = t.name,
category = c.name,
code = t.code,
specfication = t.specification,
materialid = q.materialid,
materialcode = m.pn,
processid = q.processid,
processnumber = p == null ? 0 : p.Process_Seq,
processname = p.Process_name??"",
processname = p.Process_name ?? "",
materialstate = q.materialstate,
attachment=q.attachment,
remark=q.remark,
fileurl = q.attachment ?? "",
filename = q.filename ?? "",
remark = q.remark,
updator = u.name ?? "",
status = q.status,
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : ""
......
......@@ -2,11 +2,14 @@
using Siger.Middlelayer.AccRepository.Response;
using Siger.Middlelayer.Repository.Data.Acc;
using Siger.Middlelayer.Repository.Paged;
using System.Collections.Generic;
namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
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
/// <summary>
/// 附件
/// </summary>
public string attachment { get; set; }
public string fileurl { get; set; }
public string filename { get; set; }
/// <summary>
/// 工装编号
/// </summary>
public string code { get; set; }
public string status { get; set; }
}
public class RequestUpdateFixtureTools : RequestAddFixtureTools
......@@ -114,7 +117,8 @@ namespace Siger.Middlelayer.AccRepository.Request
/// <summary>
/// 附件
/// </summary>
public string attachment { get; set; }
public string fileurl { get; set; }
public string filename { get; set; }
/// <summary>
/// 备注
/// </summary>
......@@ -125,4 +129,19 @@ namespace Siger.Middlelayer.AccRepository.Request
{
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
{
public int id { get; set; }
public string guid { get; set; }
public string cate_guid { get; set; }
/// <summary>
/// 工装类别ID
/// </summary>
......@@ -65,7 +66,8 @@ namespace Siger.Middlelayer.AccRepository.Response
/// <summary>
/// 附件
/// </summary>
public string attachment { get; set; }
public string fileurl { get; set; }
public string filename { get; set; }
/// <summary>
/// 工装编号
/// </summary>
......@@ -76,6 +78,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public int status { 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
public int id { get; set; }
public int parentid { get; set; }
public string parentname { get; set; }
public int sonid { get; set; }
public string sonname { get; set; }
public int categoryid { get; set; }
public string category { get; set; }
public int fixturetoolid { get; set; }
public string partnumber { get; set; }
public string name { get; set; }
public string specfication { get; set; }
......@@ -118,5 +123,7 @@ namespace Siger.Middlelayer.AccRepository.Response
public string updator { get; set; }
public string updatetime { 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
/// <summary>
/// 附件
/// </summary>
public string attachment { get; set; }
public string fileurl { get; set; }
public string filename { get; set; }
/// <summary>
/// 备注
/// </summary>
......
......@@ -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 '规格型号',
`number` int(11) NOT NULL DEFAULT 0 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 '工装编号',
`projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`createtime` datetime(0) NOT NULL,
`creator` int(11) NOT NULL DEFAULT 0,
......@@ -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,
`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',
`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,
`status` int(11) NOT NULL DEFAULT 1,
`creator` int(11) NOT NULL DEFAULT 0,
......@@ -266,9 +270,12 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`processid` int(11) NOT NULL DEFAULT 0 COMMENT '工序ID',
`materialstate` int(11) NOT NULL DEFAULT 0 COMMENT '物料状态',
`attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`updator` int(11) NOT NULL DEFAULT 0,
`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,
PRIMARY KEY (`id`) USING BTREE
) 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` (
`sectionid` int(11) NOT NULL DEFAULT 0 COMMENT '工位ID',
`trigger` 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',
`ordercode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工单号',
`productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID',
......@@ -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 '程序号',
`locationid` int(11) NOT NULL COMMENT '储位位置',
`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 '动作类型',
`projectid` int(11) NOT NULL DEFAULT 0,
`send` int(1) NOT NULL DEFAULT 0 COMMENT '0:未下发 1:已下发',
......@@ -349,8 +355,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_task_list` (
DROP TABLE IF EXISTS `siger_automation_machine_status`;
CREATE TABLE `siger_automation_machine_status` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`machineid` int(11) NOT NULL DEFAULT 0 COMMENT '设备ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '工位ID',
`machineid` int(11) NOT NULL DEFAULT 0 COMMENT '工位对应设备ID',
`projectid` int(11) NOT NULL DEFAULT 0,
`enable` int(1) NOT NULL DEFAULT 1 COMMENT '设备可用状态 0:不可用 1:可用',
`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