计划工序面料、辅料管理 1.11

zhc4dev
zhc077 2 years ago
parent 6c99115e97
commit 69bcb03291
  1. 193
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessAccessoriesDataList.vue
  2. 145
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessAccessoriesList.vue
  3. 4
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
  4. 196
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessFabricDataList.vue
  5. 152
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessFabricList.vue
  6. 2
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanAccessoriesForm.vue
  7. 120
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessAccessoriesForm.vue
  8. 111
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessAccessoriesForm2.vue
  9. 64
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessAccessoriesModal.vue
  10. 60
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessAccessoriesModal2.vue
  11. 84
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessAccessoriesModal__Style#Drawer.vue
  12. 120
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessFabricForm.vue
  13. 109
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessFabricForm2.vue
  14. 72
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessFabricModal.vue
  15. 60
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessFabricModal2.vue
  16. 84
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessFabricModal__Style#Drawer.vue
  17. 2
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  18. 200
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessAccessoriesController.java
  19. 202
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessFabricController.java
  20. 88
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcessAccessories.java
  21. 89
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcessFabric.java
  22. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessAccessoriesMapper.java
  23. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanProcessFabricMapper.java
  24. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessAccessoriesService.java
  25. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessFabricService.java
  26. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessAccessoriesServiceImpl.java
  27. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessFabricServiceImpl.java

@ -0,0 +1,193 @@
<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="zyStyleFabricHandleAdd(planProcessId)" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('计划面料')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<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-plan-process-accessories-modal ref="modalForm" @ok="modalFormOk"></zy-plan-process-accessories-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyPlanProcessAccessoriesModal from './modules/ZyPlanProcessAccessoriesModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyPlanProcessAccessoriesList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessAccessoriesModal
},
data () {
return {
description: '计划工序辅料管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '计划工序ID',
align: "center",
dataIndex: 'planProcessId',
},
{
title:'辅料',
align:"center",
dataIndex: 'accessoriesId_dictText'
},
{
title:'用量',
align:"center",
dataIndex: 'amount'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcessAccessories/importExcel",
},
dictOptions:{},
superFieldList:[],
loadRouteType: false,
planProcessId: '',
}
},
created() {
// this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
fanHui(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessAccessoriesList',
});
},
valueChange(value) {
if (value) this.loadData()
},
//
loadParameter() {
if (this.loadRouteType === false) {
this.planProcessId = this.$route.query.planProcessId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planProcessId:" + this.planProcessId)
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
console.log("----------------the params:", params);
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.dataSource.forEach(item => {
// item['stationName'] = this.stationName;
// item['stationNum'] = this.stationNum;
// })
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.planProcessId = this.planProcessId;
return filterObj(param);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,145 @@
<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('计划工序辅料管理')">导出</a-button>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- <a-divider type="vertical"/>-->
<a @click="jumpPage1(record)">制定计划面料</a>
</span>
</a-table>
</div>
<zy-plan-process-accessories-modal2 ref="modalForm" @ok="modalFormOk"></zy-plan-process-accessories-modal2>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyPlanProcessAccessoriesModal2 from './modules/ZyPlanProcessAccessoriesModal2'
export default {
name: 'ZyPlanProcessAccessoriesList2',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessAccessoriesModal2
},
data() {
return {
description: '计划工序辅料管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '计划ID',
align: "center",
dataIndex: 'planId'
},
{
title: '计划工序ID',
align: "center",
dataIndex: 'planProcessId'
},
{
title: '辅料',
align: "center",
dataIndex: 'accessoriesId_dictText'
},
{
title: '用量',
align: "center",
dataIndex: 'amount'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcessAccessories/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
// this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
jumpPage1(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessAccessoriesDataList',
query: { //
'planProcessId': record.planProcessId,
},
});
},
}
}
</script>

@ -110,7 +110,7 @@ export default {
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe',
orgFields: 'id,process_code,process_name,process_describe',
destFields: 'popup,id,popup_process_name,popup_process_describe',
destFields: 'proProcess,process_code,process_name,process_describe',
},
// {
// key: 'proProcess',
@ -127,7 +127,7 @@ export default {
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe',
orgFields: 'id,process_code,process_name,process_describe',
destFields: 'popup,id,popup_process_name,popup_process_describe',
destFields: 'postProcess,process_code,process_name,process_describe',
},
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input},
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input},

