Merge remote-tracking branch 'origin/master'

zhc4dev
wangjiadong 2 years ago
commit 7a375ada8e
  1. 33
      ant-design-vue-jeecg/src/views/device/ZyDeviceList.vue
  2. 7
      ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue
  3. 19
      ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricTypeForm.vue
  4. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyOperationtoolList.vue
  5. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessActionList.vue
  6. 35
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessComponentModal.vue
  7. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessFabricList.vue
  8. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineList.vue
  9. 2
      ant-design-vue-jeecg/src/views/process/modules/list/ZyMachine.vue
  10. 293
      ant-design-vue-jeecg/src/views/process/modules/list/ZyProcessList.vue
  11. 3
      ant-design-vue-jeecg/src/views/zyProcessModular/ZyProcessModularList.vue
  12. 293
      ant-design-vue-jeecg/src/views/zyProcessModular/modules/ZyProcessList.vue
  13. 35
      ant-design-vue-jeecg/src/views/zyProcessModular/modules/ZyProcessModularModal.vue
  14. 194
      ant-design-vue-jeecg/src/views/zydevice/devicetype/ZyDevicetypeList.vue
  15. 127
      ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeForm.vue
  16. 60
      ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeModal.vue
  17. 84
      ant-design-vue-jeecg/src/views/zydevice/devicetype/modules/ZyDevicetypeModal__Style#Drawer.vue
  18. 9
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricController.java
  19. 38
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyProcessController.java
  20. 6
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyProcessMapper.java
  21. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyProcessService.java
  22. 20
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyProcessServiceImpl.java
  23. 20
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessComponentController.java
  24. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java
  25. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/mapper/ZyProcessMachineMapper.java
  26. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java
  27. 33
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/entity/ZyDevice.java
  28. 542
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/controller/ZyDevicetypeController.java
  29. 101
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/entity/ZyDevicetype.java
  30. 63
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/entity/ZyTypeparameters.java
  31. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/mapper/ZyOperationparametersMapper.java
  32. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/mapper/ZyTypeparametersMapper.java
  33. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/mapper/xml/ZyOperationparametersMapper.xml
  34. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/mapper/xml/ZyTypeparametersMapper.xml
  35. 32
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/service/IZyDevicetypeService.java
  36. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/service/IZyOperationparametersService.java
  37. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/service/IZyTypeparametersService.java
  38. 57
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/service/impl/ZyDevicetypeServiceImpl.java
  39. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/service/impl/ZyOperationparametersServiceImpl.java
  40. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/devicetype/service/impl/ZyTypeparametersServiceImpl.java
  41. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/entity/ProductMachine.java
  42. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/pdmachine/mapper/ProductMachineMapper.java
  43. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/controller/ZyProcessModularController.java
  44. 198
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/controller/ZyDevicetypeController.java
  45. 51
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/entity/ZyDevicetype.java
  46. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/mapper/ZyDevicetypeMapper.java
  47. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/mapper/xml/ZyDevicetypeMapper.xml
  48. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/service/IZyDevicetypeService.java
  49. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zydevice/devicetype/service/impl/ZyDevicetypeServiceImpl.java
  50. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java

