Commit f230b3a9ac48895f7e702b1f5d8738993cd79f05
1 parent
c86ef6bb
1. 完善收货接口
2. 开发入库组盘模块
Showing
39 changed files
with
2330 additions
and
85 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -104,6 +104,9 @@ export const getCustomerList = (params)=>getAction('/config/customer/getCustomer |
104 | 104 | export const getSupplierList = (params)=>getAction('/config/supplier/getSupplierList', params); |
105 | 105 | export const getReceiptTypeList = (params)=>getAction('/config/receiptType/getReceiptTypeList', params); |
106 | 106 | export const getShipmentTypeList = (params)=>getAction('/config/shipmentType/getShipmentTypeList', params); |
107 | +export const searchMaterialByCode = (params)=>postAction('/config/material/searchMaterialByCode', params); | |
108 | +export const listReceiveByReceiptId = (params)=>postAction('/receipt/receiveHeader/listReceiveByReceiptId', params); | |
109 | + | |
107 | 110 | |
108 | 111 | // 中转HTTP请求 |
109 | 112 | export const transitRESTful = { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContaienrDetailList.vue
0 → 100644
1 | +<template> | |
2 | + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> | |
3 | + | |
4 | + <!-- 查询区域 --> | |
5 | + <div class="table-page-search-wrapper"> | |
6 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | |
7 | + <a-row :gutter="24"> | |
8 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
9 | + <a-form-item label="货主编码"> | |
10 | + <a-input placeholder="请输入货主编码" v-model="queryParam.companyCode"></a-input> | |
11 | + </a-form-item> | |
12 | + </a-col> | |
13 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
14 | + <a-form-item label="物料编码"> | |
15 | + <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input> | |
16 | + </a-form-item> | |
17 | + </a-col> | |
18 | + <template v-if="toggleSearchStatus"> | |
19 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
20 | + <a-form-item label="物料名称"> | |
21 | + <a-input placeholder="请输入物料名称" v-model="queryParam.materialName"></a-input> | |
22 | + </a-form-item> | |
23 | + </a-col> | |
24 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
25 | + <a-form-item label="库存状态"> | |
26 | + <j-dict-select-tag placeholder="请选择库存状态" v-model="queryParam.inventoryStatus" dictCode="inventory_status"/> | |
27 | + </a-form-item> | |
28 | + </a-col> | |
29 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
30 | + <a-form-item label="批次"> | |
31 | + <a-input placeholder="请输入批次" v-model="queryParam.batch"></a-input> | |
32 | + </a-form-item> | |
33 | + </a-col> | |
34 | + </template> | |
35 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
36 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |
37 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |
38 | + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |
39 | + <a @click="handleToggleSearch" style="margin-left: 8px"> | |
40 | + {{ toggleSearchStatus ? '收起' : '展开' }} | |
41 | + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |
42 | + </a> | |
43 | + </span> | |
44 | + </a-col> | |
45 | + </a-row> | |
46 | + </a-form> | |
47 | + </div> | |
48 | + <!-- 查询区域-END --> | |
49 | + | |
50 | + <!-- 操作按钮区域 --> | |
51 | +<!-- <div class="table-operator" v-if="mainId">--> | |
52 | +<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> | |
53 | +<!-- <a-button type="primary" icon="download" @click="handleExportXls('入库组盘详情')">导出</a-button>--> | |
54 | +<!-- <a-upload--> | |
55 | +<!-- name="file"--> | |
56 | +<!-- :showUploadList="false"--> | |
57 | +<!-- :multiple="false"--> | |
58 | +<!-- :headers="tokenHeader"--> | |
59 | +<!-- :action="importExcelUrl"--> | |
60 | +<!-- @change="handleImportExcel">--> | |
61 | +<!-- <a-button type="primary" icon="import">导入</a-button>--> | |
62 | +<!-- </a-upload>--> | |
63 | +<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> | |
64 | +<!-- <a-menu slot="overlay">--> | |
65 | +<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> | |
66 | +<!-- </a-menu>--> | |
67 | +<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> | |
68 | +<!-- </a-dropdown>--> | |
69 | +<!-- </div>--> | |
70 | + | |
71 | + <!-- table区域-begin --> | |
72 | + <div> | |
73 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
74 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |
75 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
76 | + </div> | |
77 | + | |
78 | + <a-table | |
79 | + ref="table" | |
80 | + size="middle" | |
81 | + bordered | |
82 | + rowKey="id" | |
83 | + :scroll="{x:true}" | |
84 | + :columns="columns" | |
85 | + :dataSource="dataSource" | |
86 | + :pagination="ipagination" | |
87 | + :loading="loading" | |
88 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |
89 | + @change="handleTableChange"> | |
90 | + | |
91 | + <template slot="htmlSlot" slot-scope="text"> | |
92 | + <div v-html="text"></div> | |
93 | + </template> | |
94 | + <template slot="imgSlot" slot-scope="text"> | |
95 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
96 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
97 | + </template> | |
98 | + <template slot="fileSlot" slot-scope="text"> | |
99 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
100 | + <a-button | |
101 | + v-else | |
102 | + :ghost="true" | |
103 | + type="primary" | |
104 | + icon="download" | |
105 | + size="small" | |
106 | + @click="downloadFile(text)"> | |
107 | + 下载 | |
108 | + </a-button> | |
109 | + </template> | |
110 | + | |
111 | + <span slot="action" slot-scope="text, record"> | |
112 | + <a @click="handleEdit(record)">编辑</a> | |
113 | + <a-divider type="vertical" /> | |
114 | + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
115 | + <a>删除</a> | |
116 | + </a-popconfirm> | |
117 | + </span> | |
118 | + | |
119 | + </a-table> | |
120 | + </div> | |
121 | + | |
122 | + <receiptContaienrDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></receiptContaienrDetail-modal> | |
123 | + </a-card> | |
124 | +</template> | |
125 | + | |
126 | +<script> | |
127 | + | |
128 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
129 | + import ReceiptContaienrDetailModal from './modules/ReceiptContaienrDetailModal' | |
130 | + | |
131 | + export default { | |
132 | + name: "ReceiptContaienrDetailList", | |
133 | + mixins:[JeecgListMixin], | |
134 | + components: { ReceiptContaienrDetailModal }, | |
135 | + props:{ | |
136 | + mainId:{ | |
137 | + type:String, | |
138 | + default:'', | |
139 | + required:false | |
140 | + } | |
141 | + }, | |
142 | + watch:{ | |
143 | + mainId:{ | |
144 | + immediate: true, | |
145 | + handler(val) { | |
146 | + if(!this.mainId){ | |
147 | + this.clearList() | |
148 | + }else{ | |
149 | + this.queryParam['receiptContainerId'] = val | |
150 | + this.loadData(1); | |
151 | + } | |
152 | + } | |
153 | + } | |
154 | + }, | |
155 | + data () { | |
156 | + return { | |
157 | + description: '入库组盘管理页面', | |
158 | + disableMixinCreated:true, | |
159 | + // 表头 | |
160 | + columns: [ | |
161 | + { | |
162 | + title: '#', | |
163 | + dataIndex: '', | |
164 | + key:'rowIndex', | |
165 | + width:60, | |
166 | + align:"center", | |
167 | + customRender:function (t,r,index) { | |
168 | + return parseInt(index)+1; | |
169 | + } | |
170 | + }, | |
171 | + { | |
172 | + title:'货主编码', | |
173 | + align:"center", | |
174 | + dataIndex: 'companyCode' | |
175 | + }, | |
176 | + { | |
177 | + title:'物料编码', | |
178 | + align:"center", | |
179 | + dataIndex: 'materialCode' | |
180 | + }, | |
181 | + { | |
182 | + title:'物料名称', | |
183 | + align:"center", | |
184 | + dataIndex: 'materialName' | |
185 | + }, | |
186 | + { | |
187 | + title:'物料规格', | |
188 | + align:"center", | |
189 | + dataIndex: 'materialSpec' | |
190 | + }, | |
191 | + { | |
192 | + title:'物料单位', | |
193 | + align:"center", | |
194 | + dataIndex: 'materialUnit' | |
195 | + }, | |
196 | + { | |
197 | + title:'数量', | |
198 | + align:"center", | |
199 | + dataIndex: 'qty' | |
200 | + }, | |
201 | + { | |
202 | + title:'库存状态', | |
203 | + align:"center", | |
204 | + dataIndex: 'inventoryStatus_dictText', | |
205 | + }, | |
206 | + { | |
207 | + title:'批次', | |
208 | + align:"center", | |
209 | + dataIndex: 'batch' | |
210 | + }, | |
211 | + { | |
212 | + title:'创建人', | |
213 | + align:"center", | |
214 | + dataIndex: 'createBy' | |
215 | + }, | |
216 | + { | |
217 | + title:'创建日期', | |
218 | + align:"center", | |
219 | + dataIndex: 'createTime' | |
220 | + }, | |
221 | + { | |
222 | + title:'更新人', | |
223 | + align:"center", | |
224 | + dataIndex: 'updateBy' | |
225 | + }, | |
226 | + { | |
227 | + title:'更新日期', | |
228 | + align:"center", | |
229 | + dataIndex: 'updateTime' | |
230 | + }, | |
231 | + { | |
232 | + title: '操作', | |
233 | + dataIndex: 'action', | |
234 | + align:"center", | |
235 | + fixed:"right", | |
236 | + width:147, | |
237 | + scopedSlots: { customRender: 'action' }, | |
238 | + } | |
239 | + ], | |
240 | + url: { | |
241 | + list: "/receipt/receiptContainerHeader/listReceiptContaienrDetailByMainId", | |
242 | + delete: "/receipt/receiptContainerHeader/deleteReceiptContaienrDetail", | |
243 | + deleteBatch: "/receipt/receiptContainerHeader/deleteBatchReceiptContaienrDetail", | |
244 | + exportXlsUrl: "/receipt/receiptContainerHeader/exportReceiptContaienrDetail", | |
245 | + importUrl: "/receipt/receiptContainerHeader/importReceiptContaienrDetail", | |
246 | + }, | |
247 | + dictOptions:{ | |
248 | + taskType:[], | |
249 | + status:[], | |
250 | + } | |
251 | + } | |
252 | + }, | |
253 | + created() { | |
254 | + }, | |
255 | + computed: { | |
256 | + importExcelUrl(){ | |
257 | + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; | |
258 | + } | |
259 | + }, | |
260 | + methods: { | |
261 | + clearList(){ | |
262 | + this.dataSource=[] | |
263 | + this.selectedRowKeys=[] | |
264 | + this.ipagination.current = 1 | |
265 | + } | |
266 | + | |
267 | + } | |
268 | + } | |
269 | +</script> | |
270 | +<style scoped> | |
271 | + @import '~@assets/less/common.less' | |
272 | +</style> | |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.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-col :xl="6" :lg="7" :md="8" :sm="24"> | |
8 | + <a-form-item label="容器号"> | |
9 | + <a-input placeholder="请输入容器号" v-model="queryParam.containerCode"></a-input> | |
10 | + </a-form-item> | |
11 | + </a-col> | |
12 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
13 | + <a-form-item label="任务类型"> | |
14 | + <j-dict-select-tag placeholder="请选择任务类型" v-model="queryParam.taskType" dictCode="receipt_task_type"/> | |
15 | + </a-form-item> | |
16 | + </a-col> | |
17 | + <template v-if="toggleSearchStatus"> | |
18 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
19 | + <a-form-item label="状态"> | |
20 | + <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="receipt_container_status"/> | |
21 | + </a-form-item> | |
22 | + </a-col> | |
23 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
24 | + <a-form-item label="起始库位"> | |
25 | + <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> | |
26 | + </a-form-item> | |
27 | + </a-col> | |
28 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
29 | + <a-form-item label="目标库位"> | |
30 | + <a-input placeholder="请输入目标库位" v-model="queryParam.toLocationCode"></a-input> | |
31 | + </a-form-item> | |
32 | + </a-col> | |
33 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
34 | + <a-form-item label="目标出入口"> | |
35 | + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input> | |
36 | + </a-form-item> | |
37 | + </a-col> | |
38 | + <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
39 | + <a-form-item label="创建日期"> | |
40 | + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> | |
41 | + <span class="query-group-split-cust"></span> | |
42 | + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date> | |
43 | + </a-form-item> | |
44 | + </a-col> | |
45 | + </template> | |
46 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
47 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |
48 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |
49 | + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |
50 | + <a @click="handleToggleSearch" style="margin-left: 8px"> | |
51 | + {{ toggleSearchStatus ? '收起' : '展开' }} | |
52 | + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |
53 | + </a> | |
54 | + </span> | |
55 | + </a-col> | |
56 | + </a-row> | |
57 | + </a-form> | |
58 | + </div> | |
59 | + <!-- 查询区域-END --> | |
60 | + | |
61 | + <!-- 操作按钮区域 --> | |
62 | +<!-- <div class="table-operator">--> | |
63 | +<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> | |
64 | +<!-- <a-button type="primary" icon="download" @click="handleExportXls('入库组盘')">导出</a-button>--> | |
65 | +<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> | |
66 | +<!-- <a-button type="primary" icon="import">导入</a-button>--> | |
67 | +<!-- </a-upload>--> | |
68 | +<!-- <!– 高级查询区域 –>--> | |
69 | +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> | |
70 | +<!-- </div>--> | |
71 | + | |
72 | + <!-- table区域-begin --> | |
73 | + <div> | |
74 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
75 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |
76 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
77 | + </div> | |
78 | + | |
79 | + <a-table | |
80 | + ref="table" | |
81 | + size="middle" | |
82 | + bordered | |
83 | + rowKey="id" | |
84 | + class="j-table-force-nowrap" | |
85 | + :scroll="{x:true}" | |
86 | + :columns="columns" | |
87 | + :dataSource="dataSource" | |
88 | + :pagination="ipagination" | |
89 | + :loading="loading" | |
90 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" | |
91 | + :customRow="clickThenSelect" | |
92 | + @change="handleTableChange"> | |
93 | + | |
94 | + <template slot="htmlSlot" slot-scope="text"> | |
95 | + <div v-html="text"></div> | |
96 | + </template> | |
97 | + <template slot="imgSlot" slot-scope="text"> | |
98 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
99 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
100 | + </template> | |
101 | + <template slot="fileSlot" slot-scope="text"> | |
102 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
103 | + <a-button | |
104 | + v-else | |
105 | + :ghost="true" | |
106 | + type="primary" | |
107 | + icon="download" | |
108 | + size="small" | |
109 | + @click="downloadFile(text)"> | |
110 | + 下载 | |
111 | + </a-button> | |
112 | + </template> | |
113 | + | |
114 | + <span slot="action" slot-scope="text, record"> | |
115 | + <a @click="handleEdit(record)">编辑</a> | |
116 | + | |
117 | + <a-divider type="vertical" /> | |
118 | + <a-dropdown> | |
119 | + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |
120 | + <a-menu slot="overlay"> | |
121 | + <a-menu-item> | |
122 | + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
123 | + <a>删除</a> | |
124 | + </a-popconfirm> | |
125 | + </a-menu-item> | |
126 | + </a-menu> | |
127 | + </a-dropdown> | |
128 | + </span> | |
129 | + | |
130 | + </a-table> | |
131 | + </div> | |
132 | + | |
133 | + <a-tabs defaultActiveKey="1"> | |
134 | + <a-tab-pane tab="入库组盘详情" key="1" > | |
135 | + <ReceiptContaienrDetailList :mainId="selectedMainId" /> | |
136 | + </a-tab-pane> | |
137 | + </a-tabs> | |
138 | + | |
139 | + <receiptContainerHeader-modal ref="modalForm" @ok="modalFormOk"></receiptContainerHeader-modal> | |
140 | + </a-card> | |
141 | +</template> | |
142 | + | |
143 | +<script> | |
144 | + | |
145 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
146 | + import ReceiptContainerHeaderModal from './modules/ReceiptContainerHeaderModal' | |
147 | + import { getAction } from '@/api/manage' | |
148 | + import ReceiptContaienrDetailList from './ReceiptContaienrDetailList' | |
149 | + import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |
150 | + import '@/assets/less/TableExpand.less' | |
151 | + | |
152 | + export default { | |
153 | + name: "ReceiptContainerHeaderList", | |
154 | + mixins:[JeecgListMixin], | |
155 | + components: { | |
156 | + ReceiptContaienrDetailList, | |
157 | + ReceiptContainerHeaderModal | |
158 | + }, | |
159 | + data () { | |
160 | + return { | |
161 | + description: '入库组盘管理页面', | |
162 | + // 表头 | |
163 | + columns: [ | |
164 | + { | |
165 | + title:'容器号', | |
166 | + align:"center", | |
167 | + dataIndex: 'containerCode' | |
168 | + }, | |
169 | + { | |
170 | + title:'任务类型', | |
171 | + align:"center", | |
172 | + dataIndex: 'taskType_dictText', | |
173 | + }, | |
174 | + { | |
175 | + title:'状态', | |
176 | + align:"center", | |
177 | + dataIndex: 'status_dictText', | |
178 | + }, | |
179 | + { | |
180 | + title:'起始库位', | |
181 | + align:"center", | |
182 | + dataIndex: 'fromLocationCode' | |
183 | + }, | |
184 | + { | |
185 | + title:'目标库位', | |
186 | + align:"center", | |
187 | + dataIndex: 'toLocationCode' | |
188 | + }, | |
189 | + { | |
190 | + title:'目标出入口', | |
191 | + align:"center", | |
192 | + dataIndex: 'toPort' | |
193 | + }, | |
194 | + { | |
195 | + title:'创建人', | |
196 | + align:"center", | |
197 | + dataIndex: 'createBy' | |
198 | + }, | |
199 | + { | |
200 | + title:'创建日期', | |
201 | + align:"center", | |
202 | + dataIndex: 'createTime' | |
203 | + }, | |
204 | + { | |
205 | + title:'更新人', | |
206 | + align:"center", | |
207 | + dataIndex: 'updateBy' | |
208 | + }, | |
209 | + { | |
210 | + title:'更新日期', | |
211 | + align:"center", | |
212 | + dataIndex: 'updateTime' | |
213 | + }, | |
214 | + { | |
215 | + title: '操作', | |
216 | + dataIndex: 'action', | |
217 | + align:"center", | |
218 | + fixed:"right", | |
219 | + width:147, | |
220 | + scopedSlots: { customRender: 'action' }, | |
221 | + } | |
222 | + ], | |
223 | + url: { | |
224 | + list: "/receipt/receiptContainerHeader/list", | |
225 | + delete: "/receipt/receiptContainerHeader/delete", | |
226 | + deleteBatch: "/receipt/receiptContainerHeader/deleteBatch", | |
227 | + exportXlsUrl: "/receipt/receiptContainerHeader/exportXls", | |
228 | + importExcelUrl: "receipt/receiptContainerHeader/importExcel", | |
229 | + }, | |
230 | + dictOptions:{ | |
231 | + taskType:[], | |
232 | + status:[], | |
233 | + }, | |
234 | + /* 分页参数 */ | |
235 | + ipagination:{ | |
236 | + current: 1, | |
237 | + pageSize: 5, | |
238 | + pageSizeOptions: ['5', '10', '50'], | |
239 | + showTotal: (total, range) => { | |
240 | + return range[0] + "-" + range[1] + " 共" + total + "条" | |
241 | + }, | |
242 | + showQuickJumper: true, | |
243 | + showSizeChanger: true, | |
244 | + total: 0 | |
245 | + }, | |
246 | + selectedMainId:'', | |
247 | + superFieldList:[], | |
248 | + } | |
249 | + }, | |
250 | + created() { | |
251 | + this.getSuperFieldList(); | |
252 | + }, | |
253 | + computed: { | |
254 | + importExcelUrl: function(){ | |
255 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
256 | + } | |
257 | + }, | |
258 | + methods: { | |
259 | + initDictConfig(){ | |
260 | + }, | |
261 | + clickThenSelect(record) { | |
262 | + return { | |
263 | + on: { | |
264 | + click: () => { | |
265 | + this.onSelectChange(record.id.split(","), [record]); | |
266 | + } | |
267 | + } | |
268 | + } | |
269 | + }, | |
270 | + onClearSelected() { | |
271 | + this.selectedRowKeys = []; | |
272 | + this.selectionRows = []; | |
273 | + this.selectedMainId='' | |
274 | + }, | |
275 | + onSelectChange(selectedRowKeys, selectionRows) { | |
276 | + this.selectedMainId=selectedRowKeys[0] | |
277 | + this.selectedRowKeys = selectedRowKeys; | |
278 | + this.selectionRows = selectionRows; | |
279 | + }, | |
280 | + loadData(arg) { | |
281 | + if(!this.url.list){ | |
282 | + this.$message.error("请设置url.list属性!") | |
283 | + return | |
284 | + } | |
285 | + //加载数据 若传入参数1则加载第一页的内容 | |
286 | + if (arg === 1) { | |
287 | + this.ipagination.current = 1; | |
288 | + } | |
289 | + this.onClearSelected() | |
290 | + var params = this.getQueryParams();//查询条件 | |
291 | + this.loading = true; | |
292 | + getAction(this.url.list, params).then((res) => { | |
293 | + if (res.success) { | |
294 | + this.dataSource = res.result.records; | |
295 | + this.ipagination.total = res.result.total; | |
296 | + } | |
297 | + if(res.code===510){ | |
298 | + this.$message.warning(res.message) | |
299 | + } | |
300 | + this.loading = false; | |
301 | + }) | |
302 | + }, | |
303 | + getSuperFieldList(){ | |
304 | + let fieldList=[]; | |
305 | + fieldList.push({type:'string',value:'containerCode',text:'容器号',dictCode:''}) | |
306 | + fieldList.push({type:'int',value:'taskType',text:'任务类型',dictCode:'receipt_task_type'}) | |
307 | + fieldList.push({type:'int',value:'status',text:'状态',dictCode:'receipt_container_status'}) | |
308 | + fieldList.push({type:'string',value:'fromLocationCode',text:'起始库位',dictCode:''}) | |
309 | + fieldList.push({type:'string',value:'toLocationCode',text:'目标库位',dictCode:''}) | |
310 | + fieldList.push({type:'string',value:'toPort',text:'目标出入口',dictCode:''}) | |
311 | + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) | |
312 | + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |
313 | + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''}) | |
314 | + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) | |
315 | + this.superFieldList = fieldList | |
316 | + } | |
317 | + } | |
318 | + } | |
319 | +</script> | |
320 | +<style scoped> | |
321 | + @import '~@assets/less/common.less' | |
322 | +</style> | |
0 | 323 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue
... | ... | @@ -167,16 +167,6 @@ |
167 | 167 | dataIndex: 'status_dictText', |
168 | 168 | }, |
169 | 169 | { |
170 | - title:'上游单号', | |
171 | - align:"center", | |
172 | - dataIndex: 'referCode' | |
173 | - }, | |
174 | - { | |
175 | - title:'上游行号', | |
176 | - align:"center", | |
177 | - dataIndex: 'referLineNum' | |
178 | - }, | |
179 | - { | |
180 | 170 | title:'创建人', |
181 | 171 | align:"center", |
182 | 172 | dataIndex: 'createBy' |
... | ... | @@ -206,11 +196,11 @@ |
206 | 196 | } |
207 | 197 | ], |
208 | 198 | url: { |
209 | - list: "/config/receiptHeader/listReceiptDetailByMainId", | |
210 | - delete: "/config/receiptHeader/deleteReceiptDetail", | |
211 | - deleteBatch: "/config/receiptHeader/deleteBatchReceiptDetail", | |
212 | - exportXlsUrl: "/config/receiptHeader/exportReceiptDetail", | |
213 | - importUrl: "/config/receiptHeader/importReceiptDetail", | |
199 | + list: "/receipt/receiptHeader/listReceiptDetailByMainId", | |
200 | + delete: "/receipt/receiptHeader/deleteReceiptDetail", | |
201 | + deleteBatch: "/receipt/receiptHeader/deleteBatchReceiptDetail", | |
202 | + exportXlsUrl: "/receipt/receiptHeader/exportReceiptDetail", | |
203 | + importUrl: "/receipt/receiptHeader/importReceiptDetail", | |
214 | 204 | }, |
215 | 205 | dictOptions:{ |
216 | 206 | firstStatus:[], |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -162,7 +162,8 @@ |
162 | 162 | |
163 | 163 | <span slot="action" slot-scope="text, record"> |
164 | 164 | <a @click="handleEdit(record)">编辑</a> |
165 | - | |
165 | + <a-divider type="vertical" /> | |
166 | + <a @click="receive(record)">收货</a> | |
166 | 167 | <a-divider type="vertical" /> |
167 | 168 | <a-dropdown> |
168 | 169 | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
... | ... | @@ -186,6 +187,7 @@ |
186 | 187 | </a-tabs> |
187 | 188 | |
188 | 189 | <receiptHeader-modal ref="modalForm" @ok="modalFormOk"></receiptHeader-modal> |
190 | + <receive-modal ref="modalForm2" @ok="modalFormOk"></receive-modal> | |
189 | 191 | </a-card> |
190 | 192 | </template> |
191 | 193 | |
... | ... | @@ -200,12 +202,14 @@ |
200 | 202 | import {getCompanyList} from '@/api/api' |
201 | 203 | import {getReceiptTypeList} from '@/api/api' |
202 | 204 | import {getSupplierList} from '@/api/api' |
205 | + import ReceiveModal from "./modules/ReceiveModal"; | |
203 | 206 | |
204 | 207 | |
205 | 208 | export default { |
206 | 209 | name: "ReceiptHeaderList", |
207 | 210 | mixins:[JeecgListMixin], |
208 | 211 | components: { |
212 | + ReceiveModal, | |
209 | 213 | ReceiptDetailList, |
210 | 214 | ReceiptHeaderModal |
211 | 215 | }, |
... | ... | @@ -303,11 +307,11 @@ |
303 | 307 | } |
304 | 308 | ], |
305 | 309 | url: { |
306 | - list: "/config/receiptHeader/list", | |
307 | - delete: "/config/receiptHeader/delete", | |
308 | - deleteBatch: "/config/receiptHeader/deleteBatch", | |
309 | - exportXlsUrl: "/config/receiptHeader/exportXls", | |
310 | - importExcelUrl: "config/receiptHeader/importExcel", | |
310 | + list: "/receipt/receiptHeader/list", | |
311 | + delete: "/receipt/receiptHeader/delete", | |
312 | + deleteBatch: "/receipt/receiptHeader/deleteBatch", | |
313 | + exportXlsUrl: "/receipt/receiptHeader/exportXls", | |
314 | + importExcelUrl: "receipt/receiptHeader/importExcel", | |
311 | 315 | }, |
312 | 316 | dictOptions:{ |
313 | 317 | firstStatus:[], |
... | ... | @@ -341,6 +345,10 @@ |
341 | 345 | methods: { |
342 | 346 | initDictConfig(){ |
343 | 347 | }, |
348 | + receive(record){ | |
349 | + this.$refs.modalForm2.edit(record); | |
350 | + this.$refs.modalForm2.title = "收货"; | |
351 | + }, | |
344 | 352 | clickThenSelect(record) { |
345 | 353 | return { |
346 | 354 | on: { |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContaienrDetailModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + :confirmLoading="confirmLoading" | |
7 | + switchFullscreen | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :model="model" :rules="validatorRules"> | |
13 | + <a-row> | |
14 | + <a-col :span="24"> | |
15 | + <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode"> | |
16 | + <a-input v-model="model.materialCode"placeholder="请输入物料编码" ></a-input> | |
17 | + </a-form-model-item> | |
18 | + </a-col> | |
19 | + <a-col :span="24"> | |
20 | + <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> | |
21 | + <a-input v-model="model.materialName"placeholder="请输入物料名称" ></a-input> | |
22 | + </a-form-model-item> | |
23 | + </a-col> | |
24 | + <a-col :span="24"> | |
25 | + <a-form-model-item label="物料规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialSpec"> | |
26 | + <a-input v-model="model.materialSpec"placeholder="请输入物料规格" ></a-input> | |
27 | + </a-form-model-item> | |
28 | + </a-col> | |
29 | + <a-col :span="24"> | |
30 | + <a-form-model-item label="物料单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialUnit"> | |
31 | + <a-input v-model="model.materialUnit"placeholder="请输入物料单位" ></a-input> | |
32 | + </a-form-model-item> | |
33 | + </a-col> | |
34 | + <a-col :span="24"> | |
35 | + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty"> | |
36 | + <a-input-number v-model="model.qty"placeholder="请输入数量" style="width: 100%" /> | |
37 | + </a-form-model-item> | |
38 | + </a-col> | |
39 | + <a-col :span="24"> | |
40 | + <a-form-model-item label="库存状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus"> | |
41 | + <j-dict-select-tag type="list" v-model="model.inventoryStatus" dictCode="inventory_status" placeholder="请选择库存状态" /> | |
42 | + </a-form-model-item> | |
43 | + </a-col> | |
44 | + <a-col :span="24"> | |
45 | + <a-form-model-item label="批次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batch"> | |
46 | + <a-input v-model="model.batch"placeholder="请输入批次" ></a-input> | |
47 | + </a-form-model-item> | |
48 | + </a-col> | |
49 | + </a-row> | |
50 | + </a-form-model> | |
51 | + </a-spin> | |
52 | + </j-modal> | |
53 | +</template> | |
54 | + | |
55 | +<script> | |
56 | + | |
57 | + import { httpAction } from '@/api/manage' | |
58 | + import { validateDuplicateValue } from '@/utils/util' | |
59 | + | |
60 | + export default { | |
61 | + name: "ReceiptContaienrDetailModal", | |
62 | + components: { | |
63 | + }, | |
64 | + props:{ | |
65 | + mainId:{ | |
66 | + type:String, | |
67 | + required:false, | |
68 | + default:'' | |
69 | + } | |
70 | + }, | |
71 | + data () { | |
72 | + return { | |
73 | + title:"操作", | |
74 | + width:800, | |
75 | + visible: false, | |
76 | + model:{ | |
77 | + }, | |
78 | + labelCol: { | |
79 | + xs: { span: 24 }, | |
80 | + sm: { span: 5 }, | |
81 | + }, | |
82 | + wrapperCol: { | |
83 | + xs: { span: 24 }, | |
84 | + sm: { span: 16 }, | |
85 | + }, | |
86 | + | |
87 | + confirmLoading: false, | |
88 | + validatorRules: { | |
89 | + }, | |
90 | + url: { | |
91 | + add: "/receipt/receiptContainerHeader/addReceiptContaienrDetail", | |
92 | + edit: "/receipt/receiptContainerHeader/editReceiptContaienrDetail", | |
93 | + } | |
94 | + | |
95 | + } | |
96 | + }, | |
97 | + created () { | |
98 | + //备份model原始值 | |
99 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
100 | + }, | |
101 | + methods: { | |
102 | + add () { | |
103 | + this.edit(this.modelDefault); | |
104 | + }, | |
105 | + edit (record) { | |
106 | + this.model = Object.assign({}, record); | |
107 | + this.visible = true; | |
108 | + }, | |
109 | + close () { | |
110 | + this.$emit('close'); | |
111 | + this.visible = false; | |
112 | + this.$refs.form.clearValidate(); | |
113 | + }, | |
114 | + handleOk () { | |
115 | + const that = this; | |
116 | + // 触发表单验证 | |
117 | + this.$refs.form.validate(valid => { | |
118 | + if (valid) { | |
119 | + that.confirmLoading = true; | |
120 | + let httpurl = ''; | |
121 | + let method = ''; | |
122 | + if(!this.model.id){ | |
123 | + httpurl+=this.url.add; | |
124 | + method = 'post'; | |
125 | + }else{ | |
126 | + httpurl+=this.url.edit; | |
127 | + method = 'put'; | |
128 | + } | |
129 | + this.model['receiptContainerId'] = this.mainId | |
130 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
131 | + if(res.success){ | |
132 | + that.$message.success(res.message); | |
133 | + that.$emit('ok'); | |
134 | + }else{ | |
135 | + that.$message.warning(res.message); | |
136 | + } | |
137 | + }).finally(() => { | |
138 | + that.confirmLoading = false; | |
139 | + that.close(); | |
140 | + }) | |
141 | + }else{ | |
142 | + return false | |
143 | + } | |
144 | + }) | |
145 | + }, | |
146 | + handleCancel () { | |
147 | + this.close() | |
148 | + }, | |
149 | + | |
150 | + | |
151 | + } | |
152 | + } | |
153 | +</script> | |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerHeaderModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + :confirmLoading="confirmLoading" | |
7 | + switchFullscreen | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :model="model" :rules="validatorRules"> | |
13 | + <a-row> | |
14 | + <a-col :span="24"> | |
15 | + <a-form-model-item label="容器号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode"> | |
16 | + <a-input v-model="model.containerCode" placeholder="请输入容器号" ></a-input> | |
17 | + </a-form-model-item> | |
18 | + </a-col> | |
19 | + <a-col :span="24"> | |
20 | + <a-form-model-item label="任务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskType"> | |
21 | + <j-dict-select-tag type="list" v-model="model.taskType" dictCode="receipt_task_type" placeholder="请选择任务类型" /> | |
22 | + </a-form-model-item> | |
23 | + </a-col> | |
24 | + <a-col :span="24"> | |
25 | + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> | |
26 | + <j-dict-select-tag type="list" v-model="model.status" dictCode="receipt_container_status" placeholder="请选择状态" /> | |
27 | + </a-form-model-item> | |
28 | + </a-col> | |
29 | + <a-col :span="24"> | |
30 | + <a-form-model-item label="起始库位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fromLocationCode"> | |
31 | + <a-input v-model="model.fromLocationCode" placeholder="请输入起始库位" ></a-input> | |
32 | + </a-form-model-item> | |
33 | + </a-col> | |
34 | + <a-col :span="24"> | |
35 | + <a-form-model-item label="目标库位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toLocationCode"> | |
36 | + <a-input v-model="model.toLocationCode" placeholder="请输入目标库位" ></a-input> | |
37 | + </a-form-model-item> | |
38 | + </a-col> | |
39 | + <a-col :span="24"> | |
40 | + <a-form-model-item label="目标出入口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toPort"> | |
41 | + <a-input v-model="model.toPort" placeholder="请输入目标出入口" ></a-input> | |
42 | + </a-form-model-item> | |
43 | + </a-col> | |
44 | + </a-row> | |
45 | + </a-form-model> | |
46 | + </a-spin> | |
47 | + </j-modal> | |
48 | +</template> | |
49 | + | |
50 | +<script> | |
51 | + | |
52 | + import { httpAction } from '@/api/manage' | |
53 | + import { validateDuplicateValue } from '@/utils/util' | |
54 | + | |
55 | + export default { | |
56 | + name: "ReceiptContainerHeaderModal", | |
57 | + components: { | |
58 | + }, | |
59 | + data () { | |
60 | + return { | |
61 | + title:"操作", | |
62 | + width:800, | |
63 | + visible: false, | |
64 | + model:{ | |
65 | + }, | |
66 | + labelCol: { | |
67 | + xs: { span: 24 }, | |
68 | + sm: { span: 5 }, | |
69 | + }, | |
70 | + wrapperCol: { | |
71 | + xs: { span: 24 }, | |
72 | + sm: { span: 16 }, | |
73 | + }, | |
74 | + | |
75 | + confirmLoading: false, | |
76 | + validatorRules: { | |
77 | + }, | |
78 | + url: { | |
79 | + add: "/receipt/receiptContainerHeader/add", | |
80 | + edit: "/receipt/receiptContainerHeader/edit", | |
81 | + } | |
82 | + | |
83 | + } | |
84 | + }, | |
85 | + created () { | |
86 | + //备份model原始值 | |
87 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
88 | + }, | |
89 | + methods: { | |
90 | + add () { | |
91 | + this.edit(this.modelDefault); | |
92 | + }, | |
93 | + edit (record) { | |
94 | + this.model = Object.assign({}, record); | |
95 | + this.visible = true; | |
96 | + }, | |
97 | + close () { | |
98 | + this.$emit('close'); | |
99 | + this.visible = false; | |
100 | + this.$refs.form.clearValidate(); | |
101 | + }, | |
102 | + handleOk () { | |
103 | + const that = this; | |
104 | + // 触发表单验证 | |
105 | + this.$refs.form.validate(valid => { | |
106 | + if (valid) { | |
107 | + that.confirmLoading = true; | |
108 | + let httpurl = ''; | |
109 | + let method = ''; | |
110 | + if(!this.model.id){ | |
111 | + httpurl+=this.url.add; | |
112 | + method = 'post'; | |
113 | + }else{ | |
114 | + httpurl+=this.url.edit; | |
115 | + method = 'put'; | |
116 | + } | |
117 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
118 | + if(res.success){ | |
119 | + that.$message.success(res.message); | |
120 | + that.$emit('ok'); | |
121 | + }else{ | |
122 | + that.$message.warning(res.message); | |
123 | + } | |
124 | + }).finally(() => { | |
125 | + that.confirmLoading = false; | |
126 | + that.close(); | |
127 | + }) | |
128 | + }else{ | |
129 | + return false | |
130 | + } | |
131 | + }) | |
132 | + }, | |
133 | + handleCancel () { | |
134 | + this.close() | |
135 | + }, | |
136 | + | |
137 | + | |
138 | + } | |
139 | + } | |
140 | +</script> | |
0 | 141 | \ No newline at end of file |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptDetailModal.vue
... | ... | @@ -11,16 +11,15 @@ |
11 | 11 | <a-spin :spinning="confirmLoading"> |
12 | 12 | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
13 | 13 | <a-row> |
14 | - <a-col :span="24"> | |
15 | - <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode"> | |
16 | - <a-input v-model="model.materialCode"placeholder="请输入物料编码" ></a-input> | |
17 | - </a-form-model-item> | |
18 | - </a-col> | |
19 | - <a-col :span="24"> | |
20 | - <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> | |
21 | - <a-input v-model="model.materialName"placeholder="请输入物料名称" ></a-input> | |
22 | - </a-form-model-item> | |
23 | - </a-col> | |
14 | + <a-form-model-item label="物料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode"> | |
15 | + <j-search-select-tag | |
16 | + v-model="model.materialCode" | |
17 | + :dictOptions="materialList" | |
18 | + :trigger-change="true" | |
19 | + placeholder="请选择物料编码" | |
20 | + @change="searchMaterial"> | |
21 | + </j-search-select-tag> | |
22 | + </a-form-model-item> | |
24 | 23 | <a-col :span="24"> |
25 | 24 | <a-form-model-item label="单据数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty"> |
26 | 25 | <a-input-number v-model="model.qty"placeholder="请输入单据数量" style="width: 100%" /> |
... | ... | @@ -46,6 +45,7 @@ |
46 | 45 | |
47 | 46 | import { httpAction } from '@/api/manage' |
48 | 47 | import { validateDuplicateValue } from '@/utils/util' |
48 | + import {searchMaterialByCode} from '@/api/api' | |
49 | 49 | |
50 | 50 | export default { |
51 | 51 | name: "ReceiptDetailModal", |
... | ... | @@ -63,6 +63,8 @@ |
63 | 63 | title:"操作", |
64 | 64 | width:800, |
65 | 65 | visible: false, |
66 | + materialList:{}, | |
67 | + querySource:{}, | |
66 | 68 | model:{ |
67 | 69 | }, |
68 | 70 | labelCol: { |
... | ... | @@ -73,15 +75,11 @@ |
73 | 75 | xs: { span: 24 }, |
74 | 76 | sm: { span: 16 }, |
75 | 77 | }, |
76 | - | |
77 | 78 | confirmLoading: false, |
78 | 79 | validatorRules: { |
79 | 80 | materialCode: [ |
80 | 81 | { required: true, message: '请输入物料编码!'}, |
81 | 82 | ], |
82 | - materialName: [ | |
83 | - { required: true, message: '请输入物料名称!'}, | |
84 | - ], | |
85 | 83 | qty: [ |
86 | 84 | { required: true, message: '请输入单据数量!'}, |
87 | 85 | ], |
... | ... | @@ -99,6 +97,7 @@ |
99 | 97 | created () { |
100 | 98 | //备份model原始值 |
101 | 99 | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
100 | + this.searchMaterial(); | |
102 | 101 | }, |
103 | 102 | methods: { |
104 | 103 | add () { |
... | ... | @@ -114,6 +113,14 @@ |
114 | 113 | this.visible = false; |
115 | 114 | this.$refs.form.clearValidate(); |
116 | 115 | }, |
116 | + searchMaterial() { | |
117 | + const that = this; | |
118 | + that.querySource.materialCode = that.model.materialCode; | |
119 | + console.log("model.materialCode:" + that.model.materialCode); | |
120 | + searchMaterialByCode(that.querySource).then((res) => { | |
121 | + that.materialList = res.result; | |
122 | + }) | |
123 | + }, | |
117 | 124 | handleOk () { |
118 | 125 | const that = this; |
119 | 126 | // 触发表单验证 |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue
... | ... | @@ -11,7 +11,6 @@ |
11 | 11 | <a-spin :spinning="confirmLoading"> |
12 | 12 | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
13 | 13 | <a-row> |
14 | - | |
15 | 14 | <a-col :span="24"> |
16 | 15 | <a-form-model-item label="货主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="companyCode"> |
17 | 16 | <a-select |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + :confirmLoading="confirmLoading" | |
7 | + switchFullscreen | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :model="model" :rules="validatorRules"> | |
13 | + <a-row> | |
14 | + <a-col :span="24"> | |
15 | + <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode"> | |
16 | + <a-input v-model="model.containerCode"placeholder="请输入容器编码" style="width: 100%" /> | |
17 | + </a-form-model-item> | |
18 | + </a-col> | |
19 | + </a-row> | |
20 | + </a-form-model> | |
21 | + </a-spin> | |
22 | + | |
23 | + <a-table | |
24 | + ref="table" | |
25 | + rowKey="id" | |
26 | + size="middle" | |
27 | + :columns="columns" | |
28 | + :loading="loading" | |
29 | + :dataSource="dataSource" | |
30 | + :pagination="false"> | |
31 | + <span slot="action" slot-scope="text, record"> | |
32 | + <a-input-number | |
33 | + placeholder="" | |
34 | + v-model="record.taskQty" | |
35 | + :value="text" | |
36 | + /> | |
37 | + </span> | |
38 | + </a-table> | |
39 | + </j-modal> | |
40 | +</template> | |
41 | + | |
42 | +<script> | |
43 | + | |
44 | + import { httpAction } from '@/api/manage' | |
45 | + import { validateDuplicateValue } from '@/utils/util' | |
46 | + import {searchMaterialByCode} from '@/api/api' | |
47 | + import {listReceiveByReceiptId} from '@/api/api' | |
48 | + | |
49 | + export default { | |
50 | + name: "ReceiveModal", | |
51 | + components: { | |
52 | + }, | |
53 | + props:{ | |
54 | + mainId:{ | |
55 | + type:String, | |
56 | + required:false, | |
57 | + default:'' | |
58 | + } | |
59 | + }, | |
60 | + data () { | |
61 | + return { | |
62 | + title:"操作", | |
63 | + width:800, | |
64 | + visible: false, | |
65 | + materialList:{}, | |
66 | + querySource:{}, | |
67 | + dataSource:[], | |
68 | + model:{ | |
69 | + }, | |
70 | + labelCol: { | |
71 | + xs: { span: 24 }, | |
72 | + sm: { span: 5 }, | |
73 | + }, | |
74 | + wrapperCol: { | |
75 | + xs: { span: 24 }, | |
76 | + sm: { span: 16 }, | |
77 | + }, | |
78 | + columns:[ | |
79 | + { | |
80 | + title: '物料编码', | |
81 | + dataIndex: 'materialCode', | |
82 | + align: "center", | |
83 | + width: 124, | |
84 | + key: 'materialCode' | |
85 | + }, | |
86 | + { | |
87 | + title: '物料名称', | |
88 | + dataIndex: 'materialName', | |
89 | + width: 96, | |
90 | + key: 'materialName' | |
91 | + }, | |
92 | + { | |
93 | + title: '物料规格', | |
94 | + dataIndex: 'materialSpec', | |
95 | + width: 96, | |
96 | + key: 'materialSpec' | |
97 | + }, | |
98 | + { | |
99 | + title: '库存状态', | |
100 | + dataIndex: 'inventoryStatus', | |
101 | + key: 'inventoryStatus', | |
102 | + width: 96, | |
103 | + }, | |
104 | + { | |
105 | + title: '批次', | |
106 | + dataIndex: 'batch', | |
107 | + key: 'batch' | |
108 | + }, | |
109 | + { | |
110 | + title: '可收数量', | |
111 | + dataIndex: 'qty', | |
112 | + width: 80, | |
113 | + key: 'qty' | |
114 | + }, | |
115 | + { | |
116 | + title: '收货数量', | |
117 | + dataIndex: 'action', | |
118 | + scopedSlots: { customRender: 'action' }, | |
119 | + } | |
120 | + ], | |
121 | + confirmLoading: false, | |
122 | + validatorRules: { | |
123 | + containerCode: [ | |
124 | + { required: true, message: '请输入容器编码!'}, | |
125 | + ], | |
126 | + }, | |
127 | + url: { | |
128 | + add: "/receipt/receiveHeader/receiving", | |
129 | + edit: "/receipt/receiptHeader/editReceiptDetail", | |
130 | + } | |
131 | + | |
132 | + } | |
133 | + }, | |
134 | + created () { | |
135 | + //备份model原始值 | |
136 | + console.log("created"); | |
137 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
138 | + this.searchReceive(); | |
139 | + }, | |
140 | + methods: { | |
141 | + add () { | |
142 | + console.log("add 1"); | |
143 | + this.edit(this.modelDefault); | |
144 | + this.model.inventoryStatus = "good"; | |
145 | + }, | |
146 | + edit (record) { | |
147 | + console.log("edit 1"); | |
148 | + this.model = Object.assign({}, record); | |
149 | + this.visible = true; | |
150 | + this.searchReceive(); | |
151 | + }, | |
152 | + show(record){ | |
153 | + this.model = Object.assign({}, record); | |
154 | + this.visible = true; | |
155 | + }, | |
156 | + close () { | |
157 | + this.$emit('close'); | |
158 | + this.visible = false; | |
159 | + this.$refs.form.clearValidate(); | |
160 | + }, | |
161 | + loadData() { | |
162 | + this.searchReceive(); | |
163 | + }, | |
164 | + searchReceive() { | |
165 | + const that = this; | |
166 | + that.querySource.receiptCode = that.model.code; | |
167 | + listReceiveByReceiptId(that.querySource).then((res) => { | |
168 | + that.dataSource = res.result; | |
169 | + }) | |
170 | + }, | |
171 | + handleOk () { | |
172 | + console.log("handleOk"); | |
173 | + const that = this; | |
174 | + // 触发表单验证 | |
175 | + this.$refs.form.validate(valid => { | |
176 | + if (valid) { | |
177 | + that.confirmLoading = true; | |
178 | + let httpurl = ''; | |
179 | + let method = ''; | |
180 | + httpurl+=this.url.add; | |
181 | + method = 'post'; | |
182 | + this.dataSource[0].containerCode = this.model.containerCode; | |
183 | + httpAction(httpurl,this.dataSource, method).then((res)=>{ | |
184 | + if(res.success){ | |
185 | + that.$message.success(res.message); | |
186 | + that.$emit('ok'); | |
187 | + }else{ | |
188 | + that.$message.warning(res.message); | |
189 | + } | |
190 | + }).finally(() => { | |
191 | + that.confirmLoading = false; | |
192 | + that.close(); | |
193 | + }) | |
194 | + }else{ | |
195 | + return false | |
196 | + } | |
197 | + }) | |
198 | + }, | |
199 | + handleCancel () { | |
200 | + this.close() | |
201 | + }, | |
202 | + | |
203 | + | |
204 | + } | |
205 | + } | |
206 | +</script> | |
... | ... |
jeecg-boot-master/ant-design-vue-jeecg/src/views/user/LoginAccount.vue
... | ... | @@ -94,9 +94,7 @@ |
94 | 94 | let obj = getWarehouseByUserCode(that.querySource); |
95 | 95 | obj.then((res) => { |
96 | 96 | that.warehouseList = res.result; |
97 | - if (res.code != 200) { | |
98 | - that.warehouseList = {}; | |
99 | - } | |
97 | + this.model.warehouseCode = this.warehouseList[0].code; | |
100 | 98 | }) |
101 | 99 | }, |
102 | 100 | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneGUI.java
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
... | ... | @@ -13,4 +13,6 @@ import org.jeecg.modules.wms.config.container.entity.Container; |
13 | 13 | public interface IContainerService extends IService<Container> { |
14 | 14 | |
15 | 15 | Result batchAddContainers(Container container, int number); |
16 | + | |
17 | + Container getContainerByCode(String containCode, String warehouseCode); | |
16 | 18 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
... | ... | @@ -54,6 +54,15 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
54 | 54 | return Result.error("添加失败!"); |
55 | 55 | } |
56 | 56 | |
57 | + @Override | |
58 | + public Container getContainerByCode(String containCode, String warehouseCode) { | |
59 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
60 | + containerLambdaQueryWrapper.eq(Container::getCode, containCode) | |
61 | + .eq(Container::getWarehouseCode, warehouseCode); | |
62 | + Container container = containerService.getOne(containerLambdaQueryWrapper); | |
63 | + return container; | |
64 | + } | |
65 | + | |
57 | 66 | |
58 | 67 | private int getStartNumber(String containerTypeCode, String warehouseCode) { |
59 | 68 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/containerType/service/IContainerTypeService.java
1 | 1 | package org.jeecg.modules.wms.config.containerType.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
4 | 5 | import org.jeecg.modules.wms.config.containerType.entity.ContainerType; |
5 | 6 | |
6 | 7 | /** |
... | ... | @@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.containerType.entity.ContainerType; |
11 | 12 | */ |
12 | 13 | public interface IContainerTypeService extends IService<ContainerType> { |
13 | 14 | |
15 | + ContainerType getContainerTypeByCode(String containerTypeCode, String warehouseCode); | |
14 | 16 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/containerType/service/impl/ContainerTypeServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.config.containerType.service.impl; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
3 | 5 | import org.jeecg.modules.wms.config.containerType.entity.ContainerType; |
4 | 6 | import org.jeecg.modules.wms.config.containerType.mapper.ContainerTypeMapper; |
5 | 7 | import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService; |
... | ... | @@ -7,6 +9,8 @@ import org.springframework.stereotype.Service; |
7 | 9 | |
8 | 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 11 | |
12 | +import java.lang.ref.WeakReference; | |
13 | + | |
10 | 14 | /** |
11 | 15 | * @Description: 容器类型 |
12 | 16 | * @Author: jeecg-boot |
... | ... | @@ -16,4 +20,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
16 | 20 | @Service |
17 | 21 | public class ContainerTypeServiceImpl extends ServiceImpl<ContainerTypeMapper, ContainerType> implements IContainerTypeService { |
18 | 22 | |
23 | + @Override | |
24 | + public ContainerType getContainerTypeByCode(String containerTypeCode, String warehouseCode) { | |
25 | + LambdaQueryWrapper<ContainerType> containerTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
26 | + containerTypeLambdaQueryWrapper.eq(ContainerType::getCode, containerTypeCode) | |
27 | + .eq(ContainerType::getWarehouseCode, warehouseCode); | |
28 | + ContainerType containerType = getOne(containerTypeLambdaQueryWrapper); | |
29 | + return containerType; | |
30 | + } | |
19 | 31 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/material/controller/MaterialController.java
1 | 1 | package org.jeecg.modules.wms.config.material.controller; |
2 | 2 | |
3 | +import java.lang.ref.WeakReference; | |
4 | +import java.util.ArrayList; | |
3 | 5 | import java.util.Arrays; |
4 | 6 | import java.util.List; |
5 | 7 | import java.util.Map; |
... | ... | @@ -9,6 +11,9 @@ import java.io.UnsupportedEncodingException; |
9 | 11 | import java.net.URLDecoder; |
10 | 12 | import javax.servlet.http.HttpServletRequest; |
11 | 13 | import javax.servlet.http.HttpServletResponse; |
14 | + | |
15 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
16 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
12 | 17 | import org.jeecg.common.api.vo.Result; |
13 | 18 | import org.jeecg.common.system.query.QueryGenerator; |
14 | 19 | import org.jeecg.common.system.util.JwtUtil; |
... | ... | @@ -19,8 +24,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
19 | 24 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
20 | 25 | import lombok.extern.slf4j.Slf4j; |
21 | 26 | |
27 | +import org.jeecg.modules.system.entity.SysUser; | |
22 | 28 | import org.jeecg.modules.wms.config.material.entity.Material; |
23 | 29 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
30 | +import org.jeecg.modules.wms.domain.SearchDomain; | |
24 | 31 | import org.jeecg.utils.StringUtils; |
25 | 32 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
26 | 33 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
... | ... | @@ -176,4 +183,22 @@ public class MaterialController extends JeecgController<Material, IMaterialServi |
176 | 183 | return super.importExcel(request, response, Material.class); |
177 | 184 | } |
178 | 185 | |
186 | + /** | |
187 | + * 通过用户名获取可以登陆的仓库列表 | |
188 | + */ | |
189 | + @PostMapping("/searchMaterialByCode") | |
190 | + @ResponseBody | |
191 | + public Result searchMaterialByCode(@RequestBody Material material) | |
192 | + { | |
193 | + String materialCode = material.getCode(); | |
194 | + List<Material> materialList = materialService.searchMaterialByCode(materialCode); | |
195 | + List<SearchDomain> searchDomainList = new ArrayList<>(); | |
196 | + for(Material material1 : materialList) { | |
197 | + SearchDomain searchDomain = new SearchDomain(); | |
198 | + searchDomain.setText(material1.getCode() + " " + material1.getName()); | |
199 | + searchDomain.setValue(material1.getCode()); | |
200 | + searchDomainList.add(searchDomain); | |
201 | + } | |
202 | + return Result.OK(searchDomainList); | |
203 | + } | |
179 | 204 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/material/service/IMaterialService.java
1 | 1 | package org.jeecg.modules.wms.config.material.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | +import org.jeecg.common.api.vo.Result; | |
4 | 5 | import org.jeecg.modules.wms.config.material.entity.Material; |
5 | 6 | |
7 | +import java.util.List; | |
8 | + | |
6 | 9 | /** |
7 | 10 | * @Description: 物料管理 |
8 | 11 | * @Author: jeecg-boot |
... | ... | @@ -11,4 +14,7 @@ import org.jeecg.modules.wms.config.material.entity.Material; |
11 | 14 | */ |
12 | 15 | public interface IMaterialService extends IService<Material> { |
13 | 16 | |
17 | + public Material getMaterialByCode(String code); | |
18 | + | |
19 | + public List<Material> searchMaterialByCode(String code); | |
14 | 20 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/material/service/impl/MaterialServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.config.material.service.impl; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import org.jeecg.common.api.vo.Result; | |
3 | 6 | import org.jeecg.modules.wms.config.material.entity.Material; |
4 | 7 | import org.jeecg.modules.wms.config.material.mapper.MaterialMapper; |
5 | 8 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
9 | +import org.jeecg.utils.StringUtils; | |
6 | 10 | import org.springframework.stereotype.Service; |
7 | 11 | |
8 | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 13 | |
14 | +import javax.annotation.Resource; | |
15 | +import java.util.List; | |
16 | + | |
10 | 17 | /** |
11 | 18 | * @Description: 物料管理 |
12 | 19 | * @Author: jeecg-boot |
... | ... | @@ -16,4 +23,25 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
16 | 23 | @Service |
17 | 24 | public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements IMaterialService { |
18 | 25 | |
26 | + | |
27 | + @Override | |
28 | + public Material getMaterialByCode(String code) { | |
29 | + if(StringUtils.isEmpty(code)) { | |
30 | + return null; | |
31 | + } | |
32 | + LambdaQueryWrapper<Material> materialLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
33 | + materialLambdaQueryWrapper.eq(Material::getCode, code); | |
34 | + Material material = this.getOne(materialLambdaQueryWrapper); | |
35 | + return material; | |
36 | + } | |
37 | + | |
38 | + @Override | |
39 | + public List<Material> searchMaterialByCode(String code) { | |
40 | + LambdaQueryWrapper<Material> materialLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
41 | + materialLambdaQueryWrapper.like(StringUtils.isNotEmpty(code), Material::getCode, code); | |
42 | + List<Material> materialList = this.list(materialLambdaQueryWrapper); | |
43 | + return materialList; | |
44 | + } | |
45 | + | |
46 | + | |
19 | 47 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/domain/SearchDomain.java
0 → 100644
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.controller; | |
2 | + | |
3 | +import org.jeecg.common.system.query.QueryGenerator; | |
4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | +import lombok.extern.slf4j.Slf4j; | |
8 | +import org.jeecg.common.system.base.controller.JeecgController; | |
9 | +import org.jeecg.common.api.vo.Result; | |
10 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; | |
11 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | |
12 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; | |
13 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; | |
14 | +import org.springframework.beans.factory.annotation.Autowired; | |
15 | +import org.springframework.web.bind.annotation.*; | |
16 | +import javax.servlet.http.HttpServletRequest; | |
17 | +import javax.servlet.http.HttpServletResponse; | |
18 | +import org.springframework.web.servlet.ModelAndView; | |
19 | +import java.util.Arrays; | |
20 | +import org.jeecg.common.util.oConvertUtils; | |
21 | +import io.swagger.annotations.Api; | |
22 | +import io.swagger.annotations.ApiOperation; | |
23 | +import org.jeecg.common.aspect.annotation.AutoLog; | |
24 | +import org.apache.shiro.SecurityUtils; | |
25 | +import org.jeecg.common.system.vo.LoginUser; | |
26 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | |
27 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |
28 | +import org.jeecgframework.poi.excel.entity.ExportParams; | |
29 | +import org.jeecgframework.poi.excel.entity.ImportParams; | |
30 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |
31 | +import org.springframework.web.multipart.MultipartFile; | |
32 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | |
33 | +import java.io.IOException; | |
34 | +import java.util.List; | |
35 | +import java.util.Map; | |
36 | +import java.util.stream.Collectors; | |
37 | + | |
38 | + /** | |
39 | + * @Description: 入库组盘 | |
40 | + * @Author: jeecg-boot | |
41 | + * @Date: 2022-11-09 | |
42 | + * @Version: V1.0 | |
43 | + */ | |
44 | +@Api(tags="入库组盘") | |
45 | +@RestController | |
46 | +@RequestMapping("/receipt/receiptContainerHeader") | |
47 | +@Slf4j | |
48 | +public class ReceiptContainerHeaderController extends JeecgController<ReceiptContainerHeader, IReceiptContainerHeaderService> { | |
49 | + | |
50 | + @Autowired | |
51 | + private IReceiptContainerHeaderService receiptContainerHeaderService; | |
52 | + | |
53 | + @Autowired | |
54 | + private IReceiptContaienrDetailService receiptContaienrDetailService; | |
55 | + | |
56 | + | |
57 | + /*---------------------------------主表处理-begin-------------------------------------*/ | |
58 | + | |
59 | + /** | |
60 | + * 分页列表查询 | |
61 | + * @param receiptContainerHeader | |
62 | + * @param pageNo | |
63 | + * @param pageSize | |
64 | + * @param req | |
65 | + * @return | |
66 | + */ | |
67 | + //@AutoLog(value = "入库组盘-分页列表查询") | |
68 | + @ApiOperation(value="入库组盘-分页列表查询", notes="入库组盘-分页列表查询") | |
69 | + @GetMapping(value = "/list") | |
70 | + public Result<IPage<ReceiptContainerHeader>> queryPageList(ReceiptContainerHeader receiptContainerHeader, | |
71 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |
72 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |
73 | + HttpServletRequest req) { | |
74 | + QueryWrapper<ReceiptContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerHeader, req.getParameterMap()); | |
75 | + Page<ReceiptContainerHeader> page = new Page<ReceiptContainerHeader>(pageNo, pageSize); | |
76 | + IPage<ReceiptContainerHeader> pageList = receiptContainerHeaderService.page(page, queryWrapper); | |
77 | + return Result.OK(pageList); | |
78 | + } | |
79 | + | |
80 | + /** | |
81 | + * 添加 | |
82 | + * @param receiptContainerHeader | |
83 | + * @return | |
84 | + */ | |
85 | + @AutoLog(value = "入库组盘-添加") | |
86 | + @ApiOperation(value="入库组盘-添加", notes="入库组盘-添加") | |
87 | + @PostMapping(value = "/add") | |
88 | + public Result<String> add(@RequestBody ReceiptContainerHeader receiptContainerHeader) { | |
89 | + receiptContainerHeaderService.save(receiptContainerHeader); | |
90 | + return Result.OK("添加成功!"); | |
91 | + } | |
92 | + | |
93 | + /** | |
94 | + * 编辑 | |
95 | + * @param receiptContainerHeader | |
96 | + * @return | |
97 | + */ | |
98 | + @AutoLog(value = "入库组盘-编辑") | |
99 | + @ApiOperation(value="入库组盘-编辑", notes="入库组盘-编辑") | |
100 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |
101 | + public Result<String> edit(@RequestBody ReceiptContainerHeader receiptContainerHeader) { | |
102 | + receiptContainerHeaderService.updateById(receiptContainerHeader); | |
103 | + return Result.OK("编辑成功!"); | |
104 | + } | |
105 | + | |
106 | + /** | |
107 | + * 通过id删除 | |
108 | + * @param id | |
109 | + * @return | |
110 | + */ | |
111 | + @AutoLog(value = "入库组盘-通过id删除") | |
112 | + @ApiOperation(value="入库组盘-通过id删除", notes="入库组盘-通过id删除") | |
113 | + @DeleteMapping(value = "/delete") | |
114 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |
115 | + receiptContainerHeaderService.delMain(id); | |
116 | + return Result.OK("删除成功!"); | |
117 | + } | |
118 | + | |
119 | + /** | |
120 | + * 批量删除 | |
121 | + * @param ids | |
122 | + * @return | |
123 | + */ | |
124 | + @AutoLog(value = "入库组盘-批量删除") | |
125 | + @ApiOperation(value="入库组盘-批量删除", notes="入库组盘-批量删除") | |
126 | + @DeleteMapping(value = "/deleteBatch") | |
127 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |
128 | + this.receiptContainerHeaderService.delBatchMain(Arrays.asList(ids.split(","))); | |
129 | + return Result.OK("批量删除成功!"); | |
130 | + } | |
131 | + | |
132 | + /** | |
133 | + * 导出 | |
134 | + * @return | |
135 | + */ | |
136 | + @RequestMapping(value = "/exportXls") | |
137 | + public ModelAndView exportXls(HttpServletRequest request, ReceiptContainerHeader receiptContainerHeader) { | |
138 | + return super.exportXls(request, receiptContainerHeader, ReceiptContainerHeader.class, "入库组盘"); | |
139 | + } | |
140 | + | |
141 | + /** | |
142 | + * 导入 | |
143 | + * @return | |
144 | + */ | |
145 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |
146 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |
147 | + return super.importExcel(request, response, ReceiptContainerHeader.class); | |
148 | + } | |
149 | + /*---------------------------------主表处理-end-------------------------------------*/ | |
150 | + | |
151 | + | |
152 | + /*--------------------------------子表处理-入库组盘详情-begin----------------------------------------------*/ | |
153 | + /** | |
154 | + * 通过主表ID查询 | |
155 | + * @return | |
156 | + */ | |
157 | + //@AutoLog(value = "入库组盘详情-通过主表ID查询") | |
158 | + @ApiOperation(value="入库组盘详情-通过主表ID查询", notes="入库组盘详情-通过主表ID查询") | |
159 | + @GetMapping(value = "/listReceiptContaienrDetailByMainId") | |
160 | + public Result<IPage<ReceiptContaienrDetail>> listReceiptContaienrDetailByMainId(ReceiptContaienrDetail receiptContaienrDetail, | |
161 | + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
162 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | |
163 | + HttpServletRequest req) { | |
164 | + QueryWrapper<ReceiptContaienrDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptContaienrDetail, req.getParameterMap()); | |
165 | + Page<ReceiptContaienrDetail> page = new Page<ReceiptContaienrDetail>(pageNo, pageSize); | |
166 | + IPage<ReceiptContaienrDetail> pageList = receiptContaienrDetailService.page(page, queryWrapper); | |
167 | + return Result.OK(pageList); | |
168 | + } | |
169 | + | |
170 | + /** | |
171 | + * 添加 | |
172 | + * @param receiptContaienrDetail | |
173 | + * @return | |
174 | + */ | |
175 | + @AutoLog(value = "入库组盘详情-添加") | |
176 | + @ApiOperation(value="入库组盘详情-添加", notes="入库组盘详情-添加") | |
177 | + @PostMapping(value = "/addReceiptContaienrDetail") | |
178 | + public Result<String> addReceiptContaienrDetail(@RequestBody ReceiptContaienrDetail receiptContaienrDetail) { | |
179 | + receiptContaienrDetailService.save(receiptContaienrDetail); | |
180 | + return Result.OK("添加成功!"); | |
181 | + } | |
182 | + | |
183 | + /** | |
184 | + * 编辑 | |
185 | + * @param receiptContaienrDetail | |
186 | + * @return | |
187 | + */ | |
188 | + @AutoLog(value = "入库组盘详情-编辑") | |
189 | + @ApiOperation(value="入库组盘详情-编辑", notes="入库组盘详情-编辑") | |
190 | + @RequestMapping(value = "/editReceiptContaienrDetail", method = {RequestMethod.PUT,RequestMethod.POST}) | |
191 | + public Result<String> editReceiptContaienrDetail(@RequestBody ReceiptContaienrDetail receiptContaienrDetail) { | |
192 | + receiptContaienrDetailService.updateById(receiptContaienrDetail); | |
193 | + return Result.OK("编辑成功!"); | |
194 | + } | |
195 | + | |
196 | + /** | |
197 | + * 通过id删除 | |
198 | + * @param id | |
199 | + * @return | |
200 | + */ | |
201 | + @AutoLog(value = "入库组盘详情-通过id删除") | |
202 | + @ApiOperation(value="入库组盘详情-通过id删除", notes="入库组盘详情-通过id删除") | |
203 | + @DeleteMapping(value = "/deleteReceiptContaienrDetail") | |
204 | + public Result<String> deleteReceiptContaienrDetail(@RequestParam(name="id",required=true) String id) { | |
205 | + receiptContaienrDetailService.removeById(id); | |
206 | + return Result.OK("删除成功!"); | |
207 | + } | |
208 | + | |
209 | + /** | |
210 | + * 批量删除 | |
211 | + * @param ids | |
212 | + * @return | |
213 | + */ | |
214 | + @AutoLog(value = "入库组盘详情-批量删除") | |
215 | + @ApiOperation(value="入库组盘详情-批量删除", notes="入库组盘详情-批量删除") | |
216 | + @DeleteMapping(value = "/deleteBatchReceiptContaienrDetail") | |
217 | + public Result<String> deleteBatchReceiptContaienrDetail(@RequestParam(name="ids",required=true) String ids) { | |
218 | + this.receiptContaienrDetailService.removeByIds(Arrays.asList(ids.split(","))); | |
219 | + return Result.OK("批量删除成功!"); | |
220 | + } | |
221 | + | |
222 | + /** | |
223 | + * 导出 | |
224 | + * @return | |
225 | + */ | |
226 | + @RequestMapping(value = "/exportReceiptContaienrDetail") | |
227 | + public ModelAndView exportReceiptContaienrDetail(HttpServletRequest request, ReceiptContaienrDetail receiptContaienrDetail) { | |
228 | + // Step.1 组装查询条件 | |
229 | + QueryWrapper<ReceiptContaienrDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptContaienrDetail, request.getParameterMap()); | |
230 | + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | |
231 | + | |
232 | + // Step.2 获取导出数据 | |
233 | + List<ReceiptContaienrDetail> pageList = receiptContaienrDetailService.list(queryWrapper); | |
234 | + List<ReceiptContaienrDetail> exportList = null; | |
235 | + | |
236 | + // 过滤选中数据 | |
237 | + String selections = request.getParameter("selections"); | |
238 | + if (oConvertUtils.isNotEmpty(selections)) { | |
239 | + List<String> selectionList = Arrays.asList(selections.split(",")); | |
240 | + exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); | |
241 | + } else { | |
242 | + exportList = pageList; | |
243 | + } | |
244 | + | |
245 | + // Step.3 AutoPoi 导出Excel | |
246 | + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | |
247 | + mv.addObject(NormalExcelConstants.FILE_NAME, "入库组盘详情"); //此处设置的filename无效 ,前端会重更新设置一下 | |
248 | + mv.addObject(NormalExcelConstants.CLASS, ReceiptContaienrDetail.class); | |
249 | + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("入库组盘详情报表", "导出人:" + sysUser.getRealname(), "入库组盘详情")); | |
250 | + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); | |
251 | + return mv; | |
252 | + } | |
253 | + | |
254 | + /** | |
255 | + * 导入 | |
256 | + * @return | |
257 | + */ | |
258 | + @RequestMapping(value = "/importReceiptContaienrDetail/{mainId}") | |
259 | + public Result<?> importReceiptContaienrDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) { | |
260 | + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | |
261 | + Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | |
262 | + for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | |
263 | + MultipartFile file = entity.getValue();// 获取上传文件对象 | |
264 | + ImportParams params = new ImportParams(); | |
265 | + params.setTitleRows(2); | |
266 | + params.setHeadRows(1); | |
267 | + params.setNeedSave(true); | |
268 | + try { | |
269 | + List<ReceiptContaienrDetail> list = ExcelImportUtil.importExcel(file.getInputStream(), ReceiptContaienrDetail.class, params); | |
270 | + for (ReceiptContaienrDetail temp : list) { | |
271 | + temp.setReceiptContainerId(mainId); | |
272 | + } | |
273 | + long start = System.currentTimeMillis(); | |
274 | + receiptContaienrDetailService.saveBatch(list); | |
275 | + log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); | |
276 | + return Result.OK("文件导入成功!数据行数:" + list.size()); | |
277 | + } catch (Exception e) { | |
278 | + log.error(e.getMessage(), e); | |
279 | + return Result.error("文件导入失败:" + e.getMessage()); | |
280 | + } finally { | |
281 | + try { | |
282 | + file.getInputStream().close(); | |
283 | + } catch (IOException e) { | |
284 | + e.printStackTrace(); | |
285 | + } | |
286 | + } | |
287 | + } | |
288 | + return Result.error("文件导入失败!"); | |
289 | + } | |
290 | + | |
291 | + /*--------------------------------子表处理-入库组盘详情-end----------------------------------------------*/ | |
292 | + | |
293 | + | |
294 | + | |
295 | + | |
296 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContaienrDetail.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import com.baomidou.mybatisplus.annotation.IdType; | |
5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
7 | +import org.jeecg.common.aspect.annotation.Dict; | |
8 | +import lombok.Data; | |
9 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
10 | +import org.springframework.format.annotation.DateTimeFormat; | |
11 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
12 | +import java.util.Date; | |
13 | +import io.swagger.annotations.ApiModel; | |
14 | +import io.swagger.annotations.ApiModelProperty; | |
15 | +import java.io.UnsupportedEncodingException; | |
16 | + | |
17 | +/** | |
18 | + * @Description: 入库组盘详情 | |
19 | + * @Author: jeecg-boot | |
20 | + * @Date: 2022-11-09 | |
21 | + * @Version: V1.0 | |
22 | + */ | |
23 | +@Data | |
24 | +@TableName("receipt_contaienr_detail") | |
25 | +@ApiModel(value="receipt_contaienr_detail对象", description="入库组盘详情") | |
26 | +public class ReceiptContaienrDetail implements Serializable { | |
27 | + private static final long serialVersionUID = 1L; | |
28 | + | |
29 | + /**主键*/ | |
30 | + @TableId(type = IdType.AUTO) | |
31 | + @ApiModelProperty(value = "主键") | |
32 | + private Integer id; | |
33 | + /**入库组盘ID*/ | |
34 | + @ApiModelProperty(value = "入库组盘ID") | |
35 | + private Integer receiptContainerId; | |
36 | + /**入库组ID*/ | |
37 | + @ApiModelProperty(value = "入库单ID") | |
38 | + private Integer receiptId; | |
39 | + /**入库单详情ID*/ | |
40 | + @ApiModelProperty(value = "入库单详情ID") | |
41 | + private Integer receiptDetailId; | |
42 | + /**入库单编码*/ | |
43 | + @ApiModelProperty(value = "入库单编码") | |
44 | + private String receiptCode; | |
45 | + /**仓库编码*/ | |
46 | + @Excel(name = "仓库编码", width = 15) | |
47 | + @ApiModelProperty(value = "仓库编码") | |
48 | + private String warehouseCode; | |
49 | + /**货主编码*/ | |
50 | + @Excel(name = "货主编码", width = 15) | |
51 | + @ApiModelProperty(value = "货主编码") | |
52 | + private String companyCode; | |
53 | + /**物料编码*/ | |
54 | + @Excel(name = "物料编码", width = 15) | |
55 | + @ApiModelProperty(value = "物料编码") | |
56 | + private String materialCode; | |
57 | + /**物料名称*/ | |
58 | + @Excel(name = "物料名称", width = 15) | |
59 | + @ApiModelProperty(value = "物料名称") | |
60 | + private String materialName; | |
61 | + /**物料规格*/ | |
62 | + @Excel(name = "物料规格", width = 15) | |
63 | + @ApiModelProperty(value = "物料规格") | |
64 | + private String materialSpec; | |
65 | + /**物料单位*/ | |
66 | + @Excel(name = "物料单位", width = 15) | |
67 | + @ApiModelProperty(value = "物料单位") | |
68 | + private String materialUnit; | |
69 | + /**数量*/ | |
70 | + @Excel(name = "数量", width = 15) | |
71 | + @ApiModelProperty(value = "数量") | |
72 | + private java.math.BigDecimal qty; | |
73 | + /**库存状态*/ | |
74 | + @Excel(name = "库存状态", width = 15) | |
75 | + @Dict(dicCode = "inventory_status") | |
76 | + @ApiModelProperty(value = "库存状态") | |
77 | + private String inventoryStatus; | |
78 | + /**批次*/ | |
79 | + @Excel(name = "批次", width = 15) | |
80 | + @ApiModelProperty(value = "批次") | |
81 | + private String batch; | |
82 | + /**批号*/ | |
83 | + @Excel(name = "批号", width = 15) | |
84 | + @ApiModelProperty(value = "批号") | |
85 | + private String lot; | |
86 | + /**项目号*/ | |
87 | + @Excel(name = "项目号", width = 15) | |
88 | + @ApiModelProperty(value = "项目号") | |
89 | + private String project; | |
90 | + /**备用字段1*/ | |
91 | + @Excel(name = "备用字段1", width = 15) | |
92 | + @ApiModelProperty(value = "备用字段1") | |
93 | + private String userdef1; | |
94 | + /**备用字段2*/ | |
95 | + @Excel(name = "备用字段2", width = 15) | |
96 | + @ApiModelProperty(value = "备用字段2") | |
97 | + private String userdef2; | |
98 | + /**备用字段3*/ | |
99 | + @Excel(name = "备用字段3", width = 15) | |
100 | + @ApiModelProperty(value = "备用字段3") | |
101 | + private String userdef3; | |
102 | + /**创建人*/ | |
103 | + @ApiModelProperty(value = "创建人") | |
104 | + private String createBy; | |
105 | + /**创建日期*/ | |
106 | + @ApiModelProperty(value = "创建日期") | |
107 | + private Date createTime; | |
108 | + /**更新人*/ | |
109 | + @ApiModelProperty(value = "更新人") | |
110 | + private String updateBy; | |
111 | + /**更新日期*/ | |
112 | + @ApiModelProperty(value = "更新日期") | |
113 | + private Date updateTime; | |
114 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContainerHeader.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.io.UnsupportedEncodingException; | |
5 | +import java.util.Date; | |
6 | +import com.baomidou.mybatisplus.annotation.IdType; | |
7 | +import com.baomidou.mybatisplus.annotation.TableId; | |
8 | +import com.baomidou.mybatisplus.annotation.TableName; | |
9 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
10 | +import lombok.Data; | |
11 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
12 | +import org.springframework.format.annotation.DateTimeFormat; | |
13 | +import org.jeecg.common.aspect.annotation.Dict; | |
14 | +import io.swagger.annotations.ApiModel; | |
15 | +import io.swagger.annotations.ApiModelProperty; | |
16 | + | |
17 | +/** | |
18 | + * @Description: 入库组盘 | |
19 | + * @Author: jeecg-boot | |
20 | + * @Date: 2022-11-09 | |
21 | + * @Version: V1.0 | |
22 | + */ | |
23 | +@Data | |
24 | +@TableName("receipt_container_header") | |
25 | +@ApiModel(value="receipt_container_header对象", description="入库组盘") | |
26 | +public class ReceiptContainerHeader implements Serializable { | |
27 | + private static final long serialVersionUID = 1L; | |
28 | + | |
29 | + /**主键*/ | |
30 | + @TableId(type = IdType.AUTO) | |
31 | + @ApiModelProperty(value = "主键") | |
32 | + private Integer id; | |
33 | + /**仓库编码*/ | |
34 | + @Excel(name = "仓库编码", width = 15) | |
35 | + @ApiModelProperty(value = "仓库编码") | |
36 | + private String warehouseCode; | |
37 | + /**货主*/ | |
38 | + @Excel(name = "货主", width = 15) | |
39 | + @ApiModelProperty(value = "货主") | |
40 | + private String companyCode; | |
41 | + /**容器号*/ | |
42 | + @Excel(name = "容器号", width = 15) | |
43 | + @ApiModelProperty(value = "容器号") | |
44 | + private String containerCode; | |
45 | + /**容器类型*/ | |
46 | + @Excel(name = "容器类型", width = 15) | |
47 | + @ApiModelProperty(value = "容器类型") | |
48 | + private String containerTypeCode; | |
49 | + /**任务类型*/ | |
50 | + @Excel(name = "任务类型", width = 15, dicCode = "receipt_task_type") | |
51 | + @Dict(dicCode = "receipt_task_type") | |
52 | + @ApiModelProperty(value = "任务类型") | |
53 | + private Integer taskType; | |
54 | + /**状态*/ | |
55 | + @Excel(name = "状态", width = 15, dicCode = "receipt_container_status") | |
56 | + @Dict(dicCode = "receipt_container_status") | |
57 | + @ApiModelProperty(value = "状态") | |
58 | + private Integer status; | |
59 | + /**起始库位*/ | |
60 | + @Excel(name = "起始库位", width = 15) | |
61 | + @ApiModelProperty(value = "起始库位") | |
62 | + private String fromLocationCode; | |
63 | + /**目标库位*/ | |
64 | + @Excel(name = "目标库位", width = 15) | |
65 | + @ApiModelProperty(value = "目标库位") | |
66 | + private String toLocationCode; | |
67 | + /**目标出入口*/ | |
68 | + @Excel(name = "目标出入口", width = 15) | |
69 | + @ApiModelProperty(value = "目标出入口") | |
70 | + private String toPort; | |
71 | + /**备用字段1*/ | |
72 | + @Excel(name = "备用字段1", width = 15) | |
73 | + @ApiModelProperty(value = "备用字段1") | |
74 | + private String userdef1; | |
75 | + /**备用字段2*/ | |
76 | + @Excel(name = "备用字段2", width = 15) | |
77 | + @ApiModelProperty(value = "备用字段2") | |
78 | + private String userdef2; | |
79 | + /**备用字段3*/ | |
80 | + @Excel(name = "备用字段3", width = 15) | |
81 | + @ApiModelProperty(value = "备用字段3") | |
82 | + private String userdef3; | |
83 | + /**创建人*/ | |
84 | + @ApiModelProperty(value = "创建人") | |
85 | + private String createBy; | |
86 | + /**创建日期*/ | |
87 | + @ApiModelProperty(value = "创建日期") | |
88 | + private Date createTime; | |
89 | + /**更新人*/ | |
90 | + @ApiModelProperty(value = "更新人") | |
91 | + private String updateBy; | |
92 | + /**更新日期*/ | |
93 | + @ApiModelProperty(value = "更新日期") | |
94 | + private Date updateTime; | |
95 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/ReceiptContaienrDetailMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper; | |
2 | + | |
3 | +import java.util.List; | |
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; | |
7 | + | |
8 | +/** | |
9 | + * @Description: 入库组盘详情 | |
10 | + * @Author: jeecg-boot | |
11 | + * @Date: 2022-11-09 | |
12 | + * @Version: V1.0 | |
13 | + */ | |
14 | +public interface ReceiptContaienrDetailMapper extends BaseMapper<ReceiptContaienrDetail> { | |
15 | + | |
16 | + public boolean deleteByMainId(@Param("mainId") String mainId); | |
17 | + | |
18 | + public List<ReceiptContaienrDetail> selectByMainId(@Param("mainId") String mainId); | |
19 | + | |
20 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/ReceiptContainerHeaderMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
7 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | |
8 | + | |
9 | +/** | |
10 | + * @Description: 入库组盘 | |
11 | + * @Author: jeecg-boot | |
12 | + * @Date: 2022-11-09 | |
13 | + * @Version: V1.0 | |
14 | + */ | |
15 | +public interface ReceiptContainerHeaderMapper extends BaseMapper<ReceiptContainerHeader> { | |
16 | + | |
17 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/xml/ReceiptContaienrDetailMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper"> | |
4 | + | |
5 | + <delete id="deleteByMainId" parameterType="java.lang.String"> | |
6 | + DELETE | |
7 | + FROM receipt_contaienr_detail | |
8 | + WHERE | |
9 | + receipt_container_id = #{mainId} | |
10 | + </delete> | |
11 | + | |
12 | + <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail"> | |
13 | + SELECT * | |
14 | + FROM receipt_contaienr_detail | |
15 | + WHERE | |
16 | + receipt_container_id = #{mainId} | |
17 | + </select> | |
18 | +</mapper> | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/xml/ReceiptContainerHeaderMapper.xml
0 → 100644
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContaienrDetailService.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.service; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
4 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @Description: 入库组盘详情 | |
10 | + * @Author: jeecg-boot | |
11 | + * @Date: 2022-11-09 | |
12 | + * @Version: V1.0 | |
13 | + */ | |
14 | +public interface IReceiptContaienrDetailService extends IService<ReceiptContaienrDetail> { | |
15 | + | |
16 | + public List<ReceiptContaienrDetail> selectByMainId(String mainId); | |
17 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContainerHeaderService.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.service; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
4 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
5 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import java.io.Serializable; | |
8 | +import java.util.Collection; | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @Description: 入库组盘 | |
13 | + * @Author: jeecg-boot | |
14 | + * @Date: 2022-11-09 | |
15 | + * @Version: V1.0 | |
16 | + */ | |
17 | +public interface IReceiptContainerHeaderService extends IService<ReceiptContainerHeader> { | |
18 | + | |
19 | + /** | |
20 | + * 删除一对多 | |
21 | + */ | |
22 | + public void delMain (String id); | |
23 | + | |
24 | + /** | |
25 | + * 批量删除一对多 | |
26 | + */ | |
27 | + public void delBatchMain (Collection<? extends Serializable> idList); | |
28 | + | |
29 | + ReceiptContainerHeader getUnCompleteReceiptContainerByCode(String containerCode, String warehouseCode); | |
30 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContaienrDetailServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.service.impl; | |
2 | + | |
3 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; | |
4 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper; | |
5 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; | |
6 | +import org.springframework.stereotype.Service; | |
7 | +import java.util.List; | |
8 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
9 | +import org.springframework.beans.factory.annotation.Autowired; | |
10 | + | |
11 | +/** | |
12 | + * @Description: 入库组盘详情 | |
13 | + * @Author: jeecg-boot | |
14 | + * @Date: 2022-11-09 | |
15 | + * @Version: V1.0 | |
16 | + */ | |
17 | +@Service | |
18 | +public class ReceiptContaienrDetailServiceImpl extends ServiceImpl<ReceiptContaienrDetailMapper, ReceiptContaienrDetail> implements IReceiptContaienrDetailService { | |
19 | + | |
20 | + @Autowired | |
21 | + private ReceiptContaienrDetailMapper receiptContaienrDetailMapper; | |
22 | + | |
23 | + @Override | |
24 | + public List<ReceiptContaienrDetail> selectByMainId(String mainId) { | |
25 | + return receiptContaienrDetailMapper.selectByMainId(mainId); | |
26 | + } | |
27 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiptContainerHeader.service.impl; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | |
6 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper; | |
7 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerHeaderMapper; | |
8 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; | |
9 | +import org.jeecg.utils.constant.QuantityConstant; | |
10 | +import org.springframework.stereotype.Service; | |
11 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
12 | +import org.springframework.beans.factory.annotation.Autowired; | |
13 | +import org.springframework.transaction.annotation.Transactional; | |
14 | +import java.io.Serializable; | |
15 | +import java.util.List; | |
16 | +import java.util.Collection; | |
17 | + | |
18 | +/** | |
19 | + * @Description: 入库组盘 | |
20 | + * @Author: jeecg-boot | |
21 | + * @Date: 2022-11-09 | |
22 | + * @Version: V1.0 | |
23 | + */ | |
24 | +@Service | |
25 | +public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContainerHeaderMapper, ReceiptContainerHeader> implements IReceiptContainerHeaderService { | |
26 | + | |
27 | + @Autowired | |
28 | + private ReceiptContainerHeaderMapper receiptContainerHeaderMapper; | |
29 | + @Autowired | |
30 | + private ReceiptContaienrDetailMapper receiptContaienrDetailMapper; | |
31 | + | |
32 | + @Override | |
33 | + @Transactional | |
34 | + public void delMain(String id) { | |
35 | + receiptContaienrDetailMapper.deleteByMainId(id); | |
36 | + receiptContainerHeaderMapper.deleteById(id); | |
37 | + } | |
38 | + | |
39 | + @Override | |
40 | + @Transactional | |
41 | + public void delBatchMain(Collection<? extends Serializable> idList) { | |
42 | + for(Serializable id:idList) { | |
43 | + receiptContaienrDetailMapper.deleteByMainId(id.toString()); | |
44 | + receiptContainerHeaderMapper.deleteById(id); | |
45 | + } | |
46 | + } | |
47 | + | |
48 | + @Override | |
49 | + public ReceiptContainerHeader getUnCompleteReceiptContainerByCode(String containerCode, String warehouseCode) { | |
50 | + LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
51 | + receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getContainerCode, containerCode) | |
52 | + .eq(ReceiptContainerHeader::getWarehouseCode, warehouseCode) | |
53 | + .lt(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED); | |
54 | + ReceiptContainerHeader receiptContainerHeader = getOne(receiptContainerHeaderLambdaQueryWrapper); | |
55 | + return receiptContainerHeader; | |
56 | + } | |
57 | + | |
58 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
... | ... | @@ -8,16 +8,25 @@ import lombok.extern.slf4j.Slf4j; |
8 | 8 | import org.jeecg.common.system.base.controller.JeecgController; |
9 | 9 | import org.jeecg.common.api.vo.Result; |
10 | 10 | import org.jeecg.common.system.util.JwtUtil; |
11 | +import org.jeecg.modules.wms.config.material.entity.Material; | |
12 | +import org.jeecg.modules.wms.config.material.service.IMaterialService; | |
11 | 13 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; |
12 | 14 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; |
13 | 15 | import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; |
14 | 16 | import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; |
17 | +import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | |
15 | 18 | import org.jeecg.utils.StringUtils; |
19 | +import org.jeecg.utils.constant.QuantityConstant; | |
16 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
17 | 21 | import org.springframework.web.bind.annotation.*; |
22 | + | |
23 | +import javax.annotation.Resource; | |
18 | 24 | import javax.servlet.http.HttpServletRequest; |
19 | 25 | import javax.servlet.http.HttpServletResponse; |
20 | 26 | import org.springframework.web.servlet.ModelAndView; |
27 | + | |
28 | +import java.math.BigDecimal; | |
29 | +import java.util.ArrayList; | |
21 | 30 | import java.util.Arrays; |
22 | 31 | import org.jeecg.common.util.oConvertUtils; |
23 | 32 | import io.swagger.annotations.Api; |
... | ... | @@ -45,7 +54,7 @@ import java.util.stream.Collectors; |
45 | 54 | */ |
46 | 55 | @Api(tags="入库表主表") |
47 | 56 | @RestController |
48 | -@RequestMapping("/config/receiptHeader") | |
57 | +@RequestMapping("/receipt/receiptHeader") | |
49 | 58 | @Slf4j |
50 | 59 | public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IReceiptHeaderService> { |
51 | 60 | |
... | ... | @@ -54,6 +63,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
54 | 63 | |
55 | 64 | @Autowired |
56 | 65 | private IReceiptDetailService receiptDetailService; |
66 | + @Resource | |
67 | + private IMaterialService materialService; | |
57 | 68 | |
58 | 69 | |
59 | 70 | /*---------------------------------主表处理-begin-------------------------------------*/ |
... | ... | @@ -182,7 +193,35 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
182 | 193 | @ApiOperation(value="入库单详情-添加", notes="入库单详情-添加") |
183 | 194 | @PostMapping(value = "/addReceiptDetail") |
184 | 195 | public Result<String> addReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { |
185 | - receiptDetailService.save(receiptDetail); | |
196 | + ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); | |
197 | + if(receiptHeader == null) { | |
198 | + return Result.error("添加失败,没有找到入库单头"); | |
199 | + } | |
200 | + String receiptCode = receiptHeader.getCode(); | |
201 | + if(StringUtils.isEmpty(receiptCode)) { | |
202 | + return Result.error("添加失败,没有找到入库单编码"); | |
203 | + } | |
204 | + String warehouseCode = receiptHeader.getWarehouseCode(); | |
205 | + String companyCode = receiptHeader.getCompanyCode(); | |
206 | + String materialCode = receiptDetail.getMaterialCode(); | |
207 | + Material material = materialService.getMaterialByCode(materialCode); | |
208 | + if(material == null) { | |
209 | + return Result.error("添加失败,没有找到入库单头"); | |
210 | + } | |
211 | + String materialName = material.getName(); | |
212 | + String materialSpec = material.getSpec(); | |
213 | + String materialUnit = material.getUnit(); | |
214 | + receiptDetail.setReceiptCode(receiptCode); | |
215 | + receiptDetail.setWarehouseCode(warehouseCode); | |
216 | + receiptDetail.setCompanyCode(companyCode); | |
217 | + receiptDetail.setMaterialName(materialName); | |
218 | + receiptDetail.setMaterialSpec(materialSpec); | |
219 | + receiptDetail.setMaterialUnit(materialUnit); | |
220 | + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
221 | + boolean result = receiptDetailService.save(receiptDetail); | |
222 | + if(!result) { | |
223 | + return Result.error("添加失败, 保存的时候报错"); | |
224 | + } | |
186 | 225 | return Result.OK("添加成功!"); |
187 | 226 | } |
188 | 227 | |
... | ... | @@ -262,7 +301,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
262 | 301 | * @return |
263 | 302 | */ |
264 | 303 | @RequestMapping(value = "/importReceiptDetail/{mainId}") |
265 | - public Result<?> importReceiptDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") String mainId) { | |
304 | + public Result<?> importReceiptDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) { | |
266 | 305 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
267 | 306 | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
268 | 307 | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
... | ... | @@ -297,6 +336,4 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
297 | 336 | /*--------------------------------子表处理-入库单详情-end----------------------------------------------*/ |
298 | 337 | |
299 | 338 | |
300 | - | |
301 | - | |
302 | 339 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptDetail.java
... | ... | @@ -32,7 +32,7 @@ public class ReceiptDetail implements Serializable { |
32 | 32 | private Integer id; |
33 | 33 | /**入库单ID*/ |
34 | 34 | @ApiModelProperty(value = "入库单ID") |
35 | - private String receiptId; | |
35 | + private Integer receiptId; | |
36 | 36 | /**入库单编码*/ |
37 | 37 | @Excel(name = "入库单编码", width = 15) |
38 | 38 | @ApiModelProperty(value = "入库单编码") |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/controller/ReceiveController.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiving.controller; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
4 | +import io.swagger.annotations.Api; | |
5 | +import io.swagger.annotations.ApiOperation; | |
6 | +import lombok.extern.slf4j.Slf4j; | |
7 | +import org.jeecg.common.api.vo.Result; | |
8 | +import org.jeecg.common.system.query.QueryGenerator; | |
9 | +import org.jeecg.common.system.util.JwtUtil; | |
10 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
11 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
12 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; | |
13 | +import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | |
14 | +import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; | |
15 | +import org.jeecg.utils.StringUtils; | |
16 | +import org.springframework.web.bind.annotation.*; | |
17 | + | |
18 | +import javax.annotation.Resource; | |
19 | +import javax.servlet.http.HttpServletRequest; | |
20 | +import java.math.BigDecimal; | |
21 | +import java.util.ArrayList; | |
22 | +import java.util.List; | |
23 | + | |
24 | +/** | |
25 | + * @author 游杰 | |
26 | + */ | |
27 | +@Api(tags="入库表主表") | |
28 | +@RestController | |
29 | +@RequestMapping("/receipt/receiveHeader") | |
30 | +@Slf4j | |
31 | +public class ReceiveController { | |
32 | + | |
33 | + @Resource | |
34 | + private IReceiptDetailService receiptDetailService; | |
35 | + @Resource | |
36 | + private IReceiveService receiveService; | |
37 | + | |
38 | + /** | |
39 | + * 通过主表ID查询 | |
40 | + * @return | |
41 | + */ | |
42 | + @ApiOperation(value="入库单详情-通过主表ID查询", notes="入库单详情-通过主表ID查询") | |
43 | + @PostMapping("/listReceiveByReceiptId") | |
44 | + @ResponseBody | |
45 | + public Result listReceiveByReceiptId(@RequestBody ReceiptDetail receiptDetailDomain) { | |
46 | + List<Receive> receiveList = new ArrayList<>(); | |
47 | + QueryWrapper<ReceiptDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptDetailDomain, null); | |
48 | + List<ReceiptDetail> receiptDetailList = receiptDetailService.list(queryWrapper); | |
49 | + for(ReceiptDetail receiptDetail : receiptDetailList) { | |
50 | + Receive receive = new Receive(); | |
51 | + receive.setId(receiptDetail.getId()); | |
52 | + receive.setMaterialCode(receiptDetail.getMaterialCode()); | |
53 | + receive.setMaterialName(receiptDetail.getMaterialName()); | |
54 | + receive.setMateiralSpec(receiptDetail.getMaterialSpec()); | |
55 | + receive.setMaterialUnit(receiptDetail.getMaterialUnit()); | |
56 | + receive.setInventoryStatus(receiptDetail.getInventoryStatus()); | |
57 | + receive.setBatch(receiptDetail.getBatch()); | |
58 | + //计算待收数量 | |
59 | + BigDecimal qty = receiptDetail.getQty().subtract(receiptDetail.getTaskQty()); | |
60 | + if(qty.compareTo(BigDecimal.ZERO) < 0) { | |
61 | + return Result.error("待收数量小于0"); | |
62 | + } | |
63 | + receive.setQty(qty); | |
64 | + receive.setTaskQty(BigDecimal.ZERO); | |
65 | + receiveList.add(receive); | |
66 | + } | |
67 | + return Result.OK(receiveList); | |
68 | + } | |
69 | + | |
70 | + /** | |
71 | + * 收货 | |
72 | + * @return | |
73 | + */ | |
74 | + @ApiOperation(value="入库单-收货", notes="入库单-收货") | |
75 | + @PostMapping("/receiving") | |
76 | + @ResponseBody | |
77 | + public Result receiving(@RequestBody List<Receive> receiveList, HttpServletRequest req) { | |
78 | + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); | |
79 | + return receiveService.receiving(receiveList, warehouseCode); | |
80 | + } | |
81 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/domain/Receive.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiving.domain; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.math.BigDecimal; | |
6 | + | |
7 | +@Data | |
8 | +public class Receive { | |
9 | + | |
10 | + private Integer id; | |
11 | + private String containerCode; | |
12 | + private String materialCode; | |
13 | + private String materialName; | |
14 | + private String mateiralSpec; | |
15 | + private String materialUnit; | |
16 | + private String inventoryStatus; | |
17 | + private String batch; | |
18 | + private BigDecimal qty; //可收数量 | |
19 | + private BigDecimal taskQty; //实收数量 | |
20 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/mapper/ReceiveMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiving.mapper; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
7 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
8 | +import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | |
9 | + | |
10 | +/** | |
11 | + * @Description: 入库表主表 | |
12 | + * @Author: jeecg-boot | |
13 | + * @Date: 2022-11-01 | |
14 | + * @Version: V1.0 | |
15 | + */ | |
16 | +public interface ReceiveMapper extends BaseMapper<Receive> { | |
17 | + | |
18 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/IReceiveService.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiving.service; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
4 | +import org.jeecg.common.api.vo.Result; | |
5 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
6 | +import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | |
7 | +import org.springframework.web.bind.annotation.RequestBody; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author 游杰 | |
13 | + */ | |
14 | +public interface IReceiveService extends IService<Receive> { | |
15 | + | |
16 | + public Result receiving(List<Receive> receiveList, String warehouseCode); | |
17 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.receiving.service.impl; | |
2 | + | |
3 | + | |
4 | +import com.aliyun.oss.ServiceException; | |
5 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
6 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
7 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
8 | +import org.jeecg.common.api.vo.Result; | |
9 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
10 | +import org.jeecg.modules.wms.config.container.service.IContainerService; | |
11 | +import org.jeecg.modules.wms.config.containerType.entity.ContainerType; | |
12 | +import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService; | |
13 | +import org.jeecg.modules.wms.config.material.entity.Material; | |
14 | +import org.jeecg.modules.wms.config.material.service.IMaterialService; | |
15 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; | |
16 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | |
17 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; | |
18 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; | |
19 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
20 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
21 | +import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptHeaderMapper; | |
22 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; | |
23 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; | |
24 | +import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | |
25 | +import org.jeecg.modules.wms.receipt.receiving.mapper.ReceiveMapper; | |
26 | +import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; | |
27 | +import org.jeecg.utils.StringUtils; | |
28 | +import org.jeecg.utils.constant.QuantityConstant; | |
29 | +import org.springframework.stereotype.Service; | |
30 | +import org.springframework.transaction.annotation.Transactional; | |
31 | + | |
32 | +import javax.annotation.Resource; | |
33 | +import java.math.BigDecimal; | |
34 | +import java.util.ArrayList; | |
35 | +import java.util.List; | |
36 | + | |
37 | +/** | |
38 | + * @author 游杰 | |
39 | + */ | |
40 | +@Service | |
41 | +public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> implements IReceiveService { | |
42 | + | |
43 | + @Resource | |
44 | + private IReceiptDetailService receiptDetailService; | |
45 | + @Resource | |
46 | + private IContainerService containerService; | |
47 | + @Resource | |
48 | + private IMaterialService materialService; | |
49 | + @Resource | |
50 | + private IReceiptContainerHeaderService receiptContainerHeaderService; | |
51 | + @Resource | |
52 | + private IContainerTypeService containerTypeService; | |
53 | + @Resource | |
54 | + private IReceiptContaienrDetailService receiptContaienrDetailService; | |
55 | + | |
56 | + /** | |
57 | + * 1.判断容器是否存在,并且不能被锁定 | |
58 | + * 2.收货数量必须大于0 | |
59 | + * 3.收货数量不能大于可收数量 | |
60 | + * 4.物料必须存在 | |
61 | + * 5.更新入库单详情,增加收货数量 | |
62 | + * 6.更新入库组盘头、详情 | |
63 | + * 7.更新入库单状态 | |
64 | + */ | |
65 | + @Override | |
66 | + @Transactional | |
67 | + public Result receiving(List<Receive> receiveList, String warehouseCode) { | |
68 | + boolean result = false; | |
69 | + if(receiveList == null || receiveList.size() == 0) { | |
70 | + return Result.error("收货信息为空"); | |
71 | + } | |
72 | + String containerCode = receiveList.get(0).getContainerCode(); | |
73 | + if(StringUtils.isEmpty(containerCode)) { | |
74 | + return Result.error("容器号为空"); | |
75 | + } | |
76 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
77 | + if(container == null) { | |
78 | + return Result.error("根据容器号 " + containerCode + ", 没有找到容器"); | |
79 | + } | |
80 | + String containerStatus = container.getStatus(); | |
81 | + if(containerStatus.equals(QuantityConstant.STATUS_CONTAINER_LOCK)) { | |
82 | + return Result.error("容器被锁定,不能用于收货"); | |
83 | + } | |
84 | + String containerTypeCode = container.getContainerTypeCode(); | |
85 | + if(StringUtils.isEmpty(containerTypeCode)) { | |
86 | + return Result.error("容器类型编码为空"); | |
87 | + } | |
88 | + ContainerType containerType = containerTypeService | |
89 | + .getContainerTypeByCode(containerTypeCode, warehouseCode); | |
90 | + if(containerType == null) { | |
91 | + return Result.error("容器类型为空"); | |
92 | + } | |
93 | + BigDecimal sumQty = receiveList.stream().map(Receive::getTaskQty) | |
94 | + .reduce(BigDecimal.ZERO, BigDecimal::add); | |
95 | + if(sumQty.compareTo(BigDecimal.ZERO) <= 0) { | |
96 | + return Result.error("总的收货数量必须大于0"); | |
97 | + } | |
98 | + int taskType = QuantityConstant.TASK_TYPE_WHOLERECEIPT; | |
99 | + String fromLocationCode = container.getLocationCode(); | |
100 | + if(StringUtils.isNotEmpty(fromLocationCode)) { | |
101 | + taskType = QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT; | |
102 | + } | |
103 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService | |
104 | + .getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); | |
105 | + if(receiptContainerHeader != null) { | |
106 | + if (receiptContainerHeader.getStatus() >= QuantityConstant.RECEIPT_CONTAINER_TASK) { | |
107 | + throw new ServiceException("容器已经生成任务,不能放物料了!"); | |
108 | + } | |
109 | + } else { | |
110 | + receiptContainerHeader = new ReceiptContainerHeader(); | |
111 | + receiptContainerHeader.setWarehouseCode(warehouseCode); | |
112 | + receiptContainerHeader.setContainerCode(containerCode); | |
113 | + receiptContainerHeader.setContainerTypeCode(containerTypeCode); | |
114 | + receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_BUILD); | |
115 | + receiptContainerHeader.setTaskType(taskType); | |
116 | + receiptContainerHeader.setFromLocationCode(fromLocationCode); | |
117 | + if (taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { | |
118 | + receiptContainerHeader.setToLocationCode(fromLocationCode); | |
119 | + } | |
120 | + result = receiptContainerHeaderService.save(receiptContainerHeader); | |
121 | + if(!result) { | |
122 | + throw new ServiceException("保存入库组盘头失败"); | |
123 | + } | |
124 | + } | |
125 | + | |
126 | + List<ReceiptDetail> receiptDetailList = new ArrayList<>(); | |
127 | + List<ReceiptContaienrDetail> receiptContaienrDetailList = new ArrayList<>(); | |
128 | + for(Receive receive : receiveList) { | |
129 | + //待收数量 | |
130 | + BigDecimal qty = receive.getQty(); | |
131 | + //收货数量 | |
132 | + BigDecimal taskQty = receive.getTaskQty(); | |
133 | + if(taskQty.compareTo(qty) > 0) { | |
134 | + throw new ServiceException("收货数量不能可收数量,收货数量:" + taskQty + " 可收数量:" + qty); | |
135 | + } | |
136 | + if(taskQty.compareTo(BigDecimal.ZERO) <= 0) { | |
137 | + continue; | |
138 | + } | |
139 | + ReceiptDetail receiptDetail = receiptDetailService.getById(receive.getId()); | |
140 | + if(receiptDetail == null) { | |
141 | + throw new ServiceException("没有找到入库单详情,id:" + receive.getId()); | |
142 | + } | |
143 | + String materialCode = receiptDetail.getMaterialCode(); | |
144 | + if(StringUtils.isEmpty(materialCode)) { | |
145 | + throw new ServiceException("物料编码为空"); | |
146 | + } | |
147 | + Material material = materialService.getMaterialByCode(materialCode); | |
148 | + if(material == null) { | |
149 | + throw new ServiceException(materialCode + "物料不存在"); | |
150 | + } | |
151 | + BigDecimal receiptQty = receiptDetail.getQty(); | |
152 | + BigDecimal receiptTaskQty = receiptDetail.getTaskQty(); | |
153 | + receiptTaskQty = receiptTaskQty.add(taskQty); | |
154 | + if(receiptTaskQty.compareTo(receiptQty) > 0) { | |
155 | + throw new ServiceException("收货数量必须小于单据数量"); | |
156 | + } | |
157 | + receiptDetail.setTaskQty(receiptTaskQty); | |
158 | + receiptDetailList.add(receiptDetail); | |
159 | + | |
160 | + LambdaQueryWrapper<ReceiptContaienrDetail> receiptContaienrDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
161 | + receiptContaienrDetailLambdaQueryWrapper.eq(ReceiptContaienrDetail::getReceiptId, receiptDetail.getReceiptId()) | |
162 | + .eq(ReceiptContaienrDetail::getReceiptDetailId, receiptDetail.getId()) | |
163 | + .eq(ReceiptContaienrDetail::getReceiptContainerId, receiptContainerHeader.getId()); | |
164 | + ReceiptContaienrDetail receiptContaienrDetail = receiptContaienrDetailService.getOne(receiptContaienrDetailLambdaQueryWrapper); | |
165 | + if(receiptContaienrDetail != null) { | |
166 | + //如果是已经组过的详情,那么直接相加收货数量 | |
167 | + receiptContaienrDetail.setQty(receiptContaienrDetail.getQty().add(taskQty)); | |
168 | + receiptContaienrDetailService.updateById(receiptContaienrDetail); | |
169 | + } else { | |
170 | + receiptContaienrDetail = new ReceiptContaienrDetail(); | |
171 | + receiptContaienrDetail.setCompanyCode(receiptDetail.getCompanyCode()); | |
172 | + receiptContaienrDetail.setReceiptDetailId(receiptDetail.getId()); | |
173 | + receiptContaienrDetail.setReceiptId(receiptDetail.getReceiptId()); | |
174 | + receiptContaienrDetail.setReceiptCode(receiptDetail.getReceiptCode()); | |
175 | + receiptContaienrDetail.setReceiptContainerId(receiptContainerHeader.getId()); | |
176 | + receiptContaienrDetail.setWarehouseCode(receiptDetail.getWarehouseCode()); | |
177 | + receiptContaienrDetail.setMaterialCode(receiptDetail.getMaterialCode()); | |
178 | + receiptContaienrDetail.setMaterialName(receiptDetail.getMaterialName()); | |
179 | + receiptContaienrDetail.setMaterialSpec(receiptDetail.getMaterialSpec()); | |
180 | + receiptContaienrDetail.setMaterialUnit(receiptDetail.getMaterialUnit()); | |
181 | + receiptContaienrDetail.setQty(taskQty); | |
182 | + receiptContaienrDetail.setBatch(receiptDetail.getBatch()); | |
183 | + receiptContaienrDetail.setLot(receiptDetail.getLot()); | |
184 | + receiptContaienrDetail.setProject(receiptDetail.getProject()); | |
185 | + receiptContaienrDetail.setInventoryStatus(receiptDetail.getInventoryStatus()); | |
186 | + receiptContaienrDetailList.add(receiptContaienrDetail); | |
187 | + } | |
188 | + | |
189 | + } | |
190 | + result = receiptDetailService.updateBatchById(receiptDetailList); | |
191 | + if(!result) { | |
192 | + throw new ServiceException("批量更新入库单详情失败"); | |
193 | + } | |
194 | + | |
195 | + if(receiptContaienrDetailList.size() > 0) { | |
196 | + result = receiptContaienrDetailService.saveBatch(receiptContaienrDetailList); | |
197 | + if (!result) { | |
198 | + throw new ServiceException("保存入库组盘详情失败"); | |
199 | + } | |
200 | + } | |
201 | + | |
202 | + return Result.OK("收货成功"); | |
203 | + } | |
204 | +} | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... | ... | @@ -31,18 +31,15 @@ public class QuantityConstant { |
31 | 31 | public static final Integer RECEIPT_HEADER_BUILD = 0; |
32 | 32 | |
33 | 33 | //等待审核 |
34 | - public static final Integer RECEIPT_HEADER_VERIFYING = 5; | |
34 | + public static final Integer RECEIPT_HEADER_VERIFYING = 10; | |
35 | 35 | |
36 | 36 | //驳回 |
37 | - public static final Integer RECEIPT_HEADER_REJECTED = 10; | |
37 | + public static final Integer RECEIPT_HEADER_REJECTED = 20; | |
38 | 38 | |
39 | 39 | //作废 |
40 | - public static final Integer RECEIPT_HEADER_OBSOLETE = 20; | |
40 | + public static final Integer RECEIPT_HEADER_OBSOLETE = 30; | |
41 | 41 | |
42 | - /**通过*/ | |
43 | -// public static final Integer RECEIPT_HEADER_APPROVE = 50; | |
44 | - | |
45 | - /**订单池*/ | |
42 | + //订单池 | |
46 | 43 | public static final Integer RECEIPT_HEADER_POOL = 100; |
47 | 44 | |
48 | 45 | //入库预约 |
... | ... | @@ -63,13 +60,13 @@ public class QuantityConstant { |
63 | 60 | //等待上架 |
64 | 61 | public static final Integer RECEIPT_HEADER_WAIT = 280; |
65 | 62 | |
66 | - /** 上架 */ | |
63 | + //上架 | |
67 | 64 | public static final Integer RECEIPT_HEADER_SHELF = 300; |
68 | 65 | |
69 | - /** 过账*/ | |
66 | + //过账 | |
70 | 67 | public static final Integer RECEIPT_HEADER_POSTING = 800; |
71 | 68 | |
72 | - /** 回传 */ | |
69 | + //回传 | |
73 | 70 | public static final Integer RECEIPT_HEADER_RETURN = 900; |
74 | 71 | |
75 | 72 | |
... | ... | @@ -85,43 +82,25 @@ public class QuantityConstant { |
85 | 82 | //出库预约成功 |
86 | 83 | public static final Integer SHIPMENT_HEADER_RESERVATION = 120; |
87 | 84 | |
88 | - //出库审核成功 | |
89 | - public static final Integer SHIPMENT_HEADER_STOCK_UP = 125; | |
90 | - | |
91 | - //出库审核失败 | |
92 | - public static final Integer SHIPMENT_HEADER_NOT_APPROVED = 130; | |
93 | - | |
94 | - //出库中 | |
95 | - public static final Integer SHIPMENT_HEADER_SHIPPING = 140; | |
96 | - | |
97 | - //已完成 | |
98 | - public static final Integer SHIPMENT_HEADER_COMPLETE = 145; | |
99 | - | |
100 | 85 | //订单分析 |
101 | 86 | public static final Integer SHIPMENT_HEADER_ANALYSIS = 150; |
102 | 87 | |
103 | 88 | //波次 |
104 | - public static final Integer SHIPMENT_HEADER_WAVE = 200; | |
89 | + public static final Integer SHIPMENT_HEADER_WAVE = 180; | |
105 | 90 | |
106 | 91 | //出库组盘 |
107 | - public static final Integer SHIPMENT_HEADER_GROUPDISK = 300; | |
108 | - | |
109 | - //拣货完成 | |
110 | - public static final Integer SHIPMENT_HEADER_COMPLETED = 500; | |
111 | - | |
112 | - //备货中 | |
113 | - public static final Integer SHIPMENT_HEADER_PREPARE = 550; | |
92 | + public static final Integer SHIPMENT_HEADER_GROUPDISK = 200; | |
114 | 93 | |
115 | - //备货完成 | |
116 | - public static final Integer SHIPMENT_HEADER_COMPLETE_PREPARE = 600; | |
94 | + //等待下架 | |
95 | + public static final Integer SHIPMENT_HEADER_WAITING_OFF_SHELF = 240; | |
117 | 96 | |
118 | - //备货完成回传成功 | |
119 | - public static final Integer SHIPMENT_HEADER_COMPLETE_PREPARE_RETURN = 700; | |
97 | + //下架 | |
98 | + public static final Integer SHIPMENT_HEADER_OFF_SHELF = 300; | |
120 | 99 | |
121 | - //销售出库完成 | |
122 | - public static final Integer SHIPMENT_HEADER_OUT = 800; | |
100 | + //过账 | |
101 | + public static final Integer SHIPMENT_HEADER_COMPLETED = 800; | |
123 | 102 | |
124 | - //出库回传成功 | |
103 | + //回传 | |
125 | 104 | public static final Integer SHIPMENT_HEADER_RETURN = 900; |
126 | 105 | |
127 | 106 | |
... | ... | @@ -139,8 +118,6 @@ public class QuantityConstant { |
139 | 118 | public static final Integer UPLOAD_SUCCESS = 20; |
140 | 119 | |
141 | 120 | |
142 | - | |
143 | - | |
144 | 121 | //4、入库组盘状态 |
145 | 122 | |
146 | 123 | //新建 |
... | ... |