@ -0,0 +1,196 @@
<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="zyStyleFabricHandleAdd(planProcessId)" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('计划面料')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<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-plan-process-fabric-modal @valueChange="valueChange" ref="modalForm"
@ok="modalFormOk"></zy-plan-process-fabric-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyPlanProcessFabricModal from './modules/ZyPlanProcessFabricModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyPlanProcessFabricList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessFabricModal
},
data() {
return {
description: '计划工序面料管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
// {
// title:'ID',
// align:"center",
// dataIndex: 'planId'
// },
{
title: '计划工序ID',
align: "center",
dataIndex: 'planProcessId',
},
{
title: '面料',
align: "center",
dataIndex: 'fabricId_dictText'
},
{
title: '用量',
align: "center",
dataIndex: 'amount'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcessFabric/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcessFabric/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcessFabric/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcessFabric/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcessFabric/importExcel",
},
dictOptions: {},
superFieldList: [],
loadRouteType: false,
planProcessId: '',
}
},
created() {
// this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
fanHui(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessFabricList',
});
},
valueChange(value) {
if (value) this.loadData()
},
//
loadParameter() {
if (this.loadRouteType === false) {
this.planProcessId = this.$route.query.planProcessId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planProcessId:" + this.planProcessId)
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
console.log("----------------the params:", params);
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.dataSource.forEach(item => {
// item['stationName'] = this.stationName;
// item['stationNum'] = this.stationNum;
// })
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.planProcessId = this.planProcessId;
return filterObj(param);
},
}
}
</script>

@ -0,0 +1,152 @@
<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('计划工序面料管理')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- <a-divider type="vertical"/>-->
<a @click="jumpPage1(record)">制定计划面料</a>
</span>
</a-table>
</div>
<zy-plan-process-fabric-modal2 ref="modalForm" @ok="modalFormOk"></zy-plan-process-fabric-modal2>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyPlanProcessFabricModal2 from './modules/ZyPlanProcessFabricModal2'
export default {
name: 'ZyPlanProcessFabricList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessFabricModal2
},
data () {
return {
description: '计划工序面料管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'计划ID',
align:"center",
dataIndex: 'planId'
},
{
title:'计划工序ID',
align:"center",
dataIndex: 'planProcessId'
},
{
title:'面料',
align:"center",
dataIndex: 'fabricId_dictText'
},
{
title:'用量',
align:"center",
dataIndex: 'amount'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcessFabric/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcessFabric/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcessFabric/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcessFabric/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcessFabric/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
// this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
jumpPage1(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessFabricDataList',
query: { //
'planProcessId': record.planProcessId,
},
});
},
}
}
</script>

