Commit b3f219c67177da1df90f697f4b1c00a77034bcb3
1 parent
90aa8b88
策略列表
Showing
11 changed files
with
787 additions
and
5 deletions
ant-design-vue-jeecg/src/views/system/config/StrategyList.vue
0 → 100644
1 | +<template> | |
2 | + <a-card :bordered="false"> | |
3 | + <!-- 查询区域 --> | |
4 | + <div class="table-page-search-wrapper"> | |
5 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | |
6 | + <a-row :gutter="24"> | |
7 | + </a-row> | |
8 | + </a-form> | |
9 | + </div> | |
10 | + <!-- 查询区域-END --> | |
11 | + | |
12 | + <!-- 操作按钮区域 --> | |
13 | + <div class="table-operator"> | |
14 | + <a-button v-has="'strategy:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> | |
15 | + <a-button v-has="'strategy:export'" type="primary" icon="download" @click="handleExportXls('策略列表')">导出</a-button> | |
16 | + <a-upload v-has="'strategy:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |
17 | + <a-button type="primary" icon="import">导入</a-button> | |
18 | + </a-upload> | |
19 | + <!-- 高级查询区域 --> | |
20 | + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |
21 | + <a-dropdown v-if="selectedRowKeys.length > 0"> | |
22 | + <a-menu slot="overlay" v-has="'strategy:deleteBatch'" > | |
23 | + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |
24 | + </a-menu> | |
25 | + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |
26 | + </a-dropdown> | |
27 | + </div> | |
28 | + | |
29 | + <!-- table区域-begin --> | |
30 | + <div> | |
31 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
32 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |
33 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
34 | + </div> | |
35 | + | |
36 | + <a-table | |
37 | + ref="table" | |
38 | + size="middle" | |
39 | + :scroll="{x:true}" | |
40 | + bordered | |
41 | + rowKey="id" | |
42 | + :columns="columns" | |
43 | + :dataSource="dataSource" | |
44 | + :pagination="ipagination" | |
45 | + :loading="loading" | |
46 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |
47 | + class="j-table-force-nowrap" | |
48 | + @change="handleTableChange"> | |
49 | + | |
50 | + <template slot="htmlSlot" slot-scope="text"> | |
51 | + <div v-html="text"></div> | |
52 | + </template> | |
53 | + <template slot="imgSlot" slot-scope="text"> | |
54 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
55 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
56 | + </template> | |
57 | + <template slot="fileSlot" slot-scope="text"> | |
58 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
59 | + <a-button | |
60 | + v-else | |
61 | + :ghost="true" | |
62 | + type="primary" | |
63 | + icon="download" | |
64 | + size="small" | |
65 | + @click="downloadFile(text)"> | |
66 | + 下载 | |
67 | + </a-button> | |
68 | + </template> | |
69 | + | |
70 | + <span slot="action" slot-scope="text, record"> | |
71 | + <a v-has="'strategy:edit'" @click="handleEdit(record)">编辑</a> | |
72 | + | |
73 | + <a-divider type="vertical" /> | |
74 | + <a-dropdown> | |
75 | + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |
76 | + <a-menu slot="overlay"> | |
77 | + <a-menu-item> | |
78 | + <a @click="handleDetail(record)">详情</a> | |
79 | + </a-menu-item> | |
80 | + <a-menu-item v-has="'strategy:delete'"> | |
81 | + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
82 | + <a>删除</a> | |
83 | + </a-popconfirm> | |
84 | + </a-menu-item> | |
85 | + </a-menu> | |
86 | + </a-dropdown> | |
87 | + </span> | |
88 | + | |
89 | + </a-table> | |
90 | + </div> | |
91 | + | |
92 | + <strategy-modal ref="modalForm" @ok="modalFormOk"></strategy-modal> | |
93 | + </a-card> | |
94 | +</template> | |
95 | + | |
96 | +<script> | |
97 | + | |
98 | + import '@/assets/less/TableExpand.less' | |
99 | + import { mixinDevice } from '@/utils/mixin' | |
100 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
101 | + import StrategyModal from './modules/StrategyModal' | |
102 | + import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |
103 | + | |
104 | + export default { | |
105 | + name: 'StrategyList', | |
106 | + mixins:[JeecgListMixin, mixinDevice], | |
107 | + components: { | |
108 | + StrategyModal | |
109 | + }, | |
110 | + data () { | |
111 | + return { | |
112 | + description: '策略列表管理页面', | |
113 | + // 表头 | |
114 | + columns: [ | |
115 | + { | |
116 | + title: '#', | |
117 | + dataIndex: '', | |
118 | + key:'rowIndex', | |
119 | + width:60, | |
120 | + align:"center", | |
121 | + customRender:function (t,r,index) { | |
122 | + return parseInt(index)+1; | |
123 | + } | |
124 | + }, | |
125 | + { | |
126 | + title:'策略名称', | |
127 | + align:"center", | |
128 | + dataIndex: 'name' | |
129 | + }, | |
130 | + { | |
131 | + title:'参数键名', | |
132 | + align:"center", | |
133 | + dataIndex: 'code' | |
134 | + }, | |
135 | + { | |
136 | + title:'策略类别', | |
137 | + align:"center", | |
138 | + dataIndex: 'type_dictText' | |
139 | + }, | |
140 | + { | |
141 | + title:'是否启用', | |
142 | + align:"center", | |
143 | + dataIndex: 'enabled_dictText' | |
144 | + }, | |
145 | + { | |
146 | + title:'备注', | |
147 | + align:"left", | |
148 | + dataIndex: 'remark' | |
149 | + }, | |
150 | + { | |
151 | + title: '操作', | |
152 | + dataIndex: 'action', | |
153 | + align:"center", | |
154 | + fixed:"right", | |
155 | + width:147, | |
156 | + scopedSlots: { customRender: 'action' } | |
157 | + } | |
158 | + ], | |
159 | + url: { | |
160 | + list: "/config/strategy/list", | |
161 | + delete: "/config/strategy/delete", | |
162 | + deleteBatch: "/config/strategy/deleteBatch", | |
163 | + exportXlsUrl: "/config/strategy/exportXls", | |
164 | + importExcelUrl: "/config/strategy/importExcel", | |
165 | + | |
166 | + }, | |
167 | + dictOptions:{}, | |
168 | + superFieldList:[], | |
169 | + } | |
170 | + }, | |
171 | + created() { | |
172 | + this.getSuperFieldList(); | |
173 | + }, | |
174 | + computed: { | |
175 | + importExcelUrl: function(){ | |
176 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
177 | + }, | |
178 | + }, | |
179 | + methods: { | |
180 | + initDictConfig(){ | |
181 | + }, | |
182 | + getSuperFieldList(){ | |
183 | + let fieldList=[]; | |
184 | + fieldList.push({type:'string',value:'name',text:'策略名称',dictCode:''}) | |
185 | + fieldList.push({type:'string',value:'code',text:'参数键名',dictCode:''}) | |
186 | + fieldList.push({type:'string',value:'type',text:'策略类别',dictCode:'strategyType'}) | |
187 | + fieldList.push({type:'string',value:'enabled',text:'是否启用',dictCode:'is_or_not'}) | |
188 | + fieldList.push({type:'Text',value:'remark',text:'备注',dictCode:''}) | |
189 | + this.superFieldList = fieldList | |
190 | + } | |
191 | + } | |
192 | + } | |
193 | +</script> | |
194 | +<style scoped> | |
195 | + @import '~@assets/less/common.less'; | |
196 | +</style> | |
0 | 197 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/StrategyForm.vue
0 → 100644
1 | +<template> | |
2 | + <a-spin :spinning='confirmLoading'> | |
3 | + <j-form-container :disabled='formDisabled'> | |
4 | + <a-form-model ref='form' :model='model' :rules='validatorRules' slot='detail'> | |
5 | + <a-row> | |
6 | + <a-col :span='24'> | |
7 | + <a-form-model-item label='策略名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='name'> | |
8 | + <a-input v-model='model.name' placeholder='请输入策略名称'></a-input> | |
9 | + </a-form-model-item> | |
10 | + </a-col> | |
11 | + <a-col :span='24'> | |
12 | + <a-form-model-item label='参数键名' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='code'> | |
13 | + <a-input v-model='model.code' placeholder='请输入参数键名'></a-input> | |
14 | + </a-form-model-item> | |
15 | + </a-col> | |
16 | + <a-col :span='24'> | |
17 | + <a-form-model-item label='策略类别' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='type'> | |
18 | + <j-dict-select-tag type='list' v-model='model.type' dictCode='strategyType' | |
19 | + placeholder='请选择策略类别' /> | |
20 | + </a-form-model-item> | |
21 | + </a-col> | |
22 | + <a-col :span='24'> | |
23 | + <a-form-model-item label='是否启用' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='enabled'> | |
24 | + <j-dict-select-tag type='radio' v-model='model.enabled' dictCode='is_or_not' | |
25 | + placeholder='请选择是否启用' /> | |
26 | + </a-form-model-item> | |
27 | + </a-col> | |
28 | + <a-col :span='24'> | |
29 | + <a-form-model-item label='备注' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'> | |
30 | + <a-textarea v-model='model.remark' rows='4' placeholder='请输入备注' /> | |
31 | + </a-form-model-item> | |
32 | + </a-col> | |
33 | + </a-row> | |
34 | + </a-form-model> | |
35 | + </j-form-container> | |
36 | + </a-spin> | |
37 | +</template> | |
38 | + | |
39 | +<script> | |
40 | + | |
41 | +import { httpAction, getAction } from '@/api/manage' | |
42 | +import { validateDuplicateValue } from '@/utils/util' | |
43 | + | |
44 | +export default { | |
45 | + name: 'StrategyForm', | |
46 | + components: {}, | |
47 | + props: { | |
48 | + //表单禁用 | |
49 | + disabled: { | |
50 | + type: Boolean, | |
51 | + default: false, | |
52 | + required: false | |
53 | + } | |
54 | + }, | |
55 | + data() { | |
56 | + return { | |
57 | + model: {}, | |
58 | + labelCol: { | |
59 | + xs: { span: 24 }, | |
60 | + sm: { span: 5 } | |
61 | + }, | |
62 | + wrapperCol: { | |
63 | + xs: { span: 24 }, | |
64 | + sm: { span: 16 } | |
65 | + }, | |
66 | + confirmLoading: false, | |
67 | + validatorRules: { | |
68 | + name: [ | |
69 | + { required: true, message: '请输入策略名称!' } | |
70 | + ], | |
71 | + code: [ | |
72 | + { required: true, message: '请输入参数键名!' } | |
73 | + ], | |
74 | + type: [ | |
75 | + { required: true, message: '请选择策略类别!' } | |
76 | + ], | |
77 | + enabled: [ | |
78 | + { required: true, message: '请输入是否启用!' } | |
79 | + ] | |
80 | + }, | |
81 | + url: { | |
82 | + add: '/config/strategy/add', | |
83 | + edit: '/config/strategy/edit', | |
84 | + queryById: '/config/strategy/queryById' | |
85 | + } | |
86 | + } | |
87 | + }, | |
88 | + computed: { | |
89 | + formDisabled() { | |
90 | + return this.disabled | |
91 | + } | |
92 | + }, | |
93 | + created() { | |
94 | + //备份model原始值 | |
95 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)) | |
96 | + }, | |
97 | + methods: { | |
98 | + add() { | |
99 | + this.edit(this.modelDefault) | |
100 | + }, | |
101 | + edit(record) { | |
102 | + this.model = Object.assign({}, record) | |
103 | + this.visible = true | |
104 | + }, | |
105 | + submitForm() { | |
106 | + const that = this | |
107 | + // 触发表单验证 | |
108 | + this.$refs.form.validate(valid => { | |
109 | + if (valid) { | |
110 | + that.confirmLoading = true | |
111 | + let httpurl = '' | |
112 | + let method = '' | |
113 | + if (!this.model.id) { | |
114 | + httpurl += this.url.add | |
115 | + method = 'post' | |
116 | + } else { | |
117 | + httpurl += this.url.edit | |
118 | + method = 'put' | |
119 | + } | |
120 | + httpAction(httpurl, this.model, method).then((res) => { | |
121 | + if (res.success) { | |
122 | + that.$message.success(res.message) | |
123 | + that.$emit('ok') | |
124 | + } else { | |
125 | + that.$message.warning(res.message) | |
126 | + } | |
127 | + }).finally(() => { | |
128 | + that.confirmLoading = false | |
129 | + }) | |
130 | + } | |
131 | + | |
132 | + }) | |
133 | + } | |
134 | + } | |
135 | +} | |
136 | +</script> | |
0 | 137 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/StrategyModal.Style#Drawer.vue
0 → 100644
1 | +<template> | |
2 | + <a-drawer | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + placement="right" | |
6 | + :closable="false" | |
7 | + @close="close" | |
8 | + destroyOnClose | |
9 | + :visible="visible"> | |
10 | + <strategy-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></strategy-form> | |
11 | + <div class="drawer-footer"> | |
12 | + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |
13 | + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |
14 | + </div> | |
15 | + </a-drawer> | |
16 | +</template> | |
17 | + | |
18 | +<script> | |
19 | + | |
20 | + import StrategyForm from './StrategyForm' | |
21 | + | |
22 | + export default { | |
23 | + name: 'StrategyModal', | |
24 | + components: { | |
25 | + StrategyForm | |
26 | + }, | |
27 | + data () { | |
28 | + return { | |
29 | + title:"操作", | |
30 | + width:800, | |
31 | + visible: false, | |
32 | + disableSubmit: false | |
33 | + } | |
34 | + }, | |
35 | + methods: { | |
36 | + add () { | |
37 | + this.visible=true | |
38 | + this.$nextTick(()=>{ | |
39 | + this.$refs.realForm.add(); | |
40 | + }) | |
41 | + }, | |
42 | + edit (record) { | |
43 | + this.visible=true | |
44 | + this.$nextTick(()=>{ | |
45 | + this.$refs.realForm.edit(record); | |
46 | + }); | |
47 | + }, | |
48 | + close () { | |
49 | + this.$emit('close'); | |
50 | + this.visible = false; | |
51 | + }, | |
52 | + submitCallback(){ | |
53 | + this.$emit('ok'); | |
54 | + this.visible = false; | |
55 | + }, | |
56 | + handleOk () { | |
57 | + this.$refs.realForm.submitForm(); | |
58 | + }, | |
59 | + handleCancel () { | |
60 | + this.close() | |
61 | + } | |
62 | + } | |
63 | + } | |
64 | +</script> | |
65 | + | |
66 | +<style lang="less" scoped> | |
67 | +/** Button按钮间距 */ | |
68 | + .ant-btn { | |
69 | + margin-left: 30px; | |
70 | + margin-bottom: 30px; | |
71 | + float: right; | |
72 | + } | |
73 | + .drawer-footer{ | |
74 | + position: absolute; | |
75 | + bottom: -8px; | |
76 | + width: 100%; | |
77 | + border-top: 1px solid #e8e8e8; | |
78 | + padding: 10px 16px; | |
79 | + text-align: right; | |
80 | + left: 0; | |
81 | + background: #fff; | |
82 | + border-radius: 0 0 2px 2px; | |
83 | + } | |
84 | +</style> | |
0 | 85 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/StrategyModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + switchFullscreen | |
7 | + @ok="handleOk" | |
8 | + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <strategy-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></strategy-form> | |
12 | + </j-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | + | |
17 | + import StrategyForm from './StrategyForm' | |
18 | + export default { | |
19 | + name: 'StrategyModal', | |
20 | + components: { | |
21 | + StrategyForm | |
22 | + }, | |
23 | + data () { | |
24 | + return { | |
25 | + title:'', | |
26 | + width:800, | |
27 | + visible: false, | |
28 | + disableSubmit: false | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + add () { | |
33 | + this.visible=true | |
34 | + this.$nextTick(()=>{ | |
35 | + this.$refs.realForm.add(); | |
36 | + }) | |
37 | + }, | |
38 | + edit (record) { | |
39 | + this.visible=true | |
40 | + this.$nextTick(()=>{ | |
41 | + this.$refs.realForm.edit(record); | |
42 | + }) | |
43 | + }, | |
44 | + close () { | |
45 | + this.$emit('close'); | |
46 | + this.visible = false; | |
47 | + }, | |
48 | + handleOk () { | |
49 | + this.$refs.realForm.submitForm(); | |
50 | + }, | |
51 | + submitCallback(){ | |
52 | + this.$emit('ok'); | |
53 | + this.visible = false; | |
54 | + }, | |
55 | + handleCancel () { | |
56 | + this.close() | |
57 | + } | |
58 | + } | |
59 | + } | |
60 | +</script> | |
0 | 61 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue
... | ... | @@ -73,11 +73,11 @@ |
73 | 73 | <!-- 操作按钮区域 --> |
74 | 74 | <div class="table-operator"> |
75 | 75 | <a-button v-has="'apiLog:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
76 | - <a-button type="primary" icon="download" @click="handleExportXls('接口日志')">导出</a-button> | |
77 | - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" | |
78 | - @change="handleImportExcel"> | |
79 | - <a-button type="primary" icon="import">导入</a-button> | |
80 | - </a-upload> | |
76 | + <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')">导出</a-button> | |
77 | +<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"--> | |
78 | +<!-- @change="handleImportExcel">--> | |
79 | +<!-- <a-button type="primary" icon="import">导入</a-button>--> | |
80 | +<!-- </a-upload>--> | |
81 | 81 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
82 | 82 | <a-menu slot="overlay" v-has="'apiLog:deleteBatch'"> |
83 | 83 | <a-menu-item key="1" @click="batchDel"> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/strategy/controller/StrategyController.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.strategy.controller; | |
2 | + | |
3 | +import java.util.Arrays; | |
4 | +import java.util.List; | |
5 | +import java.util.Map; | |
6 | +import java.util.stream.Collectors; | |
7 | +import java.io.IOException; | |
8 | +import java.io.UnsupportedEncodingException; | |
9 | +import java.net.URLDecoder; | |
10 | +import javax.servlet.http.HttpServletRequest; | |
11 | +import javax.servlet.http.HttpServletResponse; | |
12 | + | |
13 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | |
14 | +import org.jeecg.common.api.vo.Result; | |
15 | +import org.jeecg.common.system.query.QueryGenerator; | |
16 | +import org.jeecg.common.util.oConvertUtils; | |
17 | +import org.jeecg.modules.wms.config.strategy.entity.Strategy; | |
18 | +import org.jeecg.modules.wms.config.strategy.service.IStrategyService; | |
19 | + | |
20 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
21 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
22 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
23 | +import lombok.extern.slf4j.Slf4j; | |
24 | + | |
25 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | |
26 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |
27 | +import org.jeecgframework.poi.excel.entity.ExportParams; | |
28 | +import org.jeecgframework.poi.excel.entity.ImportParams; | |
29 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |
30 | +import org.jeecg.common.system.base.controller.JeecgController; | |
31 | +import org.springframework.beans.factory.annotation.Autowired; | |
32 | +import org.springframework.web.bind.annotation.*; | |
33 | +import org.springframework.web.multipart.MultipartFile; | |
34 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | |
35 | +import org.springframework.web.servlet.ModelAndView; | |
36 | +import com.alibaba.fastjson.JSON; | |
37 | +import io.swagger.annotations.Api; | |
38 | +import io.swagger.annotations.ApiOperation; | |
39 | +import org.jeecg.common.aspect.annotation.AutoLog; | |
40 | + | |
41 | + /** | |
42 | + * @Description: 策略列表 | |
43 | + * @Author: jeecg-boot | |
44 | + * @Date: 2023-03-17 | |
45 | + * @Version: V1.0 | |
46 | + */ | |
47 | +@Api(tags="策略列表") | |
48 | +@RestController | |
49 | +@RequestMapping("/config/strategy") | |
50 | +@Slf4j | |
51 | +public class StrategyController extends JeecgController<Strategy, IStrategyService> { | |
52 | + @Autowired | |
53 | + private IStrategyService strategyService; | |
54 | + | |
55 | + /** | |
56 | + * 分页列表查询 | |
57 | + * | |
58 | + * @param strategy | |
59 | + * @param pageNo | |
60 | + * @param pageSize | |
61 | + * @param req | |
62 | + * @return | |
63 | + */ | |
64 | + //@AutoLog(value = "策略列表-分页列表查询") | |
65 | + @ApiOperation(value="策略列表-分页列表查询", notes="策略列表-分页列表查询") | |
66 | + @GetMapping(value = "/list") | |
67 | + public Result<IPage<Strategy>> queryPageList(Strategy strategy, | |
68 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |
69 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |
70 | + HttpServletRequest req) { | |
71 | + QueryWrapper<Strategy> queryWrapper = QueryGenerator.initQueryWrapper(strategy, req.getParameterMap()); | |
72 | + Page<Strategy> page = new Page<Strategy>(pageNo, pageSize); | |
73 | + IPage<Strategy> pageList = strategyService.page(page, queryWrapper); | |
74 | + return Result.OK(pageList); | |
75 | + } | |
76 | + | |
77 | + /** | |
78 | + * 添加 | |
79 | + * | |
80 | + * @param strategy | |
81 | + * @return | |
82 | + */ | |
83 | + @AutoLog(value = "策略列表-添加") | |
84 | + @ApiOperation(value="策略列表-添加", notes="策略列表-添加") | |
85 | + @RequiresPermissions("strategy:add") | |
86 | + @PostMapping(value = "/add") | |
87 | + public Result<String> add(@RequestBody Strategy strategy) { | |
88 | + strategyService.save(strategy); | |
89 | + return Result.OK("添加成功!"); | |
90 | + } | |
91 | + | |
92 | + /** | |
93 | + * 编辑 | |
94 | + * | |
95 | + * @param strategy | |
96 | + * @return | |
97 | + */ | |
98 | + @AutoLog(value = "策略列表-编辑") | |
99 | + @ApiOperation(value="策略列表-编辑", notes="策略列表-编辑") | |
100 | + @RequiresPermissions("strategy:edit") | |
101 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |
102 | + public Result<String> edit(@RequestBody Strategy strategy) { | |
103 | + strategyService.updateById(strategy); | |
104 | + return Result.OK("编辑成功!"); | |
105 | + } | |
106 | + | |
107 | + /** | |
108 | + * 通过id删除 | |
109 | + * | |
110 | + * @param id | |
111 | + * @return | |
112 | + */ | |
113 | + @AutoLog(value = "策略列表-通过id删除") | |
114 | + @ApiOperation(value="策略列表-通过id删除", notes="策略列表-通过id删除") | |
115 | + @RequiresPermissions("strategy:delete") | |
116 | + @DeleteMapping(value = "/delete") | |
117 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |
118 | + strategyService.removeById(id); | |
119 | + return Result.OK("删除成功!"); | |
120 | + } | |
121 | + | |
122 | + /** | |
123 | + * 批量删除 | |
124 | + * | |
125 | + * @param ids | |
126 | + * @return | |
127 | + */ | |
128 | + @AutoLog(value = "策略列表-批量删除") | |
129 | + @ApiOperation(value="策略列表-批量删除", notes="策略列表-批量删除") | |
130 | + @RequiresPermissions("strategy:deleteBatch") | |
131 | + @DeleteMapping(value = "/deleteBatch") | |
132 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |
133 | + this.strategyService.removeByIds(Arrays.asList(ids.split(","))); | |
134 | + return Result.OK("批量删除成功!"); | |
135 | + } | |
136 | + | |
137 | + /** | |
138 | + * 通过id查询 | |
139 | + * | |
140 | + * @param id | |
141 | + * @return | |
142 | + */ | |
143 | + //@AutoLog(value = "策略列表-通过id查询") | |
144 | + @ApiOperation(value="策略列表-通过id查询", notes="策略列表-通过id查询") | |
145 | + @GetMapping(value = "/queryById") | |
146 | + public Result<Strategy> queryById(@RequestParam(name="id",required=true) String id) { | |
147 | + Strategy strategy = strategyService.getById(id); | |
148 | + if(strategy==null) { | |
149 | + return Result.error("未找到对应数据"); | |
150 | + } | |
151 | + return Result.OK(strategy); | |
152 | + } | |
153 | + | |
154 | + /** | |
155 | + * 导出excel | |
156 | + * | |
157 | + * @param request | |
158 | + * @param strategy | |
159 | + */ | |
160 | + @RequestMapping(value = "/exportXls") | |
161 | + @RequiresPermissions("strategy:export") | |
162 | + public ModelAndView exportXls(HttpServletRequest request, Strategy strategy) { | |
163 | + return super.exportXls(request, strategy, Strategy.class, "策略列表"); | |
164 | + } | |
165 | + | |
166 | + /** | |
167 | + * 通过excel导入数据 | |
168 | + * | |
169 | + * @param request | |
170 | + * @param response | |
171 | + * @return | |
172 | + */ | |
173 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |
174 | + @RequiresPermissions("strategy:import") | |
175 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |
176 | + return super.importExcel(request, response, Strategy.class); | |
177 | + } | |
178 | + | |
179 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/strategy/entity/Strategy.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.strategy.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.io.UnsupportedEncodingException; | |
5 | +import java.util.Date; | |
6 | +import java.math.BigDecimal; | |
7 | +import com.baomidou.mybatisplus.annotation.IdType; | |
8 | +import com.baomidou.mybatisplus.annotation.TableId; | |
9 | +import com.baomidou.mybatisplus.annotation.TableName; | |
10 | +import lombok.Data; | |
11 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
12 | +import org.springframework.format.annotation.DateTimeFormat; | |
13 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
14 | +import org.jeecg.common.aspect.annotation.Dict; | |
15 | +import io.swagger.annotations.ApiModel; | |
16 | +import io.swagger.annotations.ApiModelProperty; | |
17 | +import lombok.EqualsAndHashCode; | |
18 | +import lombok.experimental.Accessors; | |
19 | + | |
20 | +/** | |
21 | + * @Description: 策略列表 | |
22 | + * @Author: jeecg-boot | |
23 | + * @Date: 2023-03-17 | |
24 | + * @Version: V1.0 | |
25 | + */ | |
26 | +@Data | |
27 | +@TableName("strategy") | |
28 | +@Accessors(chain = true) | |
29 | +@EqualsAndHashCode(callSuper = false) | |
30 | +@ApiModel(value="strategy对象", description="策略列表") | |
31 | +public class Strategy implements Serializable { | |
32 | + private static final long serialVersionUID = 1L; | |
33 | + | |
34 | + /**主键*/ | |
35 | + @TableId(type = IdType.ASSIGN_ID) | |
36 | + @ApiModelProperty(value = "主键") | |
37 | + private String id; | |
38 | + /**策略名称*/ | |
39 | + @Excel(name = "策略名称", width = 15) | |
40 | + @ApiModelProperty(value = "策略名称") | |
41 | + private String name; | |
42 | + /**参数键名*/ | |
43 | + @Excel(name = "参数键名", width = 15) | |
44 | + @ApiModelProperty(value = "参数键名") | |
45 | + private String code; | |
46 | + /**策略类别*/ | |
47 | + @Excel(name = "策略类别", width = 15, dicCode = "strategyType") | |
48 | + @Dict(dicCode = "strategyType") | |
49 | + @ApiModelProperty(value = "策略类别") | |
50 | + private String type; | |
51 | + /**是否启用*/ | |
52 | + @Excel(name = "是否启用", width = 15, dicCode = "is_or_not") | |
53 | + @Dict(dicCode = "is_or_not") | |
54 | + @ApiModelProperty(value = "是否启用") | |
55 | + private String enabled; | |
56 | + /**remark*/ | |
57 | + @Excel(name = "remark", width = 15) | |
58 | + @ApiModelProperty(value = "remark") | |
59 | + private String remark; | |
60 | + /**创建人*/ | |
61 | + @ApiModelProperty(value = "创建人") | |
62 | + private String createBy; | |
63 | + /**创建日期*/ | |
64 | + @ApiModelProperty(value = "创建日期") | |
65 | + private Date createTime; | |
66 | + /**更新人*/ | |
67 | + @ApiModelProperty(value = "更新人") | |
68 | + private String updateBy; | |
69 | + /**更新日期*/ | |
70 | + @ApiModelProperty(value = "更新日期") | |
71 | + private Date updateTime; | |
72 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/strategy/mapper/StrategyMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.strategy.mapper; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | +import org.jeecg.modules.wms.config.strategy.entity.Strategy; | |
7 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
8 | + | |
9 | +/** | |
10 | + * @Description: 策略列表 | |
11 | + * @Author: jeecg-boot | |
12 | + * @Date: 2023-03-17 | |
13 | + * @Version: V1.0 | |
14 | + */ | |
15 | +public interface StrategyMapper extends BaseMapper<Strategy> { | |
16 | + | |
17 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/strategy/mapper/xml/StrategyMapper.xml
0 → 100644
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/strategy/service/IStrategyService.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.strategy.service; | |
2 | + | |
3 | +import org.jeecg.modules.wms.config.strategy.entity.Strategy; | |
4 | +import com.baomidou.mybatisplus.extension.service.IService; | |
5 | + | |
6 | +/** | |
7 | + * @Description: 策略列表 | |
8 | + * @Author: jeecg-boot | |
9 | + * @Date: 2023-03-17 | |
10 | + * @Version: V1.0 | |
11 | + */ | |
12 | +public interface IStrategyService extends IService<Strategy> { | |
13 | + | |
14 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/strategy/service/impl/StrategyServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.strategy.service.impl; | |
2 | + | |
3 | +import org.jeecg.modules.wms.config.strategy.entity.Strategy; | |
4 | +import org.jeecg.modules.wms.config.strategy.mapper.StrategyMapper; | |
5 | +import org.jeecg.modules.wms.config.strategy.service.IStrategyService; | |
6 | +import org.springframework.stereotype.Service; | |
7 | + | |
8 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
9 | + | |
10 | +/** | |
11 | + * @Description: 策略列表 | |
12 | + * @Author: jeecg-boot | |
13 | + * @Date: 2023-03-17 | |
14 | + * @Version: V1.0 | |
15 | + */ | |
16 | +@Service | |
17 | +public class StrategyServiceImpl extends ServiceImpl<StrategyMapper, Strategy> implements IStrategyService { | |
18 | + | |
19 | +} | |
... | ... |