2022-12-19 修改产品管理部分问题

zhc4dev
赵玉瑞 2 years ago
parent 230f46a84d
commit f586728a5b
  1. 323
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 11
      ant-design-vue-jeecg/src/views/process/ZyClothsModularCompentList.vue
  3. 310
      ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
  4. 6
      ant-design-vue-jeecg/src/views/process/ZyProcessList.vue
  5. 43
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentModal.vue
  6. 227
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
  7. 254
      ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue
  8. 38
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java
  9. 338
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
  10. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
  11. 8
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularCompentMapper.java
  12. 3
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  13. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
  14. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularCompentMapper.xml
  15. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularCompentService.java
  16. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularService.java
  17. 21
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularCompentServiceImpl.java
  18. 9
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java

@ -13,23 +13,29 @@
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('zy_cloths_component')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('zy_cloths_component')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>--> <!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>--> <!-- </a-upload>-->
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> <a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown> </a-dropdown>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <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> <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> <a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
@ -52,7 +58,8 @@
</template> </template>
<template slot="imgSlot" slot-scope="text"> <template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> <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;"/> <img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@ -67,32 +74,32 @@
</a-button> </a-button>
</template> </template>
<span slot="action2" slot-scope="text, record" > <span slot="action2" slot-scope="text, record">
<a @click="viewVid2(record)" >管理</a> <a @click="viewVid2(record)">管理</a>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical"/>
<a @click="handleDetail(record)">详情</a> <a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" /> <a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
<!-- <a-dropdown> <!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a @click="handleDetail(record)">详情</a> <a @click="handleDetail(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown>--> </a-dropdown>-->
</span> </span>
</a-table> </a-table>
@ -106,148 +113,148 @@
<script> <script>
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin' import {mixinDevice} from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyClothsComponentModal from './modules/ZyClothsComponentModal' import ZyClothsComponentModal from './modules/ZyClothsComponentModal'
import ZyProcessComponentList from "@views/process/ZyProcessComponentList" import ZyProcessComponentList from "@views/process/ZyProcessComponentList"
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'; import {filterMultiDictText} from '@/components/dict/JDictSelectUtil';
import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail' import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail'
export default { export default {
name: 'ZyClothsComponentList', name: 'ZyClothsComponentList',
mixins:[JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
ZyProcessComponentList, ZyProcessComponentList,
ZyClothsComponentModal, ZyClothsComponentModal,
ZyClothsComponentListDetail ZyClothsComponentListDetail
}, },
data () { data() {
return { return {
description: 'zy_cloths_component管理页面', description: 'zy_cloths_component管理页面',
// //
columns: [ columns: [
{ {
title: '#', title: '#',
dataIndex: '', dataIndex: '',
key:'rowIndex', key: 'rowIndex',
width:60, width: 60,
align:"center", align: "center",
customRender:function (t,r,index) { customRender: function (t, r, index) {
return parseInt(index)+1; return parseInt(index) + 1;
}
},
{
title:'编号',
align:"center",
dataIndex: 'nums'
},
{
title:'部件名称',
align:"center",
dataIndex: 'partsName'
},
// {
// title:'',
// align:"center",
// dataIndex: 'componentType'
// },
{
title: '服装类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},
// {
// title:'',
// align:"center",
// dataIndex: 'description'
// },
{
title:'图片',
align:"center",
dataIndex: 'pictureUrl',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'模块',
align:"center",
dataIndex: 'modularId_dictText'
},
// {
// title:'',
// align:"center",
// dataIndex: 'modularType_dictText'
// },
{
title:'企业',
align:"center",
dataIndex: 'enterpriseId_dictText'
},
{
title:'创建时间',
align:"center",
dataIndex: 'createTime'
},
{
title: '部件工序',
dataIndex: 'action2',
align:"center",
scopedSlots: { customRender: 'action2' }
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
} }
],
url: {
list: "/base/zyClothsComponent/list",
delete: "/base/zyClothsComponent/delete",
deleteBatch: "/base/zyClothsComponent/deleteBatch",
exportXlsUrl: "/base/zyClothsComponent/exportXls",
importExcelUrl: "base/zyClothsComponent/importExcel",
}, },
dictOptions:{}, {
superFieldList:[], title: '编号',
} align: "center",
}, dataIndex: 'nums'
created() { },
{
title: '部件名称',
align: "center",
dataIndex: 'partsName'
},
// {
// title:'',
// align:"center",
// dataIndex: 'componentType'
// },
{
title: '服装类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},
// {
// title:'',
// align:"center",
// dataIndex: 'description'
// },
{
title: '图片',
align: "center",
dataIndex: 'pictureUrl',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '模块',
align: "center",
dataIndex: 'modularId_dictText'
},
// {
// title:'',
// align:"center",
// dataIndex: 'modularType_dictText'
// },
{
title: '企业',
align: "center",
dataIndex: 'enterpriseId_dictText'
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
},
{
title: '部件工序',
dataIndex: 'action2',
align: "center",
scopedSlots: {customRender: 'action2'}
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/base/zyClothsComponent/list",
delete: "/base/zyClothsComponent/delete",
deleteBatch: "/base/zyClothsComponent/deleteBatch",
exportXlsUrl: "/base/zyClothsComponent/exportXls",
importExcelUrl: "base/zyClothsComponent/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList(); this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}, },
computed: { },
importExcelUrl: function(){ methods: {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; viewVid2(record) {
}, this.$refs.ZyProcessComponentList.showModal2();
this.$refs.ZyProcessComponentList.edit2(record);
this.$refs.ZyProcessComponentList.disableSubmit = false;
}, },
methods: { initDictConfig() {
viewVid2(record){ },
this.$refs.ZyProcessComponentList.showModal2(); getSuperFieldList() {
this.$refs.ZyProcessComponentList.edit2(record); let fieldList = [];
this.$refs.ZyProcessComponentList.disableSubmit = false; fieldList.push({type: 'string', value: 'nums', text: '编号', dictCode: ''})
}, fieldList.push({type: 'string', value: 'partsName', text: '部件名称', dictCode: ''})
initDictConfig(){ fieldList.push({type: 'string', value: 'componentType', text: '部件类型', dictCode: ''})
}, fieldList.push({type: 'string', value: 'description', text: '描述', dictCode: ''})
getSuperFieldList(){ fieldList.push({type: 'string', value: 'pictureUrl', text: '图片', dictCode: ''})
let fieldList=[]; fieldList.push({type: 'string', value: 'modularId', text: '模块', dictCode: 'zy_cloths_modular,modular_name,id'})
fieldList.push({type:'string',value:'nums',text:'编号',dictCode:''}) fieldList.push({type: 'string', value: 'enterpriseId', text: '企业', dictCode: ''})
fieldList.push({type:'string',value:'partsName',text:'部件名称',dictCode:''}) this.superFieldList = fieldList
fieldList.push({type:'string',value:'componentType',text:'部件类型',dictCode:''}) },
fieldList.push({type:'string',value:'description',text:'描述',dictCode:''}) handleDetail(record) {
fieldList.push({type:'string',value:'pictureUrl',text:'图片',dictCode:''}) this.$refs.ZyClothsComponentListDetail.showModal(record)
fieldList.push({type:'string',value:'modularId',text:'模块',dictCode:'zy_cloths_modular,modular_name,id'})
fieldList.push({type:'string',value:'enterpriseId',text:'企业',dictCode:''})
this.superFieldList = fieldList
},
handleDetail(record){
this.$refs.ZyClothsComponentListDetail.showModal(record)
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>

@ -1,13 +1,16 @@
<template> <template>
<!-- <a-card :bordered="false">--> <!-- <a-card :bordered="false">-->
<a-modal <a-modal
width="70%" width="70%"
title="模块部件管理" :title="biaoTi"
style="font-size: 30px; color: #333"
:visible="visible" :visible="visible"
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
> >
<!-- <p style="font-size: 20px;color:#333"> {{biaoTi}} 模块部件管理 </p>-->
<!-- 查询区域 --> <!-- 查询区域 -->
<!-- <div class="table-page-search-wrapper">--> <!-- <div class="table-page-search-wrapper">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">--> <!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
@ -124,6 +127,7 @@ export default {
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
yid: '', yid: '',
biaoTi: "",
// //
columns: [ columns: [
{ {
@ -194,8 +198,11 @@ export default {
//this.ax= this.model.id; //this.ax= this.model.id;
//console.log(topicid); //console.log(topicid);
this.yid = this.model.id; this.yid = this.model.id;
this.biaoTi = record.modularName+" 模块部件管理";
//this.title = record.modularName;
console.log("+++++ this.biaoTi "+ this.biaoTi)
this.queryParam.modularId = this.model.id; this.queryParam.modularId = this.model.id;
console.log("aaaaaaa " + this.queryParam.modularId); console.log("+++++ this.queryParam.modularId: " + this.queryParam.modularId);
this.loadData(); this.loadData();
this.visible = true; this.visible = true;
}, },

@ -4,6 +4,33 @@
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="模块名称">
<a-input placeholder="请输入模块名称" v-model="queryParam.modularName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="服装类型">
<j-dict-select-tag placeholder="请选择服装类型" v-model="queryParam.clothsTypeId"
dictCode="zy_cloths_type,type_name,id"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="企业" >
<j-select-depart v-model="queryParam.enterpriseId" placeholder="请输入企业名称"/>
</a-form-model-item>
</a-col>
<!-- </a-row>-->
<!-- <a-row>-->
<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-row>
</a-form> </a-form>
</div> </div>
@ -115,160 +142,161 @@
<!-- <ZyClothsMcList ref="ZyClothsMcList"></ZyClothsMcList>--> <!-- <ZyClothsMcList ref="ZyClothsMcList"></ZyClothsMcList>-->
<ZyClothsModularCompentList ref="ZyClothsModularCompentList"></ZyClothsModularCompentList> <ZyClothsModularCompentList ref="ZyClothsModularCompentList"></ZyClothsModularCompentList>
<ZyProcessModularList ref="ZyProcessModularList"></ZyProcessModularList> <ZyProcessModularList ref="ZyProcessModularList"></ZyProcessModularList>
<<ZyClothsModularListDetail ref="ZyClothsModularListDetail"></ZyClothsModularListDetail> <ZyClothsModularListDetail ref="ZyClothsModularListDetail"></ZyClothsModularListDetail>
</a-card> </a-card>
</template> </template>
<script> <script>
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin' import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyClothsModularModal from './modules/ZyClothsModularModal' import ZyClothsModularModal from './modules/ZyClothsModularModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import ZyClothsModularCompentList from "@views/process/ZyClothsModularCompentList"; import ZyClothsModularCompentList from "@views/process/ZyClothsModularCompentList";
import ZyProcessModularList from "@views/zyProcessModular/ZyProcessModularList"; import ZyProcessModularList from "@views/zyProcessModular/ZyProcessModularList";
import ZyClothsModularListDetail from './modules/ZyClothsModularListDetail' import ZyClothsModularListDetail from './modules/ZyClothsModularListDetail'
export default {
name: 'ZyClothsModularList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyProcessModularList,
ZyClothsModularCompentList,
ZyClothsModularModal,
ZyClothsModularListDetail
},
data() {
return {
description: '制衣模块 zy_cloths_modular管理页面',
// export default {
columns: [ name: 'ZyClothsModularList',
{ mixins: [JeecgListMixin, mixinDevice],
title: '#', components: {
dataIndex: '', ZyProcessModularList,
key: 'rowIndex', ZyClothsModularCompentList,
width: 60, ZyClothsModularModal,
align: "center", ZyClothsModularListDetail
customRender: function (t, r, index) { },
return parseInt(index) + 1; data() {
} return {
}, description: '制衣模块 zy_cloths_modular管理页面',
{
title: '编号',
align: "center",
dataIndex: 'nums'
},
{
title: '模块名称',
align: "center",
dataIndex: 'modularName'
},
// {
// title: '',
// align: "center",
// dataIndex: 'modularType_dictText'
// },
// {
// title: '',
// align: "center",
// dataIndex: 'description'
// },
{
title: '服装类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},
{
title: '企业',
align: "center",
dataIndex: 'enterpriseId_dictText'
},
{
title: '图片',
align: "center",
dataIndex: 'pictureUrl',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
},
{
title: '模块部件',
dataIndex: 'action2',
align:"center",
// fixed:"right",
scopedSlots: { customRender: 'action2' }
},
{
title: '模块工序',
dataIndex: 'action3',
align:"center",
// fixed:"right",
scopedSlots: { customRender: 'action3' }
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/base/zyClothsModular/list",
delete: "/base/zyClothsModular/delete",
deleteBatch: "/base/zyClothsModular/deleteBatch",
exportXlsUrl: "/base/zyClothsModular/exportXls",
importExcelUrl: "base/zyClothsModular/importExcel",
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '编号',
align: "center",
dataIndex: 'nums'
},
{
title: '模块名称',
align: "center",
dataIndex: 'modularName'
},
// {
// title: '',
// align: "center",
// dataIndex: 'modularType_dictText'
// },
// {
// title: '',
// align: "center",
// dataIndex: 'description'
// },
{
title: '服装类型',
align: "center",
dataIndex: 'clothsTypeId_dictText'
},
{
title: '企业',
align: "center",
dataIndex: 'enterpriseId_dictText'
},
{
title: '图片',
align: "center",
dataIndex: 'pictureUrl',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
}, },
dictOptions: {}, {
superFieldList: [], title: '模块部件',
} dataIndex: 'action2',
align: "center",
// fixed:"right",
scopedSlots: {customRender: 'action2'}
},
{
title: '模块工序',
dataIndex: 'action3',
align: "center",
// fixed:"right",
scopedSlots: {customRender: 'action3'}
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/base/zyClothsModular/list",
delete: "/base/zyClothsModular/delete",
deleteBatch: "/base/zyClothsModular/deleteBatch",
exportXlsUrl: "/base/zyClothsModular/exportXls",
importExcelUrl: "base/zyClothsModular/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}, },
created() { },
this.getSuperFieldList(); methods: {
viewVid(record) {
this.$refs.ZyClothsModularCompentList.showModal1();
this.$refs.ZyClothsModularCompentList.edit1(record);
console.log("zyclothsMclist" + record.id);
this.$refs.ZyClothsModularCompentList.disableSubmit = false;
}, },
computed: { viewVid2(record) {
importExcelUrl: function () { this.$refs.ZyProcessModularList.showModal1();
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; this.$refs.ZyProcessModularList.edit1(record);
}, console.log("父弹窗ID++++++:" + record.id);
this.$refs.ZyProcessModularList.disableSubmit = false;
}, },
methods: { initDictConfig() {
viewVid(record){ },
this.$refs.ZyClothsModularCompentList.showModal1(); getSuperFieldList() {
this.$refs.ZyClothsModularCompentList.edit1(record); let fieldList = [];
console.log("zyclothsMclist"+record.id); fieldList.push({type: 'string', value: 'nums', text: '编号', dictCode: ''})
this.$refs.ZyClothsModularCompentList.disableSubmit = false; fieldList.push({type: 'string', value: 'modularName', text: '模块名称', dictCode: ''})
}, fieldList.push({type: 'string', value: 'description', text: '描述', dictCode: ''})
viewVid2(record){ fieldList.push({type: 'string', value: 'clothsTypeId', text: '衣服类型', dictCode: 'zy_cloths_type,type_name,id'})
this.$refs.ZyProcessModularList.showModal1(); fieldList.push({type: 'string', value: 'enterpriseId', text: '企业', dictCode: ''})
this.$refs.ZyProcessModularList.edit1(record); fieldList.push({type: 'string', value: 'pictureUrl', text: '图片', dictCode: ''})
console.log("父弹窗ID++++++:"+record.id); this.superFieldList = fieldList
this.$refs.ZyProcessModularList.disableSubmit = false; },
}, handleDetail(record) {
initDictConfig() { this.$refs.ZyClothsModularListDetail.showModal(record)
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'nums', text: '编号', dictCode: ''})
fieldList.push({type: 'string', value: 'modularName', text: '模块名称', dictCode: ''})
fieldList.push({type: 'string', value: 'description', text: '描述', dictCode: ''})
fieldList.push({type: 'string', value: 'clothsTypeId', text: '衣服类型', dictCode: 'zy_cloths_type,type_name,id'})
fieldList.push({type: 'string', value: 'enterpriseId', text: '企业', dictCode: ''})
fieldList.push({type: 'string', value: 'pictureUrl', text: '图片', dictCode: ''})
this.superFieldList = fieldList
},
handleDetail(record){
this.$refs.ZyClothsModularListDetail.showModal(record)
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>

@ -21,9 +21,9 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId"> <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<j-select-depart v-model="enterpriseId" placeholder="请输入企业名称" /> <j-select-depart v-model="enterpriseId" placeholder="请输入企业名称" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">

@ -8,28 +8,47 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel" @cancel="handleCancel"
cancelText="关闭"> cancelText="关闭">
<zy-cloths-modular-compent-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-cloths-modular-compent-form> <!-- <zy-cloths-modular-compent-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-cloths-modular-compent-form>-->
<zy-cloths-component-list ref="realForm" @onChangeRowKey="chuancan" @ok="submitCallback"
:disabled="disableSubmit"></zy-cloths-component-list>
</j-modal> </j-modal>
</template> </template>
<script> <script>
import ZyClothsModularCompentForm from './ZyClothsModularCompentForm' // import ZyClothsModularCompentForm from './ZyClothsModularCompentForm'
import ZyClothsComponentList from "@views/process/modules/list/ZyClothsComponentList";
import {postAction} from "@api/manage";
export default { export default {
name: 'ZyClothsModularCompentModal', name: 'ZyClothsModularCompentModal',
components: { components: {
ZyClothsModularCompentForm ZyClothsComponentList,
// ZyClothsModularCompentForm
}, },
data () { data () {
return { return {
model:{
componentId: '',
modularId: '',
},
title:'', title:'',
width:800, width:1000,
visible: false, visible: false,
disableSubmit: false disableSubmit: false,
url: {
add: "/base/zyClothsModularCompent/add",
edit: "/base/zyClothsModularCompent/edit",
queryById: "/base/zyClothsModularCompent/queryById"
}
} }
}, },
methods: { methods: {
add1 (id) { add1 (id) {
//this.model.componentId = this.$route.query.id;
// id
this.model.modularId = id;
console.log('this.modularId'+id)
this.visible=true this.visible=true
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.realForm.add1(id); this.$refs.realForm.add1(id);
@ -45,8 +64,20 @@
this.$emit('close'); this.$emit('close');
this.visible = false; this.visible = false;
}, },
chuancan(res) {
this.model.componentId = res;
},
handleOk () { 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(){ submitCallback(){
this.$emit('ok'); this.$emit('ok');

@ -5,24 +5,43 @@
<a-row> <a-row>
<a-col :span="48"> <a-col :span="48">
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId"> <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">
<j-select-depart v-model="model.enterpriseId" placeholder="请选择企业"/> <j-select-depart v-model="model.enterpriseId" placeholder="请选择企业"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="48"> <a-col :span="48">
<a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName"> <a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">
<a-input v-model="model.modularName" placeholder="请输入模块名称" ></a-input> <a-input v-model="model.modularName" placeholder="请输入模块名称"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<!-- <a-col :span="48">-->
<!-- <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">-->
<!-- <j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择服装类型" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="48"> <a-col :span="48">
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> <a-form-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择服装类型" /> <j-tree-select v-model="model.clothsTypeId"
dict="zy_cloths_type,type_name,id"
pidField="type_id"
placeholder="请选择服装类型"
@change="bianhao">
</j-tree-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col>
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" disabled></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="48"> <a-col :span="48">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description"> <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
@ -33,7 +52,7 @@
<a-row> <a-row>
<a-col :span="48"> <a-col :span="48">
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl"> <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">
<j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload> <j-image-upload isMultiple v-model="model.pictureUrl"></j-image-upload>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -44,10 +63,7 @@
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!-- </a-col>-->
<!-- <a-col :span="24">--> <!-- <a-col :span="24">-->
<!-- <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">-->
<!-- <a-input v-model="model.nums" placeholder="请输入编号" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">--> <!-- <a-col :span="24">-->
<!-- <a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">--> <!-- <a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">-->
@ -89,103 +105,120 @@
<script> <script>
import { httpAction, getAction } from '@/api/manage' import {httpAction, getAction} from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import {validateDuplicateValue} from '@/utils/util'
import JTreeSelect from '@/components/jeecg/JTreeSelect'
export default { export default {
name: 'ZyClothsModularForm', name: 'ZyClothsModularForm',
components: { components: {
}, JTreeSelect
props: { },
// props: {
disabled: { //
type: Boolean, disabled: {
default: false, type: Boolean,
required: false default: false,
required: false
}
},
data() {
return {
model: {},
labelCol: {
xs: {span: 24},
sm: {span: 4},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
// nums: [
// { required: true, message: '!'},
// ],
modularName: [
{ required: true, message: '请输入模块名称!'},
{ pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!()?]{0,50}$/, message: '文本长度过长'},
],
clothsTypeId: [
{required: true, message: '请选择衣服类型!'},
]
},
url: {
add: "/base/zyClothsModular/add",
edit: "/base/zyClothsModular/edit",
queryById: "/base/zyClothsModular/queryById",
//getActionurl
sort: "/base/zyClothsModular/sort"
} }
}
},
computed: {
formDisabled() {
return this.disabled
}, },
data () { },
return { created() {
model:{ //model
}, this.modelDefault = JSON.parse(JSON.stringify(this.model));
labelCol: { },
xs: { span: 24 }, methods: {
sm: { span: 4 }, bianhao() {
}, //var n=6
wrapperCol: { getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
xs: { span: 24 }, let num = res.result;
sm: { span: 16 }, console.log("+6++++aaa"+num)
}, //num=num.toString()
confirmLoading: false, //while(num.length<n){
validatorRules: { //num="0"+num
// nums: [ //}
// { required: true, message: '!'}, console.log(num)
// ], this.model.nums = num;
modularName: [ })
{ required: true, message: '请输入模块名称!'},
],
clothsTypeId: [
{ required: true, message: '请选择衣服类型!'},
]
},
url: {
add: "/base/zyClothsModular/add",
edit: "/base/zyClothsModular/edit",
queryById: "/base/zyClothsModular/queryById"
}
}
}, },
computed: { add() {
formDisabled(){ this.edit(this.modelDefault);
return this.disabled
},
}, },
created () { edit(record) {
//model this.model = Object.assign({}, record);
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.visible = true;
}, },
methods: { submitForm() {
add () { const that = this;
this.edit(this.modelDefault); //
}, this.$refs.form.validate(valid => {
edit (record) { if (valid) {
this.model = Object.assign({}, record); that.confirmLoading = true;
this.visible = true; let httpurl = '';
}, let method = '';
submitForm () { if (!this.model.id) {
const that = this; httpurl += this.url.add;
// method = 'post';
this.$refs.form.validate(valid => { } else {
if (valid) { httpurl += this.url.edit;
that.confirmLoading = true; method = 'put';
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;
})
} }
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> </script>
<style scoped> <style scoped>
.ant-form-item{ .ant-form-item {
margin-bottom: 16px; margin-bottom: 16px;
} }
</style> </style>

@ -0,0 +1,254 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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('zy_cloths_component')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
<!-- </div>-->
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: 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>
<!-- <span slot="action2" slot-scope="text, record" >-->
<!-- <a @click="viewVid2(record)" >管理</a>-->
<!-- </span>-->
<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-cloths-component-modal ref="modalForm" @ok="modalFormOk"></zy-cloths-component-modal>-->
<!-- <ZyProcessComponentList ref="ZyProcessComponentList"></ZyProcessComponentList>-->
<!-- <ZyClothsComponentListDetail ref="ZyClothsComponentListDetail"></ZyClothsComponentListDetail>-->
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil';
export default {
name: 'ZyClothsComponentList',
mixins:[JeecgListMixin, mixinDevice],
components: {},
data () {
return {
model:{
fuId: '',
},
description: 'zy_cloths_component管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'编号',
align:"center",
dataIndex: 'nums'
},
{
title:'模块类型',
align:"center",
dataIndex: 'modularType'
},
{
title:'部件名称',
align:"center",
dataIndex: 'partsName'
},
// {
// title:'',
// align:"center",
// dataIndex: 'componentType'
// },
// {
// title: '',
// align: "center",
// dataIndex: 'clothsTypeId_dictText'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'description'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'pictureUrl',
// scopedSlots: {customRender: 'imgSlot'}
// },
// {
// title:'',
// align:"center",
// dataIndex: 'modularId_dictText'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'modularType_dictText'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'enterpriseId_dictText'
// },
{
title:'创建时间',
align:"center",
dataIndex: 'createTime'
},
// {
// title: '',
// dataIndex: 'action2',
// align:"center",
// scopedSlots: { customRender: 'action2' }
// },
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/base/zyClothsComponent/list",
delete: "/base/zyClothsComponent/delete",
deleteBatch: "/base/zyClothsComponent/deleteBatch",
exportXlsUrl: "/base/zyClothsComponent/exportXls",
importExcelUrl: "base/zyClothsComponent/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
// viewVid2(record){
// this.$refs.ZyProcessComponentList.showModal2();
// this.$refs.ZyProcessComponentList.edit2(record);
// this.$refs.ZyProcessComponentList.disableSubmit = false;
// },
onSelectChange1(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
let ids = "";
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
this.$emit('onChangeRowKey', ids)
},
add1(id) {
//this.model.fuId = id;
console.log("弹窗list层接受到的id 应该等于modularName: "+id);
},
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'nums',text:'编号',dictCode:''})
fieldList.push({type:'string',value:'partsName',text:'部件名称',dictCode:''})
fieldList.push({type:'string',value:'componentType',text:'部件类型',dictCode:''})
fieldList.push({type:'string',value:'description',text:'描述',dictCode:''})
fieldList.push({type:'string',value:'pictureUrl',text:'图片',dictCode:''})
fieldList.push({type:'string',value:'modularId',text:'模块',dictCode:'zy_cloths_modular,modular_name,id'})
fieldList.push({type:'string',value:'enterpriseId',text:'企业',dictCode:''})
this.superFieldList = fieldList
},
handleDetail(record){
this.$refs.ZyClothsComponentListDetail.showModal(record)
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -12,14 +12,14 @@ import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.base.entity.ZyClothsComponent; import org.jeecg.modules.demo.base.entity.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent;
import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper;
import org.jeecg.modules.demo.base.service.IZyClothsComponentService; import org.jeecg.modules.demo.base.service.IZyClothsComponentService;
import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.NumberUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
@ -41,7 +41,10 @@ public class ZyClothsModularCompentController extends JeecgController<ZyClothsMo
@Autowired @Autowired
private IZyClothsModularCompentService zyClothsModularCompentService; private IZyClothsModularCompentService zyClothsModularCompentService;
@Autowired @Autowired
IZyClothsComponentService zyClothsComponentService; private IZyClothsComponentService zyClothsComponentService;
@Resource
private ZyClothsModularCompentMapper zyClothsModularCompentMapper;
/** /**
* 分页列表查询 * 分页列表查询
@ -58,17 +61,24 @@ public class ZyClothsModularCompentController extends JeecgController<ZyClothsMo
public Result<?> queryPageList(ZyClothsModularCompent zyClothsModularCompent, public Result<?> queryPageList(ZyClothsModularCompent zyClothsModularCompent,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
String modularId,
HttpServletRequest req) { HttpServletRequest req) {
System.out.println("接受到的modularId: "+modularId);
QueryWrapper<ZyClothsModularCompent> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModularCompent, req.getParameterMap()); QueryWrapper<ZyClothsModularCompent> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModularCompent, req.getParameterMap());
queryWrapper.eq("modular_id", modularId);
Page<ZyClothsModularCompent> page = new Page<ZyClothsModularCompent>(pageNo, pageSize); Page<ZyClothsModularCompent> page = new Page<ZyClothsModularCompent>(pageNo, pageSize);
IPage<ZyClothsModularCompent> pageList = zyClothsModularCompentService.page(page, queryWrapper); IPage<ZyClothsModularCompent> pageList = zyClothsModularCompentService.page(page, queryWrapper);
List<ZyClothsModularCompent> recordList = zyClothsModularCompentMapper.queryList(modularId);
pageList.setRecords(recordList);
List<ZyClothsModularCompent> records = pageList.getRecords(); List<ZyClothsModularCompent> records = pageList.getRecords();
Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?"); //Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
//只要数字 如果是纯数字 就把它替换了
Pattern pattern = Pattern.compile("[^0-9]");
for (ZyClothsModularCompent s : records) { for (ZyClothsModularCompent s : records) {
String partsName = s.getPartsName(); String partsName = s.getPartsName();
if (pattern.matcher(partsName).matches()){ if (pattern.matcher(partsName).matches()) {
ZyClothsComponent byId = zyClothsComponentService.getById(partsName); ZyClothsComponent byId = zyClothsComponentService.getById(partsName);
s.setPartsName(byId.getPartsName()) ; s.setPartsName(byId.getPartsName());
} }
} }
@ -85,7 +95,21 @@ public class ZyClothsModularCompentController extends JeecgController<ZyClothsMo
@ApiOperation(value = "制衣模块部件中间表-添加", notes = "制衣模块部件中间表-添加") @ApiOperation(value = "制衣模块部件中间表-添加", notes = "制衣模块部件中间表-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsModularCompent zyClothsModularCompent) { public Result<?> add(@RequestBody ZyClothsModularCompent zyClothsModularCompent) {
zyClothsModularCompentService.save(zyClothsModularCompent); System.out.println(zyClothsModularCompent);
String[] split = zyClothsModularCompent.getComponentId().split(",");
for (String componentId : split) {
//把部件信息查出来 赋给模块部件表
//System.out.println("+++部件id: "+componentId);
//看是否有重复信息
int a = zyClothsModularCompentMapper.count(zyClothsModularCompent.getModularId(),componentId);
if (a >= 1){
return Result.error("添加失败,存在该款式部件");
}
ZyClothsModularCompent zy = zyClothsModularCompentService.handleComponent(componentId);
zy.setModularId(zyClothsModularCompent.getModularId());
zyClothsModularCompentService.save(zy);
}
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

@ -1,199 +1,201 @@
package org.jeecg.modules.demo.base.controller; package org.jeecg.modules.demo.base.controller;
import java.util.Arrays; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Map; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.stream.Collectors; import io.swagger.annotations.Api;
import java.io.IOException; import io.swagger.annotations.ApiOperation;
import java.io.UnsupportedEncodingException; import lombok.extern.slf4j.Slf4j;
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.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.base.entity.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyClothsModular; import org.jeecg.modules.demo.base.entity.ZyClothsModular;
import org.jeecg.modules.demo.base.entity.ZyClothsType; import org.jeecg.modules.demo.base.entity.ZyClothsType;
import org.jeecg.modules.demo.base.service.IZyClothsModularService; import org.jeecg.modules.demo.base.service.IZyClothsModularService;
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.demo.base.service.IZyClothsTypeService; import org.jeecg.modules.demo.base.service.IZyClothsTypeService;
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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; 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 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;
/** import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
* @Description: zy_cloths_modular * @Description: zy_cloths_modular
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2021-11-10 * @Date: 2021-11-10
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="zy_cloths_modular") @Api(tags = "zy_cloths_modular")
@RestController @RestController
@RequestMapping("/base/zyClothsModular") @RequestMapping("/base/zyClothsModular")
@Slf4j @Slf4j
public class ZyClothsModularController extends JeecgController<ZyClothsModular, IZyClothsModularService> { public class ZyClothsModularController extends JeecgController<ZyClothsModular, IZyClothsModularService> {
@Autowired @Autowired
private IZyClothsModularService zyClothsModularService; private IZyClothsModularService zyClothsModularService;
@Autowired @Autowired
private IZyClothsTypeService zyClothsTypeService; private IZyClothsTypeService zyClothsTypeService;
/** /**
* 分页列表查询 * 分页列表查询
* *
* @param zyClothsModular * @param zyClothsModular
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param req * @param req
* @return * @return
*/ */
@AutoLog(value = "zy_cloths_modular-分页列表查询") @AutoLog(value = "zy_cloths_modular-分页列表查询")
@ApiOperation(value="zy_cloths_modular-分页列表查询", notes="zy_cloths_modular-分页列表查询") @ApiOperation(value = "zy_cloths_modular-分页列表查询", notes = "zy_cloths_modular-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> queryPageList(ZyClothsModular zyClothsModular, public Result<?> queryPageList(ZyClothsModular zyClothsModular,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<ZyClothsModular> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModular, req.getParameterMap()); QueryWrapper<ZyClothsModular> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModular, req.getParameterMap());
Page<ZyClothsModular> page = new Page<ZyClothsModular>(pageNo, pageSize); Page<ZyClothsModular> page = new Page<ZyClothsModular>(pageNo, pageSize);
IPage<ZyClothsModular> pageList = zyClothsModularService.page(page, queryWrapper); IPage<ZyClothsModular> pageList = zyClothsModularService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
@AutoLog(value = "zy_cloths_modular-查询所有") @AutoLog(value = "zy_cloths_modular-查询所有")
@ApiOperation(value="zy_cloths_modular-查询所有", notes="zy_cloths_modular-查询所有") @ApiOperation(value = "zy_cloths_modular-查询所有", notes = "zy_cloths_modular-查询所有")
@GetMapping(value = "/findAll") @GetMapping(value = "/findAll")
public Result<?> findAll() { public Result<?> findAll() {
List<ZyClothsModular> list = zyClothsModularService.list(); List<ZyClothsModular> list = zyClothsModularService.list();
for(ZyClothsModular zycl : list){ for (ZyClothsModular zycl : list) {
String id = zycl.getClothsTypeId(); String id = zycl.getClothsTypeId();
if(id!=null){ if (id != null) {
ZyClothsType byId = zyClothsTypeService.getById(id); ZyClothsType byId = zyClothsTypeService.getById(id);
zycl.setClothsTypeId(byId.getTypeName()); zycl.setClothsTypeId(byId.getTypeName());
} }
} }
return Result.OK(list); return Result.OK(list);
} }
/** /**
* 添加 * 添加
* *
* @param zyClothsModular * @param zyClothsModular
* @return * @return
*/ */
@AutoLog(value = "zy_cloths_modular-添加") @AutoLog(value = "zy_cloths_modular-添加")
@ApiOperation(value="zy_cloths_modular-添加", notes="zy_cloths_modular-添加") @ApiOperation(value = "zy_cloths_modular-添加", notes = "zy_cloths_modular-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyClothsModular zyClothsModular) { public Result<?> add(@RequestBody ZyClothsModular zyClothsModular) {
//nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8) //zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular));
zyClothsModular.setNums(zyClothsModularService.generateNumber(zyClothsModular)); //模块名称不能重复
//模块名称不能重复 List<ZyClothsModular> zyClothsModularList = zyClothsModularService.list();
List<ZyClothsModular> zyClothsModularList = zyClothsModularService.list(); for (ZyClothsModular zy : zyClothsModularList) {
for (ZyClothsModular zy : zyClothsModularList) { if (zyClothsModular.getModularName().equals(zy.getModularName())) {
if (zyClothsModular.getModularName().equals(zy.getModularName())){ return Result.error("添加失败!模块名称已存在");
return Result.error("添加失败!模块名称已存在"); }
} }
} zyClothsModularService.save(zyClothsModular);
zyClothsModularService.save(zyClothsModular); return Result.OK("添加成功!");
return Result.OK("添加成功!"); }
}
/**
/** * 编辑
* 编辑 *
* * @param zyClothsModular
* @param zyClothsModular * @return
* @return */
*/ @AutoLog(value = "zy_cloths_modular-编辑")
@AutoLog(value = "zy_cloths_modular-编辑") @ApiOperation(value = "zy_cloths_modular-编辑", notes = "zy_cloths_modular-编辑")
@ApiOperation(value="zy_cloths_modular-编辑", notes="zy_cloths_modular-编辑") @PutMapping(value = "/edit")
@PutMapping(value = "/edit") public Result<?> edit(@RequestBody ZyClothsModular zyClothsModular) {
public Result<?> edit(@RequestBody ZyClothsModular zyClothsModular) { zyClothsModularService.updateById(zyClothsModular);
zyClothsModularService.updateById(zyClothsModular); return Result.OK("编辑成功!");
return Result.OK("编辑成功!"); }
}
/**
/** * 通过id删除
* 通过id删除 *
* * @param id
* @param id * @return
* @return */
*/ @AutoLog(value = "zy_cloths_modular-通过id删除")
@AutoLog(value = "zy_cloths_modular-通过id删除") @ApiOperation(value = "zy_cloths_modular-通过id删除", notes = "zy_cloths_modular-通过id删除")
@ApiOperation(value="zy_cloths_modular-通过id删除", notes="zy_cloths_modular-通过id删除") @DeleteMapping(value = "/delete")
@DeleteMapping(value = "/delete") public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
public Result<?> delete(@RequestParam(name="id",required=true) String id) { zyClothsModularService.removeById(id);
zyClothsModularService.removeById(id); return Result.OK("删除成功!");
return Result.OK("删除成功!"); }
}
/**
/** * 批量删除
* 批量删除 *
* * @param ids
* @param ids * @return
* @return */
*/ @AutoLog(value = "zy_cloths_modular-批量删除")
@AutoLog(value = "zy_cloths_modular-批量删除") @ApiOperation(value = "zy_cloths_modular-批量删除", notes = "zy_cloths_modular-批量删除")
@ApiOperation(value="zy_cloths_modular-批量删除", notes="zy_cloths_modular-批量删除") @DeleteMapping(value = "/deleteBatch")
@DeleteMapping(value = "/deleteBatch") public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.zyClothsModularService.removeByIds(Arrays.asList(ids.split(",")));
this.zyClothsModularService.removeByIds(Arrays.asList(ids.split(","))); return Result.OK("批量删除成功!");
return Result.OK("批量删除成功!"); }
}
/**
/** * 通过id查询
* 通过id查询 *
* * @param id
* @param id * @return
* @return */
*/ @AutoLog(value = "zy_cloths_modular-通过id查询")
@AutoLog(value = "zy_cloths_modular-通过id查询") @ApiOperation(value = "zy_cloths_modular-通过id查询", notes = "zy_cloths_modular-通过id查询")
@ApiOperation(value="zy_cloths_modular-通过id查询", notes="zy_cloths_modular-通过id查询") @GetMapping(value = "/queryById")
@GetMapping(value = "/queryById") public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { ZyClothsModular zyClothsModular = zyClothsModularService.getById(id);
ZyClothsModular zyClothsModular = zyClothsModularService.getById(id); if (zyClothsModular == null) {
if(zyClothsModular==null) { return Result.error("未找到对应数据");
return Result.error("未找到对应数据"); }
} return Result.OK(zyClothsModular);
return Result.OK(zyClothsModular); }
}
/**
* sort 编码
*
* @param id 服装类型的id
* @return
*/
@AutoLog(value = "编码-通过id查询")
@ApiOperation(value = "编码-通过id查询", notes = "编码-通过id查询")
@GetMapping(value = "/sort")
public Result<?> sort(@RequestParam(name = "id", required = true) String id) {
//根据zy cloths type服装类型的id 进行自动编码
//nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)
String clothsTypeNums = zyClothsModularService.generateNumber(id);
if (clothsTypeNums == null) {
return Result.error("未找到对应数据");
}
return Result.OK(clothsTypeNums);
}
/** /**
* 导出excel * 导出excel
* *
* @param request * @param request
* @param zyClothsModular * @param zyClothsModular
*/ */
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyClothsModular zyClothsModular) { public ModelAndView exportXls(HttpServletRequest request, ZyClothsModular zyClothsModular) {
return super.exportXls(request, zyClothsModular, ZyClothsModular.class, "zy_cloths_modular"); return super.exportXls(request, zyClothsModular, ZyClothsModular.class, "zy_cloths_modular");
} }
/** /**
* 通过excel导入数据 * 通过excel导入数据
* *
* @param request * @param request
* @param response * @param response
* @return * @return
*/ */
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyClothsModular.class); return super.importExcel(request, response, ZyClothsModular.class);

@ -24,4 +24,6 @@ public interface ZyClothsComponentMapper extends BaseMapper<ZyClothsComponent> {
String getComponentNameById(String componentId); String getComponentNameById(String componentId);
List<String> selectNumsList2(); List<String> selectNumsList2();
ZyClothsComponent queryById(String componentId);
} }

@ -3,15 +3,21 @@ package org.jeecg.modules.demo.base.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* @Description: 制衣模块部件中间表 * @Description: 制衣模块部件中间表
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2022-11-11 * @Date: 2022-11-11
* @Version: V1.0 * @Version: V1.0
*/ */
public interface ZyClothsModularCompentMapper extends BaseMapper<ZyClothsModularCompent> { public interface ZyClothsModularCompentMapper extends BaseMapper<ZyClothsModularCompent> {
@Select("select count(*) from zy_cloths_modular_compent where modular_id = #{ModularId} and component_id=#{componentId}")
int count(@Param("ModularId")String ModularId, @Param("componentId")String componentId);
//根据modularId查询
List<ZyClothsModularCompent> queryList(String modularId);
} }

@ -27,4 +27,7 @@ public interface ZyClothsTypeMapper extends BaseMapper<ZyClothsType> {
void setEnterpriseId(String id); void setEnterpriseId(String id);
@Select("select nums from zy_cloths_type where id = #{id} ")
String selectNumOne(String id);
} }

@ -33,4 +33,9 @@
select nums select nums
from zy_cloths_component from zy_cloths_component
</select> </select>
<select id="queryById" resultType="org.jeecg.modules.demo.base.entity.ZyClothsComponent">
select *
from zy_cloths_component
where id = #{componentId}
</select>
</mapper> </mapper>

@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper"> <mapper namespace="org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper">
<select id="queryList" resultType="org.jeecg.modules.demo.base.entity.ZyClothsModularCompent">
select *
from zy_cloths_modular_compent
where modular_id = #{ModularId}
</select>
</mapper> </mapper>

@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IZyClothsModularCompentService extends IService<ZyClothsModularCompent> { public interface IZyClothsModularCompentService extends IService<ZyClothsModularCompent> {
/**把部件信息查出来 赋给模块部件表*/
ZyClothsModularCompent handleComponent(String componentId);
} }

@ -15,5 +15,5 @@ public interface IZyClothsModularService extends IService<ZyClothsModular> {
public List<ZyClothsModular> selectByType(String cloths_type_id); public List<ZyClothsModular> selectByType(String cloths_type_id);
/**nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)*/ /**nums,编号,varchar,18,非空,不重复,编码规则:服装类型(10)+序号(8)*/
String generateNumber(ZyClothsModular zyClothsModular); String generateNumber(String id);
} }

@ -1,12 +1,17 @@
package org.jeecg.modules.demo.base.service.impl; package org.jeecg.modules.demo.base.service.impl;
import org.jeecg.modules.demo.base.entity.ZyClothsComponent;
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent;
import org.jeecg.modules.demo.base.mapper.ZyClothsComponentMapper;
import org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper; import org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper;
import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
/** /**
* @Description: 制衣模块部件中间表 * @Description: 制衣模块部件中间表
* @Author: jeecg-boot * @Author: jeecg-boot
@ -16,4 +21,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class ZyClothsModularCompentServiceImpl extends ServiceImpl<ZyClothsModularCompentMapper, ZyClothsModularCompent> implements IZyClothsModularCompentService { public class ZyClothsModularCompentServiceImpl extends ServiceImpl<ZyClothsModularCompentMapper, ZyClothsModularCompent> implements IZyClothsModularCompentService {
@Resource
private ZyClothsComponentMapper zyClothsComponentMapper;
/**
* 把部件信息查出来 赋给模块部件表
* @param componentId 部件id
*/
@Override
public ZyClothsModularCompent handleComponent(String componentId) {
System.out.println("service层的id:"+componentId);
ZyClothsComponent zyClothsComponent = zyClothsComponentMapper.queryById(componentId);
ZyClothsModularCompent zy = new ZyClothsModularCompent();
zy.setPartsName(zyClothsComponent.getPartsName());
zy.setNums(zyClothsComponent.getNums());
zy.setComponentId(componentId);
return zy;
}
} }

@ -39,13 +39,11 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
* nums编号varchar18非空不重复编码规则服装类型10+序号8 * nums编号varchar18非空不重复编码规则服装类型10+序号8
*/ */
@Override @Override
public String generateNumber(ZyClothsModular zyClothsModular) { public String generateNumber(String id) {
String nums = zyClothsModular.getClothsTypeId(); String numOne = zyClothsTypeMapper.selectNumOne(id);
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
// String substring = nums.substring(nums.length() - 10); // String substring = nums.substring(nums.length() - 10);
String format = String.format("%08d", orderNumber()); String format = String.format("%08d", orderNumber());
return nums1 + format; return numOne + format;
} }
@ -58,6 +56,7 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
if (newNums.length() > 8) { if (newNums.length() > 8) {
String substring = nums.substring(nums.length() - 8); String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring)); listLong.add(Long.valueOf(substring));
continue;
} }
if (StringUtils.isEmpty(newNums)) { if (StringUtils.isEmpty(newNums)) {
newNums = "0"; newNums = "0";

Loading…
Cancel
Save