@ -52,7 +52,7 @@ export default {
confirmLoading: false,
validatorRules: {
accessoriesId: [
{required: true, message: "料不能为空"},
{required: true, message: "料不能为空"},
],
amount: [
{required: true, message: "用量不能不空"},

@ -0,0 +1,120 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="辅料id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accessoriesId">
<j-dict-select-tag type="list" v-model="model.accessoriesId" dictCode="zy_accessories,contents,id"
placeholder="请选择辅料"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input-number v-model="model.amount" placeholder="请输入用量" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZyPlanProcessAccessoriesForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model: {
planProcessId: '',
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
accessoriesId: [
{required: true, message: "辅料不能为空"},
],
amount: [
{required: true, message: "用量不能不空"},
{pattern: /^[0-9]{0,1000}$/, message: '用量不能为空且长度为正整数'}
],
},
url: {
add: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/add",
edit: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/edit",
queryById: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add(planProcessId) {
this.model.planProcessId = planProcessId;
console.log("Modal层接收到上级参数-planProcessId:" + this.model.planProcessId);
this.edit(this.model);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,111 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="生产计划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planId">
<!-- <a-input v-model="model.planId" placeholder="请选择生产计划"></a-input>-->
<j-dict-select-tag type="list" v-model="model.planId" dictCode="zy_product_plan,id,id"
placeholder="请选择生产计划"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'ZyPlanProcessAccessoriesForm2',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
amount: [
{ required: false},
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'},
],
},
url: {
add: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/add",
saveBatch: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/saveBatch",
edit: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/edit",
queryById: "/org.jeecg.modules.productplan/zyPlanProcessAccessories/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
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.saveBatch;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,64 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-plan-process-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-process-accessories-form>
</j-modal>
</template>
<script>
import ZyPlanProcessAccessoriesForm from './ZyPlanProcessAccessoriesForm'
export default {
name: 'ZyPlanProcessAccessoriesModal',
components: {
ZyPlanProcessAccessoriesForm
},
data () {
return {
model:{
planProcessId:'',
},
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (id) {
this.model.planProcessId=id
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(id);
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-plan-process-accessories-form2 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-process-accessories-form2>
</j-modal>
</template>
<script>
import ZyPlanProcessAccessoriesForm2 from './ZyPlanProcessAccessoriesForm2'
export default {
name: 'ZyPlanProcessAccessoriesModal2',
components: {
ZyPlanProcessAccessoriesForm2
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<zy-plan-process-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-plan-process-accessories-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ZyPlanProcessAccessoriesForm from './ZyPlanProcessAccessoriesForm'
export default {
name: 'ZyPlanProcessAccessoriesModal',
components: {
ZyPlanProcessAccessoriesForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,120 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="面料id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fabricId">
<!-- <j-multi-select-tag type="list_multi" v-model="model.fabricId" dictCode="zy_fabric,name,id"-->
<!-- placeholder="请选择面料"/>-->
<j-dict-select-tag type="list" v-model="model.fabricId" dictCode="zy_fabric,name,id" placeholder="请选择面料"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input-number v-model="model.amount" placeholder="请输入用量" style="width: 100%"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
export default {
name: 'ZyPlanProcessFabricForm',
components: {},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {
planProcessId: '',
},
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
fabricId: [
{required: true, message: "面料不能为空"},
],
amount: [
{required: true, message: "用量不能不空"},
{pattern: /^[0-9]{0,1000}$/, message: '用量不能为空且长度为正整数'}
],
},
url: {
add: "/org.jeecg.modules.productplan/zyPlanProcessFabric/add",
edit: "/org.jeecg.modules.productplan/zyPlanProcessFabric/edit",
queryById: "/org.jeecg.modules.productplan/zyPlanProcessFabric/queryById"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add(planProcessId) {
this.model.planProcessId = planProcessId;
console.log("Modal层接收到上级参数-planProcessId:" + this.model.planProcessId);
this.edit(this.model);
},
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm() {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,109 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="生产计划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planId">
<!-- <a-input v-model="model.planId" placeholder="请选择生产计划"></a-input>-->
<j-dict-select-tag type="list" v-model="model.planId" dictCode="zy_product_plan,id,id"
placeholder="请选择生产计划"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
export default {
name: 'ZyPlanProcessFabricForm2',
components: {},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {},
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
amount: [
{required: false},
{pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
],
},
url: {
add: "/org.jeecg.modules.productplan/zyPlanProcessFabric/add",
saveBatch: "/org.jeecg.modules.productplan/zyPlanProcessFabric/saveBatch",
edit: "/org.jeecg.modules.productplan/zyPlanProcessFabric/edit",
queryById: "/org.jeecg.modules.productplan/zyPlanProcessFabric/queryById"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
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.saveBatch;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,72 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-plan-process-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-process-fabric-form>
</j-modal>
</template>
<script>
import ZyPlanProcessFabricForm from './ZyPlanProcessFabricForm'
export default {
name: 'ZyPlanProcessFabricModal',
components: {
ZyPlanProcessFabricForm
},
data () {
return {
model:{
planProcessId:'',
},
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (id) {
this.model.planProcessId=id
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(id);
})
},
// add () {
// this.visible=true
// this.$nextTick(()=>{
// this.$refs.realForm.add();
// })
// },
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-plan-process-fabric-form2 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-process-fabric-form2>
</j-modal>
</template>
<script>
import ZyPlanProcessFabricForm2 from './ZyPlanProcessFabricForm2'
export default {
name: 'ZyPlanProcessFabricModal2',
components: {
ZyPlanProcessFabricForm2
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<zy-plan-process-fabric-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-plan-process-fabric-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ZyPlanProcessFabricForm from './ZyPlanProcessFabricForm'
export default {
name: 'ZyPlanProcessFabricModal',
components: {
ZyPlanProcessFabricForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -20,7 +20,7 @@
<a-form-model-item label="车间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workshopId">
<!-- <j-select-depart placeholder="请选择车间" v-model="model.workshopId" @change="groupxValChange()"/>-->
<j-dict-select-tag type="list" v-model="model.workshopId"
dictCode="sys_depart,depart_name,id,org_type='2'" @change="getGroupxValChange()"
dictCode="sys_depart,depart_name,id,org_category='2'" @change="getGroupxValChange()"
placeholder="请选择车间"/>
</a-form-model-item>
</a-col>

@ -0,0 +1,200 @@
package org.jeecg.modules.productplan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.service.IZyPlanProcessAccessoriesService;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* @Description: 计划工序辅料管理
* @Author: jeecg-boot
* @Date: 2023-01-10
* @Version: V1.0
*/
@Api(tags = "计划工序辅料管理")
@RestController
@RequestMapping("/org.jeecg.modules.productplan/zyPlanProcessAccessories")
@Slf4j
public class ZyPlanProcessAccessoriesController extends JeecgController<ZyPlanProcessAccessories, IZyPlanProcessAccessoriesService> {
@Autowired
private IZyPlanProcessAccessoriesService zyPlanProcessAccessoriesService;
@Autowired
private IZyPlanProcessService iZyPlanProcessService;
@Autowired
private IZyProductPlanService iZyProductPlanService;
/**
* 分页列表查询
*
* @param zyPlanProcessAccessories
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "计划工序辅料管理-分页列表查询")
@ApiOperation(value = "计划工序辅料管理-分页列表查询", notes = "计划工序辅料管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyPlanProcessAccessories zyPlanProcessAccessories,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyPlanProcessAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcessAccessories, req.getParameterMap());
Page<ZyPlanProcessAccessories> page = new Page<ZyPlanProcessAccessories>(pageNo, pageSize);
IPage<ZyPlanProcessAccessories> pageList = zyPlanProcessAccessoriesService.page(page, queryWrapper);
List<ZyPlanProcessAccessories> records = pageList.getRecords();
if (!ObjectUtils.isEmpty(records)) {
records.forEach(e -> {
ZyPlanProcess zyPlanProcess = iZyPlanProcessService.getById(e.getPlanProcessId());
if (!ObjectUtils.isEmpty(zyPlanProcess)) {
e.setPlanId(zyPlanProcess.getPlanId());
}
});
}
return Result.OK(pageList);
}
@ApiOperation(value = "计划工序辅料管理-添加", notes = "计划工序辅料管理-添加")
@PostMapping(value = "/saveBatch")
public Result<?> saveBatch(@RequestBody ZyPlanProcessAccessories zyPlanProcessAccessories) {
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(zyPlanProcessAccessories.getPlanId());
if (ObjectUtils.isEmpty(zyProductPlan))
throw new JeecgBootException(zyPlanProcessAccessories.getPlanId() + "-生产计划不存在");
List<ZyPlanProcessAccessories> addList = new LinkedList<>();
List<ZyPlanProcess> processList = iZyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcessAccessories.getPlanId()));
if (!ObjectUtils.isEmpty(processList)) {
processList.forEach(e -> {
ZyPlanProcessAccessories en = new ZyPlanProcessAccessories();
en.setPlanProcessId(e.getId());
addList.add(en);
});
}
zyPlanProcessAccessoriesService.saveBatch(addList);
return Result.OK("添加成功!");
}
/**
* 添加
*
* @param zyPlanProcessAccessories
* @return
*/
@AutoLog(value = "计划工序辅料管理-添加")
@ApiOperation(value = "计划工序辅料管理-添加", notes = "计划工序辅料管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyPlanProcessAccessories zyPlanProcessAccessories) {
zyPlanProcessAccessoriesService.save(zyPlanProcessAccessories);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyPlanProcessAccessories
* @return
*/
@AutoLog(value = "计划工序辅料管理-编辑")
@ApiOperation(value = "计划工序辅料管理-编辑", notes = "计划工序辅料管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyPlanProcessAccessories zyPlanProcessAccessories) {
zyPlanProcessAccessoriesService.updateById(zyPlanProcessAccessories);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "计划工序辅料管理-通过id删除")
@ApiOperation(value = "计划工序辅料管理-通过id删除", notes = "计划工序辅料管理-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
zyPlanProcessAccessoriesService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "计划工序辅料管理-批量删除")
@ApiOperation(value = "计划工序辅料管理-批量删除", notes = "计划工序辅料管理-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.zyPlanProcessAccessoriesService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "计划工序辅料管理-通过id查询")
@ApiOperation(value = "计划工序辅料管理-通过id查询", notes = "计划工序辅料管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
ZyPlanProcessAccessories zyPlanProcessAccessories = zyPlanProcessAccessoriesService.getById(id);
if (zyPlanProcessAccessories == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyPlanProcessAccessories);
}
/**
* 导出excel
*
* @param request
* @param zyPlanProcessAccessories
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyPlanProcessAccessories zyPlanProcessAccessories) {
return super.exportXls(request, zyPlanProcessAccessories, ZyPlanProcessAccessories.class, "计划工序辅料管理");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyPlanProcessAccessories.class);
}
}

@ -0,0 +1,202 @@
package org.jeecg.modules.productplan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.service.IZyPlanProcessFabricService;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* @Description: 计划工序面料管理
* @Author: jeecg-boot
* @Date: 2023-01-09
* @Version: V1.0
*/
@Api(tags = "计划工序面料管理")
@RestController
@RequestMapping("/org.jeecg.modules.productplan/zyPlanProcessFabric")
@Slf4j
public class ZyPlanProcessFabricController extends JeecgController<ZyPlanProcessFabric, IZyPlanProcessFabricService> {
@Autowired
private IZyPlanProcessFabricService zyPlanProcessFabricService;
@Autowired
private IZyPlanProcessService iZyPlanProcessService;
@Autowired
private IZyProductPlanService iZyProductPlanService;
/**
* 分页列表查询
*
* @param zyPlanProcessFabric
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "计划工序面料管理-分页列表查询")
@ApiOperation(value = "计划工序面料管理-分页列表查询", notes = "计划工序面料管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyPlanProcessFabric zyPlanProcessFabric,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyPlanProcessFabric> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcessFabric, req.getParameterMap());
Page<ZyPlanProcessFabric> page = new Page<ZyPlanProcessFabric>(pageNo, pageSize);
IPage<ZyPlanProcessFabric> pageList = zyPlanProcessFabricService.page(page, queryWrapper);
List<ZyPlanProcessFabric> records = pageList.getRecords();
if (!ObjectUtils.isEmpty(records)) {
records.forEach(e -> {
ZyPlanProcess zyPlanProcess = iZyPlanProcessService.getById(e.getPlanProcessId());
if (!ObjectUtils.isEmpty(zyPlanProcess)) {
e.setPlanId(zyPlanProcess.getPlanId());
}
});
//按planid排序
// Collections.sort(records, Comparator.comparing(ZyPlanProcessFabric::getPlanId));
}
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyPlanProcessFabric
* @return
*/
@ApiOperation(value = "计划工序面料管理-添加", notes = "计划工序面料管理-添加")
@PostMapping(value = "/saveBatch")
public Result<?> saveBatch(@RequestBody ZyPlanProcessFabric zyPlanProcessFabric) {
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(zyPlanProcessFabric.getPlanId());
if (ObjectUtils.isEmpty(zyProductPlan))
throw new JeecgBootException(zyPlanProcessFabric.getPlanId() + "-生产计划不存在");
List<ZyPlanProcessFabric> addList = new LinkedList<>();
List<ZyPlanProcess> processList = iZyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcessFabric.getPlanId()));
if (!ObjectUtils.isEmpty(processList)) {
processList.forEach(e -> {
ZyPlanProcessFabric en = new ZyPlanProcessFabric();
en.setPlanProcessId(e.getId());
addList.add(en);
});
}
zyPlanProcessFabricService.saveBatch(addList);
return Result.OK("添加成功!");
}
@ApiOperation(value = "计划工序面料管理-添加", notes = "计划工序面料管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyPlanProcessFabric zyPlanProcessFabric) {
zyPlanProcessFabricService.save(zyPlanProcessFabric);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyPlanProcessFabric
* @return
*/
@AutoLog(value = "计划工序面料管理-编辑")
@ApiOperation(value = "计划工序面料管理-编辑", notes = "计划工序面料管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyPlanProcessFabric zyPlanProcessFabric) {
zyPlanProcessFabricService.updateById(zyPlanProcessFabric);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "计划工序面料管理-通过id删除")
@ApiOperation(value = "计划工序面料管理-通过id删除", notes = "计划工序面料管理-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
zyPlanProcessFabricService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "计划工序面料管理-批量删除")
@ApiOperation(value = "计划工序面料管理-批量删除", notes = "计划工序面料管理-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.zyPlanProcessFabricService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "计划工序面料管理-通过id查询")
@ApiOperation(value = "计划工序面料管理-通过id查询", notes = "计划工序面料管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
ZyPlanProcessFabric zyPlanProcessFabric = zyPlanProcessFabricService.getById(id);
if (zyPlanProcessFabric == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyPlanProcessFabric);
}
/**
* 导出excel
*
* @param request
* @param zyPlanProcessFabric
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyPlanProcessFabric zyPlanProcessFabric) {
return super.exportXls(request, zyPlanProcessFabric, ZyPlanProcessFabric.class, "计划工序面料管理");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyPlanProcessFabric.class);
}
}

@ -0,0 +1,88 @@
package org.jeecg.modules.productplan.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Description: 计划工序辅料管理
* @Author: jeecg-boot
* @Date: 2023-01-10
* @Version: V1.0
*/
@Data
@TableName("zy_plan_process_accessories")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "zy_plan_process_accessories对象", description = "计划工序辅料管理")
public class ZyPlanProcessAccessories implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 计划工序id
*/
@Excel(name = "计划工序id", width = 15)
@ApiModelProperty(value = "计划工序id")
private String planProcessId;
/**
* 辅料id
*/
@Excel(name = "辅料id", width = 15)
@ApiModelProperty(value = "辅料id")
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id")
private String accessoriesId;
/**
* 用量
*/
@Excel(name = "用量", width = 15)
@ApiModelProperty(value = "用量")
private BigDecimal amount;
@TableField(exist = false)
private String planId;
}

@ -0,0 +1,89 @@
package org.jeecg.modules.productplan.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Description: 计划工序面料管理
* @Author: jeecg-boot
* @Date: 2023-01-09
* @Version: V1.0
*/
@Data
@TableName("zy_plan_process_fabric")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "zy_plan_process_fabric对象", description = "计划工序面料管理")
public class ZyPlanProcessFabric implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 计划工序id
*/
@Excel(name = "计划工序id", width = 15)
@ApiModelProperty(value = "计划工序id")
private String planProcessId;
/**
* 面料id
*/
@Excel(name = "面料id", width = 15)
@ApiModelProperty(value = "面料id")
@Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id")
private String fabricId;
/**
* 用量
*/
@Excel(name = "用量", width = 15)
@ApiModelProperty(value = "用量")
private BigDecimal amount;
@TableField(exist = false)
private String planId;
}

@ -0,0 +1,15 @@
package org.jeecg.modules.productplan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
/**
* @Description: 计划工序辅料管理
* @Author: jeecg-boot
* @Date: 2023-01-10
* @Version: V1.0
*/
public interface ZyPlanProcessAccessoriesMapper extends BaseMapper<ZyPlanProcessAccessories> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.productplan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
/**
* @Description: 计划工序面料管理
* @Author: jeecg-boot
* @Date: 2023-01-09
* @Version: V1.0
*/
public interface ZyPlanProcessFabricMapper extends BaseMapper<ZyPlanProcessFabric> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.productplan.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
/**
* @Description: 计划工序辅料管理
* @Author: jeecg-boot
* @Date: 2023-01-10
* @Version: V1.0
*/
public interface IZyPlanProcessAccessoriesService extends IService<ZyPlanProcessAccessories> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.productplan.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
/**
* @Description: 计划工序面料管理
* @Author: jeecg-boot
* @Date: 2023-01-09
* @Version: V1.0
*/
public interface IZyPlanProcessFabricService extends IService<ZyPlanProcessFabric> {
}

@ -0,0 +1,20 @@
package org.jeecg.modules.productplan.service.impl;
import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessAccessoriesMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessAccessoriesService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 计划工序辅料管理
* @Author: jeecg-boot
* @Date: 2023-01-10
* @Version: V1.0
*/
@Service
public class ZyPlanProcessAccessoriesServiceImpl extends ServiceImpl<ZyPlanProcessAccessoriesMapper, ZyPlanProcessAccessories> implements IZyPlanProcessAccessoriesService {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.productplan.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessFabricMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessFabricService;
import org.springframework.stereotype.Service;
/**
* @Description: 计划工序面料管理
* @Author: jeecg-boot
* @Date: 2023-01-09
* @Version: V1.0
*/
@Service
public class ZyPlanProcessFabricServiceImpl extends ServiceImpl<ZyPlanProcessFabricMapper, ZyPlanProcessFabric> implements IZyPlanProcessFabricService {
}
Loading…
Cancel
Save