Commit dab15ea3636fd7de5493c15cb63dfcb337e75b69
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4.git
into develop Conflicts: huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
Showing
21 changed files
with
1015 additions
and
10 deletions
ant-design-vue-jeecg/src/views/system/lockStation/LockStationList.vue
0 → 100644
1 | +<template> | |
2 | + <a-card :bordered="false"> | |
3 | + <!-- 查询区域 --> | |
4 | + <div class="table-page-search-wrapper"> | |
5 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | |
6 | + <a-row :gutter="24"> | |
7 | + <a-row :gutter="24"> | |
8 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
9 | + <a-form-item label="站台"> | |
10 | + <j-input placeholder="请输入站台" v-model="queryParam.code"></j-input> | |
11 | + </a-form-item> | |
12 | + </a-col> | |
13 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
14 | + <a-form-item label="任务号"> | |
15 | + <a-input placeholder="请输入任务号" v-model="queryParam.taskId"></a-input> | |
16 | + </a-form-item> | |
17 | + </a-col> | |
18 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
19 | + <a-form-item label="状态"> | |
20 | + <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="port_lock_status"/> | |
21 | + </a-form-item> | |
22 | + </a-col> | |
23 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
24 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |
25 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |
26 | + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |
27 | + </span> | |
28 | + </a-col> | |
29 | + </a-row> | |
30 | + </a-row> | |
31 | + </a-form> | |
32 | + </div> | |
33 | + <!-- 查询区域-END --> | |
34 | + | |
35 | + <!-- 操作按钮区域 --> | |
36 | + <div class="table-operator"> | |
37 | + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |
38 | + <a-dropdown v-if="selectedRowKeys.length > 0"> | |
39 | + <a-menu slot="overlay"> | |
40 | + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |
41 | + </a-menu> | |
42 | + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |
43 | + </a-dropdown> | |
44 | + </div> | |
45 | + | |
46 | + <!-- table区域-begin --> | |
47 | + <div> | |
48 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
49 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |
50 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
51 | + </div> | |
52 | + | |
53 | + <a-table | |
54 | + ref="table" | |
55 | + size="middle" | |
56 | + :scroll="{x:true}" | |
57 | + bordered | |
58 | + rowKey="id" | |
59 | + :columns="columns" | |
60 | + :dataSource="dataSource" | |
61 | + :pagination="ipagination" | |
62 | + :loading="loading" | |
63 | + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |
64 | + class="j-table-force-nowrap" | |
65 | + @change="handleTableChange"> | |
66 | + | |
67 | + <template slot="htmlSlot" slot-scope="text"> | |
68 | + <div v-html="text"></div> | |
69 | + </template> | |
70 | + <template slot="imgSlot" slot-scope="text"> | |
71 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
72 | + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
73 | + </template> | |
74 | + <template slot="fileSlot" slot-scope="text"> | |
75 | + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
76 | + <a-button | |
77 | + v-else | |
78 | + :ghost="true" | |
79 | + type="primary" | |
80 | + icon="download" | |
81 | + size="small" | |
82 | + @click="downloadFile(text)"> | |
83 | + 下载 | |
84 | + </a-button> | |
85 | + </template> | |
86 | + | |
87 | + <span slot="action" slot-scope="text, record"> | |
88 | + <a @click="handleEdit(record)">编辑</a> | |
89 | + | |
90 | + <a-divider type="vertical" /> | |
91 | + <a-dropdown> | |
92 | + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |
93 | + <a-menu slot="overlay"> | |
94 | + <a-menu-item> | |
95 | + <a @click="handleDetail(record)">详情</a> | |
96 | + </a-menu-item> | |
97 | + <a-menu-item> | |
98 | + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
99 | + <a>删除</a> | |
100 | + </a-popconfirm> | |
101 | + </a-menu-item> | |
102 | + </a-menu> | |
103 | + </a-dropdown> | |
104 | + </span> | |
105 | + | |
106 | + </a-table> | |
107 | + </div> | |
108 | + | |
109 | + <lock-station-modal ref="modalForm" @ok="modalFormOk"></lock-station-modal> | |
110 | + </a-card> | |
111 | +</template> | |
112 | + | |
113 | +<script> | |
114 | + | |
115 | + import '@/assets/less/TableExpand.less' | |
116 | + import { mixinDevice } from '@/utils/mixin' | |
117 | + import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
118 | + import LockStationModal from './modules/LockStationModal' | |
119 | + | |
120 | + export default { | |
121 | + name: 'LockStationList', | |
122 | + mixins:[JeecgListMixin, mixinDevice], | |
123 | + components: { | |
124 | + LockStationModal | |
125 | + }, | |
126 | + data () { | |
127 | + return { | |
128 | + description: '锁定站台管理页面', | |
129 | + // 表头 | |
130 | + columns: [ | |
131 | + { | |
132 | + title: '#', | |
133 | + dataIndex: '', | |
134 | + key:'rowIndex', | |
135 | + width:60, | |
136 | + align:"center", | |
137 | + customRender:function (t,r,index) { | |
138 | + return parseInt(index)+1; | |
139 | + } | |
140 | + }, | |
141 | + { | |
142 | + title:'仓库', | |
143 | + align:"center", | |
144 | + dataIndex: 'warehouseCode' | |
145 | + }, | |
146 | + { | |
147 | + title:'站台', | |
148 | + align:"center", | |
149 | + dataIndex: 'code' | |
150 | + }, | |
151 | + { | |
152 | + title:'任务ID', | |
153 | + align:"center", | |
154 | + dataIndex: 'taskId' | |
155 | + }, | |
156 | + { | |
157 | + title:'状态', | |
158 | + align:"center", | |
159 | + dataIndex: 'status_dictText' | |
160 | + }, | |
161 | + { | |
162 | + title:'库区', | |
163 | + align:"center", | |
164 | + dataIndex: 'zoneCode' | |
165 | + }, | |
166 | + { | |
167 | + title: '操作', | |
168 | + dataIndex: 'action', | |
169 | + align:"center", | |
170 | + fixed:"right", | |
171 | + width:147, | |
172 | + scopedSlots: { customRender: 'action' } | |
173 | + } | |
174 | + ], | |
175 | + url: { | |
176 | + list: "/lock/lockStation/list", | |
177 | + delete: "/lock/lockStation/delete", | |
178 | + deleteBatch: "/lock/lockStation/deleteBatch", | |
179 | + exportXlsUrl: "/lock/lockStation/exportXls", | |
180 | + importExcelUrl: "lock/lockStation/importExcel", | |
181 | + | |
182 | + }, | |
183 | + dictOptions:{}, | |
184 | + superFieldList:[], | |
185 | + } | |
186 | + }, | |
187 | + created() { | |
188 | + this.getSuperFieldList(); | |
189 | + }, | |
190 | + computed: { | |
191 | + importExcelUrl: function(){ | |
192 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
193 | + }, | |
194 | + }, | |
195 | + methods: { | |
196 | + initDictConfig(){ | |
197 | + }, | |
198 | + getSuperFieldList(){ | |
199 | + let fieldList=[]; | |
200 | + fieldList.push({type:'string',value:'warehouseCode',text:'仓库',dictCode:''}) | |
201 | + fieldList.push({type:'string',value:'code',text:'站台',dictCode:''}) | |
202 | + fieldList.push({type:'string',value:'taskId',text:'任务ID',dictCode:''}) | |
203 | + fieldList.push({type:'int',value:'status',text:'状态',dictCode:''}) | |
204 | + fieldList.push({type:'string',value:'zoneCode',text:'库区',dictCode:''}) | |
205 | + this.superFieldList = fieldList | |
206 | + } | |
207 | + } | |
208 | + } | |
209 | +</script> | |
210 | +<style scoped> | |
211 | + @import '~@assets/less/common.less'; | |
212 | +</style> | |
0 | 213 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/lockStation/modules/LockStationForm.vue
0 → 100644
1 | +<template> | |
2 | + <a-spin :spinning="confirmLoading"> | |
3 | + <j-form-container :disabled="formDisabled"> | |
4 | + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |
5 | + <a-row> | |
6 | + <a-col :span="24"> | |
7 | + <a-form-model-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseCode"> | |
8 | + <a-input v-model="model.warehouseCode" placeholder="请输入仓库" ></a-input> | |
9 | + </a-form-model-item> | |
10 | + </a-col> | |
11 | + <a-col :span="24"> | |
12 | + <a-form-model-item label="站台" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> | |
13 | + <j-search-select-tag | |
14 | + placeholder="请选择入库口" | |
15 | + v-model="model.code" | |
16 | + dict="port,name,code,type !='2'" | |
17 | + :pageSize="5" | |
18 | + :async="true"> | |
19 | + </j-search-select-tag> | |
20 | + </a-form-model-item> | |
21 | + </a-col> | |
22 | + <a-col :span="24"> | |
23 | + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> | |
24 | + <j-dict-select-tag v-model="model.status" title="状态" dictCode="port_lock_status" placeholder="请选择状态"/> | |
25 | + </a-form-model-item> | |
26 | + </a-col> | |
27 | + <a-col :span="24"> | |
28 | + <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode"> | |
29 | + <a-select | |
30 | + show-search | |
31 | + placeholder="请选择库区" | |
32 | + option-filter-prop="children" | |
33 | + v-model="model.zoneCode"> | |
34 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ | |
35 | + item.name | |
36 | + }} | |
37 | + </a-select-option> | |
38 | + </a-select> | |
39 | + </a-form-model-item> | |
40 | + </a-col> | |
41 | + </a-row> | |
42 | + </a-form-model> | |
43 | + </j-form-container> | |
44 | + </a-spin> | |
45 | +</template> | |
46 | + | |
47 | +<script> | |
48 | + | |
49 | + import { httpAction, getAction } from '@/api/manage' | |
50 | + import { validateDuplicateValue } from '@/utils/util' | |
51 | + import {getZoneList} from '@/api/api' | |
52 | + | |
53 | + export default { | |
54 | + name: 'LockStationForm', | |
55 | + components: { | |
56 | + }, | |
57 | + props: { | |
58 | + //表单禁用 | |
59 | + disabled: { | |
60 | + type: Boolean, | |
61 | + default: false, | |
62 | + required: false | |
63 | + } | |
64 | + }, | |
65 | + data () { | |
66 | + return { | |
67 | + model:{ | |
68 | + }, | |
69 | + labelCol: { | |
70 | + xs: { span: 24 }, | |
71 | + sm: { span: 5 }, | |
72 | + }, | |
73 | + wrapperCol: { | |
74 | + xs: { span: 24 }, | |
75 | + sm: { span: 16 }, | |
76 | + }, | |
77 | + confirmLoading: false, | |
78 | + validatorRules: { | |
79 | + code: [ | |
80 | + {required: true, message: '请选择站台!'}, | |
81 | + ], | |
82 | + status: [ | |
83 | + {required: true, message: '请选择状态!'}, | |
84 | + ], | |
85 | + }, | |
86 | + url: { | |
87 | + add: "/lock/lockStation/add", | |
88 | + edit: "/lock/lockStation/edit", | |
89 | + queryById: "/lock/lockStation/queryById" | |
90 | + }, | |
91 | + zoneList: [] | |
92 | + } | |
93 | + }, | |
94 | + computed: { | |
95 | + formDisabled(){ | |
96 | + return this.disabled | |
97 | + }, | |
98 | + }, | |
99 | + created () { | |
100 | + //备份model原始值 | |
101 | + this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |
102 | + this.loadFrom(); | |
103 | + }, | |
104 | + methods: { | |
105 | + add () { | |
106 | + this.edit(this.modelDefault); | |
107 | + }, | |
108 | + edit (record) { | |
109 | + this.model = Object.assign({}, record); | |
110 | + this.visible = true; | |
111 | + }, | |
112 | + loadFrom() { | |
113 | + getZoneList().then((res) => { | |
114 | + if (res.success) { | |
115 | + this.zoneList = res.result | |
116 | + } | |
117 | + }); | |
118 | + }, | |
119 | + submitForm () { | |
120 | + const that = this; | |
121 | + // 触发表单验证 | |
122 | + this.$refs.form.validate(valid => { | |
123 | + if (valid) { | |
124 | + that.confirmLoading = true; | |
125 | + let httpurl = ''; | |
126 | + let method = ''; | |
127 | + if(!this.model.id){ | |
128 | + httpurl+=this.url.add; | |
129 | + method = 'post'; | |
130 | + }else{ | |
131 | + httpurl+=this.url.edit; | |
132 | + method = 'put'; | |
133 | + } | |
134 | + httpAction(httpurl,this.model,method).then((res)=>{ | |
135 | + if(res.success){ | |
136 | + that.$message.success(res.message); | |
137 | + that.$emit('ok'); | |
138 | + }else{ | |
139 | + that.$message.warning(res.message); | |
140 | + } | |
141 | + }).finally(() => { | |
142 | + that.confirmLoading = false; | |
143 | + }) | |
144 | + } | |
145 | + | |
146 | + }) | |
147 | + }, | |
148 | + } | |
149 | + } | |
150 | +</script> | |
0 | 151 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/lockStation/modules/LockStationModal.Style#Drawer.vue
0 → 100644
1 | +<template> | |
2 | + <a-drawer | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + placement="right" | |
6 | + :closable="false" | |
7 | + @close="close" | |
8 | + destroyOnClose | |
9 | + :visible="visible"> | |
10 | + <lock-station-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></lock-station-form> | |
11 | + <div class="drawer-footer"> | |
12 | + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |
13 | + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |
14 | + </div> | |
15 | + </a-drawer> | |
16 | +</template> | |
17 | + | |
18 | +<script> | |
19 | + | |
20 | + import LockStationForm from './LockStationForm' | |
21 | + | |
22 | + export default { | |
23 | + name: 'LockStationModal', | |
24 | + components: { | |
25 | + LockStationForm | |
26 | + }, | |
27 | + data () { | |
28 | + return { | |
29 | + title:"操作", | |
30 | + width:800, | |
31 | + visible: false, | |
32 | + disableSubmit: false | |
33 | + } | |
34 | + }, | |
35 | + methods: { | |
36 | + add () { | |
37 | + this.visible=true | |
38 | + this.$nextTick(()=>{ | |
39 | + this.$refs.realForm.add(); | |
40 | + }) | |
41 | + }, | |
42 | + edit (record) { | |
43 | + this.visible=true | |
44 | + this.$nextTick(()=>{ | |
45 | + this.$refs.realForm.edit(record); | |
46 | + }); | |
47 | + }, | |
48 | + close () { | |
49 | + this.$emit('close'); | |
50 | + this.visible = false; | |
51 | + }, | |
52 | + submitCallback(){ | |
53 | + this.$emit('ok'); | |
54 | + this.visible = false; | |
55 | + }, | |
56 | + handleOk () { | |
57 | + this.$refs.realForm.submitForm(); | |
58 | + }, | |
59 | + handleCancel () { | |
60 | + this.close() | |
61 | + } | |
62 | + } | |
63 | + } | |
64 | +</script> | |
65 | + | |
66 | +<style lang="less" scoped> | |
67 | +/** Button按钮间距 */ | |
68 | + .ant-btn { | |
69 | + margin-left: 30px; | |
70 | + margin-bottom: 30px; | |
71 | + float: right; | |
72 | + } | |
73 | + .drawer-footer{ | |
74 | + position: absolute; | |
75 | + bottom: -8px; | |
76 | + width: 100%; | |
77 | + border-top: 1px solid #e8e8e8; | |
78 | + padding: 10px 16px; | |
79 | + text-align: right; | |
80 | + left: 0; | |
81 | + background: #fff; | |
82 | + border-radius: 0 0 2px 2px; | |
83 | + } | |
84 | +</style> | |
0 | 85 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/lockStation/modules/LockStationModal.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + switchFullscreen | |
7 | + @ok="handleOk" | |
8 | + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + <lock-station-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></lock-station-form> | |
12 | + </j-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | + | |
17 | + import LockStationForm from './LockStationForm' | |
18 | + export default { | |
19 | + name: 'LockStationModal', | |
20 | + components: { | |
21 | + LockStationForm | |
22 | + }, | |
23 | + data () { | |
24 | + return { | |
25 | + title:'', | |
26 | + width:800, | |
27 | + visible: false, | |
28 | + disableSubmit: false | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + add () { | |
33 | + this.visible=true | |
34 | + this.$nextTick(()=>{ | |
35 | + this.$refs.realForm.add(); | |
36 | + }) | |
37 | + }, | |
38 | + edit (record) { | |
39 | + this.visible=true | |
40 | + this.$nextTick(()=>{ | |
41 | + this.$refs.realForm.edit(record); | |
42 | + }) | |
43 | + }, | |
44 | + close () { | |
45 | + this.$emit('close'); | |
46 | + this.visible = false; | |
47 | + }, | |
48 | + handleOk () { | |
49 | + this.$refs.realForm.submitForm(); | |
50 | + }, | |
51 | + submitCallback(){ | |
52 | + this.$emit('ok'); | |
53 | + this.visible = false; | |
54 | + }, | |
55 | + handleCancel () { | |
56 | + this.close() | |
57 | + } | |
58 | + } | |
59 | + } | |
60 | +</script> | |
0 | 61 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerStatusSelectModal.vue
... | ... | @@ -24,6 +24,18 @@ |
24 | 24 | /> |
25 | 25 | </a-form-model-item> |
26 | 26 | </a-col> |
27 | + <a-col :lg="15"> | |
28 | + <a-form-model-item label="入库口"> | |
29 | + <!-- <a-input placeholder="请输入入库口" v-model="quickMainModel.toPort"/>--> | |
30 | + <j-search-select-tag | |
31 | + placeholder="请选择入库口" | |
32 | + v-model="model.fromPort" | |
33 | + dict="port,name,code,type !='2'" | |
34 | + :pageSize="5" | |
35 | + :async="true"> | |
36 | + </j-search-select-tag> | |
37 | + </a-form-model-item> | |
38 | + </a-col> | |
27 | 39 | </a-row> |
28 | 40 | </a-form-model> |
29 | 41 | </a-spin> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java
... | ... | @@ -98,6 +98,7 @@ public class MobileService implements IMobileService { |
98 | 98 | taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); |
99 | 99 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT); |
100 | 100 | } |
101 | + taskHeader.setZoneCode(container.getZoneCode()); | |
101 | 102 | taskHeader.setCallBox(QuantityConstant.CALL_BOX); |
102 | 103 | taskHeader.setContainerCode(containerCode); |
103 | 104 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
... | ... | @@ -8,6 +8,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
8 | 8 | import org.jeecg.modules.wms.api.wcs.entity.*; |
9 | 9 | import org.jeecg.modules.wms.api.wcs.service.WcsService; |
10 | 10 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
11 | +import org.jeecg.modules.wms.lockStation.service.ILockStationService; | |
11 | 12 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
12 | 13 | import org.jeecg.utils.StringUtils; |
13 | 14 | import org.jeecg.utils.interceptor.AccessLimit; |
... | ... | @@ -30,6 +31,8 @@ public class WcsController extends HuahengBaseController { |
30 | 31 | private WcsService wcsService; |
31 | 32 | @Resource |
32 | 33 | private ITaskHeaderService taskHeaderService; |
34 | + @Resource | |
35 | + private ILockStationService lockStationService; | |
33 | 36 | |
34 | 37 | /** |
35 | 38 | ** WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型 |
... | ... | @@ -258,4 +261,34 @@ public class WcsController extends HuahengBaseController { |
258 | 261 | }); |
259 | 262 | return result; |
260 | 263 | } |
264 | + | |
265 | + /** | |
266 | + ** 解锁站台 | |
267 | + */ | |
268 | + @AutoLog(value = "解锁站台") | |
269 | + @PostMapping("/removeLockStation") | |
270 | + @ApiOperation("解锁站台") | |
271 | + @ApiLogger(apiName = "解锁站台", from = "WCS") | |
272 | + public Result removeLockStation(@RequestBody WcsTaskLock wcsTaskLock, HttpServletRequest req) { | |
273 | + String warehouseCode = wcsTaskLock.getWarehouseCode(); | |
274 | + String fromPort = wcsTaskLock.getFromPort(); | |
275 | + if (StringUtils.isEmpty(warehouseCode)) { | |
276 | + return Result.error("解锁站台, 仓库号为空"); | |
277 | + } | |
278 | + if (StringUtils.isEmpty(fromPort)) { | |
279 | + return Result.error("解锁站台, 站台为空"); | |
280 | + } | |
281 | + String lockKey = warehouseCode; | |
282 | + Result result = handleMultiProcess("removeLockStation", lockKey, new MultiProcessListener() { | |
283 | + | |
284 | + @Override | |
285 | + public Result<?> doProcess() { | |
286 | + if (!lockStationService.unlockStation(fromPort, warehouseCode)) { | |
287 | + return Result.error("解锁失败"); | |
288 | + } | |
289 | + return Result.ok("解锁成功"); | |
290 | + } | |
291 | + }); | |
292 | + return result; | |
293 | + } | |
261 | 294 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/WcsTaskLock.java
0 → 100644
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wms/service/WmsServiceImpl.java
... | ... | @@ -13,11 +13,15 @@ import org.jeecg.modules.wms.api.erp.entity.*; |
13 | 13 | import org.jeecg.modules.wms.api.erp.service.IErpService; |
14 | 14 | import org.jeecg.modules.wms.api.wms.entity.WmsEntity; |
15 | 15 | import org.jeecg.modules.wms.api.wms.entity.WmsInventory; |
16 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
17 | +import org.jeecg.modules.wms.config.container.service.IContainerService; | |
18 | +import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; | |
16 | 19 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
17 | 20 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
18 | 21 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
19 | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
20 | 23 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
24 | +import org.jeecg.modules.wms.lockStation.service.ILockStationService; | |
21 | 25 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
22 | 26 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; |
23 | 27 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; |
... | ... | @@ -56,35 +60,58 @@ public class WmsServiceImpl implements WmsService { |
56 | 60 | |
57 | 61 | @Resource |
58 | 62 | private ITaskHeaderService taskHeaderService; |
63 | + | |
59 | 64 | @Resource |
60 | 65 | private IReceiptContainerHeaderService receiptContainerHeaderService; |
66 | + | |
61 | 67 | @Resource |
62 | 68 | private WmsService wmsService; |
69 | + | |
63 | 70 | @Resource |
64 | 71 | private IErpService erpService; |
72 | + | |
65 | 73 | @Resource |
66 | 74 | private IReceiveService receiveService; |
75 | + | |
67 | 76 | @Resource |
68 | 77 | private IReceiptHeaderService receiptHeaderService; |
78 | + | |
69 | 79 | @Resource |
70 | 80 | private IReceiptDetailService receiptDetailService; |
81 | + | |
71 | 82 | @Resource |
72 | 83 | private IHuahengMultiHandlerService huahengMultiHandlerService; |
84 | + | |
73 | 85 | @Resource |
74 | 86 | private IShipmentHeaderService shipmentHeaderService; |
87 | + | |
75 | 88 | @Resource |
76 | 89 | private IShipmentDetailService shipmentDetailService; |
90 | + | |
77 | 91 | @Resource |
78 | 92 | private IShipmentCombinationService shipmentCombinationService; |
93 | + | |
79 | 94 | @Resource |
80 | 95 | private IShipmentContainerHeaderService shipmentContainerHeaderService; |
96 | + | |
81 | 97 | @Resource |
82 | 98 | private IShipmentContainerDetailService shipmentContainerDetailService; |
99 | + | |
83 | 100 | @Resource |
84 | 101 | private IInventoryDetailService inventoryDetailService; |
102 | + | |
85 | 103 | @Resource |
86 | 104 | private IInventoryHeaderService inventoryHeaderService; |
87 | 105 | |
106 | + @Resource | |
107 | + private IContainerService containerService; | |
108 | + | |
109 | + @Resource | |
110 | + private IParameterConfigurationService parameterConfigurationService; | |
111 | + | |
112 | + @Resource | |
113 | + private ILockStationService lockStationService; | |
114 | + | |
88 | 115 | @Override |
89 | 116 | @Transactional(rollbackFor = Exception.class) |
90 | 117 | public Result sendWmsTask(WmsEntity wmsEntity) { |
... | ... | @@ -123,6 +150,14 @@ public class WmsServiceImpl implements WmsService { |
123 | 150 | String toPort = wmsEntity.getToPort(); |
124 | 151 | String containerCode = wmsEntity.getContainerCode(); |
125 | 152 | String referCode = wmsEntity.getTaskNo(); |
153 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
154 | + if (container == null) { | |
155 | + return Result.error("托盘:" + containerCode + " 信息为空"); | |
156 | + } | |
157 | + String zoneCode = container.getZoneCode(); | |
158 | + if (StringUtils.isEmpty(zoneCode)) { | |
159 | + return Result.error("容器没有配置库区,请配置!"); | |
160 | + } | |
126 | 161 | List<WmsInventory> wmsInventoryList = wmsEntity.getWmsInventoryList(); |
127 | 162 | List<Receive> receiveList = new ArrayList<>(); |
128 | 163 | if (wmsInventoryList == null) { |
... | ... | @@ -194,6 +229,17 @@ public class WmsServiceImpl implements WmsService { |
194 | 229 | throw new JeecgBootException("WMS下发入库信息,更新入库任务失败"); |
195 | 230 | } |
196 | 231 | } |
232 | + if (wmsEntity.getTaskType() == QuantityConstant.TASK_TYPE_WHOLERECEIPT) { | |
233 | + String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION, zoneCode); | |
234 | + if (StringUtils.isNotEmpty(value)) { | |
235 | + int lockStation = Integer.parseInt(value); | |
236 | + if (lockStation == QuantityConstant.START_LOCK_STATION) { | |
237 | + if (!lockStationService.lockStation(toPort, warehouseCode)) { | |
238 | + throw new JeecgBootException("生成入库任务时,站台已经锁定:" + toPort); | |
239 | + } | |
240 | + } | |
241 | + } | |
242 | + } | |
197 | 243 | return result; |
198 | 244 | } |
199 | 245 | |
... | ... | @@ -292,7 +338,6 @@ public class WmsServiceImpl implements WmsService { |
292 | 338 | if (StringUtils.isEmpty(toPort)) { |
293 | 339 | return Result.error("WMS下发出库任务失败,没有找到出库口" + toPort); |
294 | 340 | } |
295 | - | |
296 | 341 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
297 | 342 | if (inventoryHeader == null) { |
298 | 343 | return Result.error("WMS下发出库任务失败, 没有找到托盘库存" + containerCode); |
... | ... | @@ -330,7 +375,6 @@ public class WmsServiceImpl implements WmsService { |
330 | 375 | if (StringUtils.isEmpty(toPort)) { |
331 | 376 | return Result.error("WMS下发出库任务失败,没有找到出库口" + toPort); |
332 | 377 | } |
333 | - | |
334 | 378 | List<InventoryDetail> inventoryDetailList = new ArrayList<>(); |
335 | 379 | for (WmsInventory wmsInventory : wmsInventoryList) { |
336 | 380 | String materialCode = wmsInventory.getMaterialCode(); |
... | ... | @@ -365,8 +409,8 @@ public class WmsServiceImpl implements WmsService { |
365 | 409 | public Result createEmptyIn(WmsEntity wmsEntity) { |
366 | 410 | String warehouseCode = wmsEntity.getWarehouseCode(); |
367 | 411 | String contaienrCode = wmsEntity.getContainerCode(); |
368 | - | |
369 | - Result result = taskHeaderService.createEmptyIn(contaienrCode, QuantityConstant.EMPTY_STRING, warehouseCode); | |
412 | + String toPort = wmsEntity.getToPort(); | |
413 | + Result result = taskHeaderService.createEmptyIn(contaienrCode, QuantityConstant.EMPTY_STRING, warehouseCode, toPort); | |
370 | 414 | return result; |
371 | 415 | } |
372 | 416 | |
... | ... | @@ -376,7 +420,6 @@ public class WmsServiceImpl implements WmsService { |
376 | 420 | String warehouseCode = wmsEntity.getWarehouseCode(); |
377 | 421 | String toPort = wmsEntity.getToPort(); |
378 | 422 | String contaienrCode = wmsEntity.getContainerCode(); |
379 | - | |
380 | 423 | Result result = taskHeaderService.createEmptyOut(contaienrCode, toPort, warehouseCode); |
381 | 424 | return result; |
382 | 425 | } |
... | ... | @@ -385,5 +428,4 @@ public class WmsServiceImpl implements WmsService { |
385 | 428 | public Result cancelTaskByUpstreamTaskNo(String taskNo) { |
386 | 429 | return taskHeaderService.cancelTaskByUpstreamTaskNo(taskNo); |
387 | 430 | } |
388 | - | |
389 | 431 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/controller/LockStationController.java
0 → 100644
1 | +package org.jeecg.modules.wms.lockStation.controller; | |
2 | + | |
3 | +import java.util.Arrays; | |
4 | +import javax.servlet.http.HttpServletRequest; | |
5 | +import javax.servlet.http.HttpServletResponse; | |
6 | +import org.jeecg.common.api.vo.Result; | |
7 | +import org.jeecg.common.system.query.QueryGenerator; | |
8 | +import org.jeecg.modules.wms.lockStation.entity.LockStation; | |
9 | +import org.jeecg.modules.wms.lockStation.service.ILockStationService; | |
10 | + | |
11 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
12 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
13 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
14 | +import lombok.extern.slf4j.Slf4j; | |
15 | + | |
16 | +import org.jeecg.common.system.base.controller.JeecgController; | |
17 | +import org.springframework.beans.factory.annotation.Autowired; | |
18 | +import org.springframework.web.bind.annotation.*; | |
19 | +import org.springframework.web.servlet.ModelAndView; | |
20 | +import io.swagger.annotations.Api; | |
21 | +import io.swagger.annotations.ApiOperation; | |
22 | +import org.jeecg.common.aspect.annotation.AutoLog; | |
23 | + | |
24 | + /** | |
25 | + * @Description: 锁定站台 | |
26 | + * @Author: jeecg-boot | |
27 | + * @Date: 2023-10-23 | |
28 | + * @Version: V1.0 | |
29 | + */ | |
30 | +@Api(tags="锁定站台") | |
31 | +@RestController | |
32 | +@RequestMapping("/lock/lockStation") | |
33 | +@Slf4j | |
34 | +public class LockStationController extends JeecgController<LockStation, ILockStationService> { | |
35 | + @Autowired | |
36 | + private ILockStationService lockStationService; | |
37 | + | |
38 | + /** | |
39 | + * 分页列表查询 | |
40 | + * | |
41 | + * @param lockStation | |
42 | + * @param pageNo | |
43 | + * @param pageSize | |
44 | + * @param req | |
45 | + * @return | |
46 | + */ | |
47 | + //@AutoLog(value = "锁定站台-分页列表查询") | |
48 | + @ApiOperation(value="锁定站台-分页列表查询", notes="锁定站台-分页列表查询") | |
49 | + @GetMapping(value = "/list") | |
50 | + public Result<IPage<LockStation>> queryPageList(LockStation lockStation, | |
51 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |
52 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |
53 | + HttpServletRequest req) { | |
54 | + QueryWrapper<LockStation> queryWrapper = QueryGenerator.initQueryWrapper(lockStation, req.getParameterMap()); | |
55 | + Page<LockStation> page = new Page<LockStation>(pageNo, pageSize); | |
56 | + IPage<LockStation> pageList = lockStationService.page(page, queryWrapper); | |
57 | + return Result.OK(pageList); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * 添加 | |
62 | + * | |
63 | + * @param lockStation | |
64 | + * @return | |
65 | + */ | |
66 | + @AutoLog(value = "锁定站台-添加") | |
67 | + @ApiOperation(value="锁定站台-添加", notes="锁定站台-添加") | |
68 | + @PostMapping(value = "/add") | |
69 | + public Result<String> add(@RequestBody LockStation lockStation) { | |
70 | + lockStationService.save(lockStation); | |
71 | + return Result.OK("添加成功!"); | |
72 | + } | |
73 | + | |
74 | + /** | |
75 | + * 编辑 | |
76 | + * | |
77 | + * @param lockStation | |
78 | + * @return | |
79 | + */ | |
80 | + @AutoLog(value = "锁定站台-编辑") | |
81 | + @ApiOperation(value="锁定站台-编辑", notes="锁定站台-编辑") | |
82 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |
83 | + public Result<String> edit(@RequestBody LockStation lockStation) { | |
84 | + lockStationService.updateById(lockStation); | |
85 | + return Result.OK("编辑成功!"); | |
86 | + } | |
87 | + | |
88 | + /** | |
89 | + * 通过id删除 | |
90 | + * | |
91 | + * @param id | |
92 | + * @return | |
93 | + */ | |
94 | + @AutoLog(value = "锁定站台-通过id删除") | |
95 | + @ApiOperation(value="锁定站台-通过id删除", notes="锁定站台-通过id删除") | |
96 | + @DeleteMapping(value = "/delete") | |
97 | + public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |
98 | + lockStationService.removeById(id); | |
99 | + return Result.OK("删除成功!"); | |
100 | + } | |
101 | + | |
102 | + /** | |
103 | + * 批量删除 | |
104 | + * | |
105 | + * @param ids | |
106 | + * @return | |
107 | + */ | |
108 | + @AutoLog(value = "锁定站台-批量删除") | |
109 | + @ApiOperation(value="锁定站台-批量删除", notes="锁定站台-批量删除") | |
110 | + @DeleteMapping(value = "/deleteBatch") | |
111 | + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |
112 | + this.lockStationService.removeByIds(Arrays.asList(ids.split(","))); | |
113 | + return Result.OK("批量删除成功!"); | |
114 | + } | |
115 | + | |
116 | + /** | |
117 | + * 通过id查询 | |
118 | + * | |
119 | + * @param id | |
120 | + * @return | |
121 | + */ | |
122 | + //@AutoLog(value = "锁定站台-通过id查询") | |
123 | + @ApiOperation(value="锁定站台-通过id查询", notes="锁定站台-通过id查询") | |
124 | + @GetMapping(value = "/queryById") | |
125 | + public Result<LockStation> queryById(@RequestParam(name="id",required=true) String id) { | |
126 | + LockStation lockStation = lockStationService.getById(id); | |
127 | + if(lockStation==null) { | |
128 | + return Result.error("未找到对应数据"); | |
129 | + } | |
130 | + return Result.OK(lockStation); | |
131 | + } | |
132 | + | |
133 | + /** | |
134 | + * 导出excel | |
135 | + * | |
136 | + * @param request | |
137 | + * @param lockStation | |
138 | + */ | |
139 | + @RequestMapping(value = "/exportXls") | |
140 | + public ModelAndView exportXls(HttpServletRequest request, LockStation lockStation) { | |
141 | + return super.exportXls(request, lockStation, LockStation.class, "锁定站台"); | |
142 | + } | |
143 | + | |
144 | + /** | |
145 | + * 通过excel导入数据 | |
146 | + * | |
147 | + * @param request | |
148 | + * @param response | |
149 | + * @return | |
150 | + */ | |
151 | + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |
152 | + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |
153 | + return super.importExcel(request, response, LockStation.class); | |
154 | + } | |
155 | + | |
156 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/entity/LockStation.java
0 → 100644
1 | +package org.jeecg.modules.wms.lockStation.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.Date; | |
5 | +import com.baomidou.mybatisplus.annotation.IdType; | |
6 | +import com.baomidou.mybatisplus.annotation.TableId; | |
7 | +import com.baomidou.mybatisplus.annotation.TableName; | |
8 | +import lombok.Data; | |
9 | +import org.jeecg.common.aspect.annotation.Dict; | |
10 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
11 | +import io.swagger.annotations.ApiModel; | |
12 | +import io.swagger.annotations.ApiModelProperty; | |
13 | +import lombok.EqualsAndHashCode; | |
14 | +import lombok.experimental.Accessors; | |
15 | + | |
16 | +/** | |
17 | + * @Description: 锁定站台 | |
18 | + * @Author: jeecg-boot | |
19 | + * @Date: 2023-10-23 | |
20 | + * @Version: V1.0 | |
21 | + */ | |
22 | +@Data | |
23 | +@TableName("lock_station") | |
24 | +@Accessors(chain = true) | |
25 | +@EqualsAndHashCode(callSuper = false) | |
26 | +@ApiModel(value="lock_station对象", description="锁定站台") | |
27 | +public class LockStation implements Serializable { | |
28 | + private static final long serialVersionUID = 1L; | |
29 | + | |
30 | + /**主键*/ | |
31 | + @TableId(type = IdType.ASSIGN_ID) | |
32 | + @ApiModelProperty(value = "主键") | |
33 | + private String id; | |
34 | + /**仓库*/ | |
35 | + @Excel(name = "仓库", width = 15) | |
36 | + @ApiModelProperty(value = "仓库") | |
37 | + private String warehouseCode; | |
38 | + /**站台*/ | |
39 | + @Excel(name = "站台", width = 15) | |
40 | + @ApiModelProperty(value = "站台") | |
41 | + private String code; | |
42 | + /**任务ID*/ | |
43 | + @Excel(name = "任务ID", width = 15) | |
44 | + @ApiModelProperty(value = "任务ID") | |
45 | + private String taskId; | |
46 | + /**状态*/ | |
47 | + @Excel(name = "状态", width = 15, dicCode = "port_lock_status") | |
48 | + @Dict(dicCode = "port_lock_status") | |
49 | + @ApiModelProperty(value = "状态") | |
50 | + private Integer status; | |
51 | + /**库区*/ | |
52 | + @Excel(name = "库区", width = 15) | |
53 | + @ApiModelProperty(value = "库区") | |
54 | + private String zoneCode; | |
55 | + /**创建人*/ | |
56 | + @ApiModelProperty(value = "创建人") | |
57 | + private String createBy; | |
58 | + /**创建日期*/ | |
59 | + @ApiModelProperty(value = "创建日期") | |
60 | + private Date createTime; | |
61 | + /**更新人*/ | |
62 | + @ApiModelProperty(value = "更新人") | |
63 | + private String updateBy; | |
64 | + /**更新日期*/ | |
65 | + @ApiModelProperty(value = "更新日期") | |
66 | + private Date updateTime; | |
67 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/mapper/LockStationMapper.java
0 → 100644
1 | +package org.jeecg.modules.wms.lockStation.mapper; | |
2 | + | |
3 | +import org.jeecg.modules.wms.lockStation.entity.LockStation; | |
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
5 | + | |
6 | +/** | |
7 | + * @Description: 锁定站台 | |
8 | + * @Author: jeecg-boot | |
9 | + * @Date: 2023-10-23 | |
10 | + * @Version: V1.0 | |
11 | + */ | |
12 | +public interface LockStationMapper extends BaseMapper<LockStation> { | |
13 | + | |
14 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/mapper/xml/LockStationMapper.xml
0 → 100644
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/service/ILockStationService.java
0 → 100644
1 | +package org.jeecg.modules.wms.lockStation.service; | |
2 | + | |
3 | +import org.jeecg.modules.wms.lockStation.entity.LockStation; | |
4 | +import com.baomidou.mybatisplus.extension.service.IService; | |
5 | + | |
6 | +/** | |
7 | + * @Description: 锁定站台 | |
8 | + * @Author: jeecg-boot | |
9 | + * @Date: 2023-10-23 | |
10 | + * @Version: V1.0 | |
11 | + */ | |
12 | +public interface ILockStationService extends IService<LockStation> { | |
13 | + | |
14 | + /** | |
15 | + * 锁定站台,需判断当前站台是否是非锁定状态 | |
16 | + * @author zengxiangping | |
17 | + * @createDate 2023年10月23日 | |
18 | + * @param port | |
19 | + * @param warehouseCode | |
20 | + * @return | |
21 | + */ | |
22 | + boolean lockStation(String port, String warehouseCode); | |
23 | + | |
24 | + /** | |
25 | + * 解锁站台 | |
26 | + * @author zengxiangping | |
27 | + * @createDate 2023年10月23日 | |
28 | + * @param port | |
29 | + * @param warehouseCode | |
30 | + * @return | |
31 | + */ | |
32 | + boolean unlockStation(String port, String warehouseCode); | |
33 | + | |
34 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/service/impl/LockStationServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.lockStation.service.impl; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import org.jeecg.common.exception.JeecgBootException; | |
6 | +import org.jeecg.modules.wms.lockStation.entity.LockStation; | |
7 | +import org.jeecg.modules.wms.lockStation.mapper.LockStationMapper; | |
8 | +import org.jeecg.modules.wms.lockStation.service.ILockStationService; | |
9 | +import org.jeecg.utils.constant.QuantityConstant; | |
10 | +import org.springframework.stereotype.Service; | |
11 | + | |
12 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
13 | +import org.springframework.transaction.annotation.Transactional; | |
14 | + | |
15 | +/** | |
16 | + * @Description: 锁定站台 | |
17 | + * @Author: jeecg-boot | |
18 | + * @Date: 2023-10-23 | |
19 | + * @Version: V1.0 | |
20 | + */ | |
21 | +@Service | |
22 | +public class LockStationServiceImpl extends ServiceImpl<LockStationMapper, LockStation> implements ILockStationService { | |
23 | + | |
24 | + /** | |
25 | + * 锁定站台,需判断当前站台是否是非锁定状态 | |
26 | + * @author zengxiangping | |
27 | + * @createDate 2023年10月23日 | |
28 | + * @param port | |
29 | + * @param warehouseCode | |
30 | + * @return | |
31 | + */ | |
32 | + @Override | |
33 | + @Transactional(rollbackFor = Exception.class) | |
34 | + public boolean lockStation(String port, String warehouseCode) { | |
35 | + if (port == null) { | |
36 | + throw new JeecgBootException("锁定站台,传入站台号为空"); | |
37 | + } | |
38 | + LambdaUpdateWrapper<LockStation> lockStationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
39 | + lockStationLambdaUpdateWrapper.eq(LockStation::getCode, port).eq(LockStation::getWarehouseCode, warehouseCode) | |
40 | + .eq(LockStation::getStatus, QuantityConstant.UNLOCK).set(LockStation::getStatus, QuantityConstant.LOCK); | |
41 | + return update(lockStationLambdaUpdateWrapper); | |
42 | + } | |
43 | + | |
44 | + /** | |
45 | + * 解锁站台 | |
46 | + * @author zengxiangping | |
47 | + * @createDate 2023年10月23日 | |
48 | + * @param port | |
49 | + * @param warehouseCode | |
50 | + * @return | |
51 | + */ | |
52 | + @Override | |
53 | + public boolean unlockStation(String port, String warehouseCode) { | |
54 | + LambdaUpdateWrapper<LockStation> lockStationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
55 | + lockStationLambdaUpdateWrapper.eq(LockStation::getCode, port).eq(LockStation::getWarehouseCode, warehouseCode).set(LockStation::getStatus, | |
56 | + QuantityConstant.UNLOCK); | |
57 | + return update(lockStationLambdaUpdateWrapper); | |
58 | + } | |
59 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContainerHeader.java
... | ... | @@ -65,6 +65,10 @@ public class ReceiptContainerHeader implements Serializable { |
65 | 65 | @Excel(name = "目标库位", width = 15) |
66 | 66 | @ApiModelProperty(value = "目标库位") |
67 | 67 | private String toLocationCode; |
68 | + /** 起始入库口 */ | |
69 | + @Excel(name = "起始入库口", width = 15) | |
70 | + @ApiModelProperty(value = "起始入库口") | |
71 | + private String fromPort; | |
68 | 72 | /** 目标出入口 */ |
69 | 73 | @Excel(name = "目标出入口", width = 15) |
70 | 74 | @ApiModelProperty(value = "目标出入口") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -16,6 +16,7 @@ import org.jeecg.modules.wms.config.container.service.IContainerService; |
16 | 16 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
17 | 17 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
18 | 18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
19 | +import org.jeecg.modules.wms.lockStation.service.ILockStationService; | |
19 | 20 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail; |
20 | 21 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
21 | 22 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerDetailMapper; |
... | ... | @@ -91,6 +92,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
91 | 92 | @Resource |
92 | 93 | private IParameterConfigurationService parameterConfigurationService; |
93 | 94 | |
95 | + @Resource | |
96 | + private ILockStationService lockStationService; | |
97 | + | |
94 | 98 | @Override |
95 | 99 | @Transactional |
96 | 100 | public void delMain(String id) { |
... | ... | @@ -132,6 +136,15 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
132 | 136 | String fromLocationCode = receiptContainerHeader.getFromLocationCode(); |
133 | 137 | String toLocationCode = receiptContainerHeader.getToLocationCode(); |
134 | 138 | int taskType = receiptContainerHeader.getTaskType(); |
139 | + String fromPort = receiptContainerHeader.getFromPort(); | |
140 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
141 | + if (container == null) { | |
142 | + return Result.error("托盘:" + containerCode + " 信息为空"); | |
143 | + } | |
144 | + String zoneCode = container.getZoneCode(); | |
145 | + if (StringUtils.isEmpty(zoneCode)) { | |
146 | + return Result.error("容器没有配置库区,请配置!"); | |
147 | + } | |
135 | 148 | boolean success = false; |
136 | 149 | List<ReceiptContainerDetail> receiptContainerDetailList = |
137 | 150 | receiptContainerDetailService.getReceiptContainerDetailListByHeaderId(receiptContainerHeader.getId()); |
... | ... | @@ -155,7 +168,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
155 | 168 | throw new JeecgBootException(result.getMessage()); |
156 | 169 | } |
157 | 170 | TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult(); |
158 | - String zoneCode = taskLockEntity.getZoneCode(); | |
171 | + if (taskLockEntity.getZoneCode() != null) { | |
172 | + zoneCode = taskLockEntity.getZoneCode(); | |
173 | + } | |
159 | 174 | taskHeader = new TaskHeader(); |
160 | 175 | taskHeader.setContainerCode(containerCode); |
161 | 176 | taskHeader.setContainerFillStatus(containerFillStatus); |
... | ... | @@ -244,6 +259,15 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
244 | 259 | throw new JeecgBootException("创建入库任务, 更新入库单明细失败"); |
245 | 260 | } |
246 | 261 | } |
262 | + String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION,zoneCode); | |
263 | + if (StringUtils.isNotEmpty(value)) { | |
264 | + int lockStation = Integer.parseInt(value); | |
265 | + if (lockStation == QuantityConstant.START_LOCK_STATION) { | |
266 | + if (!lockStationService.lockStation(fromPort, warehouseCode)) { | |
267 | + throw new JeecgBootException("生成入库任务时,站台已经锁定:" + fromPort); | |
268 | + } | |
269 | + } | |
270 | + } | |
247 | 271 | LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 |
248 | 272 | LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集 |
249 | 273 | LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -425,11 +425,12 @@ public class TaskHeaderController extends HuahengBaseController { |
425 | 425 | public Result createEmptyIn(@RequestBody TaskHeader taskHeader, HttpServletRequest req) { |
426 | 426 | String contaienrCode = taskHeader.getContainerCode(); |
427 | 427 | String toLocationCode = taskHeader.getToLocationCode(); |
428 | + String toPortCode = taskHeader.getToPortCode(); | |
428 | 429 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
429 | 430 | Result result = handleMultiProcess("createEmptyIn", new MultiProcessListener() { |
430 | 431 | @Override |
431 | 432 | public Result<?> doProcess() { |
432 | - Result result = taskHeaderService.createEmptyIn(contaienrCode, toLocationCode, warehouseCode); | |
433 | + Result result = taskHeaderService.createEmptyIn(contaienrCode, toLocationCode, warehouseCode,toPortCode); | |
433 | 434 | return result; |
434 | 435 | } |
435 | 436 | }); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... | ... | @@ -131,7 +131,7 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
131 | 131 | * @param warehouseCode |
132 | 132 | * @return |
133 | 133 | */ |
134 | - Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode); | |
134 | + Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode, String toPortCode); | |
135 | 135 | |
136 | 136 | /** |
137 | 137 | * 创建空托盘出库任务 |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -32,6 +32,7 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailS |
32 | 32 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
33 | 33 | import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; |
34 | 34 | import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; |
35 | +import org.jeecg.modules.wms.lockStation.service.ILockStationService; | |
35 | 36 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
36 | 37 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; |
37 | 38 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; |
... | ... | @@ -150,6 +151,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
150 | 151 | private ITaskHeaderHistoryService taskHeaderHistoryService; |
151 | 152 | @Resource |
152 | 153 | private IShipmentCombinationService shipmentCombinationService; |
154 | + @Resource | |
155 | + private ILockStationService lockStationService; | |
153 | 156 | |
154 | 157 | @Override |
155 | 158 | @Transactional |
... | ... | @@ -974,7 +977,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
974 | 977 | */ |
975 | 978 | @Override |
976 | 979 | @Transactional(rollbackFor = Exception.class) |
977 | - public Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode) { | |
980 | + public Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode, String toPortCode) { | |
978 | 981 | log.info("开始创建空托入库任务" + containerCode); |
979 | 982 | if (StringUtils.isEmpty(containerCode)) { |
980 | 983 | return Result.error("创建空托盘入库时, 托盘号为空"); |
... | ... | @@ -982,6 +985,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
982 | 985 | if (StringUtils.isEmpty(warehouseCode)) { |
983 | 986 | return Result.error("创建空托盘入库时, 仓库编码为空"); |
984 | 987 | } |
988 | +// if (StringUtils.isEmpty(toPortCode)) { | |
989 | +// return Result.error("创建空托盘入库时, 站台编码为空"); | |
990 | +// } | |
991 | +// Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
992 | +// if (container == null) { | |
993 | +// return Result.error("托盘:" + containerCode + " 信息为空"); | |
994 | +// } | |
995 | +// String zoneCode = container.getZoneCode(); | |
996 | +// if (StringUtils.isEmpty(zoneCode)) { | |
997 | +// return Result.error("容器没有配置库区,请配置!"); | |
998 | +// } | |
985 | 999 | |
986 | 1000 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYRECEIPT, containerCode, QuantityConstant.EMPTY_STRING, |
987 | 1001 | toLocationCode, warehouseCode); |
... | ... | @@ -995,7 +1009,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
995 | 1009 | taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); |
996 | 1010 | taskHeader.setToLocationCode(toLocationCode); |
997 | 1011 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
1012 | +// taskHeader.setZoneCode(zoneCode); | |
998 | 1013 | boolean success = taskHeaderService.save(taskHeader); |
1014 | +// String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION, zoneCode); | |
1015 | +// if (StringUtils.isNotEmpty(value)) { | |
1016 | +// int lockStation = Integer.parseInt(value); | |
1017 | +// if (lockStation == QuantityConstant.START_LOCK_STATION) { | |
1018 | +// if (!lockStationService.lockStation(toPortCode, warehouseCode)) { | |
1019 | +// throw new JeecgBootException("生成入库任务时,站台已经锁定:" + toPortCode); | |
1020 | +// } | |
1021 | +// } | |
1022 | +// } | |
999 | 1023 | log.info("完成创建空托入库任务"); |
1000 | 1024 | if (!success) { |
1001 | 1025 | throw new JeecgBootException("创建空托盘入库时,保存任务失败"); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... | ... | @@ -700,4 +700,17 @@ public class QuantityConstant { |
700 | 700 | public static final String ZONE_TYPE_TILL = "Q"; |
701 | 701 | /** 库区类型,虚拟区 */ |
702 | 702 | public static final String ZONE_TYPE_UNREAL = "X"; |
703 | + | |
704 | + public static final String START_LOCKING_STATION = "StartLockingStation"; | |
705 | + | |
706 | + public static int LOCK = 1; // 锁定 | |
707 | + | |
708 | + public static int UNLOCK = 0; // 解锁 | |
709 | + | |
710 | +// 开启站台锁定 | |
711 | + public static int START_LOCK_STATION = 1; | |
712 | + | |
713 | +// 关闭站台锁定 | |
714 | + public static int START_UNLOCK_STATION = 0; | |
715 | + | |
703 | 716 | } |
... | ... |