计划辅料管理 12.22

zhc4dev
zhc077 2 years ago
parent 37e290fb44
commit 3dbefc8bf3
  1. 218
      ant-design-vue-jeecg/src/views/productplan/ZyPlanAccessoriesDataList.vue
  2. 197
      ant-design-vue-jeecg/src/views/productplan/ZyPlanAccessoriesList.vue
  3. 122
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanAccessoriesForm.vue
  4. 108
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanAccessoriesForm2.vue
  5. 70
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanAccessoriesModal.vue
  6. 60
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanAccessoriesModal2.vue
  7. 84
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanAccessoriesModal__Style#Drawer.vue
  8. 152
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanAccessoriesController.java
  9. 84
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanAccessories.java
  10. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/mapper/ZyPlanAccessoriesMapper.java
  11. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanAccessoriesService.java
  12. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanAccessoriesServiceImpl.java

@ -0,0 +1,218 @@
<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 @click="zyStyleFabricHandleAdd(planId)" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="zyStyleFabricHandleAdd(stationId)" 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>
<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 @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<zy-plan-accessories-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-plan-accessories-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyPlanAccessoriesModal from './modules/ZyPlanAccessoriesModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyPlanAccessoriesList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanAccessoriesModal
},
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: '辅料',
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/zyPlanAccessories/list",
delete: "/org.jeecg.modules.productplan/zyPlanAccessories/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanAccessories/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanAccessories/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanAccessories/importExcel",
},
dictOptions: {},
superFieldList: [],
loadRouteType: false,
planId: "",
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
jumpPage1(record) {
this.$router.push({
path: 'productplan/ZyPlanAccessoriesDataList',
query: { //
'planId': record.planId,
// 'stationName': record.stationName,
},
});
},
fanHui() {
this.$router.push({
//
path: '/src/views/productplan/ZyPlanAccessoriesList',
});
},
valueChange(value) {
if (value) this.loadData()
},
//
loadParameter() {
if (this.loadRouteType === false) {
this.planId = this.$route.query.planId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planId:" + this.planId)
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.planId = this.planId;
return filterObj(param);
},
// initDictConfig() {
// },
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'accessoriesId', text: '辅料id', dictCode: ''})
fieldList.push({type: 'BigDecimal', value: 'amount', text: '用量(合计)', dictCode: ''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,197 @@
<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">
<!-- <template slot="htmlSlot" slot-scope="text">-->
<!-- <div v-html="text"></div>-->
<!-- </template>-->
<!-- <template slot="imgSlot" slot-scope="text">-->
<!-- <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>-->
<!-- <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>-->
<!-- </template>-->
<!-- <template slot="fileSlot" slot-scope="text">-->
<!-- <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>-->
<!-- <a-button-->
<!-- v-else-->
<!-- :ghost="true"-->
<!-- type="primary"-->
<!-- icon="download"-->
<!-- size="small"-->
<!-- @click="downloadFile(text)">-->
<!-- 下载-->
<!-- </a-button>-->
<!-- </template>-->
<!-- <span slot="action" slot-scope="text, record">-->
<!-- <a @click="handleEdit(record)">编辑</a>-->
<!-- <a-divider type="vertical" />-->
<!-- <a-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 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-accessories-modal2 ref="modalForm" @ok="modalFormOk"></zy-plan-accessories-modal2>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyPlanAccessoriesModal2 from './modules/ZyPlanAccessoriesModal2'
export default {
name: 'ZyPlanAccessoriesList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ZyPlanAccessoriesModal2
},
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:'辅料',
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/zyPlanAccessories/list",
delete: "/org.jeecg.modules.productplan/zyPlanAccessories/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanAccessories/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanAccessories/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanAccessories/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
jumpPage1(record) {
this.$router.push({
path: '/productplan/ZyPlanAccessoriesDataList',
query: { //
'planId': record.planId,
// 'stationName': record.stationName,
},
});
},
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'accessoriesId',text:'辅料id',dictCode:''})
fieldList.push({type:'BigDecimal',value:'amount',text:'用量(合计)',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,122 @@
<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="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: 'ZyPlanAccessoriesForm',
components: {},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {
planId: ''
},
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/zyPlanAccessories/add",
edit: "/org.jeecg.modules.productplan/zyPlanAccessories/edit",
queryById: "/org.jeecg.modules.productplan/zyPlanAccessories/queryById"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add(planId) {
this.model.planId = planId;
console.log("Modal层接收到上级参数-planId:" + this.model.planId);
this.edit(this.model);
},
// 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) => {
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,108 @@
<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-search-select-tag type="list" v-model="model.planId" dictCode="zy_product_plan,id,id"-->
<!-- placeholder="请选择生产计划"/>-->
<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: 'ZyPlanAccessoriesForm',
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: {
},
url: {
add: "/org.jeecg.modules.productplan/zyPlanAccessories/add",
edit: "/org.jeecg.modules.productplan/zyPlanAccessories/edit",
queryById: "/org.jeecg.modules.productplan/zyPlanAccessories/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.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,70 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<zy-plan-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-accessories-form>
</j-modal>
</template>
<script>
import ZyPlanAccessoriesForm from './ZyPlanAccessoriesForm'
export default {
name: 'ZyPlanAccessoriesModal',
components: {
ZyPlanAccessoriesForm
},
data () {
return {
model:{
planId:'',
},
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (id) {
this.model.planId=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-accessories-form2 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-accessories-form2>
</j-modal>
</template>
<script>
import ZyPlanAccessoriesForm2 from './ZyPlanAccessoriesForm2'
export default {
name: 'ZyPlanAccessoriesModal',
components: {
ZyPlanAccessoriesForm2
},
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-accessories-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-plan-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 ZyPlanAccessoriesForm from './ZyPlanAccessoriesForm'
export default {
name: 'ZyPlanAccessoriesModal',
components: {
ZyPlanAccessoriesForm
},
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,152 @@
package org.jeecg.modules.productplan.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.productplan.entity.ZyPlanAccessories;
import org.jeecg.modules.productplan.service.IZyPlanAccessoriesService;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* @Description: 计划辅料表
* @Author: jeecg-boot
* @Date: 2022-12-21
* @Version: V1.0
*/
@Api(tags = "计划辅料表")
@RestController
@RequestMapping("/org.jeecg.modules.productplan/zyPlanAccessories")
@Slf4j
public class ZyPlanAccessoriesController extends JeecgController<ZyPlanAccessories, IZyPlanAccessoriesService> {
@Autowired
private IZyPlanAccessoriesService zyPlanAccessoriesService;
/**
* 分页列表查询
*
* @param zyPlanAccessories
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "计划辅料表-分页列表查询")
@ApiOperation(value = "计划辅料表-分页列表查询", notes = "计划辅料表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyPlanAccessories zyPlanAccessories, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<ZyPlanAccessories> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanAccessories, req.getParameterMap());
Page<ZyPlanAccessories> page = new Page<ZyPlanAccessories>(pageNo, pageSize);
IPage<ZyPlanAccessories> pageList = zyPlanAccessoriesService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyPlanAccessories
* @return
*/
@AutoLog(value = "计划辅料表-添加")
@ApiOperation(value = "计划辅料表-添加", notes = "计划辅料表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyPlanAccessories zyPlanAccessories) {
zyPlanAccessoriesService.save(zyPlanAccessories);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyPlanAccessories
* @return
*/
@AutoLog(value = "计划辅料表-编辑")
@ApiOperation(value = "计划辅料表-编辑", notes = "计划辅料表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyPlanAccessories zyPlanAccessories) {
zyPlanAccessoriesService.updateById(zyPlanAccessories);
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) {
zyPlanAccessoriesService.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.zyPlanAccessoriesService.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) {
ZyPlanAccessories zyPlanAccessories = zyPlanAccessoriesService.getById(id);
if (zyPlanAccessories == null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyPlanAccessories);
}
/**
* 导出excel
*
* @param request
* @param zyPlanAccessories
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyPlanAccessories zyPlanAccessories) {
return super.exportXls(request, zyPlanAccessories, ZyPlanAccessories.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, ZyPlanAccessories.class);
}
}

@ -0,0 +1,84 @@
package org.jeecg.modules.productplan.entity;
import com.baomidou.mybatisplus.annotation.IdType;
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: 2022-12-21
* @Version: V1.0
*/
@Data
@TableName("zy_plan_accessories")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "zy_plan_accessories对象", description = "计划辅料表")
public class ZyPlanAccessories 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 planId;
/**
* 辅料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;
}

@ -0,0 +1,15 @@
package org.jeecg.modules.productplan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.productplan.entity.ZyPlanAccessories;
/**
* @Description: 计划辅料表
* @Author: jeecg-boot
* @Date: 2022-12-21
* @Version: V1.0
*/
public interface ZyPlanAccessoriesMapper extends BaseMapper<ZyPlanAccessories> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.productplan.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.ZyPlanAccessories;
/**
* @Description: 计划辅料表
* @Author: jeecg-boot
* @Date: 2022-12-21
* @Version: V1.0
*/
public interface IZyPlanAccessoriesService extends IService<ZyPlanAccessories> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.productplan.service.impl;
import org.jeecg.modules.productplan.entity.ZyPlanAccessories;
import org.jeecg.modules.productplan.mapper.ZyPlanAccessoriesMapper;
import org.jeecg.modules.productplan.service.IZyPlanAccessoriesService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 计划辅料表
* @Author: jeecg-boot
* @Date: 2022-12-21
* @Version: V1.0
*/
@Service
public class ZyPlanAccessoriesServiceImpl extends ServiceImpl<ZyPlanAccessoriesMapper, ZyPlanAccessories> implements IZyPlanAccessoriesService {
}
Loading…
Cancel
Save