制衣模块相关问题

zhc4dev
赵玉瑞 2 years ago
parent 6c99115e97
commit febda1402c
  1. 35
      ant-design-vue-jeecg/src/views/process/ZyClothsModularList.vue
  2. 354
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  3. 122
      ant-design-vue-jeecg/src/views/zyProcessModular/ZyProcessModularList.vue
  4. 10
      ant-design-vue-jeecg/src/views/zystyleaccessories/ZyStyleAccessoriesList.vue
  5. 14
      ant-design-vue-jeecg/src/views/zystylemodular/ZyStyleModularList.vue
  6. 28
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/controller/ZyStyleModularController.java
  7. 5
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/entity/ZyStyleModular.java
  8. 5
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/ZyStyleModularMapper.java
  9. 5
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/zyStyleModular/mapper/xml/ZyStyleModularMapper.xml
  10. 57
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyaccessories/controller/ZyStyleAccessoriesController.java
  11. 33
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/controller/ZyProcessModularController.java
  12. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/entity/ZyProcessModular.java
  13. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyProcessModular/mapper/ZyProcessModularMapper.java
  14. 22
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylefabric/controller/ZyStyleFabricController.java

@ -5,8 +5,9 @@
<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-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="模块名称"> <a-form-item label="模块编号">
<a-input placeholder="请输入模块名称" v-model="queryParam.modularName"></a-input> <!--自带模糊查询-->
<a-input placeholder="请输入模块编号" v-model="queryParam.nums"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -20,7 +21,7 @@
<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="企业" > <a-form-model-item label="企业" >
<j-select-depart v-model="queryParam.enterpriseId" placeholder="请输入企业名称"/> <j-select-depart v-model="queryParam.enterpriseId" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- </a-row>--> <!-- </a-row>-->
@ -120,19 +121,19 @@
<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>
@ -183,7 +184,7 @@ export default {
} }
}, },
{ {
title: '编号', title: '模块编号',
align: "center", align: "center",
dataIndex: 'nums' dataIndex: 'nums'
}, },