@ -130,6 +130,26 @@
return parseInt(index)+1;
}
},
{
title:'设备类型',
align:"center",
dataIndex: 'typeCode_dictText'
},
{
title:'设备型号',
align:"center",
dataIndex: 'modelId_dictText'
},
{
title:'设备品牌',
align:"center",
dataIndex: 'brandId_dictText'
},
{
title:'设备名称',
align:"center",
dataIndex: 'name'
},
{
title:'设备图片',
align:"center",
@ -139,14 +159,10 @@
{
title:'设备二维码',
align:"center",
dataIndex: 'erweima',
dataIndex: 'qrcode',
scopedSlots: {customRender: 'imgeSlot'}
},
{
title:'设备类型',
align:"center",
dataIndex: 'typeid_dictText'
},
{
title:'设备编号',
align:"center",
@ -165,11 +181,6 @@
align:"center",
dataIndex: 'agent_dictText'
},
{
title:'存放位置',
align:"center",
dataIndex: 'adress'
},
{
title:'设备状态',
align:"center",

@ -24,7 +24,7 @@
<a-input placeholder="名称" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="颜色">
<a-input placeholder="请输入颜色" v-model="queryParam.color"></a-input>
@ -40,15 +40,10 @@
<j-search-select-tag placeholder="请选择材质" v-model="queryParam.material" dict="material"/>
</a-form-item>
</a-col>
</template>
<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>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>

@ -74,7 +74,13 @@
created () {
//使使while
// this.model.nums=randomString(4)
var n=4
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
var n=4
getAction(this.url.weiyi,{id:this.model.nums}).then((res)=>{
var num=parseInt(res.message,10)+1
num=num.toString()
@ -83,14 +89,9 @@
}
this.model.nums=num;
console.log(num)
})
//model
console.log(this.model.nums)
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
})
//model
console.log(this.model.nums)
this.edit(this.modelDefault);
},
edit (record) {

@ -12,7 +12,7 @@
<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>-->
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>

@ -12,7 +12,7 @@
<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>-->
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>

@ -8,28 +8,44 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-process-component-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-process-component-form>
<!-- <zy-process-component-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-process-component-form>-->
<zy-process ref="realForm"
@onChangeRowKey="chuancan"
@ok="submitCallback"
:disabled="disableSubmit"></zy-process>
</j-modal>
</template>
<script>
import ZyProcessComponentForm from './ZyProcessComponentForm'
import {postAction} from "@api/manage";
import ZyProcess from "@views/process/modules/list/ZyProcessList";
export default {
name: 'ZyProcessComponentModal',
components: {
ZyProcess,
ZyProcessComponentForm
},
data () {
return {
model:{
componentId: '',
processId: '',
},
title:'',
width:800,
visible: false,
disableSubmit: false
disableSubmit: false,
url: {
add: "/pro/zyProcessComponent/add",
}
}
},
methods: {
add1 (componentId1) {
this.model.componentId = componentId1;
//console.log("componentId1: "+componentId1)
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add1(componentId1);
@ -41,12 +57,25 @@
this.$refs.realForm.edit(record);
})
},
chuancan(res) {
this.model.processId = res;
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
// this.$refs.realForm.submitForm();
postAction(this.url.add, this.model).then((res) => {
if (res.success) {
this.$message.success(res.message);
} else {
this.$message.warning(res.message);
}
this.$emit('valueChange', 1)
this.close()
})
},
submitCallback(){
this.$emit('ok');

@ -17,7 +17,7 @@
<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>-->
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>

@ -17,7 +17,7 @@
<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>-->
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>

@ -142,7 +142,7 @@
// }
],
url: {
list: "/devicetype/zyDevicetype/list1",
list: "/device/zyDevice/list1",
importExcelUrl: "base/zyClothAction/importExcel",
},

@ -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>

@ -216,13 +216,14 @@ export default {
this.biaoTi = record.modularName+"模块工序管理";
//console.log(topicid);
this.queryParam.modularId = this.model.id;
console.log("子弹窗拿到的ID++++++:"+ this.queryParam.modularId);
//console.log("ID++++++"+ this.queryParam.modularId);
this.loadData();
this.visible = true;
},
showModal1() {
this.visible = true;
},
//list List
valueChange(value) {
if (value) this.loadData()
},

@ -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>

@ -8,28 +8,44 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-process-modular-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-process-modular-form>
<!-- <zy-process-modular-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-process-modular-form>-->
<ZyProcess ref="realForm"
@onChangeRowKey="chuancan"
@ok="submitCallback"
:disabled="disableSubmit"></ZyProcess>
</j-modal>
</template>
<script>
import ZyProcessModularForm from './ZyProcessModularForm'
import ZyProcess from "@views/zyProcessModular/modules/ZyProcessList";
import {postAction} from "@api/manage";
export default {
name: 'ZyProcessModularModal',
components: {
ZyProcess,
ZyProcessModularForm
},
data () {
return {
model:{
modularId: '',
processId: '',
},
title:'',
width:800,
visible: false,
disableSubmit: false
disableSubmit: false,
url: {
add: "/zyProcessModular/zyProcessModular/add",
},
}
},
methods: {
add1 (modularId1) {
this.model.modularId = modularId1;
//console.log("modal modularId1: "+ modularId1);
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add1(modularId1);
@ -41,12 +57,25 @@ export default {
this.$refs.realForm.edit(record);
})
},
chuancan(res) {
this.model.processId = res;
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
// this.$refs.realForm.submitForm();
postAction(this.url.add, this.model).then((res) => {
if (res.success) {
this.$message.success(res.message);
} else {
this.$message.warning(res.message);
}
this.$emit('valueChange', 1)
this.close()
})
},
submitCallback(){
this.$emit('ok');

@ -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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <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>

@ -89,6 +89,15 @@ public class ZyFabricController extends JeecgController<ZyFabric, IZyFabricServi
if(zyFabric.getName()!=null&&!zyFabric.getName().equals("")){
queryWrapper.like("name",zyFabric.getName());
}
if(zyFabric.getColor()!=null&&!zyFabric.getColor().equals("")){
queryWrapper.like("color",zyFabric.getColor());
}
if(zyFabric.getPattern()!=null&&!zyFabric.getPattern().equals("")){
queryWrapper.like("pattern",zyFabric.getPattern());
}
if(zyFabric.getMaterial()!=null&&!zyFabric.getMaterial().equals("")){
queryWrapper.like("material",zyFabric.getMaterial());
}
queryWrapper.orderByDesc("create_time");
// QueryWrapper queryWrapper = new QueryWrapper();
Page<ZyFabric> page = new Page<>(pageNo, pageSize);

@ -101,6 +101,44 @@ public class ZyProcessController extends JeecgController<ZyProcess, IZyProcessSe
return Result.OK(pageList);
}
/**
* 制衣模块之模块工序中的工序接口 分页列表查询
* 根据服装类型筛选list中的数据
*/
@GetMapping(value = "/listScreenTwo")
public Result<?> queryPageListScreenTwo(ZyProcess zyProcess,
@RequestParam(name = "clothsTypeId", required = true) String clothsTypeId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
//根据clothsTypeId 查到服装类型的编号 在根据编号进行筛选
String nums = zyProcessService.getNums(clothsTypeId);
QueryWrapper<ZyProcess> queryWrappers = QueryGenerator.initQueryWrapper(zyProcess, req.getParameterMap());
queryWrappers.eq(StringUtils.hasText(nums), "style_id", nums);
Page<ZyProcess> page = new Page<>(pageNo, pageSize);
IPage<ZyProcess> pageList = zyProcessService.page(page, queryWrappers);
return Result.OK(pageList);
}
/**
* 制衣部件之部件工序中的工序接口 分页列表查询
* 根据服装类型筛选list中的数据
*/
@GetMapping(value = "/listScreenThree")
public Result<?> queryPageListScreenThree(ZyProcess zyProcess,
@RequestParam(name = "clothsComponentId", required = true) String clothsComponentId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
//根据clothsTypeId 查到服装类型的编号 在根据编号进行筛选
String nums = zyProcessService.getNumsByClothsComponentId(clothsComponentId);
QueryWrapper<ZyProcess> queryWrappers = QueryGenerator.initQueryWrapper(zyProcess, req.getParameterMap());
queryWrappers.eq(StringUtils.hasText(nums), "style_id", nums);
Page<ZyProcess> page = new Page<>(pageNo, pageSize);
IPage<ZyProcess> pageList = zyProcessService.page(page, queryWrappers);
return Result.OK(pageList);
}
/**
* 添加
*

@ -34,4 +34,10 @@ public interface ZyProcessMapper extends BaseMapper<ZyProcess> {
@Select("select nums from zy_cloths_type where id=#{typeId}")
String getNums(String typeId);
@Select("select cloths_type_id from zy_cloths_modular where id=#{clothsTypeId}")
String getClothsTypeId(String clothsTypeId);
@Select("select cloths_type_id from zy_cloths_component where id=#{clothsComponentId}")
String getClothsComponentId(String clothsComponentId);
}

@ -24,4 +24,8 @@ public interface IZyProcessService extends IService<ZyProcess> {
/**根据服装类型筛选list中的数据*/
String screenList(String clothStyleId);
String getNums(String clothsTypeId);
String getNumsByClothsComponentId(String clothsComponentId);
}

@ -48,17 +48,29 @@ public class ZyProcessServiceImpl extends ServiceImpl<ZyProcessMapper, ZyProcess
/**
* 根据服装类型筛选list中的数据
*
* @param clothStyleId
* @param clothStyleId zy cloths style中的Id
*/
@Override
public String screenList(String clothStyleId) {
//先拿到zy cloths style 中的typeId
//在拿到zy cloths type 中的nums
//先拿到zy cloths style 中的typeId 再拿到zy cloths type 中的nums
String typeId = baseMapper.getTypeId(clothStyleId);
return baseMapper.getNums(typeId);
}
@Override
public String getNums(String clothsTypeId) {
//先在zy cloths modular 根据id拿到clothsTypeId 再在zy cloths type中拿到编号
String id = baseMapper.getClothsTypeId(clothsTypeId);
return baseMapper.getNums(id);
}
@Override
public String getNumsByClothsComponentId(String clothsComponentId) {
//先在zy cloths component中 根据id拿到clothsTypeId 再在zy cloths type中拿到编号
String id = baseMapper.getClothsComponentId(clothsComponentId);
return baseMapper.getNums(id);
}
@Override
public ZyProcess selectZyprocess(String id) {
List<String> list=baseMapper.selectByIds(id);

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.pro.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -27,6 +28,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -131,8 +133,22 @@ public class ZyProcessComponentController extends JeecgController<ZyProcessCompo
@ApiOperation(value = "zy_process_component-添加", notes = "zy_process_component-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProcessComponent zyProcessComponent) {
zyProcessComponentService.save(zyProcessComponent);
return Result.OK("添加成功!");
//System.err.println("zyProcessComponent"+ zyProcessComponent+ LocalDateTime.now());
LambdaQueryWrapper<ZyProcessComponent> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ZyProcessComponent::getComponentId,zyProcessComponent.getComponentId());
String[] processIds = zyProcessComponent.getProcessId().split(",");
for (String processId : processIds) {
queryWrapper.eq( ZyProcessComponent::getProcessId,processId);
int count = zyProcessComponentService.count(queryWrapper);
if (count >= 1){
return Result.error("存在已添加过的数据!");
}
zyProcessComponent.setId(null);
zyProcessComponent.setProcessId(processId);
//System.out.println(""+zyProcessComponent + LocalDateTime.now());
zyProcessComponentService.save(zyProcessComponent);
}
return Result.OK("添加成功");
}
/**

@ -41,7 +41,7 @@ public class ZyProcessMachine implements Serializable {
private String processId;
/**机器*/
@Excel(name = "机器", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@Dict(dictTable = "zy_device", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "机器")
private String machineId;
/**创建时间*/

@ -21,6 +21,6 @@ public interface ZyProcessMachineMapper extends BaseMapper<ZyProcessMachine> {
@Select("<script>select * from zy_process_machine <where><if test=\" p != null\">process_id in (select id from zy_process where process_name like #{p})</if><if test=\" m != null\"> and machine_id in (select id from zy_devicetype where name like #{m})</if></where></script>")
IPage<ZyProcessMachine> page(Page<ZyProcessMachine> page, @Param("p") String processId, @Param("m") String machineId);
@Select("<script>select a.*,b.process_code,c.code from zy_process_machine as a,zy_process as b,zy_devicetype as c <where> a.process_id=b.id and a.machine_id=c.id and a.process_id=#{p} <if test=\" m != null\"> and machine_id in (select id from zy_devicetype where name like #{m})</if></where></script>")
@Select("<script>select a.*,b.process_code,c.code from zy_process_machine as a,zy_process as b,zy_device as c <where> a.process_id=b.id and a.machine_id=c.id and a.process_id=#{p} <if test=\" m != null\"> and machine_id in (select id from zy_device where name like #{m})</if></where></script>")
IPage<ZyProcessMachine> page1(Page<ZyProcessMachine> page, @Param("p") String s, @Param("m") String t);
}

@ -102,12 +102,25 @@ public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceServi
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);
pageList.getRecords().get(i).setQrcode("data:image/png;base64,"+text);
}
return Result.OK(pageList);
}
@AutoLog(value = "设备信息-分页列表查询")
@ApiOperation(value="设备信息-分页列表查询", notes="设备信息-分页列表查询")
@GetMapping(value = "/list1")
public Result<?> queryPageList1(ZyDevice zyDevice,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) throws WriterException, IOException {
QueryWrapper<ZyDevice> queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap());
Page<ZyDevice> page = new Page<ZyDevice>(pageNo, pageSize);
IPage<ZyDevice> pageList = zyDeviceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
/**
* 添加
*
* @param zyDevice

@ -53,16 +53,16 @@ public class ZyDevice implements Serializable {
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
private String orgCode;
/**设备图片*/
@Excel(name = "设备图片", width = 15)
@ApiModelProperty(value = "设备图片")
private String img;
/**设备类型*/
@Excel(name = "设备类型", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "设备类型")
private String typeid;
// @Excel(name = "设备类型", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
// @Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
// @ApiModelProperty(value = "设备类型")
// private String typeid;
/**设备编号*/
@Excel(name = "设备编号", width = 15)
@ApiModelProperty(value = "设备编号")
@ -79,9 +79,9 @@ public class ZyDevice implements Serializable {
@ApiModelProperty(value = "经办人")
private String agent;
/**存放位置*/
@Excel(name = "存放位置", width = 15)
@ApiModelProperty(value = "存放位置")
private String adress;
// @Excel(name = "存放位置", width = 15)
// @ApiModelProperty(value = "存放位置")
// private String adress;
/**设备状态*/
@Excel(name = "设备状态", width = 15)
@ApiModelProperty(value = "设备状态")
@ -89,11 +89,11 @@ public class ZyDevice implements Serializable {
/**二维码*/
@Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码")
private String erweima;
private String qrcode;
/**维护周期*/
@Excel(name = "维护周期", width = 15)
@ApiModelProperty(value = "维护周期")
private String maintenancecycle;
private Integer maintenancecycle;
/**管理人*/
@Excel(name = "管理人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ -109,4 +109,17 @@ public class ZyDevice implements Serializable {
@Excel(name = "3d模型", width = 15)
@ApiModelProperty(value = "3d模型")
private String img3d;
// @Excel(name = "设备品牌", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "zy_devicebrand", dicText = "brand", dicCode = "id")
@ApiModelProperty(value = "设备品牌")
private String brandId;
@Dict(dictTable = "zy_devicemodel", dicText = "model", dicCode = "id")
@ApiModelProperty(value = "设备型号")
private String modelId;
@Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "设备类型")
private String typeCode;
@ApiModelProperty(value = "设备名称")
private String name;
}

@ -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);
}
}

