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

zhc4dev
赵玉瑞 2 years ago
parent 230f46a84d
commit f586728a5b
  1. 133
      ant-design-vue-jeecg/src/views/process/ZyClothsComponentList.vue
  2. 11
      ant-design-vue-jeecg/src/views/process/ZyClothsModularCompentList.vue
  3. 70
      ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
  4. 43
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularCompentModal.vue
  5. 103
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
  6. 254
      ant-design-vue-jeecg/src/views/process/modules/list/ZyClothsComponentList.vue
  7. 38
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularCompentController.java
  8. 100
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
  9. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsComponentMapper.java
  10. 6
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsModularCompentMapper.java
  11. 3
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/ZyClothsTypeMapper.java
  12. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsComponentMapper.xml
  13. 5
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/mapper/xml/ZyClothsModularCompentMapper.xml
  14. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularCompentService.java
  15. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/IZyClothsModularService.java
  16. 21
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularCompentServiceImpl.java
  17. 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">
<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>-->
<!-- <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>-->
<!-- <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-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-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>
<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>
@ -52,7 +58,8 @@
</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;"/>
<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>
@ -67,20 +74,20 @@
</a-button>
</template>
<span slot="action2" slot-scope="text, record" >
<a @click="viewVid2(record)" >管理</a>
<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-divider type="vertical"/>
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" />
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-dropdown>
<!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
@ -106,23 +113,23 @@
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyClothsComponentModal from './modules/ZyClothsComponentModal'
import ZyProcessComponentList from "@views/process/ZyProcessComponentList"
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil';
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyClothsComponentModal from './modules/ZyClothsComponentModal'
import ZyProcessComponentList from "@views/process/ZyProcessComponentList"
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil';
import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail'
export default {
export default {
name: 'ZyClothsComponentList',
mixins:[JeecgListMixin, mixinDevice],
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyProcessComponentList,
ZyClothsComponentModal,
ZyClothsComponentListDetail
},
data () {
data() {
return {
description: 'zy_cloths_component管理页面',
//
@ -130,21 +137,21 @@ import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail'
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title:'编号',
align:"center",
title: '编号',
align: "center",
dataIndex: 'nums'
},
{
title:'部件名称',
align:"center",
title: '部件名称',
align: "center",
dataIndex: 'partsName'
},
// {
@ -163,14 +170,14 @@ import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail'
// dataIndex: 'description'
// },
{
title:'图片',
align:"center",
title: '图片',
align: "center",
dataIndex: 'pictureUrl',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'模块',
align:"center",
title: '模块',
align: "center",
dataIndex: 'modularId_dictText'
},
// {
@ -179,28 +186,28 @@ import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail'
// dataIndex: 'modularType_dictText'
// },
{
title:'企业',
align:"center",
title: '企业',
align: "center",
dataIndex: 'enterpriseId_dictText'
},
{
title:'创建时间',
align:"center",
title: '创建时间',
align: "center",
dataIndex: 'createTime'
},
{
title: '部件工序',
dataIndex: 'action2',
align:"center",
scopedSlots: { customRender: 'action2' }
align: "center",
scopedSlots: {customRender: 'action2'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
@ -211,43 +218,43 @@ import ZyClothsComponentListDetail from './modules/ZyClothsComponentListDetail'
importExcelUrl: "base/zyClothsComponent/importExcel",
},
dictOptions:{},
superFieldList:[],
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
viewVid2(record){
viewVid2(record) {
this.$refs.ZyProcessComponentList.showModal2();
this.$refs.ZyProcessComponentList.edit2(record);
this.$refs.ZyProcessComponentList.disableSubmit = false;
},
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:''})
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){
handleDetail(record) {
this.$refs.ZyClothsComponentListDetail.showModal(record)
}
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>

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

@ -4,6 +4,33 @@
<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.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-form>
</div>
@ -115,21 +142,22 @@
<!-- <ZyClothsMcList ref="ZyClothsMcList"></ZyClothsMcList>-->
<ZyClothsModularCompentList ref="ZyClothsModularCompentList"></ZyClothsModularCompentList>
<ZyProcessModularList ref="ZyProcessModularList"></ZyProcessModularList>
<<ZyClothsModularListDetail ref="ZyClothsModularListDetail"></ZyClothsModularListDetail>
<ZyClothsModularListDetail ref="ZyClothsModularListDetail"></ZyClothsModularListDetail>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyClothsModularModal from './modules/ZyClothsModularModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import ZyClothsModularCompentList from "@views/process/ZyClothsModularCompentList";
import ZyProcessModularList from "@views/zyProcessModular/ZyProcessModularList";
import ZyClothsModularListDetail from './modules/ZyClothsModularListDetail'
export default {
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyClothsModularModal from './modules/ZyClothsModularModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import ZyClothsModularCompentList from "@views/process/ZyClothsModularCompentList";
import ZyProcessModularList from "@views/zyProcessModular/ZyProcessModularList";
import ZyClothsModularListDetail from './modules/ZyClothsModularListDetail'
export default {
name: 'ZyClothsModularList',
mixins: [JeecgListMixin, mixinDevice],
components: {
@ -198,16 +226,16 @@
{
title: '模块部件',
dataIndex: 'action2',
align:"center",
align: "center",
// fixed:"right",
scopedSlots: { customRender: 'action2' }
scopedSlots: {customRender: 'action2'}
},
{
title: '模块工序',
dataIndex: 'action3',
align:"center",
align: "center",
// fixed:"right",
scopedSlots: { customRender: 'action3' }
scopedSlots: {customRender: 'action3'}
},
{
title: '操作',
@ -239,16 +267,16 @@
},
},
methods: {
viewVid(record){
viewVid(record) {
this.$refs.ZyClothsModularCompentList.showModal1();
this.$refs.ZyClothsModularCompentList.edit1(record);
console.log("zyclothsMclist"+record.id);
console.log("zyclothsMclist" + record.id);
this.$refs.ZyClothsModularCompentList.disableSubmit = false;
},
viewVid2(record){
viewVid2(record) {
this.$refs.ZyProcessModularList.showModal1();
this.$refs.ZyProcessModularList.edit1(record);
console.log("父弹窗ID++++++:"+record.id);
console.log("父弹窗ID++++++:" + record.id);
this.$refs.ZyProcessModularList.disableSubmit = false;
},
initDictConfig() {
@ -263,12 +291,12 @@
fieldList.push({type: 'string', value: 'pictureUrl', text: '图片', dictCode: ''})
this.superFieldList = fieldList
},
handleDetail(record){
handleDetail(record) {
this.$refs.ZyClothsModularListDetail.showModal(record)
}
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>

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

@ -12,17 +12,36 @@
<a-row>
<a-col :span="48">
<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-col>
</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-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-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<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-col>
</a-row>
<a-row>
<a-col :span="48">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
@ -33,7 +52,7 @@
<a-row>
<a-col :span="48">
<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-col>
</a-row>
@ -44,10 +63,7 @@
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <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-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularName">-->
@ -89,12 +105,14 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
import JTreeSelect from '@/components/jeecg/JTreeSelect'
export default {
export default {
name: 'ZyClothsModularForm',
components: {
JTreeSelect
},
props: {
//
@ -104,17 +122,16 @@
required: false
}
},
data () {
data() {
return {
model:{
},
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
xs: {span: 24},
sm: {span: 4},
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
@ -123,36 +140,52 @@
// ],
modularName: [
{ required: true, message: '请输入模块名称!'},
{ pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!()?]{0,50}$/, message: '文本长度过长'},
],
clothsTypeId: [
{ required: true, message: '请选择衣服类型!'},
{required: true, message: '请选择衣服类型!'},
]
},
url: {
add: "/base/zyClothsModular/add",
edit: "/base/zyClothsModular/edit",
queryById: "/base/zyClothsModular/queryById"
queryById: "/base/zyClothsModular/queryById",
//getActionurl
sort: "/base/zyClothsModular/sort"
}
}
},
computed: {
formDisabled(){
formDisabled() {
return this.disabled
},
},
created () {
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
bianhao() {
//var n=6
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
let num = res.result;
console.log("+6++++aaa"+num)
//num=num.toString()
//while(num.length<n){
//num="0"+num
//}
console.log(num)
this.model.nums = num;
})
},
add() {
this.edit(this.modelDefault);
},
edit (record) {
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
submitForm() {
const that = this;
//
this.$refs.form.validate(valid => {
@ -160,18 +193,18 @@
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
}else{
} else {
that.$message.warning(res.message);
}
}).finally(() => {
@ -182,10 +215,10 @@
})
},
}
}
}
</script>
<style scoped>
.ant-form-item{
.ant-form-item {
margin-bottom: 16px;
}
}
</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.modules.demo.base.entity.ZyClothsComponent;
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.IZyClothsModularCompentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.NumberUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
@ -41,7 +41,10 @@ public class ZyClothsModularCompentController extends JeecgController<ZyClothsMo
@Autowired
private IZyClothsModularCompentService zyClothsModularCompentService;
@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,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
String modularId,
HttpServletRequest req) {
System.out.println("接受到的modularId: "+modularId);
QueryWrapper<ZyClothsModularCompent> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModularCompent, req.getParameterMap());
queryWrapper.eq("modular_id", modularId);
Page<ZyClothsModularCompent> page = new Page<ZyClothsModularCompent>(pageNo, pageSize);
IPage<ZyClothsModularCompent> pageList = zyClothsModularCompentService.page(page, queryWrapper);
List<ZyClothsModularCompent> recordList = zyClothsModularCompentMapper.queryList(modularId);
pageList.setRecords(recordList);
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) {
String partsName = s.getPartsName();
if (pattern.matcher(partsName).matches()){
if (pattern.matcher(partsName).matches()) {
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 = "制衣模块部件中间表-添加")
@PostMapping(value = "/add")
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("添加成功!");
}

@ -1,51 +1,35 @@
package org.jeecg.modules.demo.base.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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.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.ZyClothsType;
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.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;
/**
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
* @Description: zy_cloths_modular
* @Author: jeecg-boot
* @Date: 2021-11-10
* @Version: V1.0
*/
@Api(tags="zy_cloths_modular")
@Api(tags = "zy_cloths_modular")
@RestController
@RequestMapping("/base/zyClothsModular")
@Slf4j
@ -66,11 +50,11 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
* @return
*/
@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")
public Result<?> queryPageList(ZyClothsModular zyClothsModular,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyClothsModular> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModular, req.getParameterMap());
Page<ZyClothsModular> page = new Page<ZyClothsModular>(pageNo, pageSize);
@ -79,13 +63,13 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
}
@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")
public Result<?> findAll() {
List<ZyClothsModular> list = zyClothsModularService.list();
for(ZyClothsModular zycl : list){
for (ZyClothsModular zycl : list) {
String id = zycl.getClothsTypeId();
if(id!=null){
if (id != null) {
ZyClothsType byId = zyClothsTypeService.getById(id);
zycl.setClothsTypeId(byId.getTypeName());
}
@ -101,15 +85,14 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
* @return
*/
@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")
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();
for (ZyClothsModular zy : zyClothsModularList) {
if (zyClothsModular.getModularName().equals(zy.getModularName())){
if (zyClothsModular.getModularName().equals(zy.getModularName())) {
return Result.error("添加失败!模块名称已存在");
}
}
@ -124,7 +107,7 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
* @return
*/
@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")
public Result<?> edit(@RequestBody ZyClothsModular zyClothsModular) {
zyClothsModularService.updateById(zyClothsModular);
@ -138,9 +121,9 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
* @return
*/
@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")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
zyClothsModularService.removeById(id);
return Result.OK("删除成功!");
}
@ -152,9 +135,9 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
* @return
*/
@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")
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(",")));
return Result.OK("批量删除成功!");
}
@ -166,16 +149,35 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
* @return
*/
@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")
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);
if(zyClothsModular==null) {
if (zyClothsModular == null) {
return Result.error("未找到对应数据");
}
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
*

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

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.base.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
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);
@Select("select nums from zy_cloths_type where id = #{id} ")
String selectNumOne(String id);
}

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

@ -2,4 +2,9 @@
<!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">
<select id="queryList" resultType="org.jeecg.modules.demo.base.entity.ZyClothsModularCompent">
select *
from zy_cloths_modular_compent
where modular_id = #{ModularId}
</select>
</mapper>

@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
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);
/**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;
import org.jeecg.modules.demo.base.entity.ZyClothsComponent;
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.IZyClothsModularCompentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
/**
* @Description: 制衣模块部件中间表
* @Author: jeecg-boot
@ -16,4 +21,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
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
*/
@Override
public String generateNumber(ZyClothsModular zyClothsModular) {
String nums = zyClothsModular.getClothsTypeId();
ZyClothsType zyClothsType = zyClothsTypeMapper.selectById(nums);
String nums1 = zyClothsType.getNums();
public String generateNumber(String id) {
String numOne = zyClothsTypeMapper.selectNumOne(id);
// String substring = nums.substring(nums.length() - 10);
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) {
String substring = nums.substring(nums.length() - 8);
listLong.add(Long.valueOf(substring));
continue;
}
if (StringUtils.isEmpty(newNums)) {
newNums = "0";

Loading…
Cancel
Save