@ -5,15 +5,15 @@
<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" /> <j-select-depart v-model="model.enterpriseId"/>
</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="clothsTypeId">--> <!-- <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="请选择衣服类型" />--> <!-- <j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择衣服类型" />-->
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<a-form-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> <a-form-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<j-tree-select v-model="model.clothsTypeId" <j-tree-select v-model="model.clothsTypeId"
dict="zy_cloths_type,type_name,id" dict="zy_cloths_type,type_name,id"
@ -28,7 +28,7 @@
<a-row> <a-row>
<a-col :span="478"> <a-col :span="478">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums"> <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" disabled=""></a-input> <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>
@ -36,17 +36,17 @@
<a-row> <a-row>
<a-col :span="48"> <a-col :span="48">
<a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName"> <a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">
<a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input> <a-input v-model="model.partsName" 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-col :span="48">-->
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">--> <!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">-->
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />--> <!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" 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">
@ -66,55 +66,44 @@
</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="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>
<a-row> <a-row>
<!-- <a-col :span="24">--> <!--<a-col :span="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="model.enterpriseId" />--> <!-- <j-select-depart v-model="model.enterpriseId" />-->
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!--</a-col>-->
<!-- <a-col :span="24">-->
<!-- <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="24">-->
<!-- <a-form-model-item label="部件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partsName">-->
<!-- <a-input v-model="model.partsName" placeholder="请输入部件名称" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">-->
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="部件类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="componentType">-->
<!-- <a-input v-model="model.componentType" placeholder="请输入部件类型" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">-->
<!-- <a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">-->
<!-- <j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!--<a-col :span="24">-->
<!-- <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="24">-->
<!-- <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modularId">-->
<!-- <j-dict-select-tag type="list" v-model="model.modularId" dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块" />-->
<!-- </a-form-model-item>-->
<!--</a-col>-->
<!--<a-col :span="24">-->
<!-- <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">-->
<!-- <a-textarea v-model="model.description" rows="4" placeholder="请输入描述"/>-->
<!-- </a-form-model-item>-->
<!--</a-col>-->
<!--<a-col :span="24">-->
<!-- <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pictureUrl">-->
<!-- <j-image-upload isMultiple v-model="model.pictureUrl" ></j-image-upload>-->
<!-- </a-form-model-item>-->
<!--</a-col>-->
<!-- <a-col :span="24">--> <!--<a-col :span="24">-->
<!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">--> <!-- <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId">-->
<!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>--> <!-- <a-input v-model="model.enterpriseId" placeholder="请输入企业" ></a-input>-->
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!--</a-col>-->
</a-row> </a-row>
</a-form-model> </a-form-model>
@ -124,143 +113,142 @@
<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' import JTreeSelect from '@/components/jeecg/JTreeSelect'
export default { export default {
name: 'ZyClothsComponentForm', name: 'ZyClothsComponentForm',
components: { components: {
JTreeSelect JTreeSelect
}, },
props: { props: {
// //
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false required: false
}
},
data() {
return {
model: {
nums: '',
},
labelCol: {
xs: {span: 24},
sm: {span: 4},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
// nums: [
// { required: true, message: '!'},
// ],
clothsTypeId: [
{required: true, message: '请选择服装类型!'},
],
partsName: [
{required: true, message: '请输入部件名称!'},
],
// modularId: [
// { required: true, message: '!'},
// ],
modularType: [
{required: true, message: '请选择制衣模块类型!'},
],
},
url: {
add: "/base/zyClothsComponent/add",
edit: "/base/zyClothsComponent/edit",
queryById: "/base/zyClothsComponent/queryById",
//
sort: "/base/zyClothsComponent/sort"
} }
}
},
computed: {
formDisabled() {
return this.disabled
}, },
data () { },
return { created() {
model:{ //model
nums: '', this.modelDefault = JSON.parse(JSON.stringify(this.model));
}, },
labelCol: { methods: {
xs: { span: 24 }, async getNumberClothsComponentList() {
sm: { span: 4 }, //const {data: res} = await this.$axios.get('/jeecg-boot/base/zyClothsComponent/sort?id=' + this.model.clothsTypeId)
}, getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
wrapperCol: { if (res.code !== 200) {
xs: { span: 24 }, this.$message({
sm: { span: 16 }, type: 'error',
}, message: '未查询到数据!'
confirmLoading: false, });
validatorRules: {
// nums: [
// { required: true, message: '!'},
// ],
clothsTypeId: [
{ required: true, message: '请选择服装类型!'},
],
partsName: [
{ required: true, message: '请输入部件名称!'},
],
// modularId: [
// { required: true, message: '!'},
// ],
modularType: [
{ required: true, message: '请选择制衣模块类型!'},
],
},
url: {
add: "/base/zyClothsComponent/add",
edit: "/base/zyClothsComponent/edit",
queryById: "/base/zyClothsComponent/queryById",
//
sort: "/base/zyClothsComponent/sort"
} }
} this.model.nums = res.result;
console.log("制衣部件 编号: " + this.model.nums);
//console.log('res.result')
//console.log(res.result)
//this.confirmLoading = false
// if (this.data.length === 0) {
// this.data.push(res.result)
// }
})
}, },
computed: { // bianHao() {
formDisabled(){ // getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
return this.disabled // let number = res.result;
}, // console.log("List id " + this.model.clothsTypeId)
// console.log("List " +number)
// this.model.nums = number;
// })
// },
add() {
this.edit(this.modelDefault);
}, },
created () { edit(record) {
//model this.model = Object.assign({}, record);
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.visible = true;
}, },
methods: { submitForm() {
async getNumberClothsComponentList() { const that = this;
//const {data: res} = await this.$axios.get('/jeecg-boot/base/zyClothsComponent/sort?id=' + this.model.clothsTypeId) //
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { this.$refs.form.validate(valid => {
if (res.code !== 200) { if (valid) {
this.$message({ that.confirmLoading = true;
type: 'error', let httpurl = '';
message: '未查询到数据!' let method = '';
}); if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
} }
this.model.nums = res.result httpAction(httpurl, this.model, method).then((res) => {
//console.log('res.result') if (res.success) {
//console.log(res.result) that.$message.success(res.message);
//this.confirmLoading = false that.$emit('ok');
// if (this.data.length === 0) { } else {
// this.data.push(res.result) that.$message.warning(res.message);
// }
console.log("制衣部件 编号: "+this.model.nums);
})
},
// bianHao() {
// getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
// let number = res.result;
// console.log("List id " + this.model.clothsTypeId)
// console.log("List " +number)
// this.model.nums = number;
// })
// },
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
} }
httpAction(httpurl,this.model,method).then((res)=>{ }).finally(() => {
if(res.success){ that.confirmLoading = false;
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>

@ -1,5 +1,5 @@
<template> <template>
<!-- <a-card :bordered="false">--> <!-- <a-card :bordered="false">-->
<a-modal <a-modal
width="70%" width="70%"
title="" title=""
@ -13,10 +13,16 @@
<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="模块名称">-->
<!-- <j-dict-select-tag v-model="queryParam.modularId"-->
<!-- dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块名称"/>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="模块名称"> <a-form-item label="工序代码">
<j-dict-select-tag v-model="queryParam.modularId" <a-input v-model="queryParam.processCode"
dictCode="zy_cloths_modular,modular_name,id" placeholder="请选择模块名称"/> placeholder="请输入工序代码"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -41,24 +47,30 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd1(modularId1)" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd1(modularId1)" type="primary" icon="plus">新增</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('模块工序表')">导出</a-button>--> <!-- <a-button type="primary" icon="download" @click="handleExportXls('模块工序表')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> <!-- <a-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>
@ -81,7 +93,8 @@
</template> </template>
<template slot="imgSlot" slot-scope="text,record"> <template slot="imgSlot" slot-scope="text,record">
<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)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" :preview="record.id" 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>
@ -99,25 +112,12 @@
<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 class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item>-->
<!-- <a @click="handleDetail(record)">详情</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span> </span>
</a-table> </a-table>
@ -130,19 +130,19 @@
<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 ZyProcessModularModal from './modules/ZyProcessModularModal' import ZyProcessModularModal from './modules/ZyProcessModularModal'
import {getAction} from "@api/manage"; import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util"; import {filterObj} from "@/utils/util";
export default { export default {
name: 'ZyProcessModularList', name: 'ZyProcessModularList',
mixins:[JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
ZyProcessModularModal ZyProcessModularModal
}, },
data () { data() {
return { return {
description: '模块工序表管理页面', description: '模块工序表管理页面',
visible: false, visible: false,
@ -156,36 +156,46 @@ export default {
{ {
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:'模块名称', title: '模块编号',
align:"center", align: "center",
dataIndex: 'modularNums'
},
{
title: '模块名称',
align: "center",
dataIndex: 'modularId_dictText' dataIndex: 'modularId_dictText'
}, },
{ {
title:'工序名称', title: '工序代码',
align:"center", align: "center",
dataIndex: 'processCode'
},
{
title: '工序名称',
align: "center",
dataIndex: 'processId_dictText' dataIndex: 'processId_dictText'
}, },
{ {
title:'创建时间', title: '创建时间',
align:"center", align: "center",
dataIndex: 'createTime' dataIndex: 'createTime'
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
align:"center", align: "center",
fixed:"right", fixed: "right",
width:147, width: 147,
scopedSlots: { customRender: 'action' } scopedSlots: {customRender: 'action'}
} }
], ],
url: { url: {
@ -196,8 +206,8 @@ export default {
importExcelUrl: "zyProcessModular/zyProcessModular/importExcel", importExcelUrl: "zyProcessModular/zyProcessModular/importExcel",
}, },
dictOptions:{}, dictOptions: {},
superFieldList:[], superFieldList: [],
} }
}, },
created() { created() {
@ -205,15 +215,15 @@ export default {
//this.loadParameter(); //this.loadParameter();
}, },
computed: { computed: {
importExcelUrl: function(){ importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}, },
}, },
methods: { methods: {
edit1(record) { edit1(record) {
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
this.modularId1= this.model.id; this.modularId1 = this.model.id;
this.biaoTi = record.modularName+"模块工序管理"; this.biaoTi = record.modularName + "模块工序管理";
//console.log(topicid); //console.log(topicid);
this.queryParam.modularId = this.model.id; this.queryParam.modularId = this.model.id;
//console.log("ID++++++"+ this.queryParam.modularId); //console.log("ID++++++"+ this.queryParam.modularId);
@ -290,12 +300,12 @@ export default {
console.log('Clicked cancel button'); console.log('Clicked cancel button');
this.visible = false; this.visible = false;
}, },
initDictConfig(){ initDictConfig() {
}, },
getSuperFieldList(){ getSuperFieldList() {
let fieldList=[]; let fieldList = [];
fieldList.push({type:'string',value:'modularId',text:'模块ID',dictCode:''}) fieldList.push({type: 'string', value: 'modularId', text: '模块ID', dictCode: ''})
fieldList.push({type:'string',value:'processId',text:'工序ID',dictCode:''}) fieldList.push({type: 'string', value: 'processId', text: '工序ID', dictCode: ''})
this.superFieldList = fieldList this.superFieldList = fieldList
} }
} }

@ -16,11 +16,11 @@
<!-- v-model="queryParam.styleId" disabled></j-dict-select-tag>--> <!-- v-model="queryParam.styleId" disabled></j-dict-select-tag>-->
<!-- </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-item label="辅料编号">--> <a-form-item label="辅料编号">
<!-- <a-input placeholder="请输入辅料编号" v-model="queryParam.accessNum"></a-input>--> <a-input placeholder="请输入辅料编号" v-model="queryParam.accessNum"></a-input>
<!-- </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-item label="辅料名称"> <a-form-item label="辅料名称">
<j-dict-select-tag placeholder="请选择辅料名称" dictCode="zy_accessories,contents,id" <j-dict-select-tag placeholder="请选择辅料名称" dictCode="zy_accessories,contents,id"

@ -8,6 +8,13 @@
<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-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="工序代码" >
<a-input v-model="queryParam.processCode"
placeholder="请输入工序代码"/>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a-button type="primary">{{biaoTi}}</a-button>--> <!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a-button type="primary">{{biaoTi}}</a-button>-->
<!-- <a-button type="primary">{{biaoTi}}</a-button>--> <!-- <a-button type="primary">{{biaoTi}}</a-button>-->
<a-form-model-item label="工序" > <a-form-model-item label="工序" >
@ -154,6 +161,11 @@ export default {
align: "center", align: "center",
dataIndex: 'styleId_dictText' dataIndex: 'styleId_dictText'
}, },
{
title:'工序代码',
align:"center",
dataIndex: 'processCode'
},
{ {
title: '工序', title: '工序',
align: "center", align: "center",
@ -260,7 +272,7 @@ export default {
param.pageNo = this.ipagination.current; param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize; param.pageSize = this.ipagination.pageSize;
//param.id=this.id; //param.id=this.id;
param.id = this.$route.query.id; param.styleId = this.$route.query.id;
return filterObj(param); return filterObj(param);
}, },
initDictConfig() { initDictConfig() {

@ -1,5 +1,7 @@
package org.jeecg.modules.demo.zyStyleModular.controller; package org.jeecg.modules.demo.zyStyleModular.controller;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -11,6 +13,7 @@ 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
@ -54,6 +57,9 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyStyleModularController extends JeecgController<ZyStyleModular, IZyStyleModularService> { public class ZyStyleModularController extends JeecgController<ZyStyleModular, IZyStyleModularService> {
@Autowired @Autowired
private IZyStyleModularService zyStyleModularService; private IZyStyleModularService zyStyleModularService;
@Resource
private ZyStyleModularMapper zyStyleModularMapper;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -67,21 +73,25 @@ public class ZyStyleModularController extends JeecgController<ZyStyleModular, IZ
@ApiOperation(value = "款式工序表-分页列表查询", notes = "款式工序表-分页列表查询") @ApiOperation(value = "款式工序表-分页列表查询", notes = "款式工序表-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> queryPageList(ZyStyleModular zyStyleModular, public Result<?> queryPageList(ZyStyleModular zyStyleModular,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "processId", required = false) String processId,
@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<ZyStyleModular> queryWrapper = QueryGenerator.initQueryWrapper(zyStyleModular, req.getParameterMap()); //QueryWrapper<ZyStyleModular> queryWrapper = QueryGenerator.initQueryWrapper(zyStyleModular, req.getParameterMap());
//System.err.println("id "+id); LambdaQueryWrapper<ZyStyleModular> queryWrapper = new LambdaQueryWrapper<>();
//System.err.println("processId "+processId); //当从服装款式进入款式工序的时候 会有一个 styleId
QueryWrapper<ZyStyleModular> queryWrapper = new QueryWrapper<>(); queryWrapper.eq(StringUtils.hasText(zyStyleModular.getStyleId()), ZyStyleModular::getStyleId, zyStyleModular.getStyleId());
queryWrapper.eq(StringUtils.hasText(id), "style_id", id); //在工序页面 根据工序查询的时候 会有一个 processId
queryWrapper.eq(StringUtils.hasText(processId), "process_id", processId); queryWrapper.eq(StringUtils.hasText(zyStyleModular.getProcessId()), ZyStyleModular::getProcessId, zyStyleModular.getProcessId());
Page<ZyStyleModular> page = new Page<>(pageNo, pageSize); Page<ZyStyleModular> page = new Page<>(pageNo, pageSize);
IPage<ZyStyleModular> pageList = zyStyleModularService.page(page, queryWrapper); IPage<ZyStyleModular> pageList = zyStyleModularService.page(page, queryWrapper);
//List<ZyStyleModular> list = zyStyleModularMapper.selectListByStyleId(id); //在工序页面 根据工序代码查询的时候 会有一个 processCode
//pageList.setRecords(list); if (StringUtils.hasText(zyStyleModular.getProcessCode())){
String newProcessCode = "%"+zyStyleModular.getProcessCode()+"%";
List<ZyStyleModular> listByProcessCode = new ArrayList<>(zyStyleModularMapper.getListByProcessCode(newProcessCode));
List<ZyStyleModular> collect = listByProcessCode.stream().filter(zyStyMo -> zyStyMo.getStyleId().equals(zyStyleModular.getStyleId())).collect(Collectors.toList());
pageList.setRecords(collect);
}
pageList.getRecords().forEach(zyStyMo -> zyStyMo.setProcessCode(zyStyleModularMapper.getCodeById(zyStyMo.getProcessId())));
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -65,6 +66,10 @@ public class ZyStyleModular implements Serializable {
@Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id")
private String processId; private String processId;
/**工序代码*/
@TableField(exist = false)
private String processCode;
/**序号*/ /**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号") @Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号") @ApiModelProperty(value = "序号")

@ -27,4 +27,9 @@ public interface ZyStyleModularMapper extends BaseMapper<ZyStyleModular> {
@Select("select process_name from zy_process where id = #{processId}") @Select("select process_name from zy_process where id = #{processId}")
String getProcessNameByStyleId(String processId); String getProcessNameByStyleId(String processId);
@Select("select process_code from zy_process where id=#{id}")
String getCodeById(String id);
//简单的用注解 复杂的用xml 复杂的注解处理好像有问题
List<ZyStyleModular> getListByProcessCode(String processCode);
} }

@ -7,4 +7,9 @@
FROM zy_style_modular FROM zy_style_modular
WHERE style_id = #{styleId} WHERE style_id = #{styleId}
</select> </select>
<select id="getListByProcessCode" resultType="org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular">
SELECT *
FROM zy_style_modular
WHERE process_id IN (SELECT id FROM zy_process WHERE process_code LIKE #{processCode}) LIMIT 0, 1000
</select>
</mapper> </mapper>

@ -1,24 +1,18 @@
package org.jeecg.modules.demo.zyaccessories.controller; package org.jeecg.modules.demo.zyaccessories.controller;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
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.accessories.entity.ZyAccessories; import org.jeecg.modules.demo.accessories.entity.ZyAccessories;
import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService; import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService;
import org.jeecg.modules.demo.fabric.service.IZyFabricService;
import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccDetailVO; import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccDetailVO;
import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories; import org.jeecg.modules.demo.zyaccessories.entity.ZyStyleAccessories;
import org.jeecg.modules.demo.zyaccessories.mapper.ZyStyleAccessoriesMapper; import org.jeecg.modules.demo.zyaccessories.mapper.ZyStyleAccessoriesMapper;
@ -29,22 +23,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zystylefabric.entity.ZyStyleFabricDetailVo;
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper; import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper;
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.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
@ -88,35 +73,25 @@ public class ZyStyleAccessoriesController extends JeecgController<ZyStyleAccesso
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
//zyStyleAccessories.getAccessNum() 辅料编号 查询参数 只有查询的时候才会有 //zyStyleAccessories.getAccessNum() 辅料编号 查询参数 只有查询的时候才会有
// List<ZyAccessories> accessories = new ArrayList<>(); List<ZyAccessories> accessories = new ArrayList<>();
// if (StringUtils.hasText(zyStyleAccessories.getAccessNum())) { if (StringUtils.hasText(zyStyleAccessories.getAccessNum())) {
// LambdaQueryWrapper<ZyAccessories> queryWrapper2 = new LambdaQueryWrapper<>(); accessories.addAll(zyAccessoriesService.list(new LambdaQueryWrapper<ZyAccessories>().like(ZyAccessories::getNums, zyStyleAccessories.getAccessNum())));
// queryWrapper2.like(ZyAccessories::getNums, zyStyleAccessories.getAccessNum()); }
// accessories.addAll(zyAccessoriesService.list());
// }
QueryWrapper<ZyStyleAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap()); QueryWrapper<ZyStyleAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyStyleAccessories, req.getParameterMap());
Page<ZyStyleAccessories> page = new Page<ZyStyleAccessories>(pageNo, pageSize); IPage<ZyStyleAccessories> pageList = zyStyleAccessoriesService.page(new Page<>(pageNo, pageSize), queryWrapper);
IPage<ZyStyleAccessories> pageList = zyStyleAccessoriesService.page(page, queryWrapper);
List<ZyStyleAccessories> listRecords = pageList.getRecords(); List<ZyStyleAccessories> listRecords = pageList.getRecords();
// if (!ObjectUtils.isEmpty(accessories) && !ObjectUtils.isEmpty(listRecords)) { if (!ObjectUtils.isEmpty(accessories) && !ObjectUtils.isEmpty(listRecords)) {
// for (ZyAccessories zy : accessories) { List<ZyStyleAccessories> list = new ArrayList<>();
// listRecords.stream() accessories.forEach(zy -> listRecords.stream().filter(ZyStyleAccess -> ZyStyleAccess.getAccessoriesId().equals(zy.getId())).forEachOrdered(list::add));
// .filter(ZyStyleAccessories -> ZyStyleAccessories.getAccessoriesId().equals(zy.getId())) pageList.setRecords(list.stream().distinct().collect(Collectors.toList()));//去重
// .collect(Collectors.toList());
// }
// }
for (ZyStyleAccessories zy : listRecords) {
String typeName = zyStyleFabricMapper.getTypeName(zy.getStyleId());
String num = zyStyleFabricMapper.getAccessoriesNumById(zy.getAccessoriesId());
if (StringUtils.hasText(typeName)) {
zy.setTypeName(typeName);
}
if (StringUtils.hasText(num)) {
zy.setAccessNum(num);
}
} }
pageList.getRecords().forEach(zyStyleAccess -> {
String typeName = zyStyleFabricMapper.getTypeName(zyStyleAccess.getStyleId());
String num = zyStyleFabricMapper.getAccessoriesNumById(zyStyleAccess.getAccessoriesId());
if (StringUtils.hasText(typeName)) zyStyleAccess.setTypeName(typeName);
if (StringUtils.hasText(num)) zyStyleAccess.setAccessNum(num);
});
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -11,16 +11,25 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; 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.ZyProcess;
import org.jeecg.modules.demo.base.mapper.ZyProcessMapper;
import org.jeecg.modules.demo.base.service.IZyProcessService;
import org.jeecg.modules.zyProcessModular.entity.ZyProcessModular; import org.jeecg.modules.zyProcessModular.entity.ZyProcessModular;
import org.jeecg.modules.zyProcessModular.mapper.ZyProcessModularMapper;
import org.jeecg.modules.zyProcessModular.service.IZyProcessModularService; import org.jeecg.modules.zyProcessModular.service.IZyProcessModularService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
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.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @Description: 模块工序表 * @Description: 模块工序表
@ -35,13 +44,17 @@ import java.util.Arrays;
public class ZyProcessModularController extends JeecgController<ZyProcessModular, IZyProcessModularService> { public class ZyProcessModularController extends JeecgController<ZyProcessModular, IZyProcessModularService> {
@Autowired @Autowired
private IZyProcessModularService zyProcessModularService; private IZyProcessModularService zyProcessModularService;
@Autowired
private IZyProcessService zyProcessService;
@Autowired
private ZyProcessModularMapper zyProcessModularMapper;
/** /**
* 分页列表查询 * 分页列表查询
* *
* @param zyProcessModular * @param zyProcessModular
* @param pageNo * @param pageNo 当前页的页码
* @param pageSize * @param pageSize 当前页的数据条数
* @param req * @param req
* @return * @return
*/ */
@ -55,6 +68,22 @@ public class ZyProcessModularController extends JeecgController<ZyProcessModular
QueryWrapper<ZyProcessModular> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessModular, req.getParameterMap()); QueryWrapper<ZyProcessModular> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessModular, req.getParameterMap());
Page<ZyProcessModular> page = new Page<ZyProcessModular>(pageNo, pageSize); Page<ZyProcessModular> page = new Page<ZyProcessModular>(pageNo, pageSize);
IPage<ZyProcessModular> pageList = zyProcessModularService.page(page, queryWrapper); IPage<ZyProcessModular> pageList = zyProcessModularService.page(page, queryWrapper);
//在模块工序中 根据工序代码查询的时候 会有一个 processCode
if (StringUtils.hasText(zyProcessModular.getProcessCode())){
//System.err.println(LocalDateTime.now() + " +++ " +zyProcessModular.getProcessCode());
List<ZyProcess> zyProcessList = zyProcessService.list(new LambdaQueryWrapper<ZyProcess>().like(ZyProcess::getProcessCode,zyProcessModular.getProcessCode()));
List<ZyProcessModular> modularList = new ArrayList<>();
zyProcessList.forEach(zyProcess -> {
modularList.addAll(zyProcessModularService.list(new LambdaQueryWrapper<ZyProcessModular>().eq(ZyProcessModular::getProcessId, zyProcess.getId())));
List<ZyProcessModular> collect = modularList.stream().filter(zyPModular -> zyPModular.getModularId().equals(zyProcessModular.getModularId())).collect(Collectors.toList());
pageList.setRecords(collect);
});
}
//不怕空值
pageList.getRecords().forEach(zyProModular -> {
zyProModular.setModularNums(zyProcessModularMapper.getModularNumsByModularId(zyProModular.getModularId()));
zyProModular.setProcessCode(zyProcessModularMapper.getProcessCodeByProcessId(zyProModular.getProcessId()));
});
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -1,6 +1,7 @@
package org.jeecg.modules.zyProcessModular.entity; package org.jeecg.modules.zyProcessModular.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -57,11 +58,21 @@ public class ZyProcessModular implements Serializable {
@ApiModelProperty(value = "模块ID") @ApiModelProperty(value = "模块ID")
@Dict(dictTable = "zy_cloths_modular",dicText = "modular_name",dicCode = "id") @Dict(dictTable = "zy_cloths_modular",dicText = "modular_name",dicCode = "id")
private java.lang.String modularId; private java.lang.String modularId;
/**模块编号*/
@TableField(exist = false)
private String modularNums;
/**工序ID*/ /**工序ID*/
@Excel(name = "工序ID", width = 15) @Excel(name = "工序ID", width = 15)
@ApiModelProperty(value = "工序ID") @ApiModelProperty(value = "工序ID")
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id") @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
private java.lang.String processId; private java.lang.String processId;
/**工序代码*/
@TableField(exist = false)
private String processCode;
/**序号*/ /**序号*/
@Excel(name = "序号", width = 15,dicCode = "序号") @Excel(name = "序号", width = 15,dicCode = "序号")
@ApiModelProperty(value = "序号") @ApiModelProperty(value = "序号")

@ -1,6 +1,8 @@
package org.jeecg.modules.zyProcessModular.mapper; package org.jeecg.modules.zyProcessModular.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.zyProcessModular.entity.ZyProcessModular; import org.jeecg.modules.zyProcessModular.entity.ZyProcessModular;
/** /**
@ -9,6 +11,12 @@ import org.jeecg.modules.zyProcessModular.entity.ZyProcessModular;
* @Date: 2022-11-22 * @Date: 2022-11-22
* @Version: V1.0 * @Version: V1.0
*/ */
@Mapper
public interface ZyProcessModularMapper extends BaseMapper<ZyProcessModular> { public interface ZyProcessModularMapper extends BaseMapper<ZyProcessModular> {
@Select("select nums from zy_cloths_modular where id = #{modularId}")
String getModularNumsByModularId(String modularId);
@Select("select process_code from zy_process where id = #{processId}")
String getProcessCodeByProcessId(String processId);
} }

@ -58,7 +58,7 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
private IZyFabricService zyFabricService; private IZyFabricService zyFabricService;
@Autowired @Autowired
private ZyStyleFabricMapper zyStyleFabricMapper; private ZyStyleFabricMapper zyStyleFabricMapper;
/** /**
* 分页列表查询 * 分页列表查询
@ -95,23 +95,16 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
List<ZyStyleFabric> list = zyStyleFabricService.list(queryWrapper); List<ZyStyleFabric> list = zyStyleFabricService.list(queryWrapper);
//fabricNumber 面料编号查询参数 只有查询的时候才会有 //fabricNumber 面料编号查询参数 只有查询的时候才会有
if (StringUtils.hasText(fabricNumber)) { if (StringUtils.hasText(fabricNumber)) {
LambdaQueryWrapper<ZyFabric> queryWrapper2 = new LambdaQueryWrapper<>(); List<ZyFabric> listTwo = zyFabricService.list(new LambdaQueryWrapper<ZyFabric>().like(ZyFabric::getFabricNumber, fabricNumber));
queryWrapper2.like( ZyFabric::getFabricNumber,fabricNumber); if (ObjectUtils.isEmpty(listTwo)) {
List<ZyFabric> listTwo = zyFabricService.list(queryWrapper2); IPage<NewZyStyleFabric> pageList2 = new Page<NewZyStyleFabric>(pageNo, pageSize, 0);
if (ObjectUtils.isEmpty(listTwo)){
IPage<NewZyStyleFabric> pageList2 = new Page<>(pageNo, pageSize, 0);
return Result.OK(pageList2); return Result.OK(pageList2);
} }
List<ZyStyleFabric> zyStyleFabricList = new ArrayList<>(); List<ZyStyleFabric> zyStyleFabricList = new ArrayList<>();
for (ZyFabric zy : listTwo) { listTwo.stream().map(zy -> zyStyleFabricMapper.getListByFabricId(zy.getId())).forEachOrdered(zyStyleFabricList::addAll);
List<ZyStyleFabric> zyStyleFabrics = zyStyleFabricMapper.getListByFabricId(zy.getId()); List<ZyStyleFabric> collect = zyStyleFabricList.stream().filter(ZyStyleFabric -> ZyStyleFabric.getStyleId().equals(id)).collect(Collectors.toList());
zyStyleFabricList.addAll(zyStyleFabrics);
}
//将新查出来的集合在根据styleid 筛选一下
zyStyleFabricList = zyStyleFabricList.stream().filter(ZyStyleFabric -> ZyStyleFabric.getStyleId().equals(id)).collect(Collectors.toList());
list.clear(); list.clear();
list.addAll(zyStyleFabricList); list.addAll(collect);
} }
List<NewZyStyleFabric> newZyStyleFabrics = zyStyleFabricService.changeList(list); List<NewZyStyleFabric> newZyStyleFabrics = zyStyleFabricService.changeList(list);
IPage<NewZyStyleFabric> pageList = new Page<>(pageNo, pageSize, list.size()); IPage<NewZyStyleFabric> pageList = new Page<>(pageNo, pageSize, list.size());
@ -174,6 +167,7 @@ public class ZyStyleFabricController extends JeecgController<ZyStyleFabric, IZyS
zyStyleFabricService.removeById(id); zyStyleFabricService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
/** /**
* 详情 * 详情
*/ */

Loading…
Cancel
Save