Commit 4081bdb5 by yucheng.jiang
parents a2dc4644 bc381f49
<template> <template>
<div> <div>
产线监控管理 <div class="divborder">
</div> <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> </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: 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",
},
{
title: "储位位置",
key: "productcode",
},
{
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>
......
[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 ...@@ -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