@ -49,7 +49,7 @@ public class ProductMachine implements Serializable {
/**设备d*/
@Excel(name = "设备d", width = 15)
@ApiModelProperty(value = "设备d")
@Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@Dict(dictTable = "zy_device", dicText = "name", dicCode = "id")
private String machineId;
/**序号*/
@Excel(name = "序号", width = 15)

@ -18,7 +18,7 @@ import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
*/
public interface ProductMachineMapper extends BaseMapper<ProductMachine> {
@Select("select id from zy_devicetype where name like #{s}")
@Select("select id from zy_device where name like #{s}")
List<String> find(String s);
@Update("update product_machine set sort=sort+1 where id=#{id}")

@ -1,5 +1,6 @@
package org.jeecg.modules.zyProcessModular.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -18,6 +19,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.Arrays;
/**
@ -66,8 +68,22 @@ public class ZyProcessModularController extends JeecgController<ZyProcessModular
@ApiOperation(value="模块工序表-添加", notes="模块工序表-添加")
//@RequiresPermissions("org.jeecg.modules.demo:zy_process_modular:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ZyProcessModular zyProcessModular) {
zyProcessModularService.save(zyProcessModular);
public Result<Object> add(@RequestBody ZyProcessModular zyProcessModular) {
//System.err.println("zyProcessModular"+ zyProcessModular+ LocalDateTime.now());
LambdaQueryWrapper<ZyProcessModular> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq( ZyProcessModular::getModularId,zyProcessModular.getModularId());
String[] processIds = zyProcessModular.getProcessId().split(",");
for (String processId : processIds) {
queryWrapper.eq( ZyProcessModular::getProcessId,processId);
int count = zyProcessModularService.count(queryWrapper);
if (count >= 1){
return Result.error("存在已添加过的数据!");
}
zyProcessModular.setId(null);
zyProcessModular.setProcessId(processId);
//System.out.println(""+zyProcessModular + LocalDateTime.now());
zyProcessModularService.save(zyProcessModular);
}
return Result.OK("添加成功!");
}

@ -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,29 +1,36 @@
package org.jeecg.modules.devicetype.entity;
package org.jeecg.modules.zydevice.devicetype.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
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 org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.UnsupportedEncodingException;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 运行参数
* @Description: 设备类型
* @Author: jeecg-boot
* @Date: 2021-11-11
* @Date: 2023-01-04
* @Version: V1.0
*/
@Data
@TableName("zy_operationparameters")
@ApiModel(value="zy_operationparameters对象", description="运行参数")
public class ZyOperationparameters implements Serializable {
@TableName("zy_devicetype")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_devicetype对象", description="设备类型")
public class ZyDevicetype implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@ -46,18 +53,16 @@ public class ZyOperationparameters implements Serializable {
@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;
/**类型编号*/
@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;
}

@ -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();
}
}

@ -110,7 +110,7 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
queryWrapper.eq("fabric_id", zyStyleFabric.getFabricId());
int a = zyStyleFabricService.count(queryWrapper);
if (a >= 1)
return Result.error("存在添加过的数据!!!");
return Result.error("存在添加过的数据!!!");
zyStyleFabricService.save(zyStyleFabric);
}
return Result.OK("添加成功!");

Loading…
Cancel
Save