commit
7a375ada8e
50 changed files with 1585 additions and 1051 deletions
@ -0,0 +1,293 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
|
||||
<a-row :gutter="24"> |
||||
<a-col :xl="8" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="工序代码"> |
||||
<a-input placeholder="请输入工序代码" v-model="queryParam.processCode"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
<a-col :xl="10" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="工序名称"> |
||||
<a-input placeholder="请输入工序名称" v-model="queryParam.processName"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
|
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a |
||||
style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange1}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" |
||||
style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
</a-table> |
||||
</div> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import {mixinDevice} from '@/utils/mixin' |
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
||||
import {getAction} from "@api/manage"; |
||||
import {filterObj} from "@/utils/util"; |
||||
|
||||
export default { |
||||
name: 'ZyProcessList', |
||||
mixins: [JeecgListMixin, mixinDevice], |
||||
components: {}, |
||||
data() { |
||||
return { |
||||
description: 'zy_process管理页面', |
||||
model:{ |
||||
clothStyleId: '', |
||||
}, |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key: 'rowIndex', |
||||
width: 60, |
||||
align: "center", |
||||
customRender: function (t, r, index) { |
||||
return parseInt(index) + 1; |
||||
} |
||||
}, |
||||
{ |
||||
title: '工序代码', |
||||
align: "center", |
||||
dataIndex: 'processCode' |
||||
}, |
||||
{ |
||||
title: '工序名称', |
||||
align: "center", |
||||
dataIndex: 'processName' |
||||
}, |
||||
// { |
||||
// title:'工艺描述', |
||||
// align:"center", |
||||
// dataIndex: 'processDescribe' |
||||
// }, |
||||
{ |
||||
title: '服装类型', |
||||
align: "center", |
||||
dataIndex: 'styleId_dictText' |
||||
}, |
||||
{ |
||||
title: '工序等级', |
||||
align: "center", |
||||
dataIndex: 'grade' |
||||
}, |
||||
{ |
||||
title: '工段代码', |
||||
align: "center", |
||||
dataIndex: 'worksectionCode' |
||||
}, |
||||
{ |
||||
title:'创建时间', |
||||
align:"center", |
||||
dataIndex: 'createTime' |
||||
}, |
||||
|
||||
], |
||||
url: { |
||||
list: "/base/zyProcess/listScreenThree", |
||||
delete: "/base/zyProcess/delete", |
||||
deleteBatch: "/base/zyProcess/deleteBatch", |
||||
exportXlsUrl: "/base/zyProcess/exportXls", |
||||
importExcelUrl: "base/zyProcess/importExcel", |
||||
|
||||
}, |
||||
//参数 |
||||
loadRouteType: false, |
||||
styleId: '', |
||||
dictOptions: {}, |
||||
superFieldList: [], |
||||
} |
||||
}, |
||||
created() { |
||||
// queryParam.styleId=this.styleId |
||||
this.getSuperFieldList(); |
||||
//this.loadParameter(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function () { |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig() { |
||||
}, |
||||
add1(id) { |
||||
//console.log("list层 id 应该是zy cloths componentId1: "+ id) |
||||
//this.model.clothStyleId = id; |
||||
this.queryParam.clothsComponentId = id; |
||||
//根据服装类型筛选list中的数据 |
||||
this.url.list = '/base/zyProcess/listScreenThree'; |
||||
this.loadData(); |
||||
}, |
||||
onSelectChange1(selectedRowKeys, selectionRows) { |
||||
this.selectedRowKeys = selectedRowKeys; |
||||
this.selectionRows = selectionRows; |
||||
let ids = ""; |
||||
for (var a = 0; a < this.selectedRowKeys.length; a++) { |
||||
ids += this.selectedRowKeys[a] + ","; |
||||
} |
||||
this.$emit('onChangeRowKey', ids) |
||||
}, |
||||
//加载传递参数 |
||||
// loadParameter() { |
||||
// if (this.loadRouteType === false) { |
||||
// this.styleId = this.$route.query.styleId; |
||||
// console.log(this.styleId) |
||||
// this.loadRouteType = true; |
||||
// } |
||||
// }, |
||||
// loadData(arg) { |
||||
// if (!this.url.list) { |
||||
// this.$message.error("请设置url.list属性!") |
||||
// return |
||||
// } |
||||
// //加载数据 若传入参数1则加载第一页的内容 |
||||
// if (arg === 1) { |
||||
// this.ipagination.current = 1; |
||||
// } |
||||
// this.loadParameter(); |
||||
// var params = this.getQueryParams();//查询条件 |
||||
// this.loading = true; |
||||
// getAction(this.url.list, params).then((res) => { |
||||
// if (res.success) { |
||||
// //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
||||
// this.dataSource = res.result.records || res.result; |
||||
// if (res.result.total) { |
||||
// this.ipagination.total = res.result.total; |
||||
// } else { |
||||
// this.ipagination.total = 0; |
||||
// } |
||||
// //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
||||
// } else { |
||||
// this.$message.warning(res.message) |
||||
// } |
||||
// }).finally(() => { |
||||
// this.loading = false |
||||
// }) |
||||
// }, |
||||
// getQueryParams() { |
||||
// //获取查询条件 |
||||
// let sqp = {} |
||||
// if (this.superQueryParams) { |
||||
// sqp['superQueryParams'] = encodeURI(this.superQueryParams) |
||||
// sqp['superQueryMatchType'] = this.superQueryMatchType |
||||
// } |
||||
// var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); |
||||
// param.field = this.getQueryField(); |
||||
// param.pageNo = this.ipagination.current; |
||||
// param.pageSize = this.ipagination.pageSize; |
||||
// param.styleId = this.styleId; |
||||
// return filterObj(param); |
||||
// }, |
||||
getSuperFieldList() { |
||||
let fieldList = []; |
||||
fieldList.push({type: 'string', value: 'processCode', text: '工序代码', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'processName', text: '工序名称', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'processDescribe', text: '工艺描述', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'mkExplain', text: '做工说明', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'qualityRequire', text: '品质要求', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'processTime', text: '工序时间', dictCode: ''}) |
||||
fieldList.push({type: 'double', value: 'price', text: '工序单价', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'grade', text: '工序等级', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'fabricNum', text: '面料代码', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'fabricGrade', text: '面料等级', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'needlePitch', text: '针距(针/厘米)', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'machineId', text: '机器名', dictCode: 'zy_machine,name,id'}) |
||||
fieldList.push({type: 'string', value: 'manualWide', text: '手工宽放', dictCode: ''}) |
||||
fieldList.push({type: 'double', value: 'manualTime', text: '手工时间', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'machineSpeed', text: '机器转速', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'machineWide', text: '机器宽放', dictCode: ''}) |
||||
fieldList.push({type: 'double', value: 'machineTime', text: '机器时间', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'machineFloat', text: '机器浮于', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'bundleWide', text: '绑包宽放', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'bundleTime', text: '绑包时间', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'componentId', text: '部件表', dictCode: 'zy_cloths_component,parts_name,id'}) |
||||
fieldList.push({type: 'int', value: 'isBottleneck', text: '是否为瓶颈工序', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'enterpriseId', text: '企业名称', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'toolId', text: '工具名称', dictCode: 'zy_tool,name,id'}) |
||||
fieldList.push({type: 'string', value: 'styleId', text: '款式名称', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'worksectionCode', text: '工段代码', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'contractNum', text: '合同号', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalManualTmu', text: '合计(手工TMU)', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalMachineTmu', text: '合计(机器TMU)', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalMaunal', text: '合计(手工秒)', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalMachine', text: '合计(机器秒)', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'image', text: '图片', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'vedio', text: '视频', dictCode: ''}) |
||||
this.superFieldList = fieldList |
||||
}, |
||||
openDetail(id) { |
||||
this.$refs.zyProcessDetail.showModal(id) |
||||
// this.$children[0].showModal(id) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,293 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
|
||||
<a-row :gutter="24"> |
||||
<a-col :xl="8" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="工序代码"> |
||||
<a-input placeholder="请输入工序代码" v-model="queryParam.processCode"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
<a-col :xl="10" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="工序名称"> |
||||
<a-input placeholder="请输入工序名称" v-model="queryParam.processName"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
|
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a |
||||
style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange1}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" |
||||
style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
</a-table> |
||||
</div> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import {mixinDevice} from '@/utils/mixin' |
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
||||
import {getAction} from "@api/manage"; |
||||
import {filterObj} from "@/utils/util"; |
||||
|
||||
export default { |
||||
name: 'ZyProcessList', |
||||
mixins: [JeecgListMixin, mixinDevice], |
||||
components: {}, |
||||
data() { |
||||
return { |
||||
description: 'zy_process管理页面', |
||||
model:{ |
||||
clothStyleId: '', |
||||
}, |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key: 'rowIndex', |
||||
width: 60, |
||||
align: "center", |
||||
customRender: function (t, r, index) { |
||||
return parseInt(index) + 1; |
||||
} |
||||
}, |
||||
{ |
||||
title: '工序代码', |
||||
align: "center", |
||||
dataIndex: 'processCode' |
||||
}, |
||||
{ |
||||
title: '工序名称', |
||||
align: "center", |
||||
dataIndex: 'processName' |
||||
}, |
||||
// { |
||||
// title:'工艺描述', |
||||
// align:"center", |
||||
// dataIndex: 'processDescribe' |
||||
// }, |
||||
{ |
||||
title: '服装类型', |
||||
align: "center", |
||||
dataIndex: 'styleId_dictText' |
||||
}, |
||||
{ |
||||
title: '工序等级', |
||||
align: "center", |
||||
dataIndex: 'grade' |
||||
}, |
||||
{ |
||||
title: '工段代码', |
||||
align: "center", |
||||
dataIndex: 'worksectionCode' |
||||
}, |
||||
{ |
||||
title:'创建时间', |
||||
align:"center", |
||||
dataIndex: 'createTime' |
||||
}, |
||||
|
||||
], |
||||
url: { |
||||
list: "/base/zyProcess/listScreenTwo", |
||||
delete: "/base/zyProcess/delete", |
||||
deleteBatch: "/base/zyProcess/deleteBatch", |
||||
exportXlsUrl: "/base/zyProcess/exportXls", |
||||
importExcelUrl: "base/zyProcess/importExcel", |
||||
|
||||
}, |
||||
//参数 |
||||
loadRouteType: false, |
||||
styleId: '', |
||||
dictOptions: {}, |
||||
superFieldList: [], |
||||
} |
||||
}, |
||||
created() { |
||||
// queryParam.styleId=this.styleId |
||||
this.getSuperFieldList(); |
||||
//this.loadParameter(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function () { |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig() { |
||||
}, |
||||
add1(id) { |
||||
//console.log("list层 id 应该是zy cloths modularId: "+ id) |
||||
//this.model.clothStyleId = id; |
||||
this.queryParam.clothsTypeId = id; |
||||
//根据服装类型筛选list中的数据 |
||||
this.url.list = '/base/zyProcess/listScreenTwo'; |
||||
this.loadData(); |
||||
}, |
||||
onSelectChange1(selectedRowKeys, selectionRows) { |
||||
this.selectedRowKeys = selectedRowKeys; |
||||
this.selectionRows = selectionRows; |
||||
let ids = ""; |
||||
for (var a = 0; a < this.selectedRowKeys.length; a++) { |
||||
ids += this.selectedRowKeys[a] + ","; |
||||
} |
||||
this.$emit('onChangeRowKey', ids) |
||||
}, |
||||
//加载传递参数 |
||||
// loadParameter() { |
||||
// if (this.loadRouteType === false) { |
||||
// this.styleId = this.$route.query.styleId; |
||||
// console.log(this.styleId) |
||||
// this.loadRouteType = true; |
||||
// } |
||||
// }, |
||||
// loadData(arg) { |
||||
// if (!this.url.list) { |
||||
// this.$message.error("请设置url.list属性!") |
||||
// return |
||||
// } |
||||
// //加载数据 若传入参数1则加载第一页的内容 |
||||
// if (arg === 1) { |
||||
// this.ipagination.current = 1; |
||||
// } |
||||
// this.loadParameter(); |
||||
// var params = this.getQueryParams();//查询条件 |
||||
// this.loading = true; |
||||
// getAction(this.url.list, params).then((res) => { |
||||
// if (res.success) { |
||||
// //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
||||
// this.dataSource = res.result.records || res.result; |
||||
// if (res.result.total) { |
||||
// this.ipagination.total = res.result.total; |
||||
// } else { |
||||
// this.ipagination.total = 0; |
||||
// } |
||||
// //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
||||
// } else { |
||||
// this.$message.warning(res.message) |
||||
// } |
||||
// }).finally(() => { |
||||
// this.loading = false |
||||
// }) |
||||
// }, |
||||
// getQueryParams() { |
||||
// //获取查询条件 |
||||
// let sqp = {} |
||||
// if (this.superQueryParams) { |
||||
// sqp['superQueryParams'] = encodeURI(this.superQueryParams) |
||||
// sqp['superQueryMatchType'] = this.superQueryMatchType |
||||
// } |
||||
// var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); |
||||
// param.field = this.getQueryField(); |
||||
// param.pageNo = this.ipagination.current; |
||||
// param.pageSize = this.ipagination.pageSize; |
||||
// param.styleId = this.styleId; |
||||
// return filterObj(param); |
||||
// }, |
||||
getSuperFieldList() { |
||||
let fieldList = []; |
||||
fieldList.push({type: 'string', value: 'processCode', text: '工序代码', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'processName', text: '工序名称', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'processDescribe', text: '工艺描述', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'mkExplain', text: '做工说明', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'qualityRequire', text: '品质要求', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'processTime', text: '工序时间', dictCode: ''}) |
||||
fieldList.push({type: 'double', value: 'price', text: '工序单价', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'grade', text: '工序等级', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'fabricNum', text: '面料代码', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'fabricGrade', text: '面料等级', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'needlePitch', text: '针距(针/厘米)', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'machineId', text: '机器名', dictCode: 'zy_machine,name,id'}) |
||||
fieldList.push({type: 'string', value: 'manualWide', text: '手工宽放', dictCode: ''}) |
||||
fieldList.push({type: 'double', value: 'manualTime', text: '手工时间', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'machineSpeed', text: '机器转速', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'machineWide', text: '机器宽放', dictCode: ''}) |
||||
fieldList.push({type: 'double', value: 'machineTime', text: '机器时间', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'machineFloat', text: '机器浮于', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'bundleWide', text: '绑包宽放', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'bundleTime', text: '绑包时间', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'componentId', text: '部件表', dictCode: 'zy_cloths_component,parts_name,id'}) |
||||
fieldList.push({type: 'int', value: 'isBottleneck', text: '是否为瓶颈工序', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'enterpriseId', text: '企业名称', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'toolId', text: '工具名称', dictCode: 'zy_tool,name,id'}) |
||||
fieldList.push({type: 'string', value: 'styleId', text: '款式名称', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'worksectionCode', text: '工段代码', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'contractNum', text: '合同号', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalManualTmu', text: '合计(手工TMU)', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalMachineTmu', text: '合计(机器TMU)', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalMaunal', text: '合计(手工秒)', dictCode: ''}) |
||||
fieldList.push({type: 'int', value: 'totalMachine', text: '合计(机器秒)', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'image', text: '图片', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'vedio', text: '视频', dictCode: ''}) |
||||
this.superFieldList = fieldList |
||||
}, |
||||
openDetail(id) { |
||||
this.$refs.zyProcessDetail.showModal(id) |
||||
// this.$children[0].showModal(id) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,194 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="编号"> |
||||
<a-input placeholder="请输入编号" v-model="queryParam.code"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="名称"> |
||||
<a-input placeholder="请输入名称" v-model="queryParam.name"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<!-- <a-button type="primary" icon="download" @click="handleExportXls('设备类型')">导出</a-button>--> |
||||
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
||||
<!-- <a-button type="primary" icon="import">导入</a-button>--> |
||||
<!-- </a-upload>--> |
||||
<!-- <!– 高级查询区域 –>--> |
||||
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
||||
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> |
||||
<!-- <a-menu slot="overlay">--> |
||||
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> |
||||
<!-- </a-menu>--> |
||||
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> |
||||
<!-- </a-dropdown>--> |
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<a @click="handleEdit(record)">编辑</a> |
||||
|
||||
<a-divider type="vertical" /> |
||||
|
||||
|
||||
<a @click="handleDetail(record)">详情</a> |
||||
<a-divider type="vertical" /> |
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<zy-devicetype-modal ref="modalForm" @ok="modalFormOk"></zy-devicetype-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyDevicetypeModal from './modules/ZyDevicetypeModal' |
||||
|
||||
export default { |
||||
name: 'ZyDevicetypeList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyDevicetypeModal |
||||
}, |
||||
data () { |
||||
return { |
||||
description: '设备类型管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
}, |
||||
{ |
||||
title:'编号', |
||||
align:"center", |
||||
dataIndex: 'code' |
||||
}, |
||||
{ |
||||
title:'名称', |
||||
align:"center", |
||||
dataIndex: 'name' |
||||
}, |
||||
{ |
||||
title:'图片', |
||||
align:"center", |
||||
dataIndex: 'img', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/devicetype/zyDevicetype/list", |
||||
delete: "/devicetype/zyDevicetype/delete", |
||||
deleteBatch: "/devicetype/zyDevicetype/deleteBatch", |
||||
exportXlsUrl: "/devicetype/zyDevicetype/exportXls", |
||||
importExcelUrl: "devicetype/zyDevicetype/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'code',text:'类型编号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'name',text:'类型名称',dictCode:''}) |
||||
fieldList.push({type:'string',value:'img',text:'类型图片',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,127 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="类型编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> |
||||
<a-input v-model="model.code" placeholder="请输入类型编号" disabled></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> |
||||
<a-input v-model="model.name" placeholder="请输入类型名称" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="类型图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img"> |
||||
<j-image-upload isMultiple v-model="model.img" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'ZyDevicetypeForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
code:'', |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/devicetype/zyDevicetype/add", |
||||
edit: "/devicetype/zyDevicetype/edit", |
||||
queryById: "/devicetype/zyDevicetype/queryById", |
||||
weiyi: "/devicetype/zyDevicetype/weiyi" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
|
||||
this.edit(this.modelDefault); |
||||
var n=5 |
||||
getAction(this.url.weiyi,null).then((res)=>{ |
||||
var num=parseInt(res.result,10)+1 |
||||
num=num.toString() |
||||
while(num.length<n){ |
||||
num="0"+num |
||||
} |
||||
this.model.code="D"+num; |
||||
console.log("*****"+this.model.code) |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
}, |
||||
submitForm () { |
||||
const that = this; |
||||
// 触发表单验证 |
||||
this.$refs.form.validate(valid => { |
||||
if (valid) { |
||||
that.confirmLoading = true; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if(!this.model.id){ |
||||
httpurl+=this.url.add; |
||||
method = 'post'; |
||||
}else{ |
||||
httpurl+=this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
httpAction(httpurl,this.model,method).then((res)=>{ |
||||
if(res.success){ |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
}else{ |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
that.confirmLoading = false; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<zy-devicetype-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-devicetype-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyDevicetypeForm from './ZyDevicetypeForm' |
||||
export default { |
||||
name: 'ZyDevicetypeModal', |
||||
components: { |
||||
ZyDevicetypeForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<zy-devicetype-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-devicetype-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyDevicetypeForm from './ZyDevicetypeForm' |
||||
|
||||
export default { |
||||
name: 'ZyDevicetypeModal', |
||||
components: { |
||||
ZyDevicetypeForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
@ -1,542 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.controller; |
||||
|
||||
import com.google.zxing.BarcodeFormat; |
||||
import com.google.zxing.EncodeHintType; |
||||
import com.google.zxing.MultiFormatWriter; |
||||
import com.google.zxing.WriterException; |
||||
import com.google.zxing.client.j2se.MatrixToImageWriter; |
||||
import com.google.zxing.common.BitMatrix; |
||||
import com.google.zxing.qrcode.QRCodeWriter; |
||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
|
||||
import java.io.ByteArrayOutputStream; |
||||
import java.util.*; |
||||
|
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.modules.devicetype.entity.ZyTypeparameters; |
||||
import org.jeecg.modules.devicetype.entity.ZyOperationparameters; |
||||
import org.jeecg.modules.devicetype.entity.ZyDevicetype; |
||||
import org.jeecg.modules.devicetype.service.IZyDevicetypeService; |
||||
import org.jeecg.modules.devicetype.service.IZyTypeparametersService; |
||||
import org.jeecg.modules.devicetype.service.IZyOperationparametersService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.apache.shiro.SecurityUtils; |
||||
import org.jeecg.common.system.vo.LoginUser; |
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import java.io.IOException; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="设备类型") |
||||
@RestController |
||||
@RequestMapping("/devicetype/zyDevicetype") |
||||
@Slf4j |
||||
public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDevicetypeService> { |
||||
|
||||
@Autowired |
||||
private IZyDevicetypeService zyDevicetypeService; |
||||
|
||||
@Autowired |
||||
private IZyTypeparametersService zyTypeparametersService; |
||||
|
||||
@Autowired |
||||
private IZyOperationparametersService zyOperationparametersService; |
||||
|
||||
|
||||
/*---------------------------------主表处理-begin-------------------------------------*/ |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* @param zyDevicetype |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-分页列表查询") |
||||
@ApiOperation(value="设备类型-分页列表查询", notes="设备类型-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyDevicetype zyDevicetype, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) throws WriterException, IOException { |
||||
QueryWrapper<ZyDevicetype> queryWrapper = QueryGenerator.initQueryWrapper(zyDevicetype, req.getParameterMap()); |
||||
Page<ZyDevicetype> page = new Page<ZyDevicetype>(pageNo, pageSize); |
||||
IPage<ZyDevicetype> pageList = zyDevicetypeService.page(page, queryWrapper); |
||||
|
||||
MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); |
||||
@SuppressWarnings("rawtypes") |
||||
Map hints = new HashMap(); |
||||
//设置UTF-8, 防止中文乱码
|
||||
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
||||
//设置二维码四周白色区域的大小
|
||||
hints.put(EncodeHintType.MARGIN, 1); |
||||
//设置二维码的容错性
|
||||
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); |
||||
//width:图片完整的宽;height:图片完整的高
|
||||
//因为要在二维码下方附上文字,所以把图片设置为长方形(高大于宽)
|
||||
int width = 150; |
||||
int height = 150; |
||||
//画二维码,记得调用multiFormatWriter.encode()时最后要带上hints参数,不然上面设置无效
|
||||
QRCodeWriter qrCodeWriter = new QRCodeWriter(); |
||||
List<Object> img= new ArrayList<>(); |
||||
String content=""; |
||||
//批量生成二维码
|
||||
for (int i=0;i<pageList.getRecords().size();i++){ |
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
||||
content = pageList.getRecords().get(i).getCode(); |
||||
BitMatrix bitMatrix = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, width, height, hints); |
||||
MatrixToImageWriter.writeToStream(bitMatrix, "PNG", outputStream); |
||||
Base64.Encoder encoder = Base64.getEncoder(); |
||||
String text = encoder.encodeToString(outputStream.toByteArray()); |
||||
pageList.getRecords().get(i).setErweima("data:image/png;base64,"+text); |
||||
} |
||||
|
||||
return Result.OK(pageList); |
||||
} |
||||
@AutoLog(value = "设备类型-分页列表查询") |
||||
@ApiOperation(value="设备类型-分页列表查询", notes="设备类型-分页列表查询") |
||||
@GetMapping(value = "/list1") |
||||
public Result<?> queryPageList1(ZyDevicetype zyDevicetype, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyDevicetype> queryWrapper = QueryGenerator.initQueryWrapper(zyDevicetype, req.getParameterMap()); |
||||
Page<ZyDevicetype> page = new Page<ZyDevicetype>(pageNo, pageSize); |
||||
IPage<ZyDevicetype> pageList = zyDevicetypeService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-通过id查询") |
||||
@ApiOperation(value="设备类型-通过id查询", notes="设备类型-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyDevicetype zyDevicetype = zyDevicetypeService.getById(id); |
||||
if(zyDevicetype==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyDevicetype); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "类型参数通过主表ID查询") |
||||
@ApiOperation(value="类型参数主表ID查询", notes="类型参数-通主表ID查询") |
||||
@GetMapping(value = "/queryZyTypeparametersByMainId") |
||||
public Result<?> queryZyTypeparametersListByMainId(@RequestParam(name="id",required=true) String id) { |
||||
List<ZyTypeparameters> zyTypeparametersList = zyTypeparametersService.selectByMainId(id); |
||||
return Result.OK(zyTypeparametersList); |
||||
} |
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "运行参数通过主表ID查询") |
||||
@ApiOperation(value="运行参数主表ID查询", notes="运行参数-通主表ID查询") |
||||
@GetMapping(value = "/queryZyOperationparametersByMainId") |
||||
public Result<?> queryZyOperationparametersListByMainId(@RequestParam(name="id",required=true) String id) { |
||||
List<ZyOperationparameters> zyOperationparametersList = zyOperationparametersService.selectByMainId(id); |
||||
return Result.OK(zyOperationparametersList); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** |
||||
* 添加 |
||||
* @param zyDevicetype |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-添加") |
||||
@ApiOperation(value="设备类型-添加", notes="设备类型-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyDevicetype zyDevicetype) { |
||||
zyDevicetypeService.save(zyDevicetype); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* @param zyDevicetype |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-编辑") |
||||
@ApiOperation(value="设备类型-编辑", notes="设备类型-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyDevicetype zyDevicetype) { |
||||
zyDevicetypeService.updateById(zyDevicetype); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-通过id删除") |
||||
@ApiOperation(value="设备类型-通过id删除", notes="设备类型-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
zyDevicetypeService.delMain(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-批量删除") |
||||
@ApiOperation(value="设备类型-批量删除", notes="设备类型-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyDevicetypeService.delBatchMain(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyDevicetype zyDevicetype) { |
||||
return super.exportXls(request, zyDevicetype, ZyDevicetype.class, "设备类型"); |
||||
} |
||||
|
||||
/** |
||||
* 导入 |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyDevicetype.class); |
||||
} |
||||
/*---------------------------------主表处理-end-------------------------------------*/ |
||||
|
||||
|
||||
/*--------------------------------子表处理-类型参数-begin----------------------------------------------*/ |
||||
/** |
||||
* 通过主表ID查询 |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "类型参数-通过主表ID查询") |
||||
@ApiOperation(value="类型参数-通过主表ID查询", notes="类型参数-通过主表ID查询") |
||||
@GetMapping(value = "/listZyTypeparametersByMainId") |
||||
public Result<?> listZyTypeparametersByMainId(ZyTypeparameters zyTypeparameters, |
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyTypeparameters> queryWrapper = QueryGenerator.initQueryWrapper(zyTypeparameters, req.getParameterMap()); |
||||
Page<ZyTypeparameters> page = new Page<ZyTypeparameters>(pageNo, pageSize); |
||||
IPage<ZyTypeparameters> pageList = zyTypeparametersService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* @param zyTypeparameters |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "类型参数-添加") |
||||
@ApiOperation(value="类型参数-添加", notes="类型参数-添加") |
||||
@PostMapping(value = "/addZyTypeparameters") |
||||
public Result<?> addZyTypeparameters(@RequestBody ZyTypeparameters zyTypeparameters) { |
||||
zyTypeparametersService.save(zyTypeparameters); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* @param zyTypeparameters |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "类型参数-编辑") |
||||
@ApiOperation(value="类型参数-编辑", notes="类型参数-编辑") |
||||
@PutMapping(value = "/editZyTypeparameters") |
||||
public Result<?> editZyTypeparameters(@RequestBody ZyTypeparameters zyTypeparameters) { |
||||
zyTypeparametersService.updateById(zyTypeparameters); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "类型参数-通过id删除") |
||||
@ApiOperation(value="类型参数-通过id删除", notes="类型参数-通过id删除") |
||||
@DeleteMapping(value = "/deleteZyTypeparameters") |
||||
public Result<?> deleteZyTypeparameters(@RequestParam(name="id",required=true) String id) { |
||||
zyTypeparametersService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "类型参数-批量删除") |
||||
@ApiOperation(value="类型参数-批量删除", notes="类型参数-批量删除") |
||||
@DeleteMapping(value = "/deleteBatchZyTypeparameters") |
||||
public Result<?> deleteBatchZyTypeparameters(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyTypeparametersService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/exportZyTypeparameters") |
||||
public ModelAndView exportZyTypeparameters(HttpServletRequest request, ZyTypeparameters zyTypeparameters) { |
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<ZyTypeparameters> queryWrapper = QueryGenerator.initQueryWrapper(zyTypeparameters, request.getParameterMap()); |
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
||||
|
||||
// Step.2 获取导出数据
|
||||
List<ZyTypeparameters> pageList = zyTypeparametersService.list(queryWrapper); |
||||
List<ZyTypeparameters> exportList = null; |
||||
|
||||
// 过滤选中数据
|
||||
String selections = request.getParameter("selections"); |
||||
if (oConvertUtils.isNotEmpty(selections)) { |
||||
List<String> selectionList = Arrays.asList(selections.split(",")); |
||||
exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); |
||||
} else { |
||||
exportList = pageList; |
||||
} |
||||
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "类型参数"); //此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.CLASS, ZyTypeparameters.class); |
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("类型参数报表", "导出人:" + sysUser.getRealname(), "类型参数")); |
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
||||
return mv; |
||||
} |
||||
|
||||
/** |
||||
* 导入 |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importZyTypeparameters/{mainId}") |
||||
public Result<?> importZyTypeparameters(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") String mainId) { |
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams(); |
||||
params.setTitleRows(2); |
||||
params.setHeadRows(1); |
||||
params.setNeedSave(true); |
||||
try { |
||||
List<ZyTypeparameters> list = ExcelImportUtil.importExcel(file.getInputStream(), ZyTypeparameters.class, params); |
||||
for (ZyTypeparameters temp : list) { |
||||
temp.setTypeid(mainId); |
||||
} |
||||
long start = System.currentTimeMillis(); |
||||
zyTypeparametersService.saveBatch(list); |
||||
log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); |
||||
return Result.OK("文件导入成功!数据行数:" + list.size()); |
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return Result.error("文件导入失败:" + e.getMessage()); |
||||
} finally { |
||||
try { |
||||
file.getInputStream().close(); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
||||
return Result.error("文件导入失败!"); |
||||
} |
||||
|
||||
/*--------------------------------子表处理-类型参数-end----------------------------------------------*/ |
||||
|
||||
/*--------------------------------子表处理-运行参数-begin----------------------------------------------*/ |
||||
/** |
||||
* 通过主表ID查询 |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "运行参数-通过主表ID查询") |
||||
@ApiOperation(value="运行参数-通过主表ID查询", notes="运行参数-通过主表ID查询") |
||||
@GetMapping(value = "/listZyOperationparametersByMainId") |
||||
public Result<?> listZyOperationparametersByMainId(ZyOperationparameters zyOperationparameters, |
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyOperationparameters> queryWrapper = QueryGenerator.initQueryWrapper(zyOperationparameters, req.getParameterMap()); |
||||
Page<ZyOperationparameters> page = new Page<ZyOperationparameters>(pageNo, pageSize); |
||||
IPage<ZyOperationparameters> pageList = zyOperationparametersService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* @param zyOperationparameters |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "运行参数-添加") |
||||
@ApiOperation(value="运行参数-添加", notes="运行参数-添加") |
||||
@PostMapping(value = "/addZyOperationparameters") |
||||
public Result<?> addZyOperationparameters(@RequestBody ZyOperationparameters zyOperationparameters) { |
||||
zyOperationparametersService.save(zyOperationparameters); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* @param zyOperationparameters |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "运行参数-编辑") |
||||
@ApiOperation(value="运行参数-编辑", notes="运行参数-编辑") |
||||
@PutMapping(value = "/editZyOperationparameters") |
||||
public Result<?> editZyOperationparameters(@RequestBody ZyOperationparameters zyOperationparameters) { |
||||
zyOperationparametersService.updateById(zyOperationparameters); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "运行参数-通过id删除") |
||||
@ApiOperation(value="运行参数-通过id删除", notes="运行参数-通过id删除") |
||||
@DeleteMapping(value = "/deleteZyOperationparameters") |
||||
public Result<?> deleteZyOperationparameters(@RequestParam(name="id",required=true) String id) { |
||||
zyOperationparametersService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "运行参数-批量删除") |
||||
@ApiOperation(value="运行参数-批量删除", notes="运行参数-批量删除") |
||||
@DeleteMapping(value = "/deleteBatchZyOperationparameters") |
||||
public Result<?> deleteBatchZyOperationparameters(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyOperationparametersService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/exportZyOperationparameters") |
||||
public ModelAndView exportZyOperationparameters(HttpServletRequest request, ZyOperationparameters zyOperationparameters) { |
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<ZyOperationparameters> queryWrapper = QueryGenerator.initQueryWrapper(zyOperationparameters, request.getParameterMap()); |
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
||||
|
||||
// Step.2 获取导出数据
|
||||
List<ZyOperationparameters> pageList = zyOperationparametersService.list(queryWrapper); |
||||
List<ZyOperationparameters> exportList = null; |
||||
|
||||
// 过滤选中数据
|
||||
String selections = request.getParameter("selections"); |
||||
if (oConvertUtils.isNotEmpty(selections)) { |
||||
List<String> selectionList = Arrays.asList(selections.split(",")); |
||||
exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); |
||||
} else { |
||||
exportList = pageList; |
||||
} |
||||
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "运行参数"); //此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.CLASS, ZyOperationparameters.class); |
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("运行参数报表", "导出人:" + sysUser.getRealname(), "运行参数")); |
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
||||
return mv; |
||||
} |
||||
|
||||
/** |
||||
* 导入 |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importZyOperationparameters/{mainId}") |
||||
public Result<?> importZyOperationparameters(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") String mainId) { |
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams(); |
||||
params.setTitleRows(2); |
||||
params.setHeadRows(1); |
||||
params.setNeedSave(true); |
||||
try { |
||||
List<ZyOperationparameters> list = ExcelImportUtil.importExcel(file.getInputStream(), ZyOperationparameters.class, params); |
||||
for (ZyOperationparameters temp : list) { |
||||
temp.setTypeid(mainId); |
||||
} |
||||
long start = System.currentTimeMillis(); |
||||
zyOperationparametersService.saveBatch(list); |
||||
log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); |
||||
return Result.OK("文件导入成功!数据行数:" + list.size()); |
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return Result.error("文件导入失败:" + e.getMessage()); |
||||
} finally { |
||||
try { |
||||
file.getInputStream().close(); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
||||
return Result.error("文件导入失败!"); |
||||
} |
||||
|
||||
/*--------------------------------子表处理-运行参数-end----------------------------------------------*/ |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -1,101 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_devicetype") |
||||
@ApiModel(value="zy_devicetype对象", description="设备类型") |
||||
public class ZyDevicetype implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**父级节点*/ |
||||
@Excel(name = "父级节点", width = 15) |
||||
@ApiModelProperty(value = "父级节点") |
||||
private String pid; |
||||
/**是否有子节点*/ |
||||
@Excel(name = "是否有子节点", width = 15, dicCode = "yn") |
||||
@Dict(dicCode = "yn") |
||||
@ApiModelProperty(value = "是否有子节点") |
||||
private String hasChild; |
||||
/**类型编号*/ |
||||
@Excel(name = "类型编号", width = 15) |
||||
@ApiModelProperty(value = "类型编号") |
||||
private String code; |
||||
/**类型名称*/ |
||||
@Excel(name = "类型名称", width = 15) |
||||
@ApiModelProperty(value = "类型名称") |
||||
private String name; |
||||
/**类型图片*/ |
||||
@Excel(name = "类型图片", width = 15) |
||||
@ApiModelProperty(value = "类型图片") |
||||
private String img; |
||||
/**类型品牌*/ |
||||
@Excel(name = "类型品牌", width = 15) |
||||
@ApiModelProperty(value = "类型品牌") |
||||
private String brand; |
||||
/**型号*/ |
||||
@Excel(name = "型号", width = 15) |
||||
@ApiModelProperty(value = "型号") |
||||
private String model; |
||||
/**生产厂商*/ |
||||
@Excel(name = "生产厂商", width = 15) |
||||
@ApiModelProperty(value = "生产厂商") |
||||
private String manufacturer; |
||||
/**供货商*/ |
||||
@Excel(name = "供货商", width = 15) |
||||
@ApiModelProperty(value = "供货商") |
||||
private String supplier; |
||||
/**联系人*/ |
||||
@Excel(name = "联系人", width = 15) |
||||
@ApiModelProperty(value = "联系人") |
||||
private String contact; |
||||
/**产地*/ |
||||
@Excel(name = "产地", width = 15) |
||||
@ApiModelProperty(value = "产地") |
||||
private String place; |
||||
/**二维码*/ |
||||
@Excel(name = "二维码", width = 15) |
||||
@ApiModelProperty(value = "二维码") |
||||
private String erweima; |
||||
} |
@ -1,63 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import java.util.Date; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import java.io.UnsupportedEncodingException; |
||||
|
||||
/** |
||||
* @Description: 类型参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_typeparameters") |
||||
@ApiModel(value="zy_typeparameters对象", description="类型参数") |
||||
public class ZyTypeparameters implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**设备类型*/ |
||||
@ApiModelProperty(value = "设备类型") |
||||
private String typeid; |
||||
/**参数名*/ |
||||
@Excel(name = "参数名", width = 15) |
||||
@ApiModelProperty(value = "参数名") |
||||
private String parametersname; |
||||
/**参数值*/ |
||||
@Excel(name = "参数值", width = 15) |
||||
@ApiModelProperty(value = "参数值") |
||||
private String parametersvalue; |
||||
} |
@ -1,20 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.mapper; |
||||
|
||||
import java.util.List; |
||||
import org.jeecg.modules.devicetype.entity.ZyOperationparameters; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
* @Description: 运行参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyOperationparametersMapper extends BaseMapper<ZyOperationparameters> { |
||||
|
||||
public boolean deleteByMainId(@Param("mainId") String mainId); |
||||
|
||||
public List<ZyOperationparameters> selectByMainId(@Param("mainId") String mainId); |
||||
|
||||
} |
@ -1,20 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.mapper; |
||||
|
||||
import java.util.List; |
||||
import org.jeecg.modules.devicetype.entity.ZyTypeparameters; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
* @Description: 类型参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyTypeparametersMapper extends BaseMapper<ZyTypeparameters> { |
||||
|
||||
public boolean deleteByMainId(@Param("mainId") String mainId); |
||||
|
||||
public List<ZyTypeparameters> selectByMainId(@Param("mainId") String mainId); |
||||
|
||||
} |
@ -1,18 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.devicetype.mapper.ZyOperationparametersMapper"> |
||||
|
||||
<delete id="deleteByMainId" parameterType="java.lang.String"> |
||||
DELETE |
||||
FROM zy_operationparameters |
||||
WHERE |
||||
typeid = #{mainId} |
||||
</delete> |
||||
|
||||
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.devicetype.entity.ZyOperationparameters"> |
||||
SELECT * |
||||
FROM zy_operationparameters |
||||
WHERE |
||||
typeid = #{mainId} |
||||
</select> |
||||
</mapper> |
@ -1,18 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.devicetype.mapper.ZyTypeparametersMapper"> |
||||
|
||||
<delete id="deleteByMainId" parameterType="java.lang.String"> |
||||
DELETE |
||||
FROM zy_typeparameters |
||||
WHERE |
||||
typeid = #{mainId} |
||||
</delete> |
||||
|
||||
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.devicetype.entity.ZyTypeparameters"> |
||||
SELECT * |
||||
FROM zy_typeparameters |
||||
WHERE |
||||
typeid = #{mainId} |
||||
</select> |
||||
</mapper> |
@ -1,32 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.service; |
||||
|
||||
import org.jeecg.modules.devicetype.entity.ZyTypeparameters; |
||||
import org.jeecg.modules.devicetype.entity.ZyOperationparameters; |
||||
import org.jeecg.modules.devicetype.entity.ZyDevicetype; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import java.io.Serializable; |
||||
import java.util.Collection; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyDevicetypeService extends IService<ZyDevicetype> { |
||||
|
||||
/** |
||||
* 删除一对多 |
||||
*/ |
||||
public void delMain (String id); |
||||
|
||||
/** |
||||
* 批量删除一对多 |
||||
*/ |
||||
public void delBatchMain (Collection<? extends Serializable> idList); |
||||
|
||||
|
||||
List<ZyDevicetype> selectByid(String id); |
||||
} |
@ -1,16 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.service; |
||||
|
||||
import org.jeecg.modules.devicetype.entity.ZyOperationparameters; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 运行参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyOperationparametersService extends IService<ZyOperationparameters> { |
||||
|
||||
public List<ZyOperationparameters> selectByMainId(String mainId); |
||||
} |
@ -1,16 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.service; |
||||
|
||||
import org.jeecg.modules.devicetype.entity.ZyTypeparameters; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Description: 类型参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyTypeparametersService extends IService<ZyTypeparameters> { |
||||
|
||||
public List<ZyTypeparameters> selectByMainId(String mainId); |
||||
} |
@ -1,57 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.service.impl; |
||||
|
||||
import org.jeecg.modules.devicetype.entity.ZyDevicetype; |
||||
import org.jeecg.modules.devicetype.entity.ZyTypeparameters; |
||||
import org.jeecg.modules.devicetype.entity.ZyOperationparameters; |
||||
import org.jeecg.modules.devicetype.mapper.ZyTypeparametersMapper; |
||||
import org.jeecg.modules.devicetype.mapper.ZyOperationparametersMapper; |
||||
import org.jeecg.modules.devicetype.mapper.ZyDevicetypeMapper; |
||||
import org.jeecg.modules.devicetype.service.IZyDevicetypeService; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
import java.util.Collection; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyDevicetypeServiceImpl extends ServiceImpl<ZyDevicetypeMapper, ZyDevicetype> implements IZyDevicetypeService { |
||||
|
||||
@Autowired |
||||
private ZyDevicetypeMapper zyDevicetypeMapper; |
||||
@Autowired |
||||
private ZyTypeparametersMapper zyTypeparametersMapper; |
||||
@Autowired |
||||
private ZyOperationparametersMapper zyOperationparametersMapper; |
||||
|
||||
@Override |
||||
@Transactional |
||||
public void delMain(String id) { |
||||
zyTypeparametersMapper.deleteByMainId(id); |
||||
zyOperationparametersMapper.deleteByMainId(id); |
||||
zyDevicetypeMapper.deleteById(id); |
||||
} |
||||
|
||||
@Override |
||||
@Transactional |
||||
public void delBatchMain(Collection<? extends Serializable> idList) { |
||||
for(Serializable id:idList) { |
||||
zyTypeparametersMapper.deleteByMainId(id.toString()); |
||||
zyOperationparametersMapper.deleteByMainId(id.toString()); |
||||
zyDevicetypeMapper.deleteById(id); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<ZyDevicetype> selectByid(String id) { |
||||
return zyDevicetypeMapper.selectByid(id); |
||||
} |
||||
|
||||
} |
@ -1,27 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.service.impl; |
||||
|
||||
import org.jeecg.modules.devicetype.entity.ZyOperationparameters; |
||||
import org.jeecg.modules.devicetype.mapper.ZyOperationparametersMapper; |
||||
import org.jeecg.modules.devicetype.service.IZyOperationparametersService; |
||||
import org.springframework.stereotype.Service; |
||||
import java.util.List; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
||||
/** |
||||
* @Description: 运行参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyOperationparametersServiceImpl extends ServiceImpl<ZyOperationparametersMapper, ZyOperationparameters> implements IZyOperationparametersService { |
||||
|
||||
@Autowired |
||||
private ZyOperationparametersMapper zyOperationparametersMapper; |
||||
|
||||
@Override |
||||
public List<ZyOperationparameters> selectByMainId(String mainId) { |
||||
return zyOperationparametersMapper.selectByMainId(mainId); |
||||
} |
||||
} |
@ -1,27 +0,0 @@ |
||||
package org.jeecg.modules.devicetype.service.impl; |
||||
|
||||
import org.jeecg.modules.devicetype.entity.ZyTypeparameters; |
||||
import org.jeecg.modules.devicetype.mapper.ZyTypeparametersMapper; |
||||
import org.jeecg.modules.devicetype.service.IZyTypeparametersService; |
||||
import org.springframework.stereotype.Service; |
||||
import java.util.List; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
||||
/** |
||||
* @Description: 类型参数 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyTypeparametersServiceImpl extends ServiceImpl<ZyTypeparametersMapper, ZyTypeparameters> implements IZyTypeparametersService { |
||||
|
||||
@Autowired |
||||
private ZyTypeparametersMapper zyTypeparametersMapper; |
||||
|
||||
@Override |
||||
public List<ZyTypeparameters> selectByMainId(String mainId) { |
||||
return zyTypeparametersMapper.selectByMainId(mainId); |
||||
} |
||||
} |
@ -0,0 +1,198 @@ |
||||
package org.jeecg.modules.zydevice.devicetype.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype; |
||||
import org.jeecg.modules.zydevice.devicetype.service.IZyDevicetypeService; |
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-04 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="设备类型") |
||||
@RestController |
||||
@RequestMapping("/devicetype/zyDevicetype") |
||||
@Slf4j |
||||
public class ZyDevicetypeController extends JeecgController<ZyDevicetype, IZyDevicetypeService> { |
||||
@Autowired |
||||
private IZyDevicetypeService zyDevicetypeService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyDevicetype |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-分页列表查询") |
||||
@ApiOperation(value="设备类型-分页列表查询", notes="设备类型-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyDevicetype zyDevicetype, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyDevicetype> queryWrapper = QueryGenerator.initQueryWrapper(zyDevicetype, req.getParameterMap()); |
||||
queryWrapper.orderByDesc("code"); |
||||
Page<ZyDevicetype> page = new Page<ZyDevicetype>(pageNo, pageSize); |
||||
IPage<ZyDevicetype> pageList = zyDevicetypeService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyDevicetype |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-添加") |
||||
@ApiOperation(value="设备类型-添加", notes="设备类型-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyDevicetype zyDevicetype) { |
||||
QueryWrapper queryWrapper=new QueryWrapper(); |
||||
queryWrapper.eq("name",zyDevicetype.getName()); |
||||
int a=zyDevicetypeService.count(queryWrapper); |
||||
if(a==0){ |
||||
zyDevicetypeService.save(zyDevicetype); |
||||
return Result.OK("添加成功!");} |
||||
else{ |
||||
return Result.error("添加失败,该设备名称已存在!"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyDevicetype |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-编辑") |
||||
@ApiOperation(value="设备类型-编辑", notes="设备类型-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyDevicetype zyDevicetype) { |
||||
QueryWrapper queryWrapper=new QueryWrapper(); |
||||
queryWrapper.eq("name",zyDevicetype.getName()); |
||||
int a=zyDevicetypeService.count(queryWrapper); |
||||
if(a==0){ |
||||
zyDevicetypeService.updateById(zyDevicetype); |
||||
return Result.OK("编辑成功!");} |
||||
else{ |
||||
return Result.error("编辑失败,设备名重复!!"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-通过id删除") |
||||
@ApiOperation(value="设备类型-通过id删除", notes="设备类型-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
zyDevicetypeService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-批量删除") |
||||
@ApiOperation(value="设备类型-批量删除", notes="设备类型-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyDevicetypeService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "设备类型-通过id查询") |
||||
@ApiOperation(value="设备类型-通过id查询", notes="设备类型-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyDevicetype zyDevicetype = zyDevicetypeService.getById(id); |
||||
if(zyDevicetype==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyDevicetype); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyDevicetype |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyDevicetype zyDevicetype) { |
||||
return super.exportXls(request, zyDevicetype, ZyDevicetype.class, "设备类型"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyDevicetype.class); |
||||
} |
||||
|
||||
@AutoLog(value = "唯一") |
||||
@ApiOperation(value="设备类型-分页列表查询", notes="设备类型-分页列表查询") |
||||
@GetMapping(value = "/weiyi") |
||||
public Result<?> weiyi() { |
||||
String lastCode=zyDevicetypeService.findCode(); |
||||
if(lastCode==null||lastCode.equals("")){ |
||||
return Result.OK("0"); |
||||
} |
||||
return Result.OK(lastCode.substring(1)); |
||||
} |
||||
|
||||
|
||||
} |
@ -1,20 +1,21 @@ |
||||
package org.jeecg.modules.devicetype.mapper; |
||||
package org.jeecg.modules.zydevice.devicetype.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.jeecg.modules.devicetype.entity.ZyDevicetype; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2021-11-11 |
||||
* @Date: 2023-01-04 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyDevicetypeMapper extends BaseMapper<ZyDevicetype> { |
||||
|
||||
@Select("select * from zy_devicetype where id in (select machine_id from zy_process_machine where process_id=#{id})") |
||||
List<ZyDevicetype> selectByid(String id); |
||||
@Select("select code from zy_devicetype order by code desc limit 0,1") |
||||
String findCode(); |
||||
} |
@ -1,5 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.devicetype.mapper.ZyDevicetypeMapper"> |
||||
<mapper namespace="org.jeecg.modules.zydevice.devicetype.mapper.ZyDevicetypeMapper"> |
||||
|
||||
</mapper> |
||||
</mapper> |
@ -0,0 +1,16 @@ |
||||
package org.jeecg.modules.zydevice.devicetype.service; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-04 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyDevicetypeService extends IService<ZyDevicetype> { |
||||
|
||||
String findCode(); |
||||
} |
@ -0,0 +1,27 @@ |
||||
package org.jeecg.modules.zydevice.devicetype.service.impl; |
||||
|
||||
|
||||
import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype; |
||||
import org.jeecg.modules.zydevice.devicetype.mapper.ZyDevicetypeMapper; |
||||
import org.jeecg.modules.zydevice.devicetype.service.IZyDevicetypeService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 设备类型 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-04 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyDevicetypeServiceImpl extends ServiceImpl<ZyDevicetypeMapper, ZyDevicetype> implements IZyDevicetypeService { |
||||
|
||||
@Autowired |
||||
ZyDevicetypeMapper zyDevicetypeMapper; |
||||
@Override |
||||
public String findCode() { |
||||
return zyDevicetypeMapper.findCode(); |
||||
} |
||||
} |
Loading…
Reference in new issue