Commit 16c8f2862b6a150f208cda69f91b05626336105d
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4.git into develop
Showing
40 changed files
with
2899 additions
and
109 deletions
ant-design-vue-jeecg/src/api/api.js
@@ -260,6 +260,17 @@ export const callShipmentBox = (params) => postAction('/shipment/shipmentHeader/ | @@ -260,6 +260,17 @@ export const callShipmentBox = (params) => postAction('/shipment/shipmentHeader/ | ||
260 | export const listReceiveByReceiveId = (params) => postAction('/receipt/receiveHeader/listReceiveByReceiveId', params); | 260 | export const listReceiveByReceiveId = (params) => postAction('/receipt/receiveHeader/listReceiveByReceiveId', params); |
261 | //收货 | 261 | //收货 |
262 | export const receive = (params) => postAction('/receipt/receiveHeader/receive', params); | 262 | export const receive = (params) => postAction('/receipt/receiveHeader/receive', params); |
263 | +//全部收货 | ||
264 | +export const receiveHeader = (params) => postAction('/receipt/receiveHeader/receiveHeader?id=' + params, params); | ||
265 | +//越库 | ||
266 | +export const crossDocking = (params) => postAction('/receipt/receiptHeader/crossDocking?id=' + params, params); | ||
267 | +//收货详情转质检 | ||
268 | +export const receiveDetailToQuality = (params) => postAction('/receipt/receiveHeader/receiveDetailToQuality?id=' + params, params); | ||
269 | +//质检 | ||
270 | +export const qualityTesting = (params) => postAction('/receipt/qualityHeader/qualityTesting', params); | ||
271 | +//全部转质检 | ||
272 | +export const receiveHeaderToQuality = (params) => postAction('/receipt/receiveHeader/receiveHeaderToQuality?id=' + params, params); | ||
273 | + | ||
263 | // 中转HTTP请求 | 274 | // 中转HTTP请求 |
264 | export const transitRESTful = { | 275 | export const transitRESTful = { |
265 | get: (url, parameter) => getAction(getTransitURL(url), parameter), | 276 | get: (url, parameter) => getAction(getTransitURL(url), parameter), |
ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue
@@ -206,6 +206,11 @@ export default { | @@ -206,6 +206,11 @@ export default { | ||
206 | dataIndex: 'containerCode' | 206 | dataIndex: 'containerCode' |
207 | }, | 207 | }, |
208 | { | 208 | { |
209 | + title: '物料编码', | ||
210 | + align: "center", | ||
211 | + dataIndex: 'materialCode' | ||
212 | + }, | ||
213 | + { | ||
209 | title: '容器状态', | 214 | title: '容器状态', |
210 | align: "center", | 215 | align: "center", |
211 | dataIndex: 'containerStatus_dictText', | 216 | dataIndex: 'containerStatus_dictText', |
@@ -430,6 +435,7 @@ export default { | @@ -430,6 +435,7 @@ export default { | ||
430 | fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''}) | 435 | fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''}) |
431 | fieldList.push({type: 'string', value: 'containerStatus', text: '容器状态', dictCode: 'container_status'}) | 436 | fieldList.push({type: 'string', value: 'containerStatus', text: '容器状态', dictCode: 'container_status'}) |
432 | fieldList.push({type: 'string', value: 'locationCode', text: '库位编码', dictCode: ''}) | 437 | fieldList.push({type: 'string', value: 'locationCode', text: '库位编码', dictCode: ''}) |
438 | + fieldList.push({type: 'string', value: 'materialCode', text: '物料编码', dictCode: ''}) | ||
433 | fieldList.push({type: 'BigDecimal', value: 'totalQty', text: '总数量', dictCode: ''}) | 439 | fieldList.push({type: 'BigDecimal', value: 'totalQty', text: '总数量', dictCode: ''}) |
434 | fieldList.push({type: 'int', value: 'totalLines', text: '总行量', dictCode: ''}) | 440 | fieldList.push({type: 'int', value: 'totalLines', text: '总行量', dictCode: ''}) |
435 | fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''}) | 441 | fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''}) |
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
@@ -307,6 +307,11 @@ export default { | @@ -307,6 +307,11 @@ export default { | ||
307 | scopedSlots: {customRender: 'inventoryStatus_dictText'} | 307 | scopedSlots: {customRender: 'inventoryStatus_dictText'} |
308 | }, | 308 | }, |
309 | { | 309 | { |
310 | + title: '数量', | ||
311 | + align: "center", | ||
312 | + dataIndex: 'qty' | ||
313 | + }, | ||
314 | + { | ||
310 | title: '入库数量', | 315 | title: '入库数量', |
311 | align: "center", | 316 | align: "center", |
312 | dataIndex: 'receiptQty' | 317 | dataIndex: 'receiptQty' |
ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
@@ -618,7 +618,7 @@ export default { | @@ -618,7 +618,7 @@ export default { | ||
618 | }, | 618 | }, |
619 | success: function (response) { | 619 | success: function (response) { |
620 | if (response.code == 200) { | 620 | if (response.code == 200) { |
621 | - $("#zone").val("库位总数:" + response.result.location + ", 空闲库位:" + response.result.emptyLocation + | 621 | + $("#zone").val("库位总数:" + response.result.location + ", 空库位:" + response.result.emptyLocation + |
622 | ", 空托盘库位:" + response.result.haveContainLocation + ", 有货库位:" + response.result.haveInventoryLocation) | 622 | ", 空托盘库位:" + response.result.haveContainLocation + ", 有货库位:" + response.result.haveInventoryLocation) |
623 | } else { | 623 | } else { |
624 | alert(response.message) | 624 | alert(response.message) |
ant-design-vue-jeecg/src/views/system/receipt/QualityDetailList.vue
0 → 100644
1 | +<template> | ||
2 | + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> | ||
3 | + <!-- 操作按钮区域 --> | ||
4 | + <div class="table-operator" v-if="mainId"> | ||
5 | + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | ||
6 | + <a-button type="primary" icon="download" @click="handleExportXls('质检单详情')">导出</a-button> | ||
7 | + <a-upload | ||
8 | + name="file" | ||
9 | + :showUploadList="false" | ||
10 | + :multiple="false" | ||
11 | + :headers="tokenHeader" | ||
12 | + :action="importExcelUrl" | ||
13 | + @change="handleImportExcel"> | ||
14 | + <a-button type="primary" icon="import">导入</a-button> | ||
15 | + </a-upload> | ||
16 | + <a-dropdown v-if="selectedRowKeys.length > 0"> | ||
17 | + <a-menu slot="overlay"> | ||
18 | + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | ||
19 | + </a-menu> | ||
20 | + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | ||
21 | + </a-dropdown> | ||
22 | + </div> | ||
23 | + | ||
24 | + <!-- table区域-begin --> | ||
25 | + <div> | ||
26 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | ||
27 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | ||
28 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | ||
29 | + </div> | ||
30 | + | ||
31 | + <a-table | ||
32 | + ref="table" | ||
33 | + size="middle" | ||
34 | + bordered | ||
35 | + rowKey="id" | ||
36 | + :scroll="{x:true}" | ||
37 | + :columns="columns" | ||
38 | + :dataSource="dataSource" | ||
39 | + :pagination="ipagination" | ||
40 | + :loading="loading" | ||
41 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | ||
42 | + @change="handleTableChange"> | ||
43 | + | ||
44 | + <template slot="htmlSlot" slot-scope="text"> | ||
45 | + <div v-html="text"></div> | ||
46 | + </template> | ||
47 | + <template slot="imgSlot" slot-scope="text"> | ||
48 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | ||
49 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | ||
50 | + </template> | ||
51 | + <template slot="fileSlot" slot-scope="text"> | ||
52 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | ||
53 | + <a-button | ||
54 | + v-else | ||
55 | + :ghost="true" | ||
56 | + type="primary" | ||
57 | + icon="download" | ||
58 | + size="small" | ||
59 | + @click="downloadFile(text)"> | ||
60 | + 下载 | ||
61 | + </a-button> | ||
62 | + </template> | ||
63 | + | ||
64 | + <span slot="action" slot-scope="text, record"> | ||
65 | + <a v-has="'qualityDetail:edit'" @click="handleEdit(record)">编辑</a> | ||
66 | + <a-divider type="vertical" /> | ||
67 | + <a v-has="'qualityDetail:quality'" v-if="(record.status != 200)" @click="qualityTesting(record)">质检</a> | ||
68 | + <a-divider type="vertical" /> | ||
69 | + <a-popconfirm v-has="'qualityDetail:remove'" title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | ||
70 | + <a>删除</a> | ||
71 | + </a-popconfirm> | ||
72 | + </span> | ||
73 | + | ||
74 | + </a-table> | ||
75 | + </div> | ||
76 | + | ||
77 | + <qualityDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></qualityDetail-modal> | ||
78 | + <quality-testing-modal ref="qualityTesting" @ok="modalFormOk" :mainId="mainId"></quality-testing-modal> | ||
79 | + </a-card> | ||
80 | +</template> | ||
81 | + | ||
82 | +<script> | ||
83 | + | ||
84 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
85 | + import QualityDetailModal from './modules/QualityDetailModal' | ||
86 | + import {receiveDetailToQuality, qualityTesting} from "@api/api"; | ||
87 | + import QualityTestingModal from "@views/system/receipt/modules/QualityTestingModal"; | ||
88 | + | ||
89 | + export default { | ||
90 | + name: "QualityDetailList", | ||
91 | + mixins:[JeecgListMixin], | ||
92 | + components: {QualityTestingModal, QualityDetailModal }, | ||
93 | + props:{ | ||
94 | + mainId:{ | ||
95 | + type:String, | ||
96 | + default:'', | ||
97 | + required:false | ||
98 | + } | ||
99 | + }, | ||
100 | + watch:{ | ||
101 | + mainId:{ | ||
102 | + immediate: true, | ||
103 | + handler(val) { | ||
104 | + if(!this.mainId){ | ||
105 | + this.clearList() | ||
106 | + }else{ | ||
107 | + this.queryParam['qualityId'] = val | ||
108 | + this.loadData(1); | ||
109 | + } | ||
110 | + } | ||
111 | + } | ||
112 | + }, | ||
113 | + data () { | ||
114 | + return { | ||
115 | + description: '质检表单头管理页面', | ||
116 | + disableMixinCreated:true, | ||
117 | + // 表头 | ||
118 | + columns: [ | ||
119 | + { | ||
120 | + title: '#', | ||
121 | + dataIndex: '', | ||
122 | + key:'rowIndex', | ||
123 | + width:60, | ||
124 | + align:"center", | ||
125 | + customRender:function (t,r,index) { | ||
126 | + return parseInt(index)+1; | ||
127 | + } | ||
128 | + }, | ||
129 | + { | ||
130 | + title:'物料编码', | ||
131 | + align:"center", | ||
132 | + dataIndex: 'materialCode' | ||
133 | + }, | ||
134 | + { | ||
135 | + title:'物料名称', | ||
136 | + align:"center", | ||
137 | + dataIndex: 'materialName' | ||
138 | + }, | ||
139 | + { | ||
140 | + title:'物料规格', | ||
141 | + align:"center", | ||
142 | + dataIndex: 'materialSpec' | ||
143 | + }, | ||
144 | + { | ||
145 | + title:'物料单位', | ||
146 | + align:"center", | ||
147 | + dataIndex: 'materialUnit' | ||
148 | + }, | ||
149 | + { | ||
150 | + title:'单据数量', | ||
151 | + align:"center", | ||
152 | + dataIndex: 'qty' | ||
153 | + }, | ||
154 | + { | ||
155 | + title:'合格数量', | ||
156 | + align:"center", | ||
157 | + dataIndex: 'qualityfiedQty' | ||
158 | + }, | ||
159 | + { | ||
160 | + title:'不合格数量', | ||
161 | + align:"center", | ||
162 | + dataIndex: 'unqualityfiedQty' | ||
163 | + }, | ||
164 | + { | ||
165 | + title:'不合格原因', | ||
166 | + align:"center", | ||
167 | + dataIndex: 'remark' | ||
168 | + }, | ||
169 | + { | ||
170 | + title:'批次', | ||
171 | + align:"center", | ||
172 | + dataIndex: 'batch' | ||
173 | + }, | ||
174 | + { | ||
175 | + title:'批号', | ||
176 | + align:"center", | ||
177 | + dataIndex: 'lot' | ||
178 | + }, | ||
179 | + { | ||
180 | + title:'项目号', | ||
181 | + align:"center", | ||
182 | + dataIndex: 'project' | ||
183 | + }, | ||
184 | + { | ||
185 | + title:'单据状态', | ||
186 | + align:"center", | ||
187 | + dataIndex: 'status_dictText' | ||
188 | + }, | ||
189 | + // { | ||
190 | + // title:'上游单号', | ||
191 | + // align:"center", | ||
192 | + // dataIndex: 'referCode' | ||
193 | + // }, | ||
194 | + // { | ||
195 | + // title:'上游行号', | ||
196 | + // align:"center", | ||
197 | + // dataIndex: 'referLineNum' | ||
198 | + // }, | ||
199 | + { | ||
200 | + title:'创建人', | ||
201 | + align:"center", | ||
202 | + dataIndex: 'createBy' | ||
203 | + }, | ||
204 | + { | ||
205 | + title:'创建日期', | ||
206 | + align:"center", | ||
207 | + dataIndex: 'createTime' | ||
208 | + }, | ||
209 | + { | ||
210 | + title:'更新人', | ||
211 | + align:"center", | ||
212 | + dataIndex: 'updateBy' | ||
213 | + }, | ||
214 | + { | ||
215 | + title:'更新日期', | ||
216 | + align:"center", | ||
217 | + dataIndex: 'updateTime' | ||
218 | + }, | ||
219 | + { | ||
220 | + title: '操作', | ||
221 | + dataIndex: 'action', | ||
222 | + align:"center", | ||
223 | + fixed:"right", | ||
224 | + width:147, | ||
225 | + scopedSlots: { customRender: 'action' }, | ||
226 | + } | ||
227 | + ], | ||
228 | + url: { | ||
229 | + list: "/receipt/qualityHeader/listQualityDetailByMainId", | ||
230 | + delete: "/receipt/qualityHeader/deleteQualityDetail", | ||
231 | + deleteBatch: "/receipt/qualityHeader/deleteBatchQualityDetail", | ||
232 | + exportXlsUrl: "/receipt/qualityHeader/exportQualityDetail", | ||
233 | + importUrl: "/receipt/qualityHeader/importQualityDetail", | ||
234 | + }, | ||
235 | + dictOptions:{ | ||
236 | + } | ||
237 | + } | ||
238 | + }, | ||
239 | + created() { | ||
240 | + }, | ||
241 | + computed: { | ||
242 | + importExcelUrl(){ | ||
243 | + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; | ||
244 | + } | ||
245 | + }, | ||
246 | + methods: { | ||
247 | + clearList(){ | ||
248 | + this.dataSource=[] | ||
249 | + this.selectedRowKeys=[] | ||
250 | + this.ipagination.current = 1 | ||
251 | + }, | ||
252 | + qualityTesting(record) { | ||
253 | + this.$refs.qualityTesting.edit(record); | ||
254 | + this.$refs.qualityTesting.title = "质检"; | ||
255 | + }, | ||
256 | + } | ||
257 | + } | ||
258 | +</script> | ||
259 | +<style scoped> | ||
260 | + @import '~@assets/less/common.less' | ||
261 | +</style> |
ant-design-vue-jeecg/src/views/system/receipt/QualityHeaderList.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.code"></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 | + <a-input placeholder="请输入类型" v-model="queryParam.type"></a-input> | ||
15 | + </a-form-item> | ||
16 | + </a-col> | ||
17 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
18 | + <a-form-item label="货主"> | ||
19 | + <a-select | ||
20 | + show-search | ||
21 | + placeholder="请选择货主" | ||
22 | + option-filter-prop="children" | ||
23 | + v-model="queryParam.companyCode"> | ||
24 | + <a-select-option v-for="item in companyList" :key="item.name" :value="item.code">{{ | ||
25 | + item.name | ||
26 | + }} | ||
27 | + </a-select-option> | ||
28 | + </a-select> | ||
29 | + </a-form-item> | ||
30 | + </a-col> | ||
31 | + <template v-if="toggleSearchStatus"> | ||
32 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
33 | + <a-form-item label="头状态"> | ||
34 | + <a-input placeholder="请输入头状态" v-model="queryParam.firstStatus"></a-input> | ||
35 | + </a-form-item> | ||
36 | + </a-col> | ||
37 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
38 | + <a-form-item label="尾状态"> | ||
39 | + <a-input placeholder="请输入尾状态" v-model="queryParam.lastStatus"></a-input> | ||
40 | + </a-form-item> | ||
41 | + </a-col> | ||
42 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
43 | + <a-form-item label="上游单号"> | ||
44 | + <a-input placeholder="请输入上游单号" v-model="queryParam.referCode"></a-input> | ||
45 | + </a-form-item> | ||
46 | + </a-col> | ||
47 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
48 | + <a-form-item label="供应商"> | ||
49 | + <a-select | ||
50 | + show-search | ||
51 | + placeholder="请选择供应商" | ||
52 | + option-filter-prop="children" | ||
53 | + v-model="queryParam.supplierCode"> | ||
54 | + <a-select-option v-for="item in supplierList" :key="item.name" :value="item.code">{{ | ||
55 | + item.name | ||
56 | + }} | ||
57 | + </a-select-option> | ||
58 | + </a-select> | ||
59 | + </a-form-item> | ||
60 | + </a-col> | ||
61 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
62 | + <a-form-item label="备注"> | ||
63 | + <a-input placeholder="请输入备注" v-model="queryParam.remark"></a-input> | ||
64 | + </a-form-item> | ||
65 | + </a-col> | ||
66 | + </template> | ||
67 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
68 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | ||
69 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | ||
70 | + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | ||
71 | + <a @click="handleToggleSearch" style="margin-left: 8px"> | ||
72 | + {{ toggleSearchStatus ? '收起' : '展开' }} | ||
73 | + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | ||
74 | + </a> | ||
75 | + </span> | ||
76 | + </a-col> | ||
77 | + </a-row> | ||
78 | + </a-form> | ||
79 | + </div> | ||
80 | + <!-- 查询区域-END --> | ||
81 | + | ||
82 | + <!-- 操作按钮区域 --> | ||
83 | + <div class="table-operator"> | ||
84 | + <a-button v-has="'qualityHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> | ||
85 | + <a-button v-has="'qualityHeader:export'" type="primary" icon="download" @click="handleExportXls('质检表单头')">导出</a-button> | ||
86 | + <a-upload v-has="'qualityHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | ||
87 | + <a-button type="primary" icon="import">导入</a-button> | ||
88 | + </a-upload> | ||
89 | + <!-- 高级查询区域 --> | ||
90 | + <j-super-query v-has="'qualityHeader:superQuery'" :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | ||
91 | + </div> | ||
92 | + | ||
93 | + <!-- table区域-begin --> | ||
94 | + <div> | ||
95 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | ||
96 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | ||
97 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | ||
98 | + </div> | ||
99 | + | ||
100 | + <a-table | ||
101 | + ref="table" | ||
102 | + size="middle" | ||
103 | + bordered | ||
104 | + rowKey="id" | ||
105 | + class="j-table-force-nowrap" | ||
106 | + :scroll="{x:true}" | ||
107 | + :columns="columns" | ||
108 | + :dataSource="dataSource" | ||
109 | + :pagination="ipagination" | ||
110 | + :loading="loading" | ||
111 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" | ||
112 | + :customRow="clickThenSelect" | ||
113 | + @change="handleTableChange"> | ||
114 | + | ||
115 | + <span slot="companyCode" slot-scope="companyCode"> | ||
116 | + <a-tag :key="companyCode" color=blue> | ||
117 | + {{ solutionCompany(companyCode) }} | ||
118 | + </a-tag> | ||
119 | + </span> | ||
120 | + | ||
121 | + <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> | ||
122 | + <a-tag :key="firstStatus_dictText" :color="getStatusColor(firstStatus_dictText)"> | ||
123 | + {{ firstStatus_dictText }} | ||
124 | + </a-tag> | ||
125 | + </span> | ||
126 | + | ||
127 | + <span slot="lastStatus_dictText" slot-scope="lastStatus_dictText"> | ||
128 | + <a-tag :key="lastStatus_dictText" :color="getStatusColor(lastStatus_dictText)"> | ||
129 | + {{ lastStatus_dictText }} | ||
130 | + </a-tag> | ||
131 | + </span> | ||
132 | + | ||
133 | + <span slot="supplierCode" slot-scope="supplierCode"> | ||
134 | + <a-tag :key="supplierCode" color=pink> | ||
135 | + {{ solutionSupplier(supplierCode) }} | ||
136 | + </a-tag> | ||
137 | + </span> | ||
138 | + | ||
139 | + | ||
140 | + | ||
141 | + <template slot="htmlSlot" slot-scope="text"> | ||
142 | + <div v-html="text"></div> | ||
143 | + </template> | ||
144 | + <template slot="imgSlot" slot-scope="text"> | ||
145 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | ||
146 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | ||
147 | + </template> | ||
148 | + <template slot="fileSlot" slot-scope="text"> | ||
149 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | ||
150 | + <a-button | ||
151 | + v-else | ||
152 | + :ghost="true" | ||
153 | + type="primary" | ||
154 | + icon="download" | ||
155 | + size="small" | ||
156 | + @click="downloadFile(text)"> | ||
157 | + 下载 | ||
158 | + </a-button> | ||
159 | + </template> | ||
160 | + | ||
161 | + <span slot="action" slot-scope="text, record"> | ||
162 | + <a v-has="'qualityHeader:edit'" v-if="(record.firstStatus == 0)" @click="handleEdit(record)"> | ||
163 | + <a-button type="primary">编辑</a-button><a-divider type="vertical"/> | ||
164 | + </a> | ||
165 | + | ||
166 | + <a-popconfirm v-has="'qualityHeader:remove'" v-if="(record.firstStatus == 0)" title="确定删除吗?" @confirm="() => handleDelete(record.id)" > | ||
167 | + <a><a-button type="primary">删除</a-button></a> | ||
168 | + <a-divider type="vertical"/> | ||
169 | + </a-popconfirm> | ||
170 | +<!-- <a-dropdown>--> | ||
171 | +<!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>--> | ||
172 | +<!-- <a-menu slot="overlay">--> | ||
173 | +<!-- <a-menu-item>--> | ||
174 | +<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> | ||
175 | +<!-- <a>删除</a>--> | ||
176 | +<!-- </a-popconfirm>--> | ||
177 | +<!-- </a-menu-item>--> | ||
178 | +<!-- </a-menu>--> | ||
179 | +<!-- </a-dropdown>--> | ||
180 | + </span> | ||
181 | + | ||
182 | + </a-table> | ||
183 | + </div> | ||
184 | + | ||
185 | + <a-tabs defaultActiveKey="1"> | ||
186 | + <a-tab-pane tab="质检单详情" key="1" > | ||
187 | + <QualityDetailList :mainId="selectedMainId" /> | ||
188 | + </a-tab-pane> | ||
189 | + </a-tabs> | ||
190 | + | ||
191 | + <qualityHeader-modal ref="modalForm" @ok="modalFormOk"></qualityHeader-modal> | ||
192 | + </a-card> | ||
193 | +</template> | ||
194 | + | ||
195 | +<script> | ||
196 | + | ||
197 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
198 | + import QualityHeaderModal from './modules/QualityHeaderModal' | ||
199 | + import { getAction } from '@/api/manage' | ||
200 | + import QualityDetailList from './QualityDetailList' | ||
201 | + import '@/assets/less/TableExpand.less' | ||
202 | + import {getCompanyList, getSupplierList} from "@api/api"; | ||
203 | + | ||
204 | + export default { | ||
205 | + name: "QualityHeaderList", | ||
206 | + mixins:[JeecgListMixin], | ||
207 | + components: { | ||
208 | + QualityDetailList, | ||
209 | + QualityHeaderModal | ||
210 | + }, | ||
211 | + data () { | ||
212 | + return { | ||
213 | + description: '质检表单头管理页面', | ||
214 | + companyList: [], | ||
215 | + supplierList: [], | ||
216 | + // 表头 | ||
217 | + columns: [ | ||
218 | + { | ||
219 | + title:'编码', | ||
220 | + align:"center", | ||
221 | + dataIndex: 'code' | ||
222 | + }, | ||
223 | + { | ||
224 | + title:'类型', | ||
225 | + align:"center", | ||
226 | + dataIndex: 'type_dictText', | ||
227 | + }, | ||
228 | + { | ||
229 | + title: '货主', | ||
230 | + align: "center", | ||
231 | + dataIndex: 'companyCode', | ||
232 | + key: 'companyCode', | ||
233 | + scopedSlots: {customRender: 'companyCode'} | ||
234 | + }, | ||
235 | + { | ||
236 | + title:'头状态', | ||
237 | + align:"center", | ||
238 | + dataIndex: 'firstStatus_dictText', | ||
239 | + key: 'firstStatus_dictText', | ||
240 | + scopedSlots: {customRender: 'firstStatus_dictText'} | ||
241 | + }, | ||
242 | + { | ||
243 | + title:'尾状态', | ||
244 | + align:"center", | ||
245 | + dataIndex: 'lastStatus_dictText', | ||
246 | + key: 'lastStatus_dictText', | ||
247 | + scopedSlots: {customRender: 'lastStatus_dictText'} | ||
248 | + }, | ||
249 | + { | ||
250 | + title:'上游单号', | ||
251 | + align:"center", | ||
252 | + dataIndex: 'referCode' | ||
253 | + }, | ||
254 | + { | ||
255 | + title: '供应商', | ||
256 | + align: "center", | ||
257 | + dataIndex: 'supplierCode', | ||
258 | + key: 'supplierCode', | ||
259 | + scopedSlots: {customRender: 'supplierCode'} | ||
260 | + }, | ||
261 | + { | ||
262 | + title:'总数量', | ||
263 | + align:"center", | ||
264 | + dataIndex: 'totalQty' | ||
265 | + }, | ||
266 | + { | ||
267 | + title:'总行数', | ||
268 | + align:"center", | ||
269 | + dataIndex: 'totalLines' | ||
270 | + }, | ||
271 | + { | ||
272 | + title:'备注', | ||
273 | + align:"center", | ||
274 | + dataIndex: 'remark' | ||
275 | + }, | ||
276 | + { | ||
277 | + title:'创建人', | ||
278 | + align:"center", | ||
279 | + dataIndex: 'createBy' | ||
280 | + }, | ||
281 | + { | ||
282 | + title:'创建日期', | ||
283 | + align:"center", | ||
284 | + dataIndex: 'createTime' | ||
285 | + }, | ||
286 | + { | ||
287 | + title:'更新人', | ||
288 | + align:"center", | ||
289 | + dataIndex: 'updateBy' | ||
290 | + }, | ||
291 | + { | ||
292 | + title:'更新日期', | ||
293 | + align:"center", | ||
294 | + dataIndex: 'updateTime' | ||
295 | + }, | ||
296 | + { | ||
297 | + title: '操作', | ||
298 | + dataIndex: 'action', | ||
299 | + align:"center", | ||
300 | + fixed:"right", | ||
301 | + width:147, | ||
302 | + scopedSlots: { customRender: 'action' }, | ||
303 | + } | ||
304 | + ], | ||
305 | + url: { | ||
306 | + list: "/receipt/qualityHeader/list", | ||
307 | + delete: "/receipt/qualityHeader/delete", | ||
308 | + deleteBatch: "/receipt/qualityHeader/deleteBatch", | ||
309 | + exportXlsUrl: "/receipt/qualityHeader/exportXls", | ||
310 | + importExcelUrl: "receipt/qualityHeader/importExcel", | ||
311 | + }, | ||
312 | + dictOptions:{ | ||
313 | + }, | ||
314 | + /* 分页参数 */ | ||
315 | + ipagination:{ | ||
316 | + current: 1, | ||
317 | + pageSize: 5, | ||
318 | + pageSizeOptions: ['5', '10', '50'], | ||
319 | + showTotal: (total, range) => { | ||
320 | + return range[0] + "-" + range[1] + " 共" + total + "条" | ||
321 | + }, | ||
322 | + showQuickJumper: true, | ||
323 | + showSizeChanger: true, | ||
324 | + total: 0 | ||
325 | + }, | ||
326 | + selectedMainId:'', | ||
327 | + superFieldList:[], | ||
328 | + } | ||
329 | + }, | ||
330 | + created() { | ||
331 | + this.getSuperFieldList(); | ||
332 | + this.loadFrom(); | ||
333 | + }, | ||
334 | + computed: { | ||
335 | + importExcelUrl: function(){ | ||
336 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | ||
337 | + } | ||
338 | + }, | ||
339 | + methods: { | ||
340 | + initDictConfig(){ | ||
341 | + }, | ||
342 | + clickThenSelect(record) { | ||
343 | + return { | ||
344 | + on: { | ||
345 | + click: () => { | ||
346 | + this.onSelectChange(record.id.split(","), [record]); | ||
347 | + } | ||
348 | + } | ||
349 | + } | ||
350 | + }, | ||
351 | + onClearSelected() { | ||
352 | + this.selectedRowKeys = []; | ||
353 | + this.selectionRows = []; | ||
354 | + this.selectedMainId='' | ||
355 | + }, | ||
356 | + onSelectChange(selectedRowKeys, selectionRows) { | ||
357 | + this.selectedMainId=selectedRowKeys[0] | ||
358 | + this.selectedRowKeys = selectedRowKeys; | ||
359 | + this.selectionRows = selectionRows; | ||
360 | + }, | ||
361 | + getStatusColor(status) { | ||
362 | + const colors = { | ||
363 | + '新建': 'green', | ||
364 | + '部分质检': 'Skyblue', | ||
365 | + '质检完成': 'blue', | ||
366 | + default: 'blue' | ||
367 | + }; | ||
368 | + return colors[status] || colors.default; | ||
369 | + }, | ||
370 | + loadFrom() { | ||
371 | + getCompanyList().then((res) => { | ||
372 | + if (res.success) { | ||
373 | + this.companyList = res.result | ||
374 | + } | ||
375 | + }); | ||
376 | + getSupplierList().then((res) => { | ||
377 | + if (res.success) { | ||
378 | + this.supplierList = res.result | ||
379 | + } | ||
380 | + }); | ||
381 | + }, | ||
382 | + solutionCompany(value) { | ||
383 | + var actions = [] | ||
384 | + Object.keys(this.companyList).some((key) => { | ||
385 | + if (this.companyList[key].code == ('' + value)) { | ||
386 | + actions.push(this.companyList[key].name) | ||
387 | + return true | ||
388 | + } | ||
389 | + }) | ||
390 | + return actions.join('') | ||
391 | + }, | ||
392 | + solutionSupplier(value) { | ||
393 | + var actions = [] | ||
394 | + Object.keys(this.supplierList).some((key) => { | ||
395 | + if (this.supplierList[key].code == ('' + value)) { | ||
396 | + actions.push(this.supplierList[key].name) | ||
397 | + return true | ||
398 | + } | ||
399 | + }) | ||
400 | + return actions.join('') | ||
401 | + }, | ||
402 | + loadData(arg) { | ||
403 | + if(!this.url.list){ | ||
404 | + this.$message.error("请设置url.list属性!") | ||
405 | + return | ||
406 | + } | ||
407 | + //加载数据 若传入参数1则加载第一页的内容 | ||
408 | + if (arg === 1) { | ||
409 | + this.ipagination.current = 1; | ||
410 | + } | ||
411 | + this.onClearSelected() | ||
412 | + var params = this.getQueryParams();//查询条件 | ||
413 | + this.loading = true; | ||
414 | + getAction(this.url.list, params).then((res) => { | ||
415 | + if (res.success) { | ||
416 | + this.dataSource = res.result.records; | ||
417 | + this.ipagination.total = res.result.total; | ||
418 | + } | ||
419 | + if(res.code===510){ | ||
420 | + this.$message.warning(res.message) | ||
421 | + } | ||
422 | + this.loading = false; | ||
423 | + }) | ||
424 | + }, | ||
425 | + getSuperFieldList(){ | ||
426 | + let fieldList=[]; | ||
427 | + fieldList.push({type:'string',value:'code',text:'编码',dictCode:''}) | ||
428 | + fieldList.push({type:'string',value:'type',text:'类型',dictCode:''}) | ||
429 | + fieldList.push({type:'string',value:'companyCode',text:'货主编码',dictCode:''}) | ||
430 | + fieldList.push({type:'int',value:'firstStatus',text:'头状态',dictCode:''}) | ||
431 | + fieldList.push({type:'int',value:'lastStatus',text:'尾状态',dictCode:''}) | ||
432 | + fieldList.push({type:'string',value:'referCode',text:'上游单号',dictCode:''}) | ||
433 | + fieldList.push({type:'string',value:'supplierCode',text:'供应商编码',dictCode:''}) | ||
434 | + fieldList.push({type:'BigDecimal',value:'totalQty',text:'总数量',dictCode:''}) | ||
435 | + fieldList.push({type:'int',value:'totalLines',text:'总行数',dictCode:''}) | ||
436 | + fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''}) | ||
437 | + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) | ||
438 | + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | ||
439 | + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''}) | ||
440 | + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) | ||
441 | + this.superFieldList = fieldList | ||
442 | + } | ||
443 | + } | ||
444 | + } | ||
445 | +</script> | ||
446 | +<style scoped> | ||
447 | + @import '~@assets/less/common.less' | ||
448 | +</style> | ||
0 | \ No newline at end of file | 449 | \ No newline at end of file |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
@@ -178,6 +178,11 @@ | @@ -178,6 +178,11 @@ | ||
178 | <span slot="action" slot-scope="text, record"> | 178 | <span slot="action" slot-scope="text, record"> |
179 | <a-popconfirm v-has="'receiptHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)"> | 179 | <a-popconfirm v-has="'receiptHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)"> |
180 | <a><a-button type="default">回传</a-button></a> | 180 | <a><a-button type="default">回传</a-button></a> |
181 | + <a-divider type="vertical"/> | ||
182 | + </a-popconfirm> | ||
183 | + <a-popconfirm v-has="'receiptHeader:crossDocking'" v-if="record.lastStatus == 0" title="确定越库吗?" @confirm="() => hanleCross(record)"> | ||
184 | + <a><a-button type="primary">越库</a-button></a> | ||
185 | + <a-divider type="vertical"/> | ||
181 | </a-popconfirm> | 186 | </a-popconfirm> |
182 | <a v-if="(record.lastStatus < 800 && record.firstStatus >= 15 && record.firstStatus != '20') || (flowOff == '0' && record.lastStatus < 800) " @click="receive(record)" v-has="'receiptHeader:receive'"> | 187 | <a v-if="(record.lastStatus < 800 && record.firstStatus >= 15 && record.firstStatus != '20') || (flowOff == '0' && record.lastStatus < 800) " @click="receive(record)" v-has="'receiptHeader:receive'"> |
183 | <a-button type="primary">组盘</a-button> | 188 | <a-button type="primary">组盘</a-button> |
@@ -230,7 +235,7 @@ import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelec | @@ -230,7 +235,7 @@ import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelec | ||
230 | import '@/assets/less/TableExpand.less' | 235 | import '@/assets/less/TableExpand.less' |
231 | import {getCompanyList} from '@/api/api' | 236 | import {getCompanyList} from '@/api/api' |
232 | import {getReceiptTypeList} from '@/api/api' | 237 | import {getReceiptTypeList} from '@/api/api' |
233 | -import {getSupplierList, backErpReceipt,createReceiptAuditFlow,getDocumentAduitFlow} from '@/api/api' | 238 | +import {getSupplierList, backErpReceipt,createReceiptAuditFlow,getDocumentAduitFlow, crossDocking} from '@/api/api' |
234 | import ReceiptModal from "./modules/ReceiptModal"; | 239 | import ReceiptModal from "./modules/ReceiptModal"; |
235 | import { notification } from 'ant-design-vue'; | 240 | import { notification } from 'ant-design-vue'; |
236 | import FlowProcess from "../flow/FlowProcess"; | 241 | import FlowProcess from "../flow/FlowProcess"; |
@@ -537,6 +542,16 @@ export default { | @@ -537,6 +542,16 @@ export default { | ||
537 | this.searchQuery(); | 542 | this.searchQuery(); |
538 | }); | 543 | }); |
539 | }, | 544 | }, |
545 | + hanleCross(record) { | ||
546 | + crossDocking(record.id).then((res) => { | ||
547 | + if (res.success) { | ||
548 | + this.$message.success(res.message); | ||
549 | + } else { | ||
550 | + this.$message.warning(res.message); | ||
551 | + } | ||
552 | + this.searchQuery(); | ||
553 | + }); | ||
554 | + }, | ||
540 | loadFrom() { | 555 | loadFrom() { |
541 | getCompanyList().then((res) => { | 556 | getCompanyList().then((res) => { |
542 | if (res.success) { | 557 | if (res.success) { |
ant-design-vue-jeecg/src/views/system/receipt/ReceiveDetailList.vue
@@ -80,9 +80,11 @@ | @@ -80,9 +80,11 @@ | ||
80 | </template> | 80 | </template> |
81 | 81 | ||
82 | <span slot="action" slot-scope="text, record"> | 82 | <span slot="action" slot-scope="text, record"> |
83 | - <a @click="handleEdit(record)">编辑</a> | 83 | + <a v-has="'receiveDetail:edit'" @click="handleEdit(record)">编辑</a> |
84 | <a-divider type="vertical" /> | 84 | <a-divider type="vertical" /> |
85 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | 85 | + <a v-has="'receiveDetail:quality'" v-if="(record.status == 200)" @click="receiveDetailToQuality(record.id)">质检</a> |
86 | + <a-divider type="vertical" /> | ||
87 | + <a-popconfirm v-has="'receiveDetail:remove'" title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | ||
86 | <a>删除</a> | 88 | <a>删除</a> |
87 | </a-popconfirm> | 89 | </a-popconfirm> |
88 | </span> | 90 | </span> |
@@ -98,7 +100,7 @@ | @@ -98,7 +100,7 @@ | ||
98 | 100 | ||
99 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' | 101 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
100 | import ReceiveDetailModal from './modules/ReceiveDetailModal' | 102 | import ReceiveDetailModal from './modules/ReceiveDetailModal' |
101 | - import {getCompanyList, getSupplierList} from "@api/api"; | 103 | + import {getCompanyList, getSupplierList, receiveHeader, receiveDetailToQuality} from "@api/api"; |
102 | 104 | ||
103 | export default { | 105 | export default { |
104 | name: "ReceiveDetailList", | 106 | name: "ReceiveDetailList", |
@@ -175,6 +177,11 @@ | @@ -175,6 +177,11 @@ | ||
175 | dataIndex: 'taskQty' | 177 | dataIndex: 'taskQty' |
176 | }, | 178 | }, |
177 | { | 179 | { |
180 | + title:'质检数量', | ||
181 | + align:"center", | ||
182 | + dataIndex: 'qualityQty' | ||
183 | + }, | ||
184 | + { | ||
178 | title: '库存状态', | 185 | title: '库存状态', |
179 | align: "center", | 186 | align: "center", |
180 | dataIndex: 'inventoryStatus_dictText', | 187 | dataIndex: 'inventoryStatus_dictText', |
@@ -262,6 +269,16 @@ | @@ -262,6 +269,16 @@ | ||
262 | } | 269 | } |
263 | }); | 270 | }); |
264 | }, | 271 | }, |
272 | + receiveDetailToQuality(record) { | ||
273 | + receiveDetailToQuality(record).then((res) => { | ||
274 | + if (res.success) { | ||
275 | + this.$message.success(res.message) | ||
276 | + } else { | ||
277 | + this.$message.warning(res.message) | ||
278 | + } | ||
279 | + this.searchQuery(); | ||
280 | + }); | ||
281 | + }, | ||
265 | getStatusColor(status) { | 282 | getStatusColor(status) { |
266 | const colors = { | 283 | const colors = { |
267 | '良品': 'green', | 284 | '良品': 'green', |
ant-design-vue-jeecg/src/views/system/receipt/ReceiveHeaderList.vue
@@ -80,14 +80,14 @@ | @@ -80,14 +80,14 @@ | ||
80 | 80 | ||
81 | <!-- 操作按钮区域 --> | 81 | <!-- 操作按钮区域 --> |
82 | <div class="table-operator"> | 82 | <div class="table-operator"> |
83 | - <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | ||
84 | - <a-button type="primary" icon="download" @click="handleExportXls('收货单表头')">导出</a-button> | ||
85 | - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | 83 | + <a-button v-has="'receiveHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
84 | + <a-button v-has="'receiveHeader:export'" type="primary" icon="download" @click="handleExportXls('收货单表头')">导出</a-button> | ||
85 | + <a-upload v-has="'receiveHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | ||
86 | <a-button type="primary" icon="import">导入</a-button> | 86 | <a-button type="primary" icon="import">导入</a-button> |
87 | - <a-button v-has="'receiveHeader:print'" @click="batchPrint()" type="primary">打印</a-button> | ||
88 | </a-upload> | 87 | </a-upload> |
88 | + <a-button v-has="'receiveHeader:print'" @click="batchPrint()" type="primary">打印</a-button> | ||
89 | <!-- 高级查询区域 --> | 89 | <!-- 高级查询区域 --> |
90 | -<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> | 90 | + <j-super-query v-has="'receiveHeader:superQuery'" :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
91 | </div> | 91 | </div> |
92 | 92 | ||
93 | <!-- table区域-begin --> | 93 | <!-- table区域-begin --> |
@@ -118,6 +118,12 @@ | @@ -118,6 +118,12 @@ | ||
118 | </a-tag> | 118 | </a-tag> |
119 | </span> | 119 | </span> |
120 | 120 | ||
121 | + <span slot="type" slot-scope="type"> | ||
122 | + <a-tag :key="type" color=pink> | ||
123 | + {{ solutionType(type) }} | ||
124 | + </a-tag> | ||
125 | + </span> | ||
126 | + | ||
121 | <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> | 127 | <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> |
122 | <a-tag :key="firstStatus_dictText" :color="getStatusColor(firstStatus_dictText)"> | 128 | <a-tag :key="firstStatus_dictText" :color="getStatusColor(firstStatus_dictText)"> |
123 | {{ firstStatus_dictText }} | 129 | {{ firstStatus_dictText }} |
@@ -157,22 +163,32 @@ | @@ -157,22 +163,32 @@ | ||
157 | </template> | 163 | </template> |
158 | 164 | ||
159 | <span slot="action" slot-scope="text, record"> | 165 | <span slot="action" slot-scope="text, record"> |
160 | - <a @click="receive(record)"> | ||
161 | - <a-button v-if="(record.lastStatus < 200)" type="primary">收货</a-button><a-divider type="vertical"/> | 166 | + <a v-has="'receiveHeader:receive'" v-if="(record.lastStatus < 200)" @click="receive(record)"> |
167 | + <a-button type="primary">收货</a-button><a-divider type="vertical"/> | ||
162 | </a> | 168 | </a> |
163 | - <a @click="handleEdit(record)"> | ||
164 | - <a-button type="primary">编辑</a-button><a-divider type="vertical"/> | 169 | + <a v-has="'receiveHeader:receive'" v-if="(record.lastStatus < 200)" @click="receiveHeader(record.id)"> |
170 | + <a-button type="primary">全部收货</a-button><a-divider type="vertical"/> | ||
165 | </a> | 171 | </a> |
166 | - <a-dropdown> | ||
167 | - <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | ||
168 | - <a-menu slot="overlay"> | ||
169 | - <a-menu-item> | ||
170 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | ||
171 | - <a>删除</a> | ||
172 | - </a-popconfirm> | ||
173 | - </a-menu-item> | ||
174 | - </a-menu> | ||
175 | - </a-dropdown> | 172 | + <a v-has="'receiveHeader:quality'" v-if="(record.lastStatus == 200)" @click="receiveHeaderToQuality(record.id)"> |
173 | + <a-button type="primary">全部质检</a-button><a-divider type="vertical"/> | ||
174 | + </a> | ||
175 | + <a v-has="'receiveHeader:edit'" v-if="(record.firstStatus == 0)" @click="handleEdit(record)"> | ||
176 | + <a-button type="primary">编辑</a-button><a-divider type="vertical"/> | ||
177 | + </a> | ||
178 | + <a-popconfirm v-has="'receiveHeader:remove'" v-if="(record.firstStatus == 0)" title="确定删除吗?" @confirm="() => handleDelete(record.id)" > | ||
179 | + <a><a-button type="primary">删除</a-button></a> | ||
180 | + <a-divider type="vertical"/> | ||
181 | + </a-popconfirm> | ||
182 | +<!-- <a-dropdown>--> | ||
183 | +<!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>--> | ||
184 | +<!-- <a-menu slot="overlay">--> | ||
185 | +<!-- <a-menu-item>--> | ||
186 | +<!-- <a-popconfirm v-has="'receiveHeader:remove'" title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> | ||
187 | +<!-- <a>删除</a>--> | ||
188 | +<!-- </a-popconfirm>--> | ||
189 | +<!-- </a-menu-item>--> | ||
190 | +<!-- </a-menu>--> | ||
191 | +<!-- </a-dropdown>--> | ||
176 | </span> | 192 | </span> |
177 | 193 | ||
178 | </a-table> | 194 | </a-table> |
@@ -196,7 +212,7 @@ | @@ -196,7 +212,7 @@ | ||
196 | import { getAction } from '@/api/manage' | 212 | import { getAction } from '@/api/manage' |
197 | import ReceiveDetailList from './ReceiveDetailList' | 213 | import ReceiveDetailList from './ReceiveDetailList' |
198 | import '@/assets/less/TableExpand.less' | 214 | import '@/assets/less/TableExpand.less' |
199 | - import {getCompanyList, getSupplierList} from "@api/api"; | 215 | + import {getCompanyList, getSupplierList, receiveHeader, receiveHeaderToQuality} from "@api/api"; |
200 | import ReceiveModal from "@views/system/receipt/modules/ReceiveModal"; | 216 | import ReceiveModal from "@views/system/receipt/modules/ReceiveModal"; |
201 | 217 | ||
202 | export default { | 218 | export default { |
@@ -382,6 +398,26 @@ | @@ -382,6 +398,26 @@ | ||
382 | this.$refs.modalForm2.edit(record); | 398 | this.$refs.modalForm2.edit(record); |
383 | this.$refs.modalForm2.title = "收货"; | 399 | this.$refs.modalForm2.title = "收货"; |
384 | }, | 400 | }, |
401 | + receiveHeader(record) { | ||
402 | + receiveHeader(record).then((res) => { | ||
403 | + if (res.success) { | ||
404 | + this.$message.success(res.message) | ||
405 | + } else { | ||
406 | + this.$message.warning(res.message) | ||
407 | + } | ||
408 | + this.searchQuery(); | ||
409 | + }); | ||
410 | + }, | ||
411 | + receiveHeaderToQuality(record) { | ||
412 | + receiveHeaderToQuality(record).then((res) => { | ||
413 | + if (res.success) { | ||
414 | + this.$message.success(res.message) | ||
415 | + } else { | ||
416 | + this.$message.warning(res.message) | ||
417 | + } | ||
418 | + this.searchQuery(); | ||
419 | + }); | ||
420 | + }, | ||
385 | loadFrom() { | 421 | loadFrom() { |
386 | getCompanyList().then((res) => { | 422 | getCompanyList().then((res) => { |
387 | if (res.success) { | 423 | if (res.success) { |
@@ -394,6 +430,16 @@ | @@ -394,6 +430,16 @@ | ||
394 | } | 430 | } |
395 | }); | 431 | }); |
396 | }, | 432 | }, |
433 | + solutionType(value) { | ||
434 | + var actions = [] | ||
435 | + Object.keys(this.receiptTypeList).some((key) => { | ||
436 | + if (this.receiptTypeList[key].code == ('' + value)) { | ||
437 | + actions.push(this.receiptTypeList[key].name) | ||
438 | + return true | ||
439 | + } | ||
440 | + }) | ||
441 | + return actions.join('') | ||
442 | + }, | ||
397 | solutionCompany(value) { | 443 | solutionCompany(value) { |
398 | var actions = [] | 444 | var actions = [] |
399 | Object.keys(this.companyList).some((key) => { | 445 | Object.keys(this.companyList).some((key) => { |
ant-design-vue-jeecg/src/views/system/receipt/modules/QualityDetailModal.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 | + <a-input v-model="model.inventoryStatus"placeholder="请输入库存状态" ></a-input> | ||
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-col :span="24"> | ||
50 | + <a-form-model-item label="批号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lot"> | ||
51 | + <a-input v-model="model.lot"placeholder="请输入批号" ></a-input> | ||
52 | + </a-form-model-item> | ||
53 | + </a-col> | ||
54 | + <a-col :span="24"> | ||
55 | + <a-form-model-item label="项目号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="project"> | ||
56 | + <a-input v-model="model.project"placeholder="请输入项目号" ></a-input> | ||
57 | + </a-form-model-item> | ||
58 | + </a-col> | ||
59 | + <a-col :span="24"> | ||
60 | + <a-form-model-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> | ||
61 | + <a-input-number v-model="model.status"placeholder="请输入单据状态" style="width: 100%" /> | ||
62 | + </a-form-model-item> | ||
63 | + </a-col> | ||
64 | + </a-row> | ||
65 | + </a-form-model> | ||
66 | + </a-spin> | ||
67 | + </j-modal> | ||
68 | +</template> | ||
69 | + | ||
70 | +<script> | ||
71 | + | ||
72 | + import { httpAction } from '@/api/manage' | ||
73 | + import { validateDuplicateValue } from '@/utils/util' | ||
74 | + import {receiveHeader} from "@api/api"; | ||
75 | + | ||
76 | + export default { | ||
77 | + name: "QualityDetailModal", | ||
78 | + components: { | ||
79 | + }, | ||
80 | + props:{ | ||
81 | + mainId:{ | ||
82 | + type:String, | ||
83 | + required:false, | ||
84 | + default:'' | ||
85 | + } | ||
86 | + }, | ||
87 | + data () { | ||
88 | + return { | ||
89 | + title:"操作", | ||
90 | + width:800, | ||
91 | + visible: false, | ||
92 | + model:{ | ||
93 | + }, | ||
94 | + labelCol: { | ||
95 | + xs: { span: 24 }, | ||
96 | + sm: { span: 5 }, | ||
97 | + }, | ||
98 | + wrapperCol: { | ||
99 | + xs: { span: 24 }, | ||
100 | + sm: { span: 16 }, | ||
101 | + }, | ||
102 | + | ||
103 | + confirmLoading: false, | ||
104 | +validatorRules: { | ||
105 | +}, | ||
106 | + url: { | ||
107 | + add: "/receipt/qualityHeader/addQualityDetail", | ||
108 | + edit: "/receipt/qualityHeader/editQualityDetail", | ||
109 | + } | ||
110 | + | ||
111 | + } | ||
112 | + }, | ||
113 | + created () { | ||
114 | + //备份model原始值 | ||
115 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | ||
116 | + }, | ||
117 | + methods: { | ||
118 | + add () { | ||
119 | + this.edit(this.modelDefault); | ||
120 | + }, | ||
121 | + edit (record) { | ||
122 | + this.model = Object.assign({}, record); | ||
123 | + this.visible = true; | ||
124 | + }, | ||
125 | + close () { | ||
126 | + this.$emit('close'); | ||
127 | + this.visible = false; | ||
128 | + this.$refs.form.clearValidate(); | ||
129 | + }, | ||
130 | + handleOk () { | ||
131 | + const that = this; | ||
132 | + // 触发表单验证 | ||
133 | + this.$refs.form.validate(valid => { | ||
134 | + if (valid) { | ||
135 | + that.confirmLoading = true; | ||
136 | + let httpurl = ''; | ||
137 | + let method = ''; | ||
138 | + if(!this.model.id){ | ||
139 | + httpurl+=this.url.add; | ||
140 | + method = 'post'; | ||
141 | + }else{ | ||
142 | + httpurl+=this.url.edit; | ||
143 | + method = 'put'; | ||
144 | + } | ||
145 | + this.model['qualityId'] = this.mainId | ||
146 | + httpAction(httpurl,this.model,method).then((res)=>{ | ||
147 | + if(res.success){ | ||
148 | + that.$message.success(res.message); | ||
149 | + that.$emit('ok'); | ||
150 | + }else{ | ||
151 | + that.$message.warning(res.message); | ||
152 | + } | ||
153 | + }).finally(() => { | ||
154 | + that.confirmLoading = false; | ||
155 | + that.close(); | ||
156 | + }) | ||
157 | + }else{ | ||
158 | + return false | ||
159 | + } | ||
160 | + }) | ||
161 | + }, | ||
162 | + handleCancel () { | ||
163 | + this.close() | ||
164 | + }, | ||
165 | + | ||
166 | + | ||
167 | + } | ||
168 | + } | ||
169 | +</script> |
ant-design-vue-jeecg/src/views/system/receipt/modules/QualityHeaderForm.vue
0 → 100644
1 | +<template> | ||
2 | + <a-spin :spinning="confirmLoading"> | ||
3 | + <j-form-container :disabled="formDisabled"> | ||
4 | + <!-- 主表单区域 --> | ||
5 | + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | ||
6 | + <a-row> | ||
7 | + <a-col :span="24" > | ||
8 | + <a-form-model-item label="编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> | ||
9 | + <a-input v-model="model.code" placeholder="请输入编码" ></a-input> | ||
10 | + </a-form-model-item> | ||
11 | + </a-col> | ||
12 | + <a-col :span="24" > | ||
13 | + <a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type"> | ||
14 | + <a-input v-model="model.type" placeholder="请输入类型" ></a-input> | ||
15 | + </a-form-model-item> | ||
16 | + </a-col> | ||
17 | + <a-col :span="24" > | ||
18 | + <a-form-model-item label="货主编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="companyCode"> | ||
19 | + <a-input v-model="model.companyCode" placeholder="请输入货主编码" ></a-input> | ||
20 | + </a-form-model-item> | ||
21 | + </a-col> | ||
22 | + <a-col :span="24" > | ||
23 | + <a-form-model-item label="上游单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="referCode"> | ||
24 | + <a-input v-model="model.referCode" placeholder="请输入上游单号" ></a-input> | ||
25 | + </a-form-model-item> | ||
26 | + </a-col> | ||
27 | + <a-col :span="24" > | ||
28 | + <a-form-model-item label="供应商编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplierCode"> | ||
29 | + <a-input v-model="model.supplierCode" placeholder="请输入供应商编码" ></a-input> | ||
30 | + </a-form-model-item> | ||
31 | + </a-col> | ||
32 | + <a-col :span="24" > | ||
33 | + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> | ||
34 | + <a-input v-model="model.remark" placeholder="请输入备注" ></a-input> | ||
35 | + </a-form-model-item> | ||
36 | + </a-col> | ||
37 | + </a-row> | ||
38 | + </a-form-model> | ||
39 | + </j-form-container> | ||
40 | + <!-- 子表单区域 --> | ||
41 | + <a-tabs v-model="activeKey" @change="handleChangeTabs"> | ||
42 | + <a-tab-pane tab="质检单详情" :key="refKeys[0]" :forceRender="true"> | ||
43 | + <j-vxe-table | ||
44 | + keep-source | ||
45 | + :ref="refKeys[0]" | ||
46 | + :loading="qualityDetailTable.loading" | ||
47 | + :columns="qualityDetailTable.columns" | ||
48 | + :dataSource="qualityDetailTable.dataSource" | ||
49 | + :maxHeight="300" | ||
50 | + :disabled="formDisabled" | ||
51 | + :rowNumber="true" | ||
52 | + :rowSelection="true" | ||
53 | + :toolbar="true" | ||
54 | + /> | ||
55 | + </a-tab-pane> | ||
56 | + </a-tabs> | ||
57 | + </a-spin> | ||
58 | +</template> | ||
59 | + | ||
60 | +<script> | ||
61 | + | ||
62 | + import { getAction } from '@/api/manage' | ||
63 | + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' | ||
64 | + import { JVXETypes } from '@/components/jeecg/JVxeTable' | ||
65 | + import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' | ||
66 | + import { validateDuplicateValue } from '@/utils/util' | ||
67 | + import JFormContainer from '@/components/jeecg/JFormContainer' | ||
68 | + | ||
69 | + export default { | ||
70 | + name: 'QualityHeaderForm', | ||
71 | + mixins: [JVxeTableModelMixin], | ||
72 | + components: { | ||
73 | + JFormContainer, | ||
74 | + }, | ||
75 | + data() { | ||
76 | + return { | ||
77 | + labelCol: { | ||
78 | + xs: { span: 24 }, | ||
79 | + sm: { span: 5 }, | ||
80 | + }, | ||
81 | + wrapperCol: { | ||
82 | + xs: { span: 24 }, | ||
83 | + sm: { span: 16 }, | ||
84 | + }, | ||
85 | + model:{ | ||
86 | + }, | ||
87 | + // 新增时子表默认添加几行空数据 | ||
88 | + addDefaultRowNum: 1, | ||
89 | +validatorRules: { | ||
90 | + code: [ | ||
91 | + { required: true, message: '请输入编码!'}, | ||
92 | + ], | ||
93 | +}, | ||
94 | + refKeys: ['qualityDetail', ], | ||
95 | + tableKeys:['qualityDetail', ], | ||
96 | + activeKey: 'qualityDetail', | ||
97 | + // 质检单详情 | ||
98 | + qualityDetailTable: { | ||
99 | + loading: false, | ||
100 | + dataSource: [], | ||
101 | + columns: [ | ||
102 | + { | ||
103 | + title: '物料编码', | ||
104 | + key: 'materialCode', | ||
105 | + type: JVXETypes.input, | ||
106 | + width:"200px", | ||
107 | + placeholder: '请输入${title}', | ||
108 | + defaultValue:'', | ||
109 | + }, | ||
110 | + { | ||
111 | + title: '物料名称', | ||
112 | + key: 'materialName', | ||
113 | + type: JVXETypes.input, | ||
114 | + width:"200px", | ||
115 | + placeholder: '请输入${title}', | ||
116 | + defaultValue:'', | ||
117 | + }, | ||
118 | + { | ||
119 | + title: '物料规格', | ||
120 | + key: 'materialSpec', | ||
121 | + type: JVXETypes.input, | ||
122 | + width:"200px", | ||
123 | + placeholder: '请输入${title}', | ||
124 | + defaultValue:'', | ||
125 | + }, | ||
126 | + { | ||
127 | + title: '物料单位', | ||
128 | + key: 'materialUnit', | ||
129 | + type: JVXETypes.input, | ||
130 | + width:"200px", | ||
131 | + placeholder: '请输入${title}', | ||
132 | + defaultValue:'', | ||
133 | + }, | ||
134 | + { | ||
135 | + title: '单据数量', | ||
136 | + key: 'qty', | ||
137 | + type: JVXETypes.input, | ||
138 | + width:"200px", | ||
139 | + placeholder: '请输入${title}', | ||
140 | + defaultValue:'', | ||
141 | + }, | ||
142 | + { | ||
143 | + title: '库存状态', | ||
144 | + key: 'inventoryStatus', | ||
145 | + type: JVXETypes.input, | ||
146 | + width:"200px", | ||
147 | + placeholder: '请输入${title}', | ||
148 | + defaultValue:'', | ||
149 | + }, | ||
150 | + { | ||
151 | + title: '批次', | ||
152 | + key: 'batch', | ||
153 | + type: JVXETypes.input, | ||
154 | + width:"200px", | ||
155 | + placeholder: '请输入${title}', | ||
156 | + defaultValue:'', | ||
157 | + }, | ||
158 | + { | ||
159 | + title: '批号', | ||
160 | + key: 'lot', | ||
161 | + type: JVXETypes.input, | ||
162 | + width:"200px", | ||
163 | + placeholder: '请输入${title}', | ||
164 | + defaultValue:'', | ||
165 | + }, | ||
166 | + { | ||
167 | + title: '项目号', | ||
168 | + key: 'project', | ||
169 | + type: JVXETypes.input, | ||
170 | + width:"200px", | ||
171 | + placeholder: '请输入${title}', | ||
172 | + defaultValue:'', | ||
173 | + }, | ||
174 | + { | ||
175 | + title: '单据状态', | ||
176 | + key: 'status', | ||
177 | + type: JVXETypes.input, | ||
178 | + width:"200px", | ||
179 | + placeholder: '请输入${title}', | ||
180 | + defaultValue:'', | ||
181 | + }, | ||
182 | + ] | ||
183 | + }, | ||
184 | + url: { | ||
185 | + add: "/receipt/qualityHeader/add", | ||
186 | + edit: "/receipt/qualityHeader/edit", | ||
187 | + queryById: "/receipt/qualityHeader/queryById", | ||
188 | + qualityDetail: { | ||
189 | + list: '/receipt/qualityHeader/queryQualityDetailByMainId' | ||
190 | + }, | ||
191 | + } | ||
192 | + } | ||
193 | + }, | ||
194 | + props: { | ||
195 | + //表单禁用 | ||
196 | + disabled: { | ||
197 | + type: Boolean, | ||
198 | + default: false, | ||
199 | + required: false | ||
200 | + } | ||
201 | + }, | ||
202 | + computed: { | ||
203 | + formDisabled(){ | ||
204 | + return this.disabled | ||
205 | + }, | ||
206 | + }, | ||
207 | + created () { | ||
208 | + }, | ||
209 | + methods: { | ||
210 | + addBefore(){ | ||
211 | + this.qualityDetailTable.dataSource=[] | ||
212 | + }, | ||
213 | + getAllTable() { | ||
214 | + let values = this.tableKeys.map(key => getRefPromise(this, key)) | ||
215 | + return Promise.all(values) | ||
216 | + }, | ||
217 | + /** 调用完edit()方法之后会自动调用此方法 */ | ||
218 | + editAfter() { | ||
219 | + this.$nextTick(() => { | ||
220 | + }) | ||
221 | + // 加载子表数据 | ||
222 | + if (this.model.id) { | ||
223 | + let params = { id: this.model.id } | ||
224 | + this.requestSubTableData(this.url.qualityDetail.list, params, this.qualityDetailTable) | ||
225 | + } | ||
226 | + }, | ||
227 | + //校验所有一对一子表表单 | ||
228 | + validateSubForm(allValues){ | ||
229 | + return new Promise((resolve,reject)=>{ | ||
230 | + Promise.all([ | ||
231 | + ]).then(() => { | ||
232 | + resolve(allValues) | ||
233 | + }).catch(e => { | ||
234 | + if (e.error === VALIDATE_FAILED) { | ||
235 | + // 如果有未通过表单验证的子表,就自动跳转到它所在的tab | ||
236 | + this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] | ||
237 | + } else { | ||
238 | + console.error(e) | ||
239 | + } | ||
240 | + }) | ||
241 | + }) | ||
242 | + }, | ||
243 | + /** 整理成formData */ | ||
244 | + classifyIntoFormData(allValues) { | ||
245 | + let main = Object.assign(this.model, allValues.formValue) | ||
246 | + return { | ||
247 | + ...main, // 展开 | ||
248 | + qualityDetailList: allValues.tablesValue[0].tableData, | ||
249 | + } | ||
250 | + }, | ||
251 | + validateError(msg){ | ||
252 | + this.$message.error(msg) | ||
253 | + }, | ||
254 | + | ||
255 | + } | ||
256 | + } | ||
257 | +</script> | ||
258 | + | ||
259 | +<style scoped> | ||
260 | +</style> | ||
0 | \ No newline at end of file | 261 | \ No newline at end of file |
ant-design-vue-jeecg/src/views/system/receipt/modules/QualityHeaderModal.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="code"> | ||
16 | + <a-input v-model="model.code" 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="type"> | ||
21 | + <a-input v-model="model.type" 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="companyCode"> | ||
26 | + <a-input v-model="model.companyCode" 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="referCode"> | ||
31 | + <a-input v-model="model.referCode" 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="supplierCode"> | ||
36 | + <a-input v-model="model.supplierCode" 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="remark"> | ||
41 | + <a-input v-model="model.remark" 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: "QualityHeaderModal", | ||
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 | + code: [ | ||
78 | + { required: true, message: '请输入编码!'}, | ||
79 | + ], | ||
80 | +}, | ||
81 | + url: { | ||
82 | + add: "/receipt/qualityHeader/add", | ||
83 | + edit: "/receipt/qualityHeader/edit", | ||
84 | + } | ||
85 | + | ||
86 | + } | ||
87 | + }, | ||
88 | + created () { | ||
89 | + //备份model原始值 | ||
90 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | ||
91 | + }, | ||
92 | + methods: { | ||
93 | + add () { | ||
94 | + this.edit(this.modelDefault); | ||
95 | + }, | ||
96 | + edit (record) { | ||
97 | + this.model = Object.assign({}, record); | ||
98 | + this.visible = true; | ||
99 | + }, | ||
100 | + close () { | ||
101 | + this.$emit('close'); | ||
102 | + this.visible = false; | ||
103 | + this.$refs.form.clearValidate(); | ||
104 | + }, | ||
105 | + handleOk () { | ||
106 | + const that = this; | ||
107 | + // 触发表单验证 | ||
108 | + this.$refs.form.validate(valid => { | ||
109 | + if (valid) { | ||
110 | + that.confirmLoading = true; | ||
111 | + let httpurl = ''; | ||
112 | + let method = ''; | ||
113 | + if(!this.model.id){ | ||
114 | + httpurl+=this.url.add; | ||
115 | + method = 'post'; | ||
116 | + }else{ | ||
117 | + httpurl+=this.url.edit; | ||
118 | + method = 'put'; | ||
119 | + } | ||
120 | + httpAction(httpurl,this.model,method).then((res)=>{ | ||
121 | + if(res.success){ | ||
122 | + that.$message.success(res.message); | ||
123 | + that.$emit('ok'); | ||
124 | + }else{ | ||
125 | + that.$message.warning(res.message); | ||
126 | + } | ||
127 | + }).finally(() => { | ||
128 | + that.confirmLoading = false; | ||
129 | + that.close(); | ||
130 | + }) | ||
131 | + }else{ | ||
132 | + return false | ||
133 | + } | ||
134 | + }) | ||
135 | + }, | ||
136 | + handleCancel () { | ||
137 | + this.close() | ||
138 | + }, | ||
139 | + | ||
140 | + | ||
141 | + } | ||
142 | + } | ||
143 | +</script> | ||
0 | \ No newline at end of file | 144 | \ No newline at end of file |
ant-design-vue-jeecg/src/views/system/receipt/modules/QualityTestingModal.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="请输入物料编码" disabled="true"/></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="请输入物料名称" disabled="true"></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="请输入物料规格" disabled="true"></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="请输入物料单位" disabled="true"></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%" disabled="true"/> | ||
37 | + </a-form-model-item> | ||
38 | + </a-col> | ||
39 | + <a-col :span="24"> | ||
40 | + <a-form-model-item label="合格数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty"> | ||
41 | + <a-input-number v-model="model.qualityfiedQty"placeholder="请输入合格数量" style="width: 100%" /> | ||
42 | + </a-form-model-item> | ||
43 | + </a-col> | ||
44 | + <a-col :span="24"> | ||
45 | + <a-form-model-item label="不合格数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty"> | ||
46 | + <a-input-number v-model="model.unqualityfiedQty"placeholder="请输入不合格数量" style="width: 100%" /> | ||
47 | + </a-form-model-item> | ||
48 | + </a-col> | ||
49 | + <a-col :span="24"> | ||
50 | + <a-form-model-item label="不合格原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> | ||
51 | + <a-input v-model="model.remark"placeholder="请输入不合格原因" /> | ||
52 | + </a-form-model-item> | ||
53 | + </a-col> | ||
54 | + </a-row> | ||
55 | + </a-form-model> | ||
56 | + </a-spin> | ||
57 | + </j-modal> | ||
58 | +</template> | ||
59 | + | ||
60 | +<script> | ||
61 | + | ||
62 | + import { httpAction } from '@/api/manage' | ||
63 | + import { validateDuplicateValue } from '@/utils/util' | ||
64 | + import {receiveHeader, qualityTesting} from "@api/api"; | ||
65 | + | ||
66 | + export default { | ||
67 | + name: "QualityTestingModal", | ||
68 | + components: { | ||
69 | + }, | ||
70 | + props:{ | ||
71 | + mainId:{ | ||
72 | + type:String, | ||
73 | + required:false, | ||
74 | + default:'' | ||
75 | + } | ||
76 | + }, | ||
77 | + data () { | ||
78 | + return { | ||
79 | + title:"操作", | ||
80 | + width:800, | ||
81 | + visible: false, | ||
82 | + model:{ | ||
83 | + }, | ||
84 | + labelCol: { | ||
85 | + xs: { span: 24 }, | ||
86 | + sm: { span: 5 }, | ||
87 | + }, | ||
88 | + wrapperCol: { | ||
89 | + xs: { span: 24 }, | ||
90 | + sm: { span: 16 }, | ||
91 | + }, | ||
92 | + | ||
93 | + confirmLoading: false, | ||
94 | + validatorRules: { | ||
95 | + }, | ||
96 | + url: { | ||
97 | + add: "/receipt/qualityHeader/addQualityDetail", | ||
98 | + edit: "/receipt/qualityHeader/editQualityDetail", | ||
99 | + } | ||
100 | + | ||
101 | + } | ||
102 | + }, | ||
103 | + created () { | ||
104 | + //备份model原始值 | ||
105 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | ||
106 | + }, | ||
107 | + methods: { | ||
108 | + add () { | ||
109 | + this.edit(this.modelDefault); | ||
110 | + }, | ||
111 | + edit (record) { | ||
112 | + this.model = Object.assign({}, record); | ||
113 | + this.visible = true; | ||
114 | + }, | ||
115 | + close () { | ||
116 | + this.$emit('close'); | ||
117 | + this.visible = false; | ||
118 | + this.$refs.form.clearValidate(); | ||
119 | + }, | ||
120 | + | ||
121 | + handleOk () { | ||
122 | + const that = this; | ||
123 | + // 触发表单验证 | ||
124 | + this.$refs.form.validate(valid => { | ||
125 | + if (valid) { | ||
126 | + that.confirmLoading = true; | ||
127 | + let httpurl = ''; | ||
128 | + let method = ''; | ||
129 | + if(!this.model.id){ | ||
130 | + httpurl+=this.url.add; | ||
131 | + method = 'post'; | ||
132 | + }else{ | ||
133 | + httpurl+=this.url.edit; | ||
134 | + method = 'put'; | ||
135 | + } | ||
136 | + this.model['qualityId'] = this.mainId | ||
137 | + qualityTesting(this.model).then((res)=>{ | ||
138 | + if(res.success){ | ||
139 | + that.$message.success(res.message); | ||
140 | + that.$emit('ok'); | ||
141 | + }else{ | ||
142 | + that.$message.warning(res.message); | ||
143 | + } | ||
144 | + }).finally(() => { | ||
145 | + that.confirmLoading = false; | ||
146 | + that.close(); | ||
147 | + }) | ||
148 | + }else{ | ||
149 | + return false | ||
150 | + } | ||
151 | + }) | ||
152 | + }, | ||
153 | + handleCancel () { | ||
154 | + this.close() | ||
155 | + }, | ||
156 | + | ||
157 | + | ||
158 | + } | ||
159 | + } | ||
160 | +</script> |
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveDetailModal.vue
@@ -80,6 +80,15 @@ | @@ -80,6 +80,15 @@ | ||
80 | 80 | ||
81 | confirmLoading: false, | 81 | confirmLoading: false, |
82 | validatorRules: { | 82 | validatorRules: { |
83 | + materialCode: [ | ||
84 | + {required: true, message: '请输入物料编码!'}, | ||
85 | + ], | ||
86 | + qty: [ | ||
87 | + {required: true, message: '请输入单据数量!'}, | ||
88 | + ], | ||
89 | + inventoryStatus: [ | ||
90 | + {required: true, message: '请输入库存状态!'}, | ||
91 | + ], | ||
83 | }, | 92 | }, |
84 | url: { | 93 | url: { |
85 | add: "/receipt/receiveHeader/addReceiveDetail", | 94 | add: "/receipt/receiveHeader/addReceiveDetail", |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/controller/LocationMonitorController.java
@@ -69,6 +69,7 @@ public class LocationMonitorController { | @@ -69,6 +69,7 @@ public class LocationMonitorController { | ||
69 | // 换stream进行数据拣选速度更快 | 69 | // 换stream进行数据拣选速度更快 |
70 | List<Location> emptyLocationList = | 70 | List<Location> emptyLocationList = |
71 | locationList.stream().filter(t -> QuantityConstant.STATUS_LOCATION_EMPTY.equals(t.getStatus())).collect(Collectors.toList()); | 71 | locationList.stream().filter(t -> QuantityConstant.STATUS_LOCATION_EMPTY.equals(t.getStatus())).collect(Collectors.toList()); |
72 | + emptyLocationList = emptyLocationList.stream().filter(t -> t.getContainerCode().isEmpty()).collect(Collectors.toList()); | ||
72 | map.put("emptyLocation", emptyLocationList.size()); | 73 | map.put("emptyLocation", emptyLocationList.size()); |
73 | // 查询库位上的托盘信息 | 74 | // 查询库位上的托盘信息 |
74 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | 75 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
@@ -110,8 +111,7 @@ public class LocationMonitorController { | @@ -110,8 +111,7 @@ public class LocationMonitorController { | ||
110 | 111 | ||
111 | /* 查询库存明细 */ | 112 | /* 查询库存明细 */ |
112 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambda = Wrappers.lambdaQuery(); | 113 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambda = Wrappers.lambdaQuery(); |
113 | - inventoryDetailLambda.eq(StringUtils.isEmpty(zoneCode),InventoryDetail::getZoneCode,zoneCode) | ||
114 | - .isNotNull(InventoryDetail::getLocationCode); | 114 | + inventoryDetailLambda.eq(StringUtils.isEmpty(zoneCode), InventoryDetail::getZoneCode, zoneCode).isNotNull(InventoryDetail::getLocationCode); |
115 | HuahengJwtUtil.setWarehouseCode(inventoryDetailLambda, InventoryDetail.class, req); | 115 | HuahengJwtUtil.setWarehouseCode(inventoryDetailLambda, InventoryDetail.class, req); |
116 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambda); | 116 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambda); |
117 | 117 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryDetail/controller/InventoryDetailController.java
@@ -7,18 +7,14 @@ import java.util.List; | @@ -7,18 +7,14 @@ import java.util.List; | ||
7 | import javax.servlet.http.HttpServletRequest; | 7 | import javax.servlet.http.HttpServletRequest; |
8 | import javax.servlet.http.HttpServletResponse; | 8 | import javax.servlet.http.HttpServletResponse; |
9 | 9 | ||
10 | -import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||
11 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
12 | import org.jeecg.common.api.vo.Result; | 10 | import org.jeecg.common.api.vo.Result; |
13 | import org.jeecg.common.aspect.annotation.AutoLog; | 11 | import org.jeecg.common.aspect.annotation.AutoLog; |
14 | import org.jeecg.common.system.base.controller.JeecgController; | 12 | import org.jeecg.common.system.base.controller.JeecgController; |
15 | import org.jeecg.common.system.query.QueryGenerator; | 13 | import org.jeecg.common.system.query.QueryGenerator; |
16 | -import org.jeecg.modules.wms.config.container.entity.Container; | ||
17 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 14 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 15 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
19 | import org.jeecg.utils.HuahengJwtUtil; | 16 | import org.jeecg.utils.HuahengJwtUtil; |
20 | import org.jeecg.utils.StringUtils; | 17 | import org.jeecg.utils.StringUtils; |
21 | -import org.jeecg.utils.constant.QuantityConstant; | ||
22 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
23 | import org.springframework.web.bind.annotation.*; | 19 | import org.springframework.web.bind.annotation.*; |
24 | import org.springframework.web.servlet.ModelAndView; | 20 | import org.springframework.web.servlet.ModelAndView; |
@@ -67,7 +63,7 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | @@ -67,7 +63,7 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | ||
67 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | 63 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); |
68 | queryWrapper.lt(inventoryAge != null, "create_time", inventoryAge); | 64 | queryWrapper.lt(inventoryAge != null, "create_time", inventoryAge); |
69 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | 65 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
70 | - IPage<InventoryDetail> pageList = inventoryDetailService.page(page, queryWrapper); | 66 | + IPage<InventoryDetail> pageList = inventoryDetailService.queryPage(page, queryWrapper); |
71 | inventoryDetailService.calculateInventoryAge(pageList.getRecords());// 计算库龄 | 67 | inventoryDetailService.calculateInventoryAge(pageList.getRecords());// 计算库龄 |
72 | return Result.OK(pageList); | 68 | return Result.OK(pageList); |
73 | } | 69 | } |
@@ -75,17 +71,17 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | @@ -75,17 +71,17 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | ||
75 | @ApiOperation(value = "库存详情-分页列表查询", notes = "库存详情-分页列表查询") | 71 | @ApiOperation(value = "库存详情-分页列表查询", notes = "库存详情-分页列表查询") |
76 | @GetMapping(value = "/selectContainerlist") | 72 | @GetMapping(value = "/selectContainerlist") |
77 | public Result<IPage<InventoryDetail>> selectContainerlist(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 73 | public Result<IPage<InventoryDetail>> selectContainerlist(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
78 | - @RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize, HttpServletRequest req) { | ||
79 | - IPage<InventoryDetail> pageList=new Page<>(); | ||
80 | - //由于前端页面嵌套,进页面就会加载此接口,加个判断避免不必要的查询 | ||
81 | - if (StringUtils.isNotEmpty(inventoryDetail.getMaterialCode())){ | 74 | + @RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize, HttpServletRequest req) { |
75 | + IPage<InventoryDetail> pageList = new Page<>(); | ||
76 | + // 由于前端页面嵌套,进页面就会加载此接口,加个判断避免不必要的查询 | ||
77 | + if (StringUtils.isNotEmpty(inventoryDetail.getMaterialCode())) { | ||
82 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | 78 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
83 | - //查询出符合条件的托盘 | ||
84 | - List<String> containerCodeList=inventoryDetailService.containerCodeList(warehouseCode,inventoryDetail.getMaterialCode()); | 79 | + // 查询出符合条件的托盘 |
80 | + List<String> containerCodeList = inventoryDetailService.containerCodeList(warehouseCode, inventoryDetail.getMaterialCode()); | ||
85 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | 81 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); |
86 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | 82 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
87 | - if (containerCodeList.size()>0){ | ||
88 | - queryWrapper.in("container_code",containerCodeList); | 83 | + if (containerCodeList.size() > 0) { |
84 | + queryWrapper.in("container_code", containerCodeList); | ||
89 | } | 85 | } |
90 | pageList = inventoryDetailService.page(page, queryWrapper); | 86 | pageList = inventoryDetailService.page(page, queryWrapper); |
91 | } | 87 | } |
@@ -180,7 +176,7 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | @@ -180,7 +176,7 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | ||
180 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | 176 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
181 | return super.importExcel(request, response, InventoryDetail.class); | 177 | return super.importExcel(request, response, InventoryDetail.class); |
182 | } | 178 | } |
183 | - | 179 | + |
184 | /** | 180 | /** |
185 | * 根据多个库存头id分页列表查询 | 181 | * 根据多个库存头id分页列表查询 |
186 | */ | 182 | */ |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/controller/QualityHeaderController.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.controller; | ||
2 | + | ||
3 | +import java.io.IOException; | ||
4 | +import java.util.Arrays; | ||
5 | +import java.util.List; | ||
6 | +import java.util.Map; | ||
7 | +import java.util.stream.Collectors; | ||
8 | + | ||
9 | +import javax.servlet.http.HttpServletRequest; | ||
10 | +import javax.servlet.http.HttpServletResponse; | ||
11 | + | ||
12 | +import org.apache.shiro.SecurityUtils; | ||
13 | +import org.jeecg.common.api.vo.Result; | ||
14 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
15 | +import org.jeecg.common.exception.JeecgBootException; | ||
16 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
17 | +import org.jeecg.common.system.query.QueryGenerator; | ||
18 | +import org.jeecg.common.system.vo.LoginUser; | ||
19 | +import org.jeecg.common.util.oConvertUtils; | ||
20 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | ||
21 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityHeader; | ||
22 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityDetailService; | ||
23 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityHeaderService; | ||
24 | +import org.jeecg.utils.constant.QuantityConstant; | ||
25 | +import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
26 | +import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
27 | +import org.jeecgframework.poi.excel.entity.ExportParams; | ||
28 | +import org.jeecgframework.poi.excel.entity.ImportParams; | ||
29 | +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
30 | +import org.springframework.beans.factory.annotation.Autowired; | ||
31 | +import org.springframework.web.bind.annotation.*; | ||
32 | +import org.springframework.web.multipart.MultipartFile; | ||
33 | +import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
34 | +import org.springframework.web.servlet.ModelAndView; | ||
35 | + | ||
36 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
37 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
38 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
39 | + | ||
40 | +import io.swagger.annotations.Api; | ||
41 | +import io.swagger.annotations.ApiOperation; | ||
42 | +import lombok.extern.slf4j.Slf4j; | ||
43 | + | ||
44 | +/** | ||
45 | + * @Description: 质检表单头 | ||
46 | + * @Author: jeecg-boot | ||
47 | + * @Date: 2023-10-24 | ||
48 | + * @Version: V1.0 | ||
49 | + */ | ||
50 | +@Api(tags = "质检表单头") | ||
51 | +@RestController | ||
52 | +@RequestMapping("/receipt/qualityHeader") | ||
53 | +@Slf4j | ||
54 | +public class QualityHeaderController extends JeecgController<QualityHeader, IQualityHeaderService> { | ||
55 | + | ||
56 | + @Autowired | ||
57 | + private IQualityHeaderService qualityHeaderService; | ||
58 | + | ||
59 | + @Autowired | ||
60 | + private IQualityDetailService qualityDetailService; | ||
61 | + | ||
62 | + /*---------------------------------主表处理-begin-------------------------------------*/ | ||
63 | + | ||
64 | + /** | ||
65 | + * 分页列表查询 | ||
66 | + * @param qualityHeader | ||
67 | + * @param pageNo | ||
68 | + * @param pageSize | ||
69 | + * @param req | ||
70 | + * @return | ||
71 | + */ | ||
72 | + // @AutoLog(value = "质检表单头-分页列表查询") | ||
73 | + @ApiOperation(value = "质检表单头-分页列表查询", notes = "质检表单头-分页列表查询") | ||
74 | + @GetMapping(value = "/list") | ||
75 | + public Result<IPage<QualityHeader>> queryPageList(QualityHeader qualityHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
76 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | ||
77 | + QueryWrapper<QualityHeader> queryWrapper = QueryGenerator.initQueryWrapper(qualityHeader, req.getParameterMap()); | ||
78 | + Page<QualityHeader> page = new Page<QualityHeader>(pageNo, pageSize); | ||
79 | + IPage<QualityHeader> pageList = qualityHeaderService.page(page, queryWrapper); | ||
80 | + return Result.OK(pageList); | ||
81 | + } | ||
82 | + | ||
83 | + /** | ||
84 | + * 添加 | ||
85 | + * @param qualityHeader | ||
86 | + * @return | ||
87 | + */ | ||
88 | + @AutoLog(value = "质检表单头-添加") | ||
89 | + @ApiOperation(value = "质检表单头-添加", notes = "质检表单头-添加") | ||
90 | + @PostMapping(value = "/add") | ||
91 | + public Result<String> add(@RequestBody QualityHeader qualityHeader) { | ||
92 | + qualityHeaderService.save(qualityHeader); | ||
93 | + return Result.OK("添加成功!"); | ||
94 | + } | ||
95 | + | ||
96 | + /** | ||
97 | + * 编辑 | ||
98 | + * @param qualityHeader | ||
99 | + * @return | ||
100 | + */ | ||
101 | + @AutoLog(value = "质检表单头-编辑") | ||
102 | + @ApiOperation(value = "质检表单头-编辑", notes = "质检表单头-编辑") | ||
103 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) | ||
104 | + public Result<String> edit(@RequestBody QualityHeader qualityHeader) { | ||
105 | + if (qualityHeader.getFirstStatus().intValue() > QuantityConstant.QUALITY_HEADER_BUILD) { | ||
106 | + throw new JeecgBootException("不能删除非新建状态单据"); | ||
107 | + } | ||
108 | + qualityHeaderService.updateById(qualityHeader); | ||
109 | + return Result.OK("编辑成功!"); | ||
110 | + } | ||
111 | + | ||
112 | + /** | ||
113 | + * 通过id删除 | ||
114 | + * @param id | ||
115 | + * @return | ||
116 | + */ | ||
117 | + @AutoLog(value = "质检表单头-通过id删除") | ||
118 | + @ApiOperation(value = "质检表单头-通过id删除", notes = "质检表单头-通过id删除") | ||
119 | + @DeleteMapping(value = "/delete") | ||
120 | + public Result<String> delete(@RequestParam(name = "id", required = true) String id) { | ||
121 | + QualityHeader qualityHeader = qualityHeaderService.getById(id); | ||
122 | + if (qualityHeader.getFirstStatus().intValue() > QuantityConstant.QUALITY_HEADER_BUILD) { | ||
123 | + throw new JeecgBootException("不能删除非新建状态单据"); | ||
124 | + } | ||
125 | + qualityHeaderService.delMain(id); | ||
126 | + return Result.OK("删除成功!"); | ||
127 | + } | ||
128 | + | ||
129 | + /** | ||
130 | + * 批量删除 | ||
131 | + * @param ids | ||
132 | + * @return | ||
133 | + */ | ||
134 | + @AutoLog(value = "质检表单头-批量删除") | ||
135 | + @ApiOperation(value = "质检表单头-批量删除", notes = "质检表单头-批量删除") | ||
136 | + @DeleteMapping(value = "/deleteBatch") | ||
137 | + public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { | ||
138 | + this.qualityHeaderService.delBatchMain(Arrays.asList(ids.split(","))); | ||
139 | + return Result.OK("批量删除成功!"); | ||
140 | + } | ||
141 | + | ||
142 | + /** | ||
143 | + * 导出 | ||
144 | + * @return | ||
145 | + */ | ||
146 | + @RequestMapping(value = "/exportXls") | ||
147 | + public ModelAndView exportXls(HttpServletRequest request, QualityHeader qualityHeader) { | ||
148 | + return super.exportXls(request, qualityHeader, QualityHeader.class, "质检表单头"); | ||
149 | + } | ||
150 | + | ||
151 | + /** | ||
152 | + * 导入 | ||
153 | + * @return | ||
154 | + */ | ||
155 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
156 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
157 | + return super.importExcel(request, response, QualityHeader.class); | ||
158 | + } | ||
159 | + /*---------------------------------主表处理-end-------------------------------------*/ | ||
160 | + | ||
161 | + /*--------------------------------子表处理-质检单详情-begin----------------------------------------------*/ | ||
162 | + /** | ||
163 | + * 通过主表ID查询 | ||
164 | + * @return | ||
165 | + */ | ||
166 | + // @AutoLog(value = "质检单详情-通过主表ID查询") | ||
167 | + @ApiOperation(value = "质检单详情-通过主表ID查询", notes = "质检单详情-通过主表ID查询") | ||
168 | + @GetMapping(value = "/listQualityDetailByMainId") | ||
169 | + public Result<IPage<QualityDetail>> listQualityDetailByMainId(QualityDetail qualityDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
170 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | ||
171 | + QueryWrapper<QualityDetail> queryWrapper = QueryGenerator.initQueryWrapper(qualityDetail, req.getParameterMap()); | ||
172 | + Page<QualityDetail> page = new Page<QualityDetail>(pageNo, pageSize); | ||
173 | + IPage<QualityDetail> pageList = qualityDetailService.page(page, queryWrapper); | ||
174 | + return Result.OK(pageList); | ||
175 | + } | ||
176 | + | ||
177 | + /** | ||
178 | + * 添加 | ||
179 | + * @param qualityDetail | ||
180 | + * @return | ||
181 | + */ | ||
182 | + @AutoLog(value = "质检单详情-添加") | ||
183 | + @ApiOperation(value = "质检单详情-添加", notes = "质检单详情-添加") | ||
184 | + @PostMapping(value = "/addQualityDetail") | ||
185 | + public Result<String> addQualityDetail(@RequestBody QualityDetail qualityDetail) { | ||
186 | + | ||
187 | + qualityDetailService.save(qualityDetail); | ||
188 | + return Result.OK("添加成功!"); | ||
189 | + } | ||
190 | + | ||
191 | + /** | ||
192 | + * 编辑 | ||
193 | + * @param qualityDetail | ||
194 | + * @return | ||
195 | + */ | ||
196 | + @AutoLog(value = "质检单详情-编辑") | ||
197 | + @ApiOperation(value = "质检单详情-编辑", notes = "质检单详情-编辑") | ||
198 | + @RequestMapping(value = "/editQualityDetail", method = {RequestMethod.PUT, RequestMethod.POST}) | ||
199 | + public Result<String> editQualityDetail(@RequestBody QualityDetail qualityDetail) { | ||
200 | + if (qualityDetail.getStatus().intValue() > QuantityConstant.QUALITY_HEADER_BUILD) { | ||
201 | + throw new JeecgBootException("不能添加非新建状态单据"); | ||
202 | + } | ||
203 | + qualityDetailService.updateById(qualityDetail); | ||
204 | + return Result.OK("编辑成功!"); | ||
205 | + } | ||
206 | + | ||
207 | + /** | ||
208 | + * 通过id删除 | ||
209 | + * @param id | ||
210 | + * @return | ||
211 | + */ | ||
212 | + @AutoLog(value = "质检单详情-通过id删除") | ||
213 | + @ApiOperation(value = "质检单详情-通过id删除", notes = "质检单详情-通过id删除") | ||
214 | + @DeleteMapping(value = "/deleteQualityDetail") | ||
215 | + public Result<String> deleteQualityDetail(@RequestParam(name = "id", required = true) String id) { | ||
216 | + QualityDetail qualityDetail = qualityDetailService.getById(id); | ||
217 | + if (qualityDetail.getStatus().intValue() > QuantityConstant.QUALITY_HEADER_BUILD) { | ||
218 | + throw new JeecgBootException("不能添加非新建状态单据"); | ||
219 | + } | ||
220 | + qualityDetailService.removeById(id); | ||
221 | + return Result.OK("删除成功!"); | ||
222 | + } | ||
223 | + | ||
224 | + /** | ||
225 | + * 批量删除 | ||
226 | + * @param ids | ||
227 | + * @return | ||
228 | + */ | ||
229 | + @AutoLog(value = "质检单详情-批量删除") | ||
230 | + @ApiOperation(value = "质检单详情-批量删除", notes = "质检单详情-批量删除") | ||
231 | + @DeleteMapping(value = "/deleteBatchQualityDetail") | ||
232 | + public Result<String> deleteBatchQualityDetail(@RequestParam(name = "ids", required = true) String ids) { | ||
233 | + this.qualityDetailService.removeByIds(Arrays.asList(ids.split(","))); | ||
234 | + return Result.OK("批量删除成功!"); | ||
235 | + } | ||
236 | + | ||
237 | + /** | ||
238 | + * 导出 | ||
239 | + * @return | ||
240 | + */ | ||
241 | + @RequestMapping(value = "/exportQualityDetail") | ||
242 | + public ModelAndView exportQualityDetail(HttpServletRequest request, QualityDetail qualityDetail) { | ||
243 | + // Step.1 组装查询条件 | ||
244 | + QueryWrapper<QualityDetail> queryWrapper = QueryGenerator.initQueryWrapper(qualityDetail, request.getParameterMap()); | ||
245 | + LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); | ||
246 | + | ||
247 | + // Step.2 获取导出数据 | ||
248 | + List<QualityDetail> pageList = qualityDetailService.list(queryWrapper); | ||
249 | + List<QualityDetail> exportList = null; | ||
250 | + | ||
251 | + // 过滤选中数据 | ||
252 | + String selections = request.getParameter("selections"); | ||
253 | + if (oConvertUtils.isNotEmpty(selections)) { | ||
254 | + List<String> selectionList = Arrays.asList(selections.split(",")); | ||
255 | + exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); | ||
256 | + } else { | ||
257 | + exportList = pageList; | ||
258 | + } | ||
259 | + | ||
260 | + // Step.3 AutoPoi 导出Excel | ||
261 | + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | ||
262 | + mv.addObject(NormalExcelConstants.FILE_NAME, "质检单详情"); // 此处设置的filename无效 ,前端会重更新设置一下 | ||
263 | + mv.addObject(NormalExcelConstants.CLASS, QualityDetail.class); | ||
264 | + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("质检单详情报表", "导出人:" + sysUser.getRealname(), "质检单详情")); | ||
265 | + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); | ||
266 | + return mv; | ||
267 | + } | ||
268 | + | ||
269 | + /** | ||
270 | + * 导入 | ||
271 | + * @return | ||
272 | + */ | ||
273 | + @RequestMapping(value = "/importQualityDetail/{mainId}") | ||
274 | + public Result<?> importQualityDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) { | ||
275 | + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request; | ||
276 | + Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | ||
277 | + for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | ||
278 | + MultipartFile file = entity.getValue();// 获取上传文件对象 | ||
279 | + ImportParams params = new ImportParams(); | ||
280 | + params.setTitleRows(2); | ||
281 | + params.setHeadRows(1); | ||
282 | + params.setNeedSave(true); | ||
283 | + try { | ||
284 | + List<QualityDetail> list = ExcelImportUtil.importExcel(file.getInputStream(), QualityDetail.class, params); | ||
285 | + for (QualityDetail temp : list) { | ||
286 | + temp.setQualityId(mainId); | ||
287 | + } | ||
288 | + long start = System.currentTimeMillis(); | ||
289 | + qualityDetailService.saveBatch(list); | ||
290 | + log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); | ||
291 | + return Result.OK("文件导入成功!数据行数:" + list.size()); | ||
292 | + } catch (Exception e) { | ||
293 | + log.error(e.getMessage(), e); | ||
294 | + return Result.error("文件导入失败:" + e.getMessage()); | ||
295 | + } finally { | ||
296 | + try { | ||
297 | + file.getInputStream().close(); | ||
298 | + } catch (IOException e) { | ||
299 | + e.printStackTrace(); | ||
300 | + } | ||
301 | + } | ||
302 | + } | ||
303 | + return Result.error("文件导入失败!"); | ||
304 | + } | ||
305 | + | ||
306 | + /*--------------------------------子表处理-质检单详情-end----------------------------------------------*/ | ||
307 | + | ||
308 | + /** | ||
309 | + * 质检 | ||
310 | + * @param qualityDetail | ||
311 | + * @return | ||
312 | + */ | ||
313 | + @AutoLog(value = "质检单详情-质检") | ||
314 | + @ApiOperation(value = "质检单详情-质检", notes = "质检单详情-质检") | ||
315 | + @RequestMapping(value = "/qualityTesting", method = {RequestMethod.PUT, RequestMethod.POST}) | ||
316 | + public Result<String> qualityTesting(@RequestBody QualityDetail qualityDetail) { | ||
317 | + return qualityDetailService.qualityTesting(qualityDetail); | ||
318 | + } | ||
319 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/entity/QualityDetail.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.entity; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.math.BigDecimal; | ||
5 | + | ||
6 | +import org.jeecg.common.aspect.annotation.Dict; | ||
7 | +import org.jeecg.common.exception.JeecgBootException; | ||
8 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
9 | + | ||
10 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
11 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
12 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
13 | + | ||
14 | +import io.swagger.annotations.ApiModel; | ||
15 | +import io.swagger.annotations.ApiModelProperty; | ||
16 | +import lombok.Data; | ||
17 | + | ||
18 | +/** | ||
19 | + * @Description: 质检单详情 | ||
20 | + * @Author: jeecg-boot | ||
21 | + * @Date: 2023-10-24 | ||
22 | + * @Version: V1.0 | ||
23 | + */ | ||
24 | +@Data | ||
25 | +@TableName("quality_detail") | ||
26 | +@ApiModel(value = "quality_detail对象", description = "质检单详情") | ||
27 | +public class QualityDetail implements Serializable { | ||
28 | + private static final long serialVersionUID = 1L; | ||
29 | + | ||
30 | + /** 主键 */ | ||
31 | + @TableId(type = IdType.AUTO) | ||
32 | + @ApiModelProperty(value = "主键") | ||
33 | + private java.lang.Integer id; | ||
34 | + /** 质检单id */ | ||
35 | + @ApiModelProperty(value = "质检单id") | ||
36 | + private java.lang.Integer qualityId; | ||
37 | + /** 质检单号 */ | ||
38 | + @Excel(name = "质检单号", width = 15) | ||
39 | + @ApiModelProperty(value = "质检单号") | ||
40 | + private java.lang.String qualityCode; | ||
41 | + /** 仓库编码 */ | ||
42 | + @Excel(name = "仓库编码", width = 15) | ||
43 | + @ApiModelProperty(value = "仓库编码") | ||
44 | + private java.lang.String warehouseCode; | ||
45 | + /** 货主编码 */ | ||
46 | + @Excel(name = "货主编码", width = 15) | ||
47 | + @ApiModelProperty(value = "货主编码") | ||
48 | + private java.lang.String companyCode; | ||
49 | + /** 物料编码 */ | ||
50 | + @Excel(name = "物料编码", width = 15) | ||
51 | + @ApiModelProperty(value = "物料编码") | ||
52 | + private java.lang.String materialCode; | ||
53 | + /** 物料名称 */ | ||
54 | + @Excel(name = "物料名称", width = 15) | ||
55 | + @ApiModelProperty(value = "物料名称") | ||
56 | + private java.lang.String materialName; | ||
57 | + /** 物料规格 */ | ||
58 | + @Excel(name = "物料规格", width = 15) | ||
59 | + @ApiModelProperty(value = "物料规格") | ||
60 | + private java.lang.String materialSpec; | ||
61 | + /** 物料单位 */ | ||
62 | + @Excel(name = "物料单位", width = 15) | ||
63 | + @ApiModelProperty(value = "物料单位") | ||
64 | + private java.lang.String materialUnit; | ||
65 | + /** 单据数量 */ | ||
66 | + @Excel(name = "单据数量", width = 15) | ||
67 | + @ApiModelProperty(value = "单据数量") | ||
68 | + private BigDecimal qty; | ||
69 | + /** 合格数量 */ | ||
70 | + @Excel(name = "合格数量", width = 15) | ||
71 | + @ApiModelProperty(value = "合格数量") | ||
72 | + private BigDecimal qualityfiedQty; | ||
73 | + /** 不合格数量 */ | ||
74 | + @Excel(name = "不合格数量", width = 15) | ||
75 | + @ApiModelProperty(value = "不合格数量") | ||
76 | + private BigDecimal unqualityfiedQty; | ||
77 | + /** 不合格原因 */ | ||
78 | + @Excel(name = "不合格原因", width = 15) | ||
79 | + @ApiModelProperty(value = "不合格原因") | ||
80 | + private java.lang.String remark; | ||
81 | + /** 库存状态 */ | ||
82 | + @Excel(name = "库存状态", width = 15) | ||
83 | + @ApiModelProperty(value = "库存状态") | ||
84 | + @Dict(dicCode = "inventory_status") | ||
85 | + private java.lang.String inventoryStatus; | ||
86 | + /** 批次 */ | ||
87 | + @Excel(name = "批次", width = 15) | ||
88 | + @ApiModelProperty(value = "批次") | ||
89 | + private java.lang.String batch; | ||
90 | + /** 批号 */ | ||
91 | + @Excel(name = "批号", width = 15) | ||
92 | + @ApiModelProperty(value = "批号") | ||
93 | + private java.lang.String lot; | ||
94 | + /** 项目号 */ | ||
95 | + @Excel(name = "项目号", width = 15) | ||
96 | + @ApiModelProperty(value = "项目号") | ||
97 | + private java.lang.String project; | ||
98 | + /** 单据状态 */ | ||
99 | + @Excel(name = "单据状态", width = 15) | ||
100 | + @ApiModelProperty(value = "单据状态") | ||
101 | + @Dict(dicCode = "quality_header_status") | ||
102 | + private java.lang.Integer status; | ||
103 | + /** 上游单号 */ | ||
104 | + @Excel(name = "上游单号", width = 15) | ||
105 | + @ApiModelProperty(value = "上游单号") | ||
106 | + private java.lang.String referCode; | ||
107 | + /** 上游行号 */ | ||
108 | + @Excel(name = "上游行号", width = 15) | ||
109 | + @ApiModelProperty(value = "上游行号") | ||
110 | + private java.lang.Integer referLineNum; | ||
111 | + /** 创建人 */ | ||
112 | + @ApiModelProperty(value = "创建人") | ||
113 | + private java.lang.String createBy; | ||
114 | + /** 创建日期 */ | ||
115 | + @ApiModelProperty(value = "创建日期") | ||
116 | + private java.util.Date createTime; | ||
117 | + /** 更新人 */ | ||
118 | + @ApiModelProperty(value = "更新人") | ||
119 | + private java.lang.String updateBy; | ||
120 | + /** 更新日期 */ | ||
121 | + @ApiModelProperty(value = "更新日期") | ||
122 | + private java.util.Date updateTime; | ||
123 | + | ||
124 | + public void setQty(BigDecimal qty) { | ||
125 | + if (qty.compareTo(BigDecimal.ZERO) < 0) { | ||
126 | + throw new JeecgBootException("质检单据数量不能小于0"); | ||
127 | + } | ||
128 | + this.qty = qty; | ||
129 | + } | ||
130 | + | ||
131 | + public void setQualityfiedQty(BigDecimal qualityfiedQty) { | ||
132 | + if (qualityfiedQty.compareTo(BigDecimal.ZERO) < 0) { | ||
133 | + throw new JeecgBootException("质检合格数量不能小于0"); | ||
134 | + } | ||
135 | + this.qualityfiedQty = qualityfiedQty; | ||
136 | + } | ||
137 | + | ||
138 | + public void setUnqualityfiedQty(BigDecimal unqualityfiedQty) { | ||
139 | + if (unqualityfiedQty.compareTo(BigDecimal.ZERO) < 0) { | ||
140 | + throw new JeecgBootException("质检不合格数量不能小于0"); | ||
141 | + } | ||
142 | + this.unqualityfiedQty = unqualityfiedQty; | ||
143 | + } | ||
144 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/entity/QualityHeader.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.entity; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | + | ||
5 | +import org.jeecg.common.aspect.annotation.Dict; | ||
6 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
7 | + | ||
8 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
9 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
10 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
11 | + | ||
12 | +import io.swagger.annotations.ApiModel; | ||
13 | +import io.swagger.annotations.ApiModelProperty; | ||
14 | +import lombok.Data; | ||
15 | + | ||
16 | +/** | ||
17 | + * @Description: 质检表单头 | ||
18 | + * @Author: jeecg-boot | ||
19 | + * @Date: 2023-10-24 | ||
20 | + * @Version: V1.0 | ||
21 | + */ | ||
22 | +@Data | ||
23 | +@TableName("quality_header") | ||
24 | +@ApiModel(value = "quality_header对象", description = "质检表单头") | ||
25 | +public class QualityHeader implements Serializable { | ||
26 | + private static final long serialVersionUID = 1L; | ||
27 | + | ||
28 | + /** 主键 */ | ||
29 | + @TableId(type = IdType.AUTO) | ||
30 | + @ApiModelProperty(value = "主键") | ||
31 | + private java.lang.Integer id; | ||
32 | + /** 编码 */ | ||
33 | + @Excel(name = "编码", width = 15) | ||
34 | + @ApiModelProperty(value = "编码") | ||
35 | + private java.lang.String code; | ||
36 | + /** 类型 */ | ||
37 | + @Excel(name = "类型", width = 15) | ||
38 | + @ApiModelProperty(value = "类型") | ||
39 | + @Dict(dicCode = "quality_type") | ||
40 | + private java.lang.String type; | ||
41 | + /** 仓库编码 */ | ||
42 | + @Excel(name = "仓库编码", width = 15) | ||
43 | + @ApiModelProperty(value = "仓库编码") | ||
44 | + private java.lang.String warehouseCode; | ||
45 | + /** 货主编码 */ | ||
46 | + @Excel(name = "货主编码", width = 15) | ||
47 | + @ApiModelProperty(value = "货主编码") | ||
48 | + private java.lang.String companyCode; | ||
49 | + /** 头状态 */ | ||
50 | + @Excel(name = "头状态", width = 15) | ||
51 | + @ApiModelProperty(value = "头状态") | ||
52 | + @Dict(dicCode = "quality_header_status") | ||
53 | + private java.lang.Integer firstStatus; | ||
54 | + /** 尾状态 */ | ||
55 | + @Excel(name = "尾状态", width = 15) | ||
56 | + @ApiModelProperty(value = "尾状态") | ||
57 | + @Dict(dicCode = "quality_header_status") | ||
58 | + private java.lang.Integer lastStatus; | ||
59 | + /** 上游单号 */ | ||
60 | + @Excel(name = "上游单号", width = 15) | ||
61 | + @ApiModelProperty(value = "上游单号") | ||
62 | + private java.lang.String referCode; | ||
63 | + /** 供应商编码 */ | ||
64 | + @Excel(name = "供应商编码", width = 15) | ||
65 | + @ApiModelProperty(value = "供应商编码") | ||
66 | + private java.lang.String supplierCode; | ||
67 | + /** 总数量 */ | ||
68 | + @Excel(name = "总数量", width = 15) | ||
69 | + @ApiModelProperty(value = "总数量") | ||
70 | + private java.math.BigDecimal totalQty; | ||
71 | + /** 总行数 */ | ||
72 | + @Excel(name = "总行数", width = 15) | ||
73 | + @ApiModelProperty(value = "总行数") | ||
74 | + private java.lang.Integer totalLines; | ||
75 | + /** 备注 */ | ||
76 | + @Excel(name = "备注", width = 15) | ||
77 | + @ApiModelProperty(value = "备注") | ||
78 | + private java.lang.String remark; | ||
79 | + /** 创建人 */ | ||
80 | + @ApiModelProperty(value = "创建人") | ||
81 | + private java.lang.String createBy; | ||
82 | + /** 创建日期 */ | ||
83 | + @ApiModelProperty(value = "创建日期") | ||
84 | + private java.util.Date createTime; | ||
85 | + /** 更新人 */ | ||
86 | + @ApiModelProperty(value = "更新人") | ||
87 | + private java.lang.String updateBy; | ||
88 | + /** 更新日期 */ | ||
89 | + @ApiModelProperty(value = "更新日期") | ||
90 | + private java.util.Date updateTime; | ||
91 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/mapper/QualityDetailMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | ||
7 | + | ||
8 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
9 | + | ||
10 | +/** | ||
11 | + * @Description: 质检单详情 | ||
12 | + * @Author: jeecg-boot | ||
13 | + * @Date: 2023-10-24 | ||
14 | + * @Version: V1.0 | ||
15 | + */ | ||
16 | +public interface QualityDetailMapper extends BaseMapper<QualityDetail> { | ||
17 | + | ||
18 | + public boolean deleteByMainId(@Param("mainId") String mainId); | ||
19 | + | ||
20 | + public List<QualityDetail> selectByMainId(@Param("mainId") String mainId); | ||
21 | + | ||
22 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/mapper/QualityHeaderMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.mapper; | ||
2 | + | ||
3 | +import org.apache.ibatis.annotations.Param; | ||
4 | +import org.apache.ibatis.annotations.Select; | ||
5 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityHeader; | ||
6 | + | ||
7 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | + | ||
9 | +/** | ||
10 | + * @Description: 质检表单头 | ||
11 | + * @Author: jeecg-boot | ||
12 | + * @Date: 2023-10-24 | ||
13 | + * @Version: V1.0 | ||
14 | + */ | ||
15 | +public interface QualityHeaderMapper extends BaseMapper<QualityHeader> { | ||
16 | + | ||
17 | + @Select("select r.code from quality_header r where r.type = #{qualityType} order by r.code desc limit 1") | ||
18 | + QualityHeader getMaxQualityHeaderCode(@Param("qualityType") String qualityType); | ||
19 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/mapper/xml/QualityDetailMapper.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.qualityHeader.mapper.QualityDetailMapper"> | ||
4 | + | ||
5 | + <delete id="deleteByMainId" parameterType="java.lang.String"> | ||
6 | + DELETE | ||
7 | + FROM quality_detail | ||
8 | + WHERE quality_id = #{mainId} | ||
9 | + </delete> | ||
10 | + | ||
11 | + <select id="selectByMainId" parameterType="java.lang.String" | ||
12 | + resultType="org.jeecg.modules.wms.receipt.qualityHeader.mapper.QualityDetailMapper"> | ||
13 | + SELECT * | ||
14 | + FROM quality_detail | ||
15 | + WHERE quality_id = #{mainId} | ||
16 | + </select> | ||
17 | + | ||
18 | +</mapper> |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/mapper/xml/QualityHeaderMapper.xml
0 → 100644
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/service/IQualityDetailService.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.service; | ||
2 | + | ||
3 | +import java.math.BigDecimal; | ||
4 | +import java.util.List; | ||
5 | + | ||
6 | +import org.jeecg.common.api.vo.Result; | ||
7 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | ||
8 | + | ||
9 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
10 | + | ||
11 | +/** | ||
12 | + * @Description: 质检单详情 | ||
13 | + * @Author: jeecg-boot | ||
14 | + * @Date: 2023-10-24 | ||
15 | + * @Version: V1.0 | ||
16 | + */ | ||
17 | +public interface IQualityDetailService extends IService<QualityDetail> { | ||
18 | + | ||
19 | + public List<QualityDetail> selectByMainId(String mainId); | ||
20 | + | ||
21 | + /** | ||
22 | + * 质检 | ||
23 | + * @return | ||
24 | + */ | ||
25 | + Result qualityTesting(QualityDetail qualityDetail); | ||
26 | + | ||
27 | + /** | ||
28 | + * 更新质检信息 | ||
29 | + * @return | ||
30 | + */ | ||
31 | + boolean updateQualityById(BigDecimal qualityfiedQty, BigDecimal unqualityfiedQty, int id); | ||
32 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/service/IQualityHeaderService.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.service; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Collection; | ||
5 | + | ||
6 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityHeader; | ||
7 | + | ||
8 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
9 | + | ||
10 | +/** | ||
11 | + * @Description: 质检表单头 | ||
12 | + * @Author: jeecg-boot | ||
13 | + * @Date: 2023-10-24 | ||
14 | + * @Version: V1.0 | ||
15 | + */ | ||
16 | +public interface IQualityHeaderService extends IService<QualityHeader> { | ||
17 | + | ||
18 | + /** | ||
19 | + * 删除一对多 | ||
20 | + */ | ||
21 | + public void delMain(String id); | ||
22 | + | ||
23 | + /** | ||
24 | + * 批量删除一对多 | ||
25 | + */ | ||
26 | + public void delBatchMain(Collection<? extends Serializable> idList); | ||
27 | + | ||
28 | + QualityHeader getQualityHeaderByReferCode(String referCode, String warehouseCode); | ||
29 | + | ||
30 | + String createQualityCode(String qualityType); | ||
31 | + | ||
32 | + boolean updateQualityHeader(Integer id); | ||
33 | + | ||
34 | + boolean updateQualityHeaderStatus(Integer id); | ||
35 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/service/impl/QualityDetailServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.service.impl; | ||
2 | + | ||
3 | +import java.math.BigDecimal; | ||
4 | +import java.util.ArrayList; | ||
5 | +import java.util.List; | ||
6 | + | ||
7 | +import javax.annotation.Resource; | ||
8 | + | ||
9 | +import org.jeecg.common.api.vo.Result; | ||
10 | +import org.jeecg.common.exception.JeecgBootException; | ||
11 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | ||
12 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | ||
13 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | ||
14 | +import org.jeecg.modules.wms.receipt.qualityHeader.mapper.QualityDetailMapper; | ||
15 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityDetailService; | ||
16 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityHeaderService; | ||
17 | +import org.jeecg.utils.constant.QuantityConstant; | ||
18 | +import org.springframework.beans.factory.annotation.Autowired; | ||
19 | +import org.springframework.stereotype.Service; | ||
20 | +import org.springframework.transaction.annotation.Transactional; | ||
21 | + | ||
22 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
23 | + | ||
24 | +/** | ||
25 | + * @Description: 质检单详情 | ||
26 | + * @Author: jeecg-boot | ||
27 | + * @Date: 2023-10-24 | ||
28 | + * @Version: V1.0 | ||
29 | + */ | ||
30 | +@Service | ||
31 | +public class QualityDetailServiceImpl extends ServiceImpl<QualityDetailMapper, QualityDetail> implements IQualityDetailService { | ||
32 | + | ||
33 | + @Autowired | ||
34 | + private QualityDetailMapper qualityDetailMapper; | ||
35 | + @Resource | ||
36 | + private IQualityDetailService qualityDetailService; | ||
37 | + @Resource | ||
38 | + private IQualityHeaderService qualityHeaderService; | ||
39 | + @Resource | ||
40 | + private IInventoryTransactionService inventoryTransactionService; | ||
41 | + | ||
42 | + @Override | ||
43 | + public List<QualityDetail> selectByMainId(String mainId) { | ||
44 | + return qualityDetailMapper.selectByMainId(mainId); | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + @Transactional(rollbackFor = Exception.class) | ||
49 | + public Result qualityTesting(QualityDetail qualityDetail) { | ||
50 | + if (qualityDetail == null) { | ||
51 | + return Result.error("质检失败, 质检数据为空"); | ||
52 | + } | ||
53 | + if (qualityDetail.getStatus().intValue() == QuantityConstant.QUALITY_HEADER_COMPLETE) { | ||
54 | + return Result.error("质检失败, 已经质检完成"); | ||
55 | + } | ||
56 | + BigDecimal qty = qualityDetail.getQty(); | ||
57 | + BigDecimal qualityfiedQty = qualityDetail.getQualityfiedQty(); | ||
58 | + BigDecimal unqualityfiedQty = qualityDetail.getUnqualityfiedQty(); | ||
59 | + BigDecimal totalQty = qualityfiedQty.add(unqualityfiedQty); | ||
60 | + if (qty.compareTo(totalQty) != 0) { | ||
61 | + return Result.error("质检失败, 质检总数应该等于单据数量"); | ||
62 | + } | ||
63 | + QualityDetail qualityDetail1 = new QualityDetail(); | ||
64 | + qualityDetail1.setId(qualityDetail.getId()); | ||
65 | + qualityDetail1.setQualityfiedQty(qualityfiedQty); | ||
66 | + qualityDetail1.setUnqualityfiedQty(unqualityfiedQty); | ||
67 | + qualityDetail1.setRemark(qualityDetail.getRemark()); | ||
68 | + qualityDetail1.setStatus(QuantityConstant.QUALITY_HEADER_COMPLETE); | ||
69 | + if (!qualityDetailService.updateById(qualityDetail1)) { | ||
70 | + throw new JeecgBootException("质检失败,更新质检数据失败"); | ||
71 | + } | ||
72 | + | ||
73 | + if (!qualityHeaderService.updateQualityHeaderStatus(qualityDetail.getQualityId())) { | ||
74 | + throw new JeecgBootException("质检失败,更新质检状态失败"); | ||
75 | + } | ||
76 | + | ||
77 | + List<InventoryTransaction> inventoryTransactionList = new ArrayList<>(); | ||
78 | + if (qualityfiedQty.compareTo(BigDecimal.ZERO) > 0) { | ||
79 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | ||
80 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_QUALITY); | ||
81 | + inventoryTransaction.setWarehouseCode(qualityDetail.getWarehouseCode()); | ||
82 | + inventoryTransaction.setCompanyCode(qualityDetail.getCompanyCode()); | ||
83 | + inventoryTransaction.setReceiptCode(qualityDetail.getQualityCode()); | ||
84 | + inventoryTransaction.setMaterialCode(qualityDetail.getMaterialCode()); | ||
85 | + inventoryTransaction.setMaterialName(qualityDetail.getMaterialName()); | ||
86 | + inventoryTransaction.setMaterialSpec(qualityDetail.getMaterialSpec()); | ||
87 | + inventoryTransaction.setMaterialUnit(qualityDetail.getMaterialUnit()); | ||
88 | + inventoryTransaction.setBatch(qualityDetail.getBatch()); | ||
89 | + inventoryTransaction.setLot(qualityDetail.getLot()); | ||
90 | + inventoryTransaction.setProject(qualityDetail.getProject()); | ||
91 | + inventoryTransaction.setInventoryStatus(QuantityConstant.QUALITY_GOOD); | ||
92 | + inventoryTransaction.setQty(qualityfiedQty); | ||
93 | + inventoryTransactionList.add(inventoryTransaction); | ||
94 | + } | ||
95 | + if (unqualityfiedQty.compareTo(BigDecimal.ZERO) > 0) { | ||
96 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | ||
97 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_QUALITY); | ||
98 | + inventoryTransaction.setWarehouseCode(qualityDetail.getWarehouseCode()); | ||
99 | + inventoryTransaction.setCompanyCode(qualityDetail.getCompanyCode()); | ||
100 | + inventoryTransaction.setReceiptCode(qualityDetail.getQualityCode()); | ||
101 | + inventoryTransaction.setMaterialCode(qualityDetail.getMaterialCode()); | ||
102 | + inventoryTransaction.setMaterialName(qualityDetail.getMaterialName()); | ||
103 | + inventoryTransaction.setMaterialSpec(qualityDetail.getMaterialSpec()); | ||
104 | + inventoryTransaction.setMaterialUnit(qualityDetail.getMaterialUnit()); | ||
105 | + inventoryTransaction.setBatch(qualityDetail.getBatch()); | ||
106 | + inventoryTransaction.setLot(qualityDetail.getLot()); | ||
107 | + inventoryTransaction.setProject(qualityDetail.getProject()); | ||
108 | + inventoryTransaction.setInventoryStatus(QuantityConstant.QUALITY_DEFECTIVE); | ||
109 | + inventoryTransaction.setQty(unqualityfiedQty); | ||
110 | + inventoryTransactionList.add(inventoryTransaction); | ||
111 | + } | ||
112 | + if (!inventoryTransactionService.saveBatch(inventoryTransactionList)) { | ||
113 | + throw new JeecgBootException("质检失败,增加库存交易记录失败"); | ||
114 | + } | ||
115 | + return Result.ok("质检成功"); | ||
116 | + } | ||
117 | + | ||
118 | + @Override | ||
119 | + public boolean updateQualityById(BigDecimal qualityfiedQty, BigDecimal unqualityfiedQty, int id) { | ||
120 | + QualityDetail qualityDetail = new QualityDetail(); | ||
121 | + qualityDetail.setId(id); | ||
122 | + qualityDetail.setQualityfiedQty(qualityfiedQty); | ||
123 | + qualityDetail.setUnqualityfiedQty(unqualityfiedQty); | ||
124 | + return updateById(qualityDetail); | ||
125 | + } | ||
126 | + | ||
127 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/qualityHeader/service/impl/QualityHeaderServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.receipt.qualityHeader.service.impl; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.math.BigDecimal; | ||
5 | +import java.text.SimpleDateFormat; | ||
6 | +import java.util.Collection; | ||
7 | +import java.util.Date; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +import javax.annotation.Resource; | ||
11 | + | ||
12 | +import org.jeecg.common.exception.JeecgBootException; | ||
13 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | ||
14 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityHeader; | ||
15 | +import org.jeecg.modules.wms.receipt.qualityHeader.mapper.QualityDetailMapper; | ||
16 | +import org.jeecg.modules.wms.receipt.qualityHeader.mapper.QualityHeaderMapper; | ||
17 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityDetailService; | ||
18 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityHeaderService; | ||
19 | +import org.jeecg.utils.constant.QuantityConstant; | ||
20 | +import org.springframework.beans.factory.annotation.Autowired; | ||
21 | +import org.springframework.stereotype.Service; | ||
22 | +import org.springframework.transaction.annotation.Transactional; | ||
23 | + | ||
24 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
25 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
26 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
27 | + | ||
28 | +/** | ||
29 | + * @Description: 质检表单头 | ||
30 | + * @Author: jeecg-boot | ||
31 | + * @Date: 2023-10-24 | ||
32 | + * @Version: V1.0 | ||
33 | + */ | ||
34 | +@Service | ||
35 | +public class QualityHeaderServiceImpl extends ServiceImpl<QualityHeaderMapper, QualityHeader> implements IQualityHeaderService { | ||
36 | + | ||
37 | + @Autowired | ||
38 | + private QualityHeaderMapper qualityHeaderMapper; | ||
39 | + @Autowired | ||
40 | + private QualityDetailMapper qualityDetailMapper; | ||
41 | + @Resource | ||
42 | + private IQualityDetailService qualityDetailService; | ||
43 | + @Resource | ||
44 | + private IQualityHeaderService qualityHeaderService; | ||
45 | + | ||
46 | + @Override | ||
47 | + @Transactional | ||
48 | + public void delMain(String id) { | ||
49 | + qualityDetailMapper.deleteByMainId(id); | ||
50 | + qualityHeaderMapper.deleteById(id); | ||
51 | + } | ||
52 | + | ||
53 | + @Override | ||
54 | + @Transactional | ||
55 | + public void delBatchMain(Collection<? extends Serializable> idList) { | ||
56 | + for (Serializable id : idList) { | ||
57 | + qualityDetailMapper.deleteByMainId(id.toString()); | ||
58 | + qualityHeaderMapper.deleteById(id); | ||
59 | + } | ||
60 | + } | ||
61 | + | ||
62 | + @Override | ||
63 | + public QualityHeader getQualityHeaderByReferCode(String referCode, String warehouseCode) { | ||
64 | + LambdaQueryWrapper<QualityHeader> qualityHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
65 | + qualityHeaderLambdaQueryWrapper.eq(QualityHeader::getReferCode, referCode); | ||
66 | + QualityHeader qualityHeader = getOne(qualityHeaderLambdaQueryWrapper); | ||
67 | + return qualityHeader; | ||
68 | + } | ||
69 | + | ||
70 | + @Override | ||
71 | + @Transactional | ||
72 | + public String createQualityCode(String qualityType) { | ||
73 | + String code = null; | ||
74 | + Date now = new Date(); | ||
75 | + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); | ||
76 | + String maxCode = null; | ||
77 | + QualityHeader qualityHeader = qualityHeaderMapper.getMaxQualityHeaderCode(qualityType); | ||
78 | + if (qualityHeader != null) { | ||
79 | + maxCode = qualityHeader.getCode(); | ||
80 | + } | ||
81 | + if (maxCode != null) { | ||
82 | + String day = maxCode.substring(maxCode.length() - 13, maxCode.length() - 5); | ||
83 | + if (day.equals(df.format(now))) { | ||
84 | + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | ||
85 | + code = qualityType + df.format(now) + String.format("%05d", Count + 1); | ||
86 | + } else { | ||
87 | + code = qualityType + df.format(now) + String.format("%05d", 0000 + 1); | ||
88 | + } | ||
89 | + } else { | ||
90 | + code = qualityType + df.format(now) + String.format("%05d", 0000 + 1); | ||
91 | + } | ||
92 | + return code; | ||
93 | + } | ||
94 | + | ||
95 | + @Override | ||
96 | + @Transactional(rollbackFor = Exception.class) | ||
97 | + public boolean updateQualityHeader(Integer id) { | ||
98 | + LambdaQueryWrapper<QualityDetail> qualityDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
99 | + qualityDetailLambdaQueryWrapper.eq(QualityDetail::getQualityId, id); | ||
100 | + List<QualityDetail> qualityDetailList = qualityDetailService.list(qualityDetailLambdaQueryWrapper); | ||
101 | + QualityHeader qualityHeader = qualityHeaderService.getById(id); | ||
102 | + if (qualityHeader == null) { | ||
103 | + return false; | ||
104 | + } | ||
105 | + BigDecimal totalQty = new BigDecimal(0); | ||
106 | + int totalLines = 0; | ||
107 | + for (QualityDetail qualityDetail : qualityDetailList) { | ||
108 | + totalLines++; | ||
109 | + totalQty = totalQty.add(qualityDetail.getQty()); | ||
110 | + } | ||
111 | + qualityHeader = new QualityHeader(); | ||
112 | + qualityHeader.setId(id); | ||
113 | + qualityHeader.setTotalQty(totalQty); | ||
114 | + qualityHeader.setTotalLines(totalLines); | ||
115 | + if (!qualityHeaderService.updateById(qualityHeader)) { | ||
116 | + return false; | ||
117 | + } | ||
118 | + return true; | ||
119 | + } | ||
120 | + | ||
121 | + @Override | ||
122 | + @Transactional(rollbackFor = Exception.class) | ||
123 | + public boolean updateQualityHeaderStatus(Integer id) { | ||
124 | + LambdaQueryWrapper<QualityDetail> qualityDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
125 | + qualityDetailLambdaQueryWrapper.eq(QualityDetail::getQualityId, id); | ||
126 | + List<QualityDetail> qualityDetailList = qualityDetailService.list(qualityDetailLambdaQueryWrapper); | ||
127 | + QualityHeader qualityHeader = qualityHeaderService.getById(id); | ||
128 | + if (qualityHeader == null) { | ||
129 | + return false; | ||
130 | + } | ||
131 | + int minStatus; | ||
132 | + int maxStatus; | ||
133 | + if (qualityDetailList.size() == 0) { | ||
134 | + minStatus = QuantityConstant.QUALITY_HEADER_BUILD; | ||
135 | + maxStatus = QuantityConstant.QUALITY_HEADER_BUILD; | ||
136 | + } else { | ||
137 | + minStatus = qualityDetailList.get(0).getStatus(); | ||
138 | + maxStatus = qualityDetailList.get(0).getStatus(); | ||
139 | + for (QualityDetail qualityDetail : qualityDetailList) { | ||
140 | + int status = qualityDetail.getStatus(); | ||
141 | + if (minStatus > status) { | ||
142 | + minStatus = status; | ||
143 | + } | ||
144 | + if (maxStatus < status) { | ||
145 | + maxStatus = status; | ||
146 | + } | ||
147 | + } | ||
148 | + } | ||
149 | + QualityHeader updateQualityHeader = new QualityHeader(); | ||
150 | + updateQualityHeader.setId(id); | ||
151 | + updateQualityHeader.setCode(qualityHeader.getCode()); | ||
152 | + updateQualityHeader.setReferCode(qualityHeader.getReferCode()); | ||
153 | + updateQualityHeader.setWarehouseCode(qualityHeader.getWarehouseCode()); | ||
154 | + updateQualityHeader.setFirstStatus(maxStatus); | ||
155 | + updateQualityHeader.setLastStatus(minStatus); | ||
156 | + if (!qualityHeaderService.updateById(updateQualityHeader)) { | ||
157 | + throw new JeecgBootException("更新收货单:" + id + " 状态失败"); | ||
158 | + } | ||
159 | + return true; | ||
160 | + } | ||
161 | +} |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
@@ -403,4 +403,13 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -403,4 +403,13 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
403 | } | 403 | } |
404 | return result; | 404 | return result; |
405 | } | 405 | } |
406 | + | ||
407 | + @AutoLog(value = "越库") | ||
408 | + @ApiOperation(value = "越库", notes = "越库") | ||
409 | + @PostMapping("/crossDocking") | ||
410 | + @ResponseBody | ||
411 | + @ApiLogger(apiName = "越库", from = "WMS") | ||
412 | + public Result<?> crossDocking(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) { | ||
413 | + return receiptHeaderService.crossDocking(id); | ||
414 | + } | ||
406 | } | 415 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/IReceiptHeaderService.java
@@ -41,4 +41,5 @@ public interface IReceiptHeaderService extends IService<ReceiptHeader> { | @@ -41,4 +41,5 @@ public interface IReceiptHeaderService extends IService<ReceiptHeader> { | ||
41 | 41 | ||
42 | String createReceiptCode(String receiptType); | 42 | String createReceiptCode(String receiptType); |
43 | 43 | ||
44 | + Result crossDocking(String id); | ||
44 | } | 45 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
@@ -3,6 +3,7 @@ package org.jeecg.modules.wms.receipt.receiptHeader.service.impl; | @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.receipt.receiptHeader.service.impl; | ||
3 | import java.io.Serializable; | 3 | import java.io.Serializable; |
4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
5 | import java.text.SimpleDateFormat; | 5 | import java.text.SimpleDateFormat; |
6 | +import java.util.ArrayList; | ||
6 | import java.util.Collection; | 7 | import java.util.Collection; |
7 | import java.util.Date; | 8 | import java.util.Date; |
8 | import java.util.List; | 9 | import java.util.List; |
@@ -15,6 +16,8 @@ import org.jeecg.modules.wms.audit.service.IAuditService; | @@ -15,6 +16,8 @@ import org.jeecg.modules.wms.audit.service.IAuditService; | ||
15 | import org.jeecg.modules.wms.config.receiptType.entity.ReceiptType; | 16 | import org.jeecg.modules.wms.config.receiptType.entity.ReceiptType; |
16 | import org.jeecg.modules.wms.config.receiptType.service.IReceiptTypeService; | 17 | import org.jeecg.modules.wms.config.receiptType.service.IReceiptTypeService; |
17 | import org.jeecg.modules.wms.flow.service.IFlowDetailService; | 18 | import org.jeecg.modules.wms.flow.service.IFlowDetailService; |
19 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | ||
20 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | ||
18 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | 21 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; |
19 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | 22 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; |
20 | import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptDetailMapper; | 23 | import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptDetailMapper; |
@@ -29,6 +32,7 @@ import org.springframework.stereotype.Service; | @@ -29,6 +32,7 @@ import org.springframework.stereotype.Service; | ||
29 | import org.springframework.transaction.annotation.Transactional; | 32 | import org.springframework.transaction.annotation.Transactional; |
30 | 33 | ||
31 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 34 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
35 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
32 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 36 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
33 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 37 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
34 | 38 | ||
@@ -60,6 +64,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | @@ -60,6 +64,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | ||
60 | private IFlowDetailService iFlowDetailService; | 64 | private IFlowDetailService iFlowDetailService; |
61 | @Resource | 65 | @Resource |
62 | private IAuditService iAuditService; | 66 | private IAuditService iAuditService; |
67 | + @Resource | ||
68 | + private IInventoryTransactionService inventoryTransactionService; | ||
63 | 69 | ||
64 | /** | 70 | /** |
65 | * @param id 入库单主表id | 71 | * @param id 入库单主表id |
@@ -136,18 +142,80 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | @@ -136,18 +142,80 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | ||
136 | } | 142 | } |
137 | if (maxCode != null) { | 143 | if (maxCode != null) { |
138 | String day = maxCode.substring(maxCode.length() - 13, maxCode.length() - 5); | 144 | String day = maxCode.substring(maxCode.length() - 13, maxCode.length() - 5); |
139 | - if (day.equals(df.format(now))) { | ||
140 | - Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | ||
141 | - code = receiptType + df.format(now) + String.format("%05d", Count + 1); | ||
142 | - } else { | ||
143 | - code = receiptType + df.format(now) + String.format("%05d", 0000 + 1); | ||
144 | - } | 145 | + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); |
146 | + code = receiptType + df.format(now) + String.format("%05d", Count + 1); | ||
145 | } else { | 147 | } else { |
146 | code = receiptType + df.format(now) + String.format("%05d", 0000 + 1); | 148 | code = receiptType + df.format(now) + String.format("%05d", 0000 + 1); |
147 | } | 149 | } |
148 | return code; | 150 | return code; |
149 | } | 151 | } |
150 | 152 | ||
153 | + @Override | ||
154 | + @Transactional(rollbackFor = Exception.class) | ||
155 | + public Result crossDocking(String id) { | ||
156 | + ReceiptHeader receiptHeader = receiptHeaderService.getById(id); | ||
157 | + if (receiptHeader == null) { | ||
158 | + return Result.error("越库失败,没有找到入库单头" + id); | ||
159 | + } | ||
160 | + List<ReceiptDetail> receiptDetailList = receiptDetailService.selectByMainId(id); | ||
161 | + if (CollectionUtils.isEmpty(receiptDetailList)) { | ||
162 | + return Result.error("越库失败,没有找到入库详情" + id); | ||
163 | + } | ||
164 | + List<InventoryTransaction> inventoryTransactionList = new ArrayList<>(); | ||
165 | + for (ReceiptDetail receiptDetail : receiptDetailList) { | ||
166 | + BigDecimal qty = receiptDetail.getQty(); | ||
167 | + receiptDetail.setTaskQty(qty); | ||
168 | + receiptDetail.setReceiptQty(qty); | ||
169 | + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED); | ||
170 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | ||
171 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_RECEIPT); | ||
172 | + inventoryTransaction.setWarehouseCode(receiptDetail.getWarehouseCode()); | ||
173 | + inventoryTransaction.setCompanyCode(receiptDetail.getCompanyCode()); | ||
174 | + inventoryTransaction.setMaterialCode(receiptDetail.getMaterialCode()); | ||
175 | + inventoryTransaction.setMaterialName(receiptDetail.getMaterialName()); | ||
176 | + inventoryTransaction.setMaterialSpec(receiptDetail.getMaterialSpec()); | ||
177 | + inventoryTransaction.setMaterialUnit(receiptDetail.getMaterialUnit()); | ||
178 | + inventoryTransaction.setReceiptId(receiptDetail.getReceiptId()); | ||
179 | + inventoryTransaction.setReceiptCode(receiptHeader.getCode()); | ||
180 | + inventoryTransaction.setReceiptType(receiptHeader.getType()); | ||
181 | + inventoryTransaction.setReceiptDetailId(receiptDetail.getId()); | ||
182 | + inventoryTransaction.setBatch(receiptDetail.getBatch()); | ||
183 | + inventoryTransaction.setLot(receiptDetail.getLot()); | ||
184 | + inventoryTransaction.setProject(receiptDetail.getProject()); | ||
185 | + inventoryTransaction.setInventoryStatus(receiptDetail.getInventoryStatus()); | ||
186 | + inventoryTransaction.setQty(qty); | ||
187 | + inventoryTransaction.setReceiptQty(qty); | ||
188 | + inventoryTransactionList.add(inventoryTransaction); | ||
189 | + | ||
190 | + inventoryTransaction = new InventoryTransaction(); | ||
191 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT); | ||
192 | + inventoryTransaction.setWarehouseCode(receiptDetail.getWarehouseCode()); | ||
193 | + inventoryTransaction.setCompanyCode(receiptDetail.getCompanyCode()); | ||
194 | + inventoryTransaction.setMaterialCode(receiptDetail.getMaterialCode()); | ||
195 | + inventoryTransaction.setMaterialName(receiptDetail.getMaterialName()); | ||
196 | + inventoryTransaction.setMaterialSpec(receiptDetail.getMaterialSpec()); | ||
197 | + inventoryTransaction.setMaterialUnit(receiptDetail.getMaterialUnit()); | ||
198 | + inventoryTransaction.setInventoryStatus(receiptDetail.getInventoryStatus()); | ||
199 | + inventoryTransaction.setBatch(receiptDetail.getBatch()); | ||
200 | + inventoryTransaction.setLot(receiptDetail.getLot()); | ||
201 | + inventoryTransaction.setProject(receiptDetail.getProject()); | ||
202 | + inventoryTransaction.setQty(receiptDetail.getQty()); | ||
203 | + inventoryTransaction.setShipmentQty(receiptDetail.getQty()); | ||
204 | + inventoryTransactionList.add(inventoryTransaction); | ||
205 | + } | ||
206 | + | ||
207 | + if (!receiptDetailService.updateBatchById(receiptDetailList)) { | ||
208 | + throw new JeecgBootException("越库失败,批量更新入库单详情失败"); | ||
209 | + } | ||
210 | + if (!inventoryTransactionService.saveBatch(inventoryTransactionList)) { | ||
211 | + throw new JeecgBootException("越库失败,批量保存库存交易记录失败"); | ||
212 | + } | ||
213 | + if (!receiptHeaderService.updateReceiptHeaderStatus(Integer.parseInt(id))) { | ||
214 | + throw new JeecgBootException("越库失败,批更新入库单失败"); | ||
215 | + } | ||
216 | + return Result.ok("越库成功"); | ||
217 | + } | ||
218 | + | ||
151 | /** | 219 | /** |
152 | * 更新入库单 头状态和尾状态 | 220 | * 更新入库单 头状态和尾状态 |
153 | * 头状态是单据详情中最大的状态 | 221 | * 头状态是单据详情中最大的状态 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/controller/ReceiveHeaderController.java
@@ -359,4 +359,47 @@ public class ReceiveHeaderController extends JeecgController<ReceiveHeader, IRec | @@ -359,4 +359,47 @@ public class ReceiveHeaderController extends JeecgController<ReceiveHeader, IRec | ||
359 | return result; | 359 | return result; |
360 | } | 360 | } |
361 | 361 | ||
362 | + /** | ||
363 | + * 全部收货 | ||
364 | + * @return | ||
365 | + */ | ||
366 | + @AutoLog("收货单-全部收货") | ||
367 | + @ApiOperation(value = "收货单-全部收货", notes = "收货单-全部收货") | ||
368 | + @PostMapping("/receiveHeader") | ||
369 | + @ResponseBody | ||
370 | + public Result receiveHeader(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) { | ||
371 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
372 | + String lockKey = warehouseCode; | ||
373 | + Result result = receiveDetailService.receiveHeader(id, warehouseCode); | ||
374 | + return result; | ||
375 | + } | ||
376 | + | ||
377 | + /** | ||
378 | + * 收货详情质检 | ||
379 | + * @return | ||
380 | + */ | ||
381 | + @AutoLog("收货单-收货详情质检") | ||
382 | + @ApiOperation(value = "收货单-收货详情质检", notes = "收货单-收货详情质检") | ||
383 | + @PostMapping("/receiveDetailToQuality") | ||
384 | + @ResponseBody | ||
385 | + public Result receiveDetailToQuality(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) { | ||
386 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
387 | + String lockKey = warehouseCode; | ||
388 | + Result result = receiveDetailService.receiveToQuality(id, warehouseCode); | ||
389 | + return result; | ||
390 | + } | ||
391 | + | ||
392 | + /** | ||
393 | + * 全部质检 | ||
394 | + * @return | ||
395 | + */ | ||
396 | + @AutoLog("收货单-全部质检") | ||
397 | + @ApiOperation(value = "收货单-全部质检", notes = "收货单-全部质检") | ||
398 | + @PostMapping("/receiveHeaderToQuality") | ||
399 | + @ResponseBody | ||
400 | + public Result receiveHeaderToQuality(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) { | ||
401 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
402 | + Result result = receiveHeaderService.receiveHeaderToQuality(id, warehouseCode); | ||
403 | + return result; | ||
404 | + } | ||
362 | } | 405 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/entity/ReceiveDetail.java
@@ -69,6 +69,10 @@ public class ReceiveDetail implements Serializable { | @@ -69,6 +69,10 @@ public class ReceiveDetail implements Serializable { | ||
69 | @Excel(name = "已收数量", width = 15) | 69 | @Excel(name = "已收数量", width = 15) |
70 | @ApiModelProperty(value = "已收数量") | 70 | @ApiModelProperty(value = "已收数量") |
71 | private java.math.BigDecimal taskQty; | 71 | private java.math.BigDecimal taskQty; |
72 | + /** 质检数量 */ | ||
73 | + @Excel(name = "质检数量", width = 15) | ||
74 | + @ApiModelProperty(value = "质检数量") | ||
75 | + private java.math.BigDecimal qualityQty; | ||
72 | /** 库存状态 */ | 76 | /** 库存状态 */ |
73 | @Excel(name = "库存状态", width = 15) | 77 | @Excel(name = "库存状态", width = 15) |
74 | @Dict(dicCode = "inventory_status") | 78 | @Dict(dicCode = "inventory_status") |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/service/IReceiveDetailService.java
1 | package org.jeecg.modules.wms.receipt.receiveHeader.service; | 1 | package org.jeecg.modules.wms.receipt.receiveHeader.service; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
3 | import java.util.List; | 4 | import java.util.List; |
4 | 5 | ||
5 | import org.jeecg.common.api.vo.Result; | 6 | import org.jeecg.common.api.vo.Result; |
@@ -21,4 +22,18 @@ public interface IReceiveDetailService extends IService<ReceiveDetail> { | @@ -21,4 +22,18 @@ public interface IReceiveDetailService extends IService<ReceiveDetail> { | ||
21 | Result saveReceiveDetail(ReceiveDetail receiveDetail); | 22 | Result saveReceiveDetail(ReceiveDetail receiveDetail); |
22 | 23 | ||
23 | Result receive(List<Receive> receiveList, String warehouseCode); | 24 | Result receive(List<Receive> receiveList, String warehouseCode); |
25 | + | ||
26 | + Result receiveHeader(String id, String warehouseCode); | ||
27 | + | ||
28 | + /** | ||
29 | + * 收货单转质检单 | ||
30 | + * @param id | ||
31 | + * @param warehouseCode | ||
32 | + * @return | ||
33 | + */ | ||
34 | + Result receiveToQuality(String id, String warehouseCode); | ||
35 | + | ||
36 | + boolean updateQualityQtyById(BigDecimal qualityQty, int id); | ||
37 | + | ||
38 | + boolean updateStatusById(int status, int id); | ||
24 | } | 39 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/service/IReceiveHeaderService.java
@@ -38,4 +38,6 @@ public interface IReceiveHeaderService extends IService<ReceiveHeader> { | @@ -38,4 +38,6 @@ public interface IReceiveHeaderService extends IService<ReceiveHeader> { | ||
38 | boolean updateReceiveHeader(Integer id); | 38 | boolean updateReceiveHeader(Integer id); |
39 | 39 | ||
40 | boolean updateReceiptHeaderStatus(Integer id); | 40 | boolean updateReceiptHeaderStatus(Integer id); |
41 | + | ||
42 | + Result receiveHeaderToQuality(String id, String warehouseCode); | ||
41 | } | 43 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/service/impl/ReceiveDetailServiceImpl.java
@@ -3,7 +3,6 @@ package org.jeecg.modules.wms.receipt.receiveHeader.service.impl; | @@ -3,7 +3,6 @@ package org.jeecg.modules.wms.receipt.receiveHeader.service.impl; | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
5 | import java.util.Collections; | 5 | import java.util.Collections; |
6 | -import java.util.Date; | ||
7 | import java.util.List; | 6 | import java.util.List; |
8 | 7 | ||
9 | import javax.annotation.Resource; | 8 | import javax.annotation.Resource; |
@@ -13,11 +12,16 @@ import org.jeecg.common.exception.JeecgBootException; | @@ -13,11 +12,16 @@ import org.jeecg.common.exception.JeecgBootException; | ||
13 | import org.jeecg.modules.wms.config.material.entity.Material; | 12 | import org.jeecg.modules.wms.config.material.entity.Material; |
14 | import org.jeecg.modules.wms.config.material.service.IMaterialService; | 13 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
15 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 14 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
16 | -import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; | ||
17 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 15 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; | 16 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
19 | import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | 17 | import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; |
20 | import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | 18 | import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; |
19 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityDetail; | ||
20 | +import org.jeecg.modules.wms.receipt.qualityHeader.entity.QualityHeader; | ||
21 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityDetailService; | ||
22 | +import org.jeecg.modules.wms.receipt.qualityHeader.service.IQualityHeaderService; | ||
23 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; | ||
24 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; | ||
21 | import org.jeecg.modules.wms.receipt.receiveHeader.entity.ReceiveDetail; | 25 | import org.jeecg.modules.wms.receipt.receiveHeader.entity.ReceiveDetail; |
22 | import org.jeecg.modules.wms.receipt.receiveHeader.entity.ReceiveHeader; | 26 | import org.jeecg.modules.wms.receipt.receiveHeader.entity.ReceiveHeader; |
23 | import org.jeecg.modules.wms.receipt.receiveHeader.mapper.ReceiveDetailMapper; | 27 | import org.jeecg.modules.wms.receipt.receiveHeader.mapper.ReceiveDetailMapper; |
@@ -52,6 +56,14 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | @@ -52,6 +56,14 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | ||
52 | @Resource | 56 | @Resource |
53 | private IReceiveHeaderService receiveHeaderService; | 57 | private IReceiveHeaderService receiveHeaderService; |
54 | @Resource | 58 | @Resource |
59 | + private IReceiptHeaderService receiptHeaderService; | ||
60 | + @Resource | ||
61 | + private IReceiptDetailService receiptDetailService; | ||
62 | + @Resource | ||
63 | + private IQualityHeaderService qualityHeaderService; | ||
64 | + @Resource | ||
65 | + private IQualityDetailService qualityDetailService; | ||
66 | + @Resource | ||
55 | private IMaterialService materialService; | 67 | private IMaterialService materialService; |
56 | @Resource | 68 | @Resource |
57 | private IReceiveDetailService receiveDetailService; | 69 | private IReceiveDetailService receiveDetailService; |
@@ -116,7 +128,7 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | @@ -116,7 +128,7 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | ||
116 | @Transactional(rollbackFor = Exception.class) | 128 | @Transactional(rollbackFor = Exception.class) |
117 | public Result receive(List<Receive> receiveList, String warehouseCode) { | 129 | public Result receive(List<Receive> receiveList, String warehouseCode) { |
118 | boolean success = false; | 130 | boolean success = false; |
119 | - if (receiveList == null || receiveList.size() == 0) { | 131 | + if (CollectionUtils.isEmpty(receiveList)) { |
120 | return Result.error("收货,收货信息为空"); | 132 | return Result.error("收货,收货信息为空"); |
121 | } | 133 | } |
122 | List<InventoryDetail> inventoryDetailList = new ArrayList<>(); | 134 | List<InventoryDetail> inventoryDetailList = new ArrayList<>(); |
@@ -172,41 +184,9 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | @@ -172,41 +184,9 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | ||
172 | receiveDetail1.setStatus(QuantityConstant.RECEIVE_HEADER_COMPLETE); | 184 | receiveDetail1.setStatus(QuantityConstant.RECEIVE_HEADER_COMPLETE); |
173 | } | 185 | } |
174 | receiveDetailList.add(receiveDetail1); | 186 | receiveDetailList.add(receiveDetail1); |
175 | - InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(receiveCode, warehouseCode); | ||
176 | - if (inventoryHeader == null) { | ||
177 | - inventoryHeader = new InventoryHeader(); | ||
178 | - inventoryHeader.setWarehouseCode(warehouseCode); | ||
179 | - inventoryHeader.setCompanyCode(receiveDetail.getCompanyCode()); | ||
180 | - inventoryHeader.setZoneCode(QuantityConstant.ZONE_RECEIVE); | ||
181 | - inventoryHeader.setContainerCode(receiveCode); | ||
182 | - inventoryHeader.setContainerStatus(QuantityConstant.STATUS_CONTAINER_EMPTY); | ||
183 | - inventoryHeader.setEnable(QuantityConstant.STATUS_ENABLE); | ||
184 | - if (!inventoryHeaderService.save(inventoryHeader)) { | ||
185 | - throw new JeecgBootException("收货, 添加库存头失败"); | ||
186 | - } | ||
187 | - } | ||
188 | - | ||
189 | - InventoryDetail inventoryDetail = new InventoryDetail(); | ||
190 | - inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); | ||
191 | - inventoryDetail.setWarehouseCode(warehouseCode); | ||
192 | - inventoryDetail.setCompanyCode(receiveDetail.getCompanyCode()); | ||
193 | - inventoryDetail.setZoneCode(QuantityConstant.ZONE_RECEIVE); | ||
194 | - inventoryDetail.setContainerCode(receiveCode); | ||
195 | - inventoryDetail.setContainerStatus(QuantityConstant.STATUS_CONTAINER_EMPTY); | ||
196 | - inventoryDetail.setMaterialCode(receiveDetail.getMaterialCode()); | ||
197 | - inventoryDetail.setMaterialName(receiveDetail.getMaterialName()); | ||
198 | - inventoryDetail.setMaterialSpec(receiveDetail.getMaterialSpec()); | ||
199 | - inventoryDetail.setMaterialUnit(receiveDetail.getMaterialUnit()); | ||
200 | - inventoryDetail.setQty(receiveQty); | ||
201 | - inventoryDetail.setInventoryStatus(receiveDetail.getInventoryStatus()); | ||
202 | - inventoryDetail.setBatch(receiveDetail.getBatch()); | ||
203 | - inventoryDetail.setLot(receiveDetail.getLot()); | ||
204 | - inventoryDetail.setProject(receiveDetail.getProject()); | ||
205 | - inventoryDetail.setReceiveTime(new Date()); | ||
206 | - inventoryDetailList.add(inventoryDetail); | ||
207 | 187 | ||
208 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); | 188 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); |
209 | - inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_RECEIPT); | 189 | + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_RECEIVE); |
210 | inventoryTransaction.setWarehouseCode(receiveDetail.getWarehouseCode()); | 190 | inventoryTransaction.setWarehouseCode(receiveDetail.getWarehouseCode()); |
211 | inventoryTransaction.setCompanyCode(receiveDetail.getCompanyCode()); | 191 | inventoryTransaction.setCompanyCode(receiveDetail.getCompanyCode()); |
212 | inventoryTransaction.setContainerCode(receiveCode); | 192 | inventoryTransaction.setContainerCode(receiveCode); |
@@ -219,7 +199,7 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | @@ -219,7 +199,7 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | ||
219 | inventoryTransaction.setLot(receiveDetail.getLot()); | 199 | inventoryTransaction.setLot(receiveDetail.getLot()); |
220 | inventoryTransaction.setProject(receiveDetail.getProject()); | 200 | inventoryTransaction.setProject(receiveDetail.getProject()); |
221 | inventoryTransaction.setInventoryStatus(receiveDetail.getInventoryStatus()); | 201 | inventoryTransaction.setInventoryStatus(receiveDetail.getInventoryStatus()); |
222 | - inventoryTransaction.setQty(receiveQty); | 202 | + inventoryTransaction.setQty(taskQty); |
223 | inventoryTransactionList.add(inventoryTransaction); | 203 | inventoryTransactionList.add(inventoryTransaction); |
224 | } | 204 | } |
225 | if (CollectionUtils.isEmpty(receiveDetailList)) { | 205 | if (CollectionUtils.isEmpty(receiveDetailList)) { |
@@ -231,16 +211,126 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | @@ -231,16 +211,126 @@ public class ReceiveDetailServiceImpl extends ServiceImpl<ReceiveDetailMapper, R | ||
231 | if (!receiveHeaderService.updateReceiptHeaderStatus(receiveId)) { | 211 | if (!receiveHeaderService.updateReceiptHeaderStatus(receiveId)) { |
232 | throw new JeecgBootException("收货, 保存库存头失败"); | 212 | throw new JeecgBootException("收货, 保存库存头失败"); |
233 | } | 213 | } |
234 | - if (!inventoryDetailService.saveBatch(inventoryDetailList)) { | ||
235 | - throw new JeecgBootException("收货, 保存库存详情失败"); | ||
236 | - } | 214 | + |
237 | if (!inventoryTransactionService.saveBatch(inventoryTransactionList)) { | 215 | if (!inventoryTransactionService.saveBatch(inventoryTransactionList)) { |
238 | throw new JeecgBootException("收货, 保存库存交易失败"); | 216 | throw new JeecgBootException("收货, 保存库存交易失败"); |
239 | } | 217 | } |
240 | - if (!taskHeaderService.combineInventoryDetail(receiveCode, warehouseCode)) { | ||
241 | - throw new JeecgBootException("收货, 合并入库库存失败"); | ||
242 | - } | ||
243 | 218 | ||
244 | return Result.OK("收货成功"); | 219 | return Result.OK("收货成功"); |
245 | } | 220 | } |
221 | + | ||
222 | + @Override | ||
223 | + @Transactional(rollbackFor = Exception.class) | ||
224 | + public Result receiveHeader(String id, String warehouseCode) { | ||
225 | + ReceiveHeader receiveHeader = receiveHeaderService.getById(id); | ||
226 | + if (receiveHeader == null) { | ||
227 | + return Result.error("收货失败, 没有找到收货头表" + id); | ||
228 | + } | ||
229 | + List<ReceiveDetail> receiveDetailList = receiveDetailService.selectByMainId(id); | ||
230 | + if (CollectionUtils.isEmpty(receiveDetailList)) { | ||
231 | + return Result.error("收货失败, 没有找到收货明细表" + id); | ||
232 | + } | ||
233 | + List<Receive> receiveList = new ArrayList<>(); | ||
234 | + for (ReceiveDetail receiveDetail : receiveDetailList) { | ||
235 | + Receive receive = new Receive(); | ||
236 | + receive.setId(receiveDetail.getId()); | ||
237 | + receive.setQty(receiveDetail.getQty()); | ||
238 | + BigDecimal taskQty = receiveDetail.getQty().subtract(receiveDetail.getTaskQty()); | ||
239 | + receive.setTaskQty(taskQty); | ||
240 | + receiveList.add(receive); | ||
241 | + } | ||
242 | + return receiveDetailService.receive(receiveList, warehouseCode); | ||
243 | + } | ||
244 | + | ||
245 | + @Override | ||
246 | + @Transactional(rollbackFor = Exception.class) | ||
247 | + public Result receiveToQuality(String id, String warehouseCode) { | ||
248 | + ReceiveDetail receiveDetail = receiveDetailService.getById(id); | ||
249 | + if (receiveDetail == null) { | ||
250 | + throw new JeecgBootException("生成质检单失败, 没有找到收货明细表" + id); | ||
251 | + } | ||
252 | + if (receiveDetail.getQty().compareTo(receiveDetail.getTaskQty()) > 0) { | ||
253 | + throw new JeecgBootException("生成质检单失败, 收货明细没有收货完成" + id); | ||
254 | + } | ||
255 | + if (receiveDetail.getQty().compareTo(receiveDetail.getQualityQty()) == 0) { | ||
256 | + throw new JeecgBootException("生成质检单失败, 收货明细已经生成质检单" + id); | ||
257 | + } | ||
258 | + ReceiveHeader receiveHeader = receiveHeaderService.getById(receiveDetail.getReceiveId()); | ||
259 | + if (receiveHeader == null) { | ||
260 | + throw new JeecgBootException("生成质检单失败, 没有找到收货主表" + id); | ||
261 | + } | ||
262 | + String referCode = receiveHeader.getCode(); | ||
263 | + QualityHeader qualityHeader = qualityHeaderService.getQualityHeaderByReferCode(referCode, warehouseCode); | ||
264 | + if (qualityHeader == null) { | ||
265 | + qualityHeader = new QualityHeader(); | ||
266 | + qualityHeader.setWarehouseCode(warehouseCode); | ||
267 | + qualityHeader.setReferCode(referCode); | ||
268 | + qualityHeader.setCompanyCode(receiveHeader.getCompanyCode()); | ||
269 | + qualityHeader.setType(QuantityConstant.QUALITY_TYPE_INCOMING); | ||
270 | + qualityHeader.setSupplierCode(receiveHeader.getSupplierCode()); | ||
271 | + String code = qualityHeaderService.createQualityCode(QuantityConstant.QUALITY_TYPE_INCOMING); | ||
272 | + qualityHeader.setCode(code); | ||
273 | + qualityHeader.setFirstStatus(QuantityConstant.QUALITY_HEADER_BUILD); | ||
274 | + qualityHeader.setLastStatus(QuantityConstant.QUALITY_HEADER_BUILD); | ||
275 | + if (!qualityHeaderService.save(qualityHeader)) { | ||
276 | + throw new JeecgBootException("生成质检单失败, 创建单据表头失败"); | ||
277 | + } | ||
278 | + } | ||
279 | + QualityDetail qualityDetail = new QualityDetail(); | ||
280 | + qualityDetail.setWarehouseCode(warehouseCode); | ||
281 | + qualityDetail.setCompanyCode(receiveHeader.getCompanyCode()); | ||
282 | + qualityDetail.setReferCode(referCode); | ||
283 | + qualityDetail.setQualityCode(qualityHeader.getCode()); | ||
284 | + qualityDetail.setQualityId(qualityHeader.getId()); | ||
285 | + qualityDetail.setStatus(QuantityConstant.QUALITY_HEADER_BUILD); | ||
286 | + qualityDetail.setQty(receiveDetail.getQty()); | ||
287 | + qualityDetail.setInventoryStatus(QuantityConstant.QUALITY_DISUSSED); | ||
288 | + qualityDetail.setMaterialCode(receiveDetail.getMaterialCode()); | ||
289 | + qualityDetail.setMaterialName(receiveDetail.getMaterialName()); | ||
290 | + qualityDetail.setMaterialSpec(receiveDetail.getMaterialSpec()); | ||
291 | + qualityDetail.setMaterialUnit(receiveDetail.getMaterialUnit()); | ||
292 | + qualityDetail.setBatch(receiveDetail.getBatch()); | ||
293 | + qualityDetail.setLot(receiveDetail.getLot()); | ||
294 | + qualityDetail.setProject(receiveDetail.getProject()); | ||
295 | + if (!qualityDetailService.save(qualityDetail)) { | ||
296 | + throw new JeecgBootException("生成质检单失败, 创建单据表详情失败"); | ||
297 | + } | ||
298 | + | ||
299 | + if (!receiveDetailService.updateQualityQtyById(receiveDetail.getQty(), receiveDetail.getId())) { | ||
300 | + throw new JeecgBootException("生成质检单失败, 更新单据详情失败"); | ||
301 | + } | ||
302 | + if (!receiveDetailService.updateStatusById(QuantityConstant.RECEIVE_HEADER_QUALITY, receiveDetail.getId())) { | ||
303 | + throw new JeecgBootException("生成质检单失败, 更新单据详情失败"); | ||
304 | + } | ||
305 | + | ||
306 | + if (!receiveHeaderService.updateReceiptHeaderStatus(receiveDetail.getReceiveId())) { | ||
307 | + throw new JeecgBootException("质检失败,更新质检状态失败"); | ||
308 | + } | ||
309 | + | ||
310 | + if (!qualityHeaderService.updateQualityHeader(qualityHeader.getId())) { | ||
311 | + throw new JeecgBootException("生成质检单失败, 更新单据数量失败"); | ||
312 | + } | ||
313 | + | ||
314 | + if (!qualityHeaderService.updateQualityHeaderStatus(qualityHeader.getId())) { | ||
315 | + throw new JeecgBootException("生成质检单失败, 更新单据状态失败"); | ||
316 | + } | ||
317 | + | ||
318 | + return Result.ok("生成质检单成功"); | ||
319 | + } | ||
320 | + | ||
321 | + @Override | ||
322 | + public boolean updateQualityQtyById(BigDecimal qualityQty, int id) { | ||
323 | + ReceiveDetail receiveDetail = new ReceiveDetail(); | ||
324 | + receiveDetail.setId(id); | ||
325 | + receiveDetail.setQualityQty(qualityQty); | ||
326 | + return receiveDetailService.updateById(receiveDetail); | ||
327 | + } | ||
328 | + | ||
329 | + @Override | ||
330 | + public boolean updateStatusById(int status, int id) { | ||
331 | + ReceiveDetail receiveDetail = new ReceiveDetail(); | ||
332 | + receiveDetail.setId(id); | ||
333 | + receiveDetail.setStatus(status); | ||
334 | + return receiveDetailService.updateById(receiveDetail); | ||
335 | + } | ||
246 | } | 336 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiveHeader/service/impl/ReceiveHeaderServiceImpl.java
@@ -187,4 +187,14 @@ public class ReceiveHeaderServiceImpl extends ServiceImpl<ReceiveHeaderMapper, R | @@ -187,4 +187,14 @@ public class ReceiveHeaderServiceImpl extends ServiceImpl<ReceiveHeaderMapper, R | ||
187 | } | 187 | } |
188 | return true; | 188 | return true; |
189 | } | 189 | } |
190 | + | ||
191 | + @Override | ||
192 | + @Transactional(rollbackFor = Exception.class) | ||
193 | + public Result receiveHeaderToQuality(String id, String warehouseCode) { | ||
194 | + List<ReceiveDetail> receiveDetailList = receiveDetailService.selectByMainId(id); | ||
195 | + for (ReceiveDetail receiveDetail : receiveDetailList) { | ||
196 | + receiveDetailService.receiveToQuality(String.valueOf(receiveDetail.getId()), warehouseCode); | ||
197 | + } | ||
198 | + return Result.ok("生成质检单成功"); | ||
199 | + } | ||
190 | } | 200 | } |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
@@ -12,7 +12,7 @@ package org.jeecg.utils.constant; | @@ -12,7 +12,7 @@ package org.jeecg.utils.constant; | ||
12 | * 8、波次状态 | 12 | * 8、波次状态 |
13 | * 9、质检状态 | 13 | * 9、质检状态 |
14 | * 10、盘点状态 | 14 | * 10、盘点状态 |
15 | - * 11、INVENTORY_TRANSACTION_RECEIPT | 15 | + * 11、库存交易记录 |
16 | * 12、调整单状态 | 16 | * 12、调整单状态 |
17 | * 13、任务内部类型 | 17 | * 13、任务内部类型 |
18 | * 14、质检单类型 | 18 | * 14、质检单类型 |
@@ -307,6 +307,12 @@ public class QuantityConstant { | @@ -307,6 +307,12 @@ public class QuantityConstant { | ||
307 | /** 移库 */ | 307 | /** 移库 */ |
308 | public static final Integer INVENTORY_TRANSACTION_TRANSFER = 50; | 308 | public static final Integer INVENTORY_TRANSACTION_TRANSFER = 50; |
309 | 309 | ||
310 | + /** 收货 */ | ||
311 | + public static final Integer INVENTORY_TRANSACTION_RECEIVE = 60; | ||
312 | + | ||
313 | + /** 质检 */ | ||
314 | + public static final Integer INVENTORY_TRANSACTION_QUALITY = 70; | ||
315 | + | ||
310 | // 12、调整单状态 | 316 | // 12、调整单状态 |
311 | 317 | ||
312 | // 未批准 | 318 | // 未批准 |
@@ -402,7 +408,22 @@ public class QuantityConstant { | @@ -402,7 +408,22 @@ public class QuantityConstant { | ||
402 | public static final Integer RECEIVE_HEADER_HALF = 100; | 408 | public static final Integer RECEIVE_HEADER_HALF = 100; |
403 | // 收货单完成收货状态 | 409 | // 收货单完成收货状态 |
404 | public static final Integer RECEIVE_HEADER_COMPLETE = 200; | 410 | public static final Integer RECEIVE_HEADER_COMPLETE = 200; |
405 | - | 411 | + // 生成质检单 |
412 | + public static final Integer RECEIVE_HEADER_QUALITY = 300; | ||
413 | + | ||
414 | + // 新建 | ||
415 | + public static final Integer QUALITY_HEADER_BUILD = 0; | ||
416 | + // 部分质检 | ||
417 | + public static final Integer QUALITY_HEADER_HALF = 100; | ||
418 | + // 质检完成 | ||
419 | + public static final Integer QUALITY_HEADER_COMPLETE = 200; | ||
420 | + | ||
421 | + /** 来料质检 */ | ||
422 | + public static final String QUALITY_TYPE_INCOMING = "QI"; | ||
423 | + /** 库内全检 */ | ||
424 | + public static final String QUALITY_TYPE_INHOUSE_FULL = "QIF"; | ||
425 | + /** 库内抽检 */ | ||
426 | + public static final String QUALITY_TYPE_INHOUSE_PART = "QIP"; | ||
406 | 427 | ||
407 | /** 对接WCS可用巷道API */ | 428 | /** 对接WCS可用巷道API */ |
408 | public static final String ADDRESS_WCS_AVAILABLE_ROWDWAY = "WCS_AVAILABLE_ROWDWAY"; | 429 | public static final String ADDRESS_WCS_AVAILABLE_ROWDWAY = "WCS_AVAILABLE_ROWDWAY"; |
@@ -451,8 +472,14 @@ public class QuantityConstant { | @@ -451,8 +472,14 @@ public class QuantityConstant { | ||
451 | public static final String PLATFORM_CODING = "赋码系统"; | 472 | public static final String PLATFORM_CODING = "赋码系统"; |
452 | public static final String PLATFORM_ERP = "ERP"; | 473 | public static final String PLATFORM_ERP = "ERP"; |
453 | public static final String PLATFORM_WMS = "WMS"; | 474 | public static final String PLATFORM_WMS = "WMS"; |
454 | - // good | 475 | + // 良品 |
455 | public static final String QUALITY_GOOD = "good"; | 476 | public static final String QUALITY_GOOD = "good"; |
477 | + // 次品 | ||
478 | + public static final String QUALITY_DEFECTIVE = "defective"; | ||
479 | + // 报废品 | ||
480 | + public static final String QUALITY_SCRAP = "scrap"; | ||
481 | + // 待确认 | ||
482 | + public static final String QUALITY_DISUSSED = "discussed"; | ||
456 | 483 | ||
457 | // 发送AGV任务成功 | 484 | // 发送AGV任务成功 |
458 | public static final int AGV_NEED_SEND = 0; | 485 | public static final int AGV_NEED_SEND = 0; |
@@ -515,23 +542,25 @@ public class QuantityConstant { | @@ -515,23 +542,25 @@ public class QuantityConstant { | ||
515 | * 出库依赖库区 | 542 | * 出库依赖库区 |
516 | */ | 543 | */ |
517 | public static final int SHIPMENT_BY_ZONE = 1; | 544 | public static final int SHIPMENT_BY_ZONE = 1; |
518 | - | ||
519 | - /** 对接WCS可用巷道API:关闭 */ | 545 | + |
546 | + /** 对接WCS可用巷道API:关闭 */ | ||
520 | public static final String AVAILABLE_ROWDWAY_CLOSE = "0"; | 547 | public static final String AVAILABLE_ROWDWAY_CLOSE = "0"; |
521 | - | 548 | + |
522 | /** 对接WCS可用巷道API:开启 */ | 549 | /** 对接WCS可用巷道API:开启 */ |
523 | public static final String AVAILABLE_ROWDWAY_OPEN = "1"; | 550 | public static final String AVAILABLE_ROWDWAY_OPEN = "1"; |
524 | - | 551 | + |
525 | /** 启用获取可用巷道API */ | 552 | /** 启用获取可用巷道API */ |
526 | public static final String RULE_AVAILABLE_ROWDWAY_STATUS = "availableRowdwayStatus"; | 553 | public static final String RULE_AVAILABLE_ROWDWAY_STATUS = "availableRowdwayStatus"; |
527 | - | ||
528 | - /** 定时任务异常响应通知配置 */ | 554 | + |
555 | + /** 接口异常响应通知配置 */ | ||
556 | + | ||
557 | + /** 定时任务异常响应通知配置 */ | ||
529 | public static final String RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME = "jobExceptionNoticeRoleOrName"; | 558 | public static final String RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME = "jobExceptionNoticeRoleOrName"; |
530 | - | ||
531 | - /** 接口异常响应通知配置 */ | 559 | + |
560 | + /** 接口异常响应通知配置 */ | ||
532 | public static final String RULE_API_EXCEPTION_NOTICE_ROLE_OR_NAME = "apiExceptionNoticeRoleOrName"; | 561 | public static final String RULE_API_EXCEPTION_NOTICE_ROLE_OR_NAME = "apiExceptionNoticeRoleOrName"; |
533 | - | ||
534 | - /** 定时任务执行消息通知配置 */ | 562 | + |
563 | + /** 定时任务执行消息通知配置 */ | ||
535 | public static final String RULE_TASK_RUN_NOTICE_CLASS_NAME = "taskRunNoticeClassName"; | 564 | public static final String RULE_TASK_RUN_NOTICE_CLASS_NAME = "taskRunNoticeClassName"; |
536 | 565 | ||
537 | public static final int RULE_TASK_NOT_CLEAR = 0; | 566 | public static final int RULE_TASK_NOT_CLEAR = 0; |
huaheng-wms-core/src/main/resources/application-dev.yml
@@ -116,7 +116,7 @@ spring: | @@ -116,7 +116,7 @@ spring: | ||
116 | # 初始化大小,最小,最大 | 116 | # 初始化大小,最小,最大 |
117 | initial-size: 5 | 117 | initial-size: 5 |
118 | min-idle: 5 | 118 | min-idle: 5 |
119 | - maxActive: 20 | 119 | + maxActive: 50 |
120 | # 配置获取连接等待超时的时间 | 120 | # 配置获取连接等待超时的时间 |
121 | maxWait: 60000 | 121 | maxWait: 60000 |
122 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | 122 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
@@ -136,7 +136,7 @@ spring: | @@ -136,7 +136,7 @@ spring: | ||
136 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 | 136 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 |
137 | datasource: | 137 | datasource: |
138 | master: | 138 | master: |
139 | - url: jdbc:log4jdbc:mysql://localhost:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true | 139 | + url: jdbc:log4jdbc:mysql://localhost:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=9999 |
140 | username: root | 140 | username: root |
141 | password: 123456 | 141 | password: 123456 |
142 | driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy | 142 | driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy |
huaheng-wms-core/src/main/resources/application-prod.yml
@@ -116,7 +116,7 @@ spring: | @@ -116,7 +116,7 @@ spring: | ||
116 | # 初始化大小,最小,最大 | 116 | # 初始化大小,最小,最大 |
117 | initial-size: 5 | 117 | initial-size: 5 |
118 | min-idle: 5 | 118 | min-idle: 5 |
119 | - maxActive: 20 | 119 | + maxActive: 50 |
120 | # 配置获取连接等待超时的时间 | 120 | # 配置获取连接等待超时的时间 |
121 | maxWait: 60000 | 121 | maxWait: 60000 |
122 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | 122 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
@@ -136,7 +136,7 @@ spring: | @@ -136,7 +136,7 @@ spring: | ||
136 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 | 136 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 |
137 | datasource: | 137 | datasource: |
138 | master: | 138 | master: |
139 | - url: jdbc:mysql://172.16.29.45:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true | 139 | + url: jdbc:mysql://172.16.29.45:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=9999 |
140 | username: root | 140 | username: root |
141 | password: hhsoftware | 141 | password: hhsoftware |
142 | driver-class-name: com.mysql.cj.jdbc.Driver | 142 | driver-class-name: com.mysql.cj.jdbc.Driver |
@@ -250,7 +250,7 @@ jeecg: | @@ -250,7 +250,7 @@ jeecg: | ||
250 | - title: 物料双边打印机纸 | 250 | - title: 物料双边打印机纸 |
251 | size: | 251 | size: |
252 | - 85 | 252 | - 85 |
253 | - - 60 | 253 | + - 60 |
254 | - title: 条码单边打印机纸 | 254 | - title: 条码单边打印机纸 |
255 | size: | 255 | size: |
256 | - 60 | 256 | - 60 |
huaheng-wms-core/src/main/resources/application-test.yml
@@ -137,7 +137,7 @@ spring: | @@ -137,7 +137,7 @@ spring: | ||
137 | datasource: | 137 | datasource: |
138 | master: | 138 | master: |
139 | # mysql数据源配置 | 139 | # mysql数据源配置 |
140 | - url: jdbc:log4jdbc:mysql://172.16.29.45:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true | 140 | + url: jdbc:log4jdbc:mysql://172.16.29.45:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=9999 |
141 | username: root | 141 | username: root |
142 | password: hhsoftware | 142 | password: hhsoftware |
143 | driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy | 143 | driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy |