Commit c410144579feb22b61fd120d0fbbad7235cc9cf8

Authored by 肖超群
1 parent 836b91c8

1. 开发空托盘组入库、出库。 托盘跨站功能

2. 开发任务取消功能
Showing 44 changed files with 4152 additions and 265 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js
@@ -125,6 +125,8 @@ export const createReceiptTask = (params)=>postAction('/receipt/receiptContainer @@ -125,6 +125,8 @@ export const createReceiptTask = (params)=>postAction('/receipt/receiptContainer
125 export const completeTaskByWMS = (params)=>postAction('/task/taskHeader/completeTaskByWMS', params); 125 export const completeTaskByWMS = (params)=>postAction('/task/taskHeader/completeTaskByWMS', params);
126 //下发任务给WCS 126 //下发任务给WCS
127 export const execute = (params)=>postAction('/task/taskHeader/execute', params); 127 export const execute = (params)=>postAction('/task/taskHeader/execute', params);
  128 +//取消任务
  129 +export const cancelTask = (params)=>postAction('/task/taskHeader/cancelTask?1', params);
128 //自动配盘 130 //自动配盘
129 export const autoCombination = (params)=>postAction('/shipment/shipmentCombination/autoCombination', params); 131 export const autoCombination = (params)=>postAction('/shipment/shipmentCombination/autoCombination', params);
130 //创建出库任务 132 //创建出库任务
@@ -133,6 +135,26 @@ export const createShipmentTask = (params)=>postAction('/shipment/shipmentCombin @@ -133,6 +135,26 @@ export const createShipmentTask = (params)=>postAction('/shipment/shipmentCombin
133 export const selectSortingPort = (params)=>postAction('/shipment/shipmentCombination/selectSortingPort', params); 135 export const selectSortingPort = (params)=>postAction('/shipment/shipmentCombination/selectSortingPort', params);
134 //选择入库分拣口 136 //选择入库分拣口
135 export const selectSupplePort = (params)=>postAction('/receipt/receiptContainerHeader/selectSupplePort', params); 137 export const selectSupplePort = (params)=>postAction('/receipt/receiptContainerHeader/selectSupplePort', params);
  138 +//创建空托盘入库任务
  139 +export const createEmptyIn = (params)=>postAction('/task/taskHeader/createEmptyIn', params);
  140 +//创建空托盘出库任务
  141 +export const createEmptyOut = (params)=>postAction('/task/taskHeader/createEmptyOut', params);
  142 +//选择出库整出口
  143 +export const selectOutPort = (params)=>postAction('/task/taskHeader/selectOutPort', params);
  144 +//选择出库分拣口
  145 +export const selectPickPort = (params)=>postAction('/task/taskHeader/selectPickPort', params);
  146 +//创建移库任务
  147 +export const createTransferTask = (params)=>postAction('/task/taskHeader/createTransferTask', params);
  148 +//创建出库查看任务
  149 +export const createCheckOutTask = (params)=>postAction('/task/taskHeader/createCheckOutTask', params);
  150 +//选择站台
  151 +export const selectPort = (params)=>postAction('/task/taskHeader/selectPort', params);
  152 +//创建跨站任务
  153 +export const createOverStationTask = (params)=>postAction('/task/taskHeader/createOverStationTask', params);
  154 +//创建空托盘组入库任务
  155 +export const createManyEmptyIn = (params)=>postAction('/task/taskHeader/createManyEmptyIn', params);
  156 +//创建空托盘组出库任务
  157 +export const createManyEmptyOut = (params)=>postAction('/task/taskHeader/createManyEmptyOut', params);
136 158
137 // 中转HTTP请求 159 // 中转HTTP请求
138 export const transitRESTful = { 160 export const transitRESTful = {
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationList.vue
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 <a-form-item label="库区编码"> 37 <a-form-item label="库区编码">
38 <a-select 38 <a-select
39 show-search 39 show-search
40 - placeholder="请输入库区编码" 40 + placeholder="请选择库区编码"
41 option-filter-prop="children" 41 option-filter-prop="children"
42 :filter-option="filterOption" 42 :filter-option="filterOption"
43 v-model="queryParam.zoneCode" 43 v-model="queryParam.zoneCode"
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
@@ -41,6 +41,12 @@ @@ -41,6 +41,12 @@
41 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" 41 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
42 @change="handleTableChange"> 42 @change="handleTableChange">
43 43
  44 + <span slot="companyCode" slot-scope="companyCode">
  45 + <a-tag :key="companyCode" color=blue>
  46 + {{ solutionCompany(companyCode) }}
  47 + </a-tag>
  48 + </span>
  49 +
44 <template slot="htmlSlot" slot-scope="text"> 50 <template slot="htmlSlot" slot-scope="text">
45 <div v-html="text"></div> 51 <div v-html="text"></div>
46 </template> 52 </template>
@@ -80,6 +86,7 @@ @@ -80,6 +86,7 @@
80 86
81 import { JeecgListMixin } from '@/mixins/JeecgListMixin' 87 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
82 import InventoryDetailModal from './modules/InventoryDetailModal' 88 import InventoryDetailModal from './modules/InventoryDetailModal'
  89 + import {getCompanyList} from '@/api/api'
83 90
84 export default { 91 export default {
85 name: "InventoryDetailList", 92 name: "InventoryDetailList",
@@ -109,6 +116,7 @@ @@ -109,6 +116,7 @@
109 return { 116 return {
110 description: '库存表管理页面', 117 description: '库存表管理页面',
111 disableMixinCreated:true, 118 disableMixinCreated:true,
  119 + companyList:[],
112 // 表头 120 // 表头
113 columns: [ 121 columns: [
114 { 122 {
@@ -119,7 +127,9 @@ @@ -119,7 +127,9 @@
119 { 127 {
120 title:'货主', 128 title:'货主',
121 align:"center", 129 align:"center",
122 - dataIndex: 'companyCode' 130 + dataIndex: 'companyCode',
  131 + key: 'companyCode',
  132 + scopedSlots: { customRender: 'companyCode' }
123 }, 133 },
124 { 134 {
125 title:'库区', 135 title:'库区',
@@ -233,6 +243,7 @@ @@ -233,6 +243,7 @@
233 } 243 }
234 }, 244 },
235 created() { 245 created() {
  246 + this.loadFrom();
236 }, 247 },
237 computed: { 248 computed: {
238 importExcelUrl(){ 249 importExcelUrl(){
@@ -240,6 +251,23 @@ @@ -240,6 +251,23 @@
240 } 251 }
241 }, 252 },
242 methods: { 253 methods: {
  254 + loadFrom() {
  255 + getCompanyList().then((res) => {
  256 + if (res.success) {
  257 + this.companyList = res.result
  258 + }
  259 + });
  260 + },
  261 + solutionCompany(value) {
  262 + var actions = []
  263 + Object.keys(this.companyList).some((key) => {
  264 + if (this.companyList[key].code == ('' + value)) {
  265 + actions.push(this.companyList[key].name)
  266 + return true
  267 + }
  268 + })
  269 + return actions.join('')
  270 + },
243 clearList(){ 271 clearList(){
244 this.dataSource=[] 272 this.dataSource=[]
245 this.selectedRowKeys=[] 273 this.selectedRowKeys=[]
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
@@ -6,7 +6,14 @@ @@ -6,7 +6,14 @@
6 <a-row :gutter="24"> 6 <a-row :gutter="24">
7 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 7 <a-col :xl="6" :lg="7" :md="8" :sm="24">
8 <a-form-item label="货主"> 8 <a-form-item label="货主">
9 - <a-input placeholder="请输入货主" v-model="queryParam.companyCode"></a-input> 9 + <a-select
  10 + show-search
  11 + placeholder="请选择货主"
  12 + option-filter-prop="children"
  13 + :filter-option="filterOption"
  14 + v-model="queryParam.companyCode">
  15 + <a-select-option v-for="item in companyList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  16 + </a-select>
10 </a-form-item> 17 </a-form-item>
11 </a-col> 18 </a-col>
12 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 19 <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -121,6 +128,12 @@ @@ -121,6 +128,12 @@
121 class="j-table-force-nowrap" 128 class="j-table-force-nowrap"
122 @change="handleTableChange"> 129 @change="handleTableChange">
123 130
  131 + <span slot="companyCode" slot-scope="companyCode">
  132 + <a-tag :key="companyCode" color=blue>
  133 + {{ solutionCompany(companyCode) }}
  134 + </a-tag>
  135 + </span>
  136 +
124 <template slot="htmlSlot" slot-scope="text"> 137 <template slot="htmlSlot" slot-scope="text">
125 <div v-html="text"></div> 138 <div v-html="text"></div>
126 </template> 139 </template>
@@ -174,6 +187,7 @@ @@ -174,6 +187,7 @@
174 import { JeecgListMixin } from '@/mixins/JeecgListMixin' 187 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
175 import InventoryTransactionModal from './modules/InventoryTransactionModal' 188 import InventoryTransactionModal from './modules/InventoryTransactionModal'
176 import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' 189 import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  190 + import {getCompanyList} from '@/api/api'
177 191
178 export default { 192 export default {
179 name: 'InventoryTransactionList', 193 name: 'InventoryTransactionList',
@@ -184,6 +198,7 @@ @@ -184,6 +198,7 @@
184 data () { 198 data () {
185 return { 199 return {
186 description: '库存交易记录管理页面', 200 description: '库存交易记录管理页面',
  201 + companyList:[],
187 // 表头 202 // 表头
188 columns: [ 203 columns: [
189 { 204 {
@@ -194,7 +209,9 @@ @@ -194,7 +209,9 @@
194 { 209 {
195 title:'货主', 210 title:'货主',
196 align:"center", 211 align:"center",
197 - dataIndex: 'companyCode' 212 + dataIndex: 'companyCode',
  213 + key: 'companyCode',
  214 + scopedSlots: { customRender: 'companyCode' }
198 }, 215 },
199 { 216 {
200 title:'容器编码', 217 title:'容器编码',
@@ -202,9 +219,14 @@ @@ -202,9 +219,14 @@
202 dataIndex: 'containerCode' 219 dataIndex: 'containerCode'
203 }, 220 },
204 { 221 {
205 - title:'库位编码', 222 + title:'起始库位编码',
  223 + align:"center",
  224 + dataIndex: 'fromLocationCode'
  225 + },
  226 + {
  227 + title:'目标库位编码',
206 align:"center", 228 align:"center",
207 - dataIndex: 'locationCode' 229 + dataIndex: 'toLocationCode'
208 }, 230 },
209 { 231 {
210 title:'交易类型', 232 title:'交易类型',
@@ -234,7 +256,7 @@ @@ -234,7 +256,7 @@
234 { 256 {
235 title:'库存状态', 257 title:'库存状态',
236 align:"center", 258 align:"center",
237 - dataIndex: 'inventoryStatus' 259 + dataIndex: 'inventoryStatus_dictText'
238 }, 260 },
239 { 261 {
240 title:'数量', 262 title:'数量',
@@ -288,7 +310,8 @@ @@ -288,7 +310,8 @@
288 } 310 }
289 }, 311 },
290 created() { 312 created() {
291 - this.getSuperFieldList(); 313 + this.getSuperFieldList();
  314 + this.loadFrom();
292 }, 315 },
293 computed: { 316 computed: {
294 importExcelUrl: function(){ 317 importExcelUrl: function(){
@@ -298,6 +321,24 @@ @@ -298,6 +321,24 @@
298 methods: { 321 methods: {
299 initDictConfig(){ 322 initDictConfig(){
300 }, 323 },
  324 + loadFrom() {
  325 + console.log("loadFrom 11");
  326 + getCompanyList().then((res) => {
  327 + if (res.success) {
  328 + this.companyList = res.result
  329 + }
  330 + });
  331 + },
  332 + solutionCompany(value) {
  333 + var actions = []
  334 + Object.keys(this.companyList).some((key) => {
  335 + if (this.companyList[key].code == ('' + value)) {
  336 + actions.push(this.companyList[key].name)
  337 + return true
  338 + }
  339 + })
  340 + return actions.join('')
  341 + },
301 getSuperFieldList(){ 342 getSuperFieldList(){
302 let fieldList=[]; 343 let fieldList=[];
303 fieldList.push({type:'string',value:'companyCode',text:'货主',dictCode:''}) 344 fieldList.push({type:'string',value:'companyCode',text:'货主',dictCode:''})
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
@@ -114,7 +114,8 @@ @@ -114,7 +114,8 @@
114 <span slot="action" slot-scope="text, record"> 114 <span slot="action" slot-scope="text, record">
115 <a @click="handleEdit(record)">编辑</a> 115 <a @click="handleEdit(record)">编辑</a>
116 <a-divider type="vertical" /> 116 <a-divider type="vertical" />
117 - <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)">生成任务</a> 117 + <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)" >生成任务</a>
  118 + <a v-else-if="record.status == 0" @click="createTask(record)">生成任务</a>
118 <a-divider type="vertical" /> 119 <a-divider type="vertical" />
119 <a-dropdown> 120 <a-dropdown>
120 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> 121 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
@@ -290,10 +291,8 @@ @@ -290,10 +291,8 @@
290 }, 291 },
291 createTask(record) { 292 createTask(record) {
292 this.loading = true; 293 this.loading = true;
293 - const that = this;  
294 this.model = Object.assign({}, record); 294 this.model = Object.assign({}, record);
295 - that.querySource.id = record.id;  
296 - createReceiptTask(that.querySource).then((res) => { 295 + createReceiptTask(this.model).then((res) => {
297 this.loading = false; 296 this.loading = false;
298 if (res.success) { 297 if (res.success) {
299 this.$message.success(res.message); 298 this.$message.success(res.message);
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerSelectModal.vue
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 33
34 import { httpAction } from '@/api/manage' 34 import { httpAction } from '@/api/manage'
35 import { validateDuplicateValue } from '@/utils/util' 35 import { validateDuplicateValue } from '@/utils/util'
36 - import {createShipmentTask} from '@/api/api' 36 + import {createReceiptTask} from '@/api/api'
37 import {selectSupplePort} from '@/api/api' 37 import {selectSupplePort} from '@/api/api'
38 38
39 export default { 39 export default {
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 data () { 51 data () {
52 return { 52 return {
53 title:"操作", 53 title:"操作",
54 - width:800, 54 + width:500,
55 visible: false, 55 visible: false,
56 model:{ 56 model:{
57 }, 57 },
@@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
96 this.$refs.form.validate(valid => { 96 this.$refs.form.validate(valid => {
97 if (valid) { 97 if (valid) {
98 that.confirmLoading = true; 98 that.confirmLoading = true;
99 - createShipmentTask(this.model).then((res) => { 99 + createReceiptTask(this.model).then((res) => {
100 if(res.success){ 100 if(res.success){
101 that.$message.success(res.message); 101 that.$message.success(res.message);
102 that.$emit('ok'); 102 that.$emit('ok');
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
@@ -166,7 +166,8 @@ @@ -166,7 +166,8 @@
166 </template> 166 </template>
167 167
168 <span slot="action" slot-scope="text, record"> 168 <span slot="action" slot-scope="text, record">
169 - <a @click="autoShipmentCombine(record)">自动配盘</a> 169 + <a-divider type="vertical" />
  170 + <a v-if="record.lastStatus < 800" @click="autoShipmentCombine(record)">自动配盘</a>
170 <a-divider type="vertical" /> 171 <a-divider type="vertical" />
171 <a @click="handleEdit(record)">编辑</a> 172 <a @click="handleEdit(record)">编辑</a>
172 173
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerSelectModal.vue
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 data () { 51 data () {
52 return { 52 return {
53 title:"操作", 53 title:"操作",
54 - width:800, 54 + width:500,
55 visible: false, 55 visible: false,
56 model:{ 56 model:{
57 }, 57 },
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.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 + <j-dict-select-tag placeholder="请选择任务类型" v-model="queryParam.taskType" dictCode="task_type"/>
  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.containerCode"></a-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <template v-if="toggleSearchStatus">
  18 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19 + <a-form-item label="库区">
  20 + <a-select
  21 + show-search
  22 + placeholder="请选择库区"
  23 + option-filter-prop="children"
  24 + :filter-option="filterOption"
  25 + v-model="queryParam.zoneCode"
  26 + style="width: 200px">
  27 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-item>
  30 + </a-col>
  31 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  32 + <a-form-item label="起始库位">
  33 + <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input>
  34 + </a-form-item>
  35 + </a-col>
  36 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  37 + <a-form-item label="目标库位">
  38 + <a-input placeholder="请输入目标库位" v-model="queryParam.toLocationCode"></a-input>
  39 + </a-form-item>
  40 + </a-col>
  41 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  42 + <a-form-item label="是否空出">
  43 + <j-dict-select-tag placeholder="请选择是否空出" v-model="queryParam.isEmptyOut" dictCode="is_or_not"/>
  44 + </a-form-item>
  45 + </a-col>
  46 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  47 + <a-form-item label="起始出入口">
  48 + <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPortCode"></a-input>
  49 + </a-form-item>
  50 + </a-col>
  51 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  52 + <a-form-item label="目标出入口">
  53 + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input>
  54 + </a-form-item>
  55 + </a-col>
  56 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  57 + <a-form-item label="任务状态">
  58 + <j-dict-select-tag placeholder="请选择任务状态" v-model="queryParam.status" dictCode="task_header_status"/>
  59 + </a-form-item>
  60 + </a-col>
  61 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  62 + <a-form-item label="是否重入">
  63 + <j-dict-select-tag placeholder="请选择是否重入" v-model="queryParam.isDoubleIn" dictCode="is_or_not"/>
  64 + </a-form-item>
  65 + </a-col>
  66 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  67 + <a-form-item label="重入库位号">
  68 + <a-input placeholder="请输入重入库位号" v-model="queryParam.originLocationCode"></a-input>
  69 + </a-form-item>
  70 + </a-col>
  71 + <a-col :xl="10" :lg="11" :md="12" :sm="24">
  72 + <a-form-item label="创建日期">
  73 + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
  74 + <span class="query-group-split-cust"></span>
  75 + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date>
  76 + </a-form-item>
  77 + </a-col>
  78 + </template>
  79 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  80 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  81 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  82 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  83 + <a @click="handleToggleSearch" style="margin-left: 8px">
  84 + {{ toggleSearchStatus ? '收起' : '展开' }}
  85 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  86 + </a>
  87 + </span>
  88 + </a-col>
  89 + </a-row>
  90 + </a-form>
  91 + </div>
  92 + <!-- 查询区域-END -->
  93 +
  94 + <!-- 操作按钮区域 -->
  95 + <div class="table-operator">
  96 + <a-button @click="createCheckOut()" type="primary">出库查看</a-button>
  97 +<!-- <a-button type="primary" icon="download" @click="handleExportXls('任务表')">导出</a-button>-->
  98 +<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  99 +<!-- <a-button type="primary" icon="import">导入</a-button>-->
  100 +<!-- </a-upload>-->
  101 +<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
  102 +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  103 + </div>
  104 +
  105 + <!-- table区域-begin -->
  106 + <div>
  107 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  108 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  109 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  110 + </div>
  111 +
  112 + <a-table
  113 + ref="table"
  114 + size="middle"
  115 + bordered
  116 + rowKey="id"
  117 + class="j-table-force-nowrap"
  118 + :scroll="{x:true}"
  119 + :columns="columns"
  120 + :dataSource="dataSource"
  121 + :pagination="ipagination"
  122 + :loading="loading"
  123 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  124 + :customRow="clickThenSelect"
  125 + @change="handleTableChange">
  126 +
  127 + <span slot="zoneCode" slot-scope="zoneCode">
  128 + <a-tag :key="zoneCode" color=blue>
  129 + {{ solutionZoneCode(zoneCode) }}
  130 + </a-tag>
  131 + </span>
  132 +
  133 + <template slot="htmlSlot" slot-scope="text">
  134 + <div v-html="text"></div>
  135 + </template>
  136 + <template slot="imgSlot" slot-scope="text">
  137 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  138 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  139 + </template>
  140 + <template slot="fileSlot" slot-scope="text">
  141 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  142 + <a-button
  143 + v-else
  144 + :ghost="true"
  145 + type="primary"
  146 + icon="download"
  147 + size="small"
  148 + @click="downloadFile(text)">
  149 + 下载
  150 + </a-button>
  151 + </template>
  152 +
  153 + <span slot="action" slot-scope="text, record">
  154 + <a v-if="record.status == 1" @click="executeTask(record)">执行</a>
  155 + <a-divider type="vertical" />
  156 + <a v-if="record.status < 100" @click="completeTask(record)">完成</a>
  157 + <a-divider type="vertical" />
  158 + <a-dropdown>
  159 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  160 + <a-menu slot="overlay">
  161 + <a-menu-item>
  162 + <a @click="handleEdit(record)">编辑</a>
  163 + </a-menu-item>
  164 + <a-menu-item>
  165 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  166 + <a>删除</a>
  167 + </a-popconfirm>
  168 + </a-menu-item>
  169 + </a-menu>
  170 + </a-dropdown>
  171 + </span>
  172 +
  173 + </a-table>
  174 + </div>
  175 +
  176 + <a-tabs defaultActiveKey="1">
  177 + <a-tab-pane tab="任务详情" key="1" >
  178 + <TaskDetailList :mainId="selectedMainId" />
  179 + </a-tab-pane>
  180 + </a-tabs>
  181 +
  182 + <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal>
  183 + <check-out-task-modal ref="checkOutModal" @ok="modalFormOk"></check-out-task-modal>
  184 + </a-card>
  185 +</template>
  186 +
  187 +<script>
  188 +
  189 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  190 + import TaskHeaderModal from './modules/TaskHeaderModal'
  191 + import { getAction } from '@/api/manage'
  192 + import TaskDetailList from './TaskDetailList'
  193 + import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  194 + import '@/assets/less/TableExpand.less'
  195 + import {completeTaskByWMS} from '@/api/api'
  196 + import {execute} from '@/api/api'
  197 + import {getZoneList} from '@/api/api'
  198 + import EmptyInTaskModal from './modules/EmptyInTaskModal'
  199 + import CheckOutTaskModal from "./modules/CheckOutTaskModal";
  200 +
  201 + export default {
  202 + name: "TaskHeaderList",
  203 + mixins:[JeecgListMixin],
  204 + components: {
  205 + CheckOutTaskModal,
  206 + EmptyInTaskModal,
  207 + TaskDetailList,
  208 + TaskHeaderModal
  209 + },
  210 + data () {
  211 + return {
  212 + description: '任务表管理页面',
  213 + zoneList:[],
  214 + // 表头
  215 + columns: [
  216 + {
  217 + title:'任务ID',
  218 + align:"center",
  219 + dataIndex: 'id',
  220 + },
  221 + {
  222 + title:'任务类型',
  223 + align:"center",
  224 + dataIndex: 'taskType_dictText',
  225 + },
  226 + {
  227 + title:'容器号',
  228 + align:"center",
  229 + dataIndex: 'containerCode'
  230 + },
  231 + {
  232 + title:'库区',
  233 + align:"center",
  234 + dataIndex: 'zoneCode',
  235 + key: 'zoneCode',
  236 + scopedSlots: { customRender: 'zoneCode' }
  237 + },
  238 + {
  239 + title:'起始库位',
  240 + align:"center",
  241 + dataIndex: 'fromLocationCode'
  242 + },
  243 + {
  244 + title:'目标库位',
  245 + align:"center",
  246 + dataIndex: 'toLocationCode'
  247 + },
  248 + {
  249 + title:'目标出入口',
  250 + align:"center",
  251 + dataIndex: 'toPortCode'
  252 + },
  253 + {
  254 + title:'任务状态',
  255 + align:"center",
  256 + dataIndex: 'status_dictText',
  257 + },
  258 + {
  259 + title:'是否重入',
  260 + align:"center",
  261 + dataIndex: 'isDoubleIn_dictText',
  262 + },
  263 + {
  264 + title:'重入库位号',
  265 + align:"center",
  266 + dataIndex: 'originLocationCode'
  267 + },
  268 + {
  269 + title:'创建人',
  270 + align:"center",
  271 + dataIndex: 'createBy'
  272 + },
  273 + {
  274 + title:'创建日期',
  275 + align:"center",
  276 + dataIndex: 'createTime'
  277 + },
  278 + {
  279 + title:'更新人',
  280 + align:"center",
  281 + dataIndex: 'updateBy'
  282 + },
  283 + {
  284 + title:'更新日期',
  285 + align:"center",
  286 + dataIndex: 'updateTime'
  287 + },
  288 + {
  289 + title: '操作',
  290 + dataIndex: 'action',
  291 + align:"center",
  292 + fixed:"right",
  293 + width:147,
  294 + scopedSlots: { customRender: 'action' },
  295 + }
  296 + ],
  297 + url: {
  298 + list: "/task/taskHeader/list",
  299 + delete: "/task/taskHeader/delete",
  300 + deleteBatch: "/task/taskHeader/deleteBatch",
  301 + exportXlsUrl: "/task/taskHeader/exportXls",
  302 + importExcelUrl: "task/taskHeader/importExcel",
  303 + },
  304 + dictOptions:{
  305 + taskType:[],
  306 + isEmptyOut:[],
  307 + isDoubleIn:[],
  308 + status:[],
  309 + },
  310 + /* 分页参数 */
  311 + ipagination:{
  312 + current: 1,
  313 + pageSize: 5,
  314 + pageSizeOptions: ['5', '10', '50'],
  315 + showTotal: (total, range) => {
  316 + return range[0] + "-" + range[1] + " 共" + total + "条"
  317 + },
  318 + showQuickJumper: true,
  319 + showSizeChanger: true,
  320 + total: 0
  321 + },
  322 + selectedMainId:'',
  323 + superFieldList:[],
  324 + }
  325 + },
  326 + created() {
  327 + this.getSuperFieldList();
  328 + this.loadFrom();
  329 + },
  330 + computed: {
  331 + importExcelUrl: function(){
  332 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  333 + }
  334 + },
  335 + methods: {
  336 + initDictConfig(){
  337 + },
  338 + clickThenSelect(record) {
  339 + return {
  340 + on: {
  341 + click: () => {
  342 + this.onSelectChange(record.id.split(","), [record]);
  343 + }
  344 + }
  345 + }
  346 + },
  347 + onClearSelected() {
  348 + this.selectedRowKeys = [];
  349 + this.selectionRows = [];
  350 + this.selectedMainId=''
  351 + },
  352 + onSelectChange(selectedRowKeys, selectionRows) {
  353 + this.selectedMainId=selectedRowKeys[0]
  354 + this.selectedRowKeys = selectedRowKeys;
  355 + this.selectionRows = selectionRows;
  356 + },
  357 + loadData(arg) {
  358 + if(!this.url.list){
  359 + this.$message.error("请设置url.list属性!")
  360 + return
  361 + }
  362 + //加载数据 若传入参数1则加载第一页的内容
  363 + if (arg === 1) {
  364 + this.ipagination.current = 1;
  365 + }
  366 + this.onClearSelected()
  367 + var params = this.getQueryParams();//查询条件
  368 + params.innernalTaskType = 400;
  369 + this.loading = true;
  370 + getAction(this.url.list, params).then((res) => {
  371 + if (res.success) {
  372 + this.dataSource = res.result.records;
  373 + this.ipagination.total = res.result.total;
  374 + }
  375 + if(res.code===510){
  376 + this.$message.warning(res.message)
  377 + }
  378 + this.loading = false;
  379 + })
  380 + },
  381 + loadFrom() {
  382 + getZoneList().then((res) => {
  383 + if (res.success) {
  384 + this.zoneList = res.result
  385 + }
  386 + });
  387 + },
  388 + createCheckOut() {
  389 + this.$refs.checkOutModal.edit();
  390 + this.$refs.checkOutModal.title = "创建出库查看任务";
  391 + },
  392 + solutionZoneCode(value) {
  393 + var actions = []
  394 + Object.keys(this.zoneList).some((key) => {
  395 + if (this.zoneList[key].code == ('' + value)) {
  396 + actions.push(this.zoneList[key].name)
  397 + return true
  398 + }
  399 + })
  400 + return actions.join('')
  401 + },
  402 + completeTask(record) {
  403 + this.loading = true;
  404 + this.model = Object.assign({}, record);
  405 + completeTaskByWMS(this.model).then((res) => {
  406 + this.loading = false;
  407 + if (res.success) {
  408 + this.$message.success(res.message);
  409 + }
  410 + else {
  411 + this.$message.error(res.message);
  412 + }
  413 + this.searchQuery();
  414 + });
  415 + },
  416 + executeTask(record) {
  417 + this.loading = true;
  418 + this.model = Object.assign({}, record);
  419 + execute(this.model).then((res) => {
  420 + this.loading = false;
  421 + if (res.success) {
  422 + this.$message.success(res.message);
  423 + }
  424 + else {
  425 + this.$message.error(res.message);
  426 + }
  427 + this.searchQuery();
  428 + });
  429 + },
  430 + getSuperFieldList(){
  431 + let fieldList=[];
  432 + fieldList.push({type:'int',value:'taskType',text:'任务类型',dictCode:'task_type'})
  433 + fieldList.push({type:'string',value:'containerCode',text:'容器号',dictCode:''})
  434 + fieldList.push({type:'string',value:'fromLocationCode',text:'起始库位',dictCode:''})
  435 + fieldList.push({type:'string',value:'toLocationCode',text:'目标库位',dictCode:''})
  436 + fieldList.push({type:'string',value:'isEmptyOut',text:'是否空出',dictCode:'is_or_not'})
  437 + fieldList.push({type:'int',value:'isDoubleIn',text:'是否重入',dictCode:'is_or_not'})
  438 + fieldList.push({type:'string',value:'originLocationCode',text:'重入库位号',dictCode:''})
  439 + fieldList.push({type:'int',value:'status',text:'任务状态',dictCode:'task_header_status'})
  440 + fieldList.push({type:'string',value:'fromPortCode',text:'起始出入口',dictCode:''})
  441 + fieldList.push({type:'string',value:'toPortCode',text:'目标出入口',dictCode:''})
  442 + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''})
  443 + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
  444 + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''})
  445 + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'})
  446 + this.superFieldList = fieldList
  447 + }
  448 + }
  449 + }
  450 +</script>
  451 +<style scoped>
  452 + @import '~@assets/less/common.less'
  453 +</style>
0 \ No newline at end of file 454 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
@@ -15,6 +15,19 @@ @@ -15,6 +15,19 @@
15 </a-form-item> 15 </a-form-item>
16 </a-col> 16 </a-col>
17 <template v-if="toggleSearchStatus"> 17 <template v-if="toggleSearchStatus">
  18 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19 + <a-form-item label="库区">
  20 + <a-select
  21 + show-search
  22 + placeholder="请选择库区"
  23 + option-filter-prop="children"
  24 + :filter-option="filterOption"
  25 + v-model="queryParam.zoneCode"
  26 + style="width: 200px">
  27 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-item>
  30 + </a-col>
18 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 31 <a-col :xl="6" :lg="7" :md="8" :sm="24">
19 <a-form-item label="起始库位"> 32 <a-form-item label="起始库位">
20 <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> 33 <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input>
@@ -32,12 +45,12 @@ @@ -32,12 +45,12 @@
32 </a-col> 45 </a-col>
33 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 46 <a-col :xl="6" :lg="7" :md="8" :sm="24">
34 <a-form-item label="起始出入口"> 47 <a-form-item label="起始出入口">
35 - <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPort"></a-input> 48 + <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPortCode"></a-input>
36 </a-form-item> 49 </a-form-item>
37 </a-col> 50 </a-col>
38 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 51 <a-col :xl="6" :lg="7" :md="8" :sm="24">
39 <a-form-item label="目标出入口"> 52 <a-form-item label="目标出入口">
40 - <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input> 53 + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input>
41 </a-form-item> 54 </a-form-item>
42 </a-col> 55 </a-col>
43 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 56 <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -79,15 +92,10 @@ @@ -79,15 +92,10 @@
79 <!-- 查询区域-END --> 92 <!-- 查询区域-END -->
80 93
81 <!-- 操作按钮区域 --> 94 <!-- 操作按钮区域 -->
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">-->  
86 -<!-- <a-button type="primary" icon="import">导入</a-button>-->  
87 -<!-- </a-upload>-->  
88 -<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->  
89 -<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->  
90 -<!-- </div>--> 95 + <div class="table-operator">
  96 + <a-button @click="createEmptyIn()" type="primary">空托入库</a-button>
  97 + <a-button @click="createManyEmptyIn()" type="primary">空托组入库</a-button>
  98 + </div>
91 99
92 <!-- table区域-begin --> 100 <!-- table区域-begin -->
93 <div> 101 <div>
@@ -111,6 +119,12 @@ @@ -111,6 +119,12 @@
111 :customRow="clickThenSelect" 119 :customRow="clickThenSelect"
112 @change="handleTableChange"> 120 @change="handleTableChange">
113 121
  122 + <span slot="zoneCode" slot-scope="zoneCode">
  123 + <a-tag :key="zoneCode" color=blue>
  124 + {{ solutionZoneCode(zoneCode) }}
  125 + </a-tag>
  126 + </span>
  127 +
114 <template slot="htmlSlot" slot-scope="text"> 128 <template slot="htmlSlot" slot-scope="text">
115 <div v-html="text"></div> 129 <div v-html="text"></div>
116 </template> 130 </template>
@@ -134,6 +148,8 @@ @@ -134,6 +148,8 @@
134 <span slot="action" slot-scope="text, record"> 148 <span slot="action" slot-scope="text, record">
135 <a v-if="record.status == 1" @click="executeTask(record)">执行</a> 149 <a v-if="record.status == 1" @click="executeTask(record)">执行</a>
136 <a-divider type="vertical" /> 150 <a-divider type="vertical" />
  151 + <a v-if="record.status < 100" @click="cancelTask(record)">取消</a>
  152 + <a-divider type="vertical" />
137 <a v-if="record.status < 100" @click="completeTask(record)">完成</a> 153 <a v-if="record.status < 100" @click="completeTask(record)">完成</a>
138 <a-divider type="vertical" /> 154 <a-divider type="vertical" />
139 <a-dropdown> 155 <a-dropdown>
@@ -161,6 +177,8 @@ @@ -161,6 +177,8 @@
161 </a-tabs> 177 </a-tabs>
162 178
163 <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal> 179 <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal>
  180 + <empty-in-task-modal ref="emptyInModal" @ok="modalFormOk"></empty-in-task-modal>
  181 + <many-empty-in-task-modal ref="manyEmptyInModal" @ok="modalFormOk"></many-empty-in-task-modal>
164 </a-card> 182 </a-card>
165 </template> 183 </template>
166 184
@@ -172,19 +190,25 @@ @@ -172,19 +190,25 @@
172 import TaskDetailList from './TaskDetailList' 190 import TaskDetailList from './TaskDetailList'
173 import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil' 191 import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
174 import '@/assets/less/TableExpand.less' 192 import '@/assets/less/TableExpand.less'
175 - import {completeTaskByWMS} from '@/api/api' 193 + import {completeTaskByWMS, cancelTask} from '@/api/api'
176 import {execute} from '@/api/api' 194 import {execute} from '@/api/api'
  195 + import {getZoneList} from '@/api/api'
  196 + import EmptyInTaskModal from './modules/EmptyInTaskModal'
  197 + import ManyEmptyInTaskModal from "./modules/ManyEmptyInTaskModal";
177 198
178 export default { 199 export default {
179 name: "TaskHeaderList", 200 name: "TaskHeaderList",
180 mixins:[JeecgListMixin], 201 mixins:[JeecgListMixin],
181 components: { 202 components: {
  203 + ManyEmptyInTaskModal,
  204 + EmptyInTaskModal,
182 TaskDetailList, 205 TaskDetailList,
183 TaskHeaderModal 206 TaskHeaderModal
184 }, 207 },
185 data () { 208 data () {
186 return { 209 return {
187 description: '任务表管理页面', 210 description: '任务表管理页面',
  211 + zoneList:[],
188 // 表头 212 // 表头
189 columns: [ 213 columns: [
190 { 214 {
@@ -203,6 +227,13 @@ @@ -203,6 +227,13 @@
203 dataIndex: 'containerCode' 227 dataIndex: 'containerCode'
204 }, 228 },
205 { 229 {
  230 + title:'库区',
  231 + align:"center",
  232 + dataIndex: 'zoneCode',
  233 + key: 'zoneCode',
  234 + scopedSlots: { customRender: 'zoneCode' }
  235 + },
  236 + {
206 title:'起始库位', 237 title:'起始库位',
207 align:"center", 238 align:"center",
208 dataIndex: 'fromLocationCode' 239 dataIndex: 'fromLocationCode'
@@ -215,7 +246,7 @@ @@ -215,7 +246,7 @@
215 { 246 {
216 title:'目标出入口', 247 title:'目标出入口',
217 align:"center", 248 align:"center",
218 - dataIndex: 'toPort' 249 + dataIndex: 'toPortCode'
219 }, 250 },
220 { 251 {
221 title:'任务状态', 252 title:'任务状态',
@@ -292,6 +323,7 @@ @@ -292,6 +323,7 @@
292 }, 323 },
293 created() { 324 created() {
294 this.getSuperFieldList(); 325 this.getSuperFieldList();
  326 + this.loadFrom();
295 }, 327 },
296 computed: { 328 computed: {
297 importExcelUrl: function(){ 329 importExcelUrl: function(){
@@ -344,6 +376,45 @@ @@ -344,6 +376,45 @@
344 this.loading = false; 376 this.loading = false;
345 }) 377 })
346 }, 378 },
  379 + loadFrom() {
  380 + getZoneList().then((res) => {
  381 + if (res.success) {
  382 + this.zoneList = res.result
  383 + }
  384 + });
  385 + },
  386 + createEmptyIn() {
  387 + this.$refs.emptyInModal.edit();
  388 + this.$refs.emptyInModal.title = "创建空托盘入库";
  389 + },
  390 + createManyEmptyIn() {
  391 + this.$refs.manyEmptyInModal.edit();
  392 + this.$refs.manyEmptyInModal.title = "创建空托盘组入库";
  393 + },
  394 + solutionZoneCode(value) {
  395 + var actions = []
  396 + Object.keys(this.zoneList).some((key) => {
  397 + if (this.zoneList[key].code == ('' + value)) {
  398 + actions.push(this.zoneList[key].name)
  399 + return true
  400 + }
  401 + })
  402 + return actions.join('')
  403 + },
  404 + cancelTask(record) {
  405 + this.loading = true;
  406 + this.model = Object.assign({}, record);
  407 + cancelTask(this.model.id).then((res) => {
  408 + this.loading = false;
  409 + if (res.success) {
  410 + this.$message.success(res.message);
  411 + }
  412 + else {
  413 + this.$message.error(res.message);
  414 + }
  415 + this.searchQuery();
  416 + });
  417 + },
347 completeTask(record) { 418 completeTask(record) {
348 this.loading = true; 419 this.loading = true;
349 this.model = Object.assign({}, record); 420 this.model = Object.assign({}, record);
@@ -382,8 +453,8 @@ @@ -382,8 +453,8 @@
382 fieldList.push({type:'int',value:'isDoubleIn',text:'是否重入',dictCode:'is_or_not'}) 453 fieldList.push({type:'int',value:'isDoubleIn',text:'是否重入',dictCode:'is_or_not'})
383 fieldList.push({type:'string',value:'originLocationCode',text:'重入库位号',dictCode:''}) 454 fieldList.push({type:'string',value:'originLocationCode',text:'重入库位号',dictCode:''})
384 fieldList.push({type:'int',value:'status',text:'任务状态',dictCode:'task_header_status'}) 455 fieldList.push({type:'int',value:'status',text:'任务状态',dictCode:'task_header_status'})
385 - fieldList.push({type:'string',value:'fromPort',text:'起始出入口',dictCode:''})  
386 - fieldList.push({type:'string',value:'toPort',text:'目标出入口',dictCode:''}) 456 + fieldList.push({type:'string',value:'fromPortCode',text:'起始出入口',dictCode:''})
  457 + fieldList.push({type:'string',value:'toPortCode',text:'目标出入口',dictCode:''})
387 fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) 458 fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''})
388 fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) 459 fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
389 fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''}) 460 fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''})
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
@@ -16,6 +16,19 @@ @@ -16,6 +16,19 @@
16 </a-col> 16 </a-col>
17 <template v-if="toggleSearchStatus"> 17 <template v-if="toggleSearchStatus">
18 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 18 <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19 + <a-form-item label="库区">
  20 + <a-select
  21 + show-search
  22 + placeholder="请选择库区"
  23 + option-filter-prop="children"
  24 + :filter-option="filterOption"
  25 + v-model="queryParam.zoneCode"
  26 + style="width: 200px">
  27 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-item>
  30 + </a-col>
  31 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
19 <a-form-item label="起始库位"> 32 <a-form-item label="起始库位">
20 <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> 33 <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input>
21 </a-form-item> 34 </a-form-item>
@@ -47,12 +60,12 @@ @@ -47,12 +60,12 @@
47 </a-col> 60 </a-col>
48 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 61 <a-col :xl="6" :lg="7" :md="8" :sm="24">
49 <a-form-item label="起始出入口"> 62 <a-form-item label="起始出入口">
50 - <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPort"></a-input> 63 + <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPortCode"></a-input>
51 </a-form-item> 64 </a-form-item>
52 </a-col> 65 </a-col>
53 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 66 <a-col :xl="6" :lg="7" :md="8" :sm="24">
54 <a-form-item label="目标出入口"> 67 <a-form-item label="目标出入口">
55 - <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input> 68 + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input>
56 </a-form-item> 69 </a-form-item>
57 </a-col> 70 </a-col>
58 <a-col :xl="10" :lg="11" :md="12" :sm="24"> 71 <a-col :xl="10" :lg="11" :md="12" :sm="24">
@@ -79,15 +92,10 @@ @@ -79,15 +92,10 @@
79 <!-- 查询区域-END --> 92 <!-- 查询区域-END -->
80 93
81 <!-- 操作按钮区域 --> 94 <!-- 操作按钮区域 -->
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">-->  
86 -<!-- <a-button type="primary" icon="import">导入</a-button>-->  
87 -<!-- </a-upload>-->  
88 -<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->  
89 -<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->  
90 -<!-- </div>--> 95 + <div class="table-operator">
  96 + <a-button @click="createEmptyOut()" type="primary" >空托出库</a-button>
  97 + <a-button @click="createManyEmptyOut()" type="primary" >空托组出库</a-button>
  98 + </div>
91 99
92 <!-- table区域-begin --> 100 <!-- table区域-begin -->
93 <div> 101 <div>
@@ -111,6 +119,12 @@ @@ -111,6 +119,12 @@
111 :customRow="clickThenSelect" 119 :customRow="clickThenSelect"
112 @change="handleTableChange"> 120 @change="handleTableChange">
113 121
  122 + <span slot="zoneCode" slot-scope="zoneCode">
  123 + <a-tag :key="zoneCode" color=blue>
  124 + {{ solutionZoneCode(zoneCode) }}
  125 + </a-tag>
  126 + </span>
  127 +
114 <template slot="htmlSlot" slot-scope="text"> 128 <template slot="htmlSlot" slot-scope="text">
115 <div v-html="text"></div> 129 <div v-html="text"></div>
116 </template> 130 </template>
@@ -161,6 +175,9 @@ @@ -161,6 +175,9 @@
161 </a-tabs> 175 </a-tabs>
162 176
163 <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal> 177 <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal>
  178 + <empty-out-task-modal ref="emptyOutModal" @ok="modalFormOk"></empty-out-task-modal>
  179 + <many-empty-out-task-modal ref="manyEmptyOutModal" @ok="modalFormOk"></many-empty-out-task-modal>
  180 +
164 </a-card> 181 </a-card>
165 </template> 182 </template>
166 183
@@ -174,11 +191,16 @@ @@ -174,11 +191,16 @@
174 import '@/assets/less/TableExpand.less' 191 import '@/assets/less/TableExpand.less'
175 import {completeTaskByWMS} from '@/api/api' 192 import {completeTaskByWMS} from '@/api/api'
176 import {execute} from '@/api/api' 193 import {execute} from '@/api/api'
  194 + import {getZoneList} from '@/api/api'
  195 + import EmptyOutTaskModal from './modules/EmptyOutTaskModal'
  196 + import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal";
177 197
178 export default { 198 export default {
179 name: "TaskHeaderList", 199 name: "TaskHeaderList",
180 mixins:[JeecgListMixin], 200 mixins:[JeecgListMixin],
181 components: { 201 components: {
  202 + ManyEmptyOutTaskModal,
  203 + EmptyOutTaskModal,
182 TaskDetailList, 204 TaskDetailList,
183 TaskHeaderModal 205 TaskHeaderModal
184 }, 206 },
@@ -203,6 +225,13 @@ @@ -203,6 +225,13 @@
203 dataIndex: 'containerCode' 225 dataIndex: 'containerCode'
204 }, 226 },
205 { 227 {
  228 + title:'库区',
  229 + align:"center",
  230 + dataIndex: 'zoneCode',
  231 + key: 'zoneCode',
  232 + scopedSlots: { customRender: 'zoneCode' }
  233 + },
  234 + {
206 title:'起始库位', 235 title:'起始库位',
207 align:"center", 236 align:"center",
208 dataIndex: 'fromLocationCode' 237 dataIndex: 'fromLocationCode'
@@ -215,7 +244,7 @@ @@ -215,7 +244,7 @@
215 { 244 {
216 title:'目标出入口', 245 title:'目标出入口',
217 align:"center", 246 align:"center",
218 - dataIndex: 'toPort' 247 + dataIndex: 'toPortCode'
219 }, 248 },
220 { 249 {
221 title:'任务状态', 250 title:'任务状态',
@@ -287,6 +316,7 @@ @@ -287,6 +316,7 @@
287 }, 316 },
288 created() { 317 created() {
289 this.getSuperFieldList(); 318 this.getSuperFieldList();
  319 + this.loadFrom();
290 }, 320 },
291 computed: { 321 computed: {
292 importExcelUrl: function(){ 322 importExcelUrl: function(){
@@ -315,6 +345,31 @@ @@ -315,6 +345,31 @@
315 this.selectedRowKeys = selectedRowKeys; 345 this.selectedRowKeys = selectedRowKeys;
316 this.selectionRows = selectionRows; 346 this.selectionRows = selectionRows;
317 }, 347 },
  348 + loadFrom() {
  349 + getZoneList().then((res) => {
  350 + if (res.success) {
  351 + this.zoneList = res.result
  352 + }
  353 + });
  354 + },
  355 + createEmptyOut() {
  356 + this.$refs.emptyOutModal.edit();
  357 + this.$refs.emptyOutModal.title = "创建空托盘出库";
  358 + },
  359 + createManyEmptyOut() {
  360 + this.$refs.manyEmptyOutModal.edit();
  361 + this.$refs.manyEmptyOutModal.title = "创建空托盘组出库";
  362 + },
  363 + solutionZoneCode(value) {
  364 + var actions = []
  365 + Object.keys(this.zoneList).some((key) => {
  366 + if (this.zoneList[key].code == ('' + value)) {
  367 + actions.push(this.zoneList[key].name)
  368 + return true
  369 + }
  370 + })
  371 + return actions.join('')
  372 + },
318 loadData(arg) { 373 loadData(arg) {
319 if(!this.url.list){ 374 if(!this.url.list){
320 this.$message.error("请设置url.list属性!") 375 this.$message.error("请设置url.list属性!")
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.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 + <j-dict-select-tag placeholder="请选择任务类型" v-model="queryParam.taskType" dictCode="task_type"/>
  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.containerCode"></a-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <template v-if="toggleSearchStatus">
  18 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19 + <a-form-item label="库区">
  20 + <a-select
  21 + show-search
  22 + placeholder="请选择库区"
  23 + option-filter-prop="children"
  24 + :filter-option="filterOption"
  25 + v-model="queryParam.zoneCode"
  26 + style="width: 200px">
  27 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-item>
  30 + </a-col>
  31 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  32 + <a-form-item label="起始库位">
  33 + <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input>
  34 + </a-form-item>
  35 + </a-col>
  36 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  37 + <a-form-item label="目标库位">
  38 + <a-input placeholder="请输入目标库位" v-model="queryParam.toLocationCode"></a-input>
  39 + </a-form-item>
  40 + </a-col>
  41 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  42 + <a-form-item label="是否空出">
  43 + <j-dict-select-tag placeholder="请选择是否空出" v-model="queryParam.isEmptyOut" dictCode="is_or_not"/>
  44 + </a-form-item>
  45 + </a-col>
  46 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  47 + <a-form-item label="起始出入口">
  48 + <a-input placeholder="请输入起始出入口" v-model="queryParam.fromPortCode"></a-input>
  49 + </a-form-item>
  50 + </a-col>
  51 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  52 + <a-form-item label="目标出入口">
  53 + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input>
  54 + </a-form-item>
  55 + </a-col>
  56 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  57 + <a-form-item label="任务状态">
  58 + <j-dict-select-tag placeholder="请选择任务状态" v-model="queryParam.status" dictCode="task_header_status"/>
  59 + </a-form-item>
  60 + </a-col>
  61 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  62 + <a-form-item label="是否重入">
  63 + <j-dict-select-tag placeholder="请选择是否重入" v-model="queryParam.isDoubleIn" dictCode="is_or_not"/>
  64 + </a-form-item>
  65 + </a-col>
  66 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  67 + <a-form-item label="重入库位号">
  68 + <a-input placeholder="请输入重入库位号" v-model="queryParam.originLocationCode"></a-input>
  69 + </a-form-item>
  70 + </a-col>
  71 + <a-col :xl="10" :lg="11" :md="12" :sm="24">
  72 + <a-form-item label="创建日期">
  73 + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
  74 + <span class="query-group-split-cust"></span>
  75 + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date>
  76 + </a-form-item>
  77 + </a-col>
  78 + </template>
  79 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  80 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  81 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  82 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  83 + <a @click="handleToggleSearch" style="margin-left: 8px">
  84 + {{ toggleSearchStatus ? '收起' : '展开' }}
  85 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  86 + </a>
  87 + </span>
  88 + </a-col>
  89 + </a-row>
  90 + </a-form>
  91 + </div>
  92 + <!-- 查询区域-END -->
  93 +
  94 + <!-- 操作按钮区域 -->
  95 + <div class="table-operator">
  96 + <a-button @click="createTransfer()" type="primary">移库任务</a-button>
  97 + <a-button @click="createOverStation()" type="primary">跨站任务</a-button>
  98 +<!-- <a-button type="primary" icon="download" @click="handleExportXls('任务表')">导出</a-button>-->
  99 +<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  100 +<!-- <a-button type="primary" icon="import">导入</a-button>-->
  101 +<!-- </a-upload>-->
  102 +<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
  103 +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  104 + </div>
  105 +
  106 + <!-- table区域-begin -->
  107 + <div>
  108 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  109 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  110 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  111 + </div>
  112 +
  113 + <a-table
  114 + ref="table"
  115 + size="middle"
  116 + bordered
  117 + rowKey="id"
  118 + class="j-table-force-nowrap"
  119 + :scroll="{x:true}"
  120 + :columns="columns"
  121 + :dataSource="dataSource"
  122 + :pagination="ipagination"
  123 + :loading="loading"
  124 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  125 + :customRow="clickThenSelect"
  126 + @change="handleTableChange">
  127 +
  128 + <span slot="zoneCode" slot-scope="zoneCode">
  129 + <a-tag :key="zoneCode" color=blue>
  130 + {{ solutionZoneCode(zoneCode) }}
  131 + </a-tag>
  132 + </span>
  133 +
  134 + <template slot="htmlSlot" slot-scope="text">
  135 + <div v-html="text"></div>
  136 + </template>
  137 + <template slot="imgSlot" slot-scope="text">
  138 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  139 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  140 + </template>
  141 + <template slot="fileSlot" slot-scope="text">
  142 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  143 + <a-button
  144 + v-else
  145 + :ghost="true"
  146 + type="primary"
  147 + icon="download"
  148 + size="small"
  149 + @click="downloadFile(text)">
  150 + 下载
  151 + </a-button>
  152 + </template>
  153 +
  154 + <span slot="action" slot-scope="text, record">
  155 + <a v-if="record.status == 1" @click="executeTask(record)">执行</a>
  156 + <a-divider type="vertical" />
  157 + <a v-if="record.status < 100" @click="completeTask(record)">完成</a>
  158 + <a-divider type="vertical" />
  159 + <a-dropdown>
  160 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  161 + <a-menu slot="overlay">
  162 + <a-menu-item>
  163 + <a @click="handleEdit(record)">编辑</a>
  164 + </a-menu-item>
  165 + <a-menu-item>
  166 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  167 + <a>删除</a>
  168 + </a-popconfirm>
  169 + </a-menu-item>
  170 + </a-menu>
  171 + </a-dropdown>
  172 + </span>
  173 +
  174 + </a-table>
  175 + </div>
  176 +
  177 + <a-tabs defaultActiveKey="1">
  178 + <a-tab-pane tab="任务详情" key="1" >
  179 + <TaskDetailList :mainId="selectedMainId" />
  180 + </a-tab-pane>
  181 + </a-tabs>
  182 +
  183 + <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal>
  184 + <transfer-task-modal ref="transferModal" @ok="modalFormOk"></transfer-task-modal>
  185 + <over-station-task-modal ref="overStationModal" @ok="modalFormOk"></over-station-task-modal>
  186 + </a-card>
  187 +</template>
  188 +
  189 +<script>
  190 +
  191 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  192 + import TaskHeaderModal from './modules/TaskHeaderModal'
  193 + import { getAction } from '@/api/manage'
  194 + import TaskDetailList from './TaskDetailList'
  195 + import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  196 + import '@/assets/less/TableExpand.less'
  197 + import {completeTaskByWMS} from '@/api/api'
  198 + import {execute} from '@/api/api'
  199 + import {getZoneList} from '@/api/api'
  200 + import EmptyInTaskModal from './modules/EmptyInTaskModal'
  201 + import TransferTaskModal from "./modules/TransferTaskModal";
  202 + import OverStationTaskModal from "./modules/OverStationTaskModal";
  203 +
  204 + export default {
  205 + name: "TaskHeaderList",
  206 + mixins:[JeecgListMixin],
  207 + components: {
  208 + OverStationTaskModal,
  209 + TransferTaskModal,
  210 + EmptyInTaskModal,
  211 + TaskDetailList,
  212 + TaskHeaderModal
  213 + },
  214 + data () {
  215 + return {
  216 + description: '任务表管理页面',
  217 + zoneList:[],
  218 + // 表头
  219 + columns: [
  220 + {
  221 + title:'任务ID',
  222 + align:"center",
  223 + dataIndex: 'id',
  224 + },
  225 + {
  226 + title:'任务类型',
  227 + align:"center",
  228 + dataIndex: 'taskType_dictText',
  229 + },
  230 + {
  231 + title:'容器号',
  232 + align:"center",
  233 + dataIndex: 'containerCode'
  234 + },
  235 + {
  236 + title:'库区',
  237 + align:"center",
  238 + dataIndex: 'zoneCode',
  239 + key: 'zoneCode',
  240 + scopedSlots: { customRender: 'zoneCode' }
  241 + },
  242 + {
  243 + title:'起始库位',
  244 + align:"center",
  245 + dataIndex: 'fromLocationCode'
  246 + },
  247 + {
  248 + title:'目标库位',
  249 + align:"center",
  250 + dataIndex: 'toLocationCode'
  251 + },
  252 + {
  253 + title:'起始出入口',
  254 + align:"center",
  255 + dataIndex: 'fromPortCode'
  256 + },
  257 + {
  258 + title:'目标出入口',
  259 + align:"center",
  260 + dataIndex: 'toPortCode'
  261 + },
  262 + {
  263 + title:'任务状态',
  264 + align:"center",
  265 + dataIndex: 'status_dictText',
  266 + },
  267 + {
  268 + title:'是否重入',
  269 + align:"center",
  270 + dataIndex: 'isDoubleIn_dictText',
  271 + },
  272 + {
  273 + title:'重入库位号',
  274 + align:"center",
  275 + dataIndex: 'originLocationCode'
  276 + },
  277 + {
  278 + title:'创建人',
  279 + align:"center",
  280 + dataIndex: 'createBy'
  281 + },
  282 + {
  283 + title:'创建日期',
  284 + align:"center",
  285 + dataIndex: 'createTime'
  286 + },
  287 + {
  288 + title:'更新人',
  289 + align:"center",
  290 + dataIndex: 'updateBy'
  291 + },
  292 + {
  293 + title:'更新日期',
  294 + align:"center",
  295 + dataIndex: 'updateTime'
  296 + },
  297 + {
  298 + title: '操作',
  299 + dataIndex: 'action',
  300 + align:"center",
  301 + fixed:"right",
  302 + width:147,
  303 + scopedSlots: { customRender: 'action' },
  304 + }
  305 + ],
  306 + url: {
  307 + list: "/task/taskHeader/list",
  308 + delete: "/task/taskHeader/delete",
  309 + deleteBatch: "/task/taskHeader/deleteBatch",
  310 + exportXlsUrl: "/task/taskHeader/exportXls",
  311 + importExcelUrl: "task/taskHeader/importExcel",
  312 + },
  313 + dictOptions:{
  314 + taskType:[],
  315 + isEmptyOut:[],
  316 + isDoubleIn:[],
  317 + status:[],
  318 + },
  319 + /* 分页参数 */
  320 + ipagination:{
  321 + current: 1,
  322 + pageSize: 5,
  323 + pageSizeOptions: ['5', '10', '50'],
  324 + showTotal: (total, range) => {
  325 + return range[0] + "-" + range[1] + " 共" + total + "条"
  326 + },
  327 + showQuickJumper: true,
  328 + showSizeChanger: true,
  329 + total: 0
  330 + },
  331 + selectedMainId:'',
  332 + superFieldList:[],
  333 + }
  334 + },
  335 + created() {
  336 + this.getSuperFieldList();
  337 + this.loadFrom();
  338 + },
  339 + computed: {
  340 + importExcelUrl: function(){
  341 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  342 + }
  343 + },
  344 + methods: {
  345 + initDictConfig(){
  346 + },
  347 + clickThenSelect(record) {
  348 + return {
  349 + on: {
  350 + click: () => {
  351 + this.onSelectChange(record.id.split(","), [record]);
  352 + }
  353 + }
  354 + }
  355 + },
  356 + onClearSelected() {
  357 + this.selectedRowKeys = [];
  358 + this.selectionRows = [];
  359 + this.selectedMainId=''
  360 + },
  361 + onSelectChange(selectedRowKeys, selectionRows) {
  362 + this.selectedMainId=selectedRowKeys[0]
  363 + this.selectedRowKeys = selectedRowKeys;
  364 + this.selectionRows = selectionRows;
  365 + },
  366 + loadData(arg) {
  367 + if(!this.url.list){
  368 + this.$message.error("请设置url.list属性!")
  369 + return
  370 + }
  371 + //加载数据 若传入参数1则加载第一页的内容
  372 + if (arg === 1) {
  373 + this.ipagination.current = 1;
  374 + }
  375 + this.onClearSelected()
  376 + var params = this.getQueryParams();//查询条件
  377 + params.innernalTaskType = 300;
  378 + this.loading = true;
  379 + getAction(this.url.list, params).then((res) => {
  380 + if (res.success) {
  381 + this.dataSource = res.result.records;
  382 + this.ipagination.total = res.result.total;
  383 + }
  384 + if(res.code===510){
  385 + this.$message.warning(res.message)
  386 + }
  387 + this.loading = false;
  388 + })
  389 + },
  390 + loadFrom() {
  391 + getZoneList().then((res) => {
  392 + if (res.success) {
  393 + this.zoneList = res.result
  394 + }
  395 + });
  396 + },
  397 + createTransfer() {
  398 + this.$refs.transferModal.edit();
  399 + this.$refs.transferModal.title = "创建移库任务";
  400 + },
  401 + createOverStation() {
  402 + this.$refs.overStationModal.edit();
  403 + this.$refs.overStationModal.title = "创建跨站任务";
  404 + },
  405 + solutionZoneCode(value) {
  406 + var actions = []
  407 + Object.keys(this.zoneList).some((key) => {
  408 + if (this.zoneList[key].code == ('' + value)) {
  409 + actions.push(this.zoneList[key].name)
  410 + return true
  411 + }
  412 + })
  413 + return actions.join('')
  414 + },
  415 + completeTask(record) {
  416 + this.loading = true;
  417 + this.model = Object.assign({}, record);
  418 + completeTaskByWMS(this.model).then((res) => {
  419 + this.loading = false;
  420 + if (res.success) {
  421 + this.$message.success(res.message);
  422 + }
  423 + else {
  424 + this.$message.error(res.message);
  425 + }
  426 + this.searchQuery();
  427 + });
  428 + },
  429 + executeTask(record) {
  430 + this.loading = true;
  431 + this.model = Object.assign({}, record);
  432 + execute(this.model).then((res) => {
  433 + this.loading = false;
  434 + if (res.success) {
  435 + this.$message.success(res.message);
  436 + }
  437 + else {
  438 + this.$message.error(res.message);
  439 + }
  440 + this.searchQuery();
  441 + });
  442 + },
  443 + getSuperFieldList(){
  444 + let fieldList=[];
  445 + fieldList.push({type:'int',value:'taskType',text:'任务类型',dictCode:'task_type'})
  446 + fieldList.push({type:'string',value:'containerCode',text:'容器号',dictCode:''})
  447 + fieldList.push({type:'string',value:'fromLocationCode',text:'起始库位',dictCode:''})
  448 + fieldList.push({type:'string',value:'toLocationCode',text:'目标库位',dictCode:''})
  449 + fieldList.push({type:'string',value:'isEmptyOut',text:'是否空出',dictCode:'is_or_not'})
  450 + fieldList.push({type:'int',value:'isDoubleIn',text:'是否重入',dictCode:'is_or_not'})
  451 + fieldList.push({type:'string',value:'originLocationCode',text:'重入库位号',dictCode:''})
  452 + fieldList.push({type:'int',value:'status',text:'任务状态',dictCode:'task_header_status'})
  453 + fieldList.push({type:'string',value:'fromPortCode',text:'起始出入口',dictCode:''})
  454 + fieldList.push({type:'string',value:'toPortCode',text:'目标出入口',dictCode:''})
  455 + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''})
  456 + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
  457 + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''})
  458 + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'})
  459 + this.superFieldList = fieldList
  460 + }
  461 + }
  462 + }
  463 +</script>
  464 +<style scoped>
  465 + @import '~@assets/less/common.less'
  466 +</style>
0 \ No newline at end of file 467 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/CheckOutTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  16 + <a-input v-model="model.containerCode" placeholder="请输入容器编码" @keyup="getPortList"></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="toPortCode">
  21 + <a-select
  22 + show-search
  23 + placeholder="请选择出库口"
  24 + option-filter-prop="children"
  25 + :filter-option="filterOption"
  26 + v-model="model.toPortCode">
  27 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + </a-row>
  32 + </a-form-model>
  33 + </a-spin>
  34 + </j-modal>
  35 +</template>
  36 +
  37 +<script>
  38 +
  39 + import { httpAction } from '@/api/manage'
  40 + import { validateDuplicateValue } from '@/utils/util'
  41 + import {createCheckOutTask} from '@/api/api'
  42 + import {selectPickPort} from '@/api/api'
  43 +
  44 + export default {
  45 + name: "CheckOutTaskModal",
  46 + components: {
  47 + },
  48 + data () {
  49 + return {
  50 + title:"操作",
  51 + width:500,
  52 + portList:[],
  53 + querySource:{},
  54 + visible: false,
  55 + model:{
  56 + },
  57 + labelCol: {
  58 + xs: { span: 24 },
  59 + sm: { span: 5 },
  60 + },
  61 + wrapperCol: {
  62 + xs: { span: 24 },
  63 + sm: { span: 16 },
  64 + },
  65 +
  66 + confirmLoading: false,
  67 + validatorRules: {
  68 + containerCode: [
  69 + { required: true, message: '请输入容器编码!'},
  70 + ],
  71 + toPortCode: [
  72 + { required: true, message: '请选择出库口!'},
  73 + ],
  74 + },
  75 + url: {
  76 + add: "/task/taskHeader/createEmptyOut",
  77 + }
  78 +
  79 + }
  80 + },
  81 + created () {
  82 + //备份model原始值
  83 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  84 + },
  85 + methods: {
  86 + add () {
  87 + this.edit(this.modelDefault);
  88 + },
  89 + edit () {
  90 + // this.getPortList();
  91 + // this.model = Object.assign({}, record);
  92 + this.visible = true;
  93 + },
  94 + close () {
  95 + this.$emit('close');
  96 + this.visible = false;
  97 + this.$refs.form.clearValidate();
  98 + },
  99 + getPortList() {
  100 + this.querySource.containerCode = this.model.containerCode;
  101 + selectPickPort(this.querySource).then((res) => {
  102 + if (res.success) {
  103 + this.portList = res.result;
  104 + this.visible = true;
  105 + }
  106 + });
  107 + },
  108 + handleOk () {
  109 + const that = this;
  110 + // 触发表单验证
  111 + this.$refs.form.validate(valid => {
  112 + if (valid) {
  113 + that.confirmLoading = true;
  114 + createCheckOutTask(this.model).then((res)=>{
  115 + if(res.success){
  116 + that.$message.success(res.message);
  117 + that.$emit('ok');
  118 + that.model.containerCode = '';
  119 + that.model.toPortCode = '';
  120 + }else{
  121 + that.$message.warning(res.message);
  122 + }
  123 + }).finally(() => {
  124 + that.confirmLoading = false;
  125 + that.close();
  126 + })
  127 + }else{
  128 + return false
  129 + }
  130 + })
  131 + },
  132 + handleCancel () {
  133 + this.close()
  134 + },
  135 +
  136 +
  137 + }
  138 + }
  139 +</script>
0 \ No newline at end of file 140 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/EmptyInTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="容器号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  16 + <a-input v-model="model.containerCode" placeholder="请输入容器号" ></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="目标库位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toLocationCode">
  21 + <a-input v-model="model.toLocationCode" placeholder="请输入目标库位" ></a-input>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + </a-row>
  25 + </a-form-model>
  26 + </a-spin>
  27 + </j-modal>
  28 +</template>
  29 +
  30 +<script>
  31 +
  32 + import { httpAction } from '@/api/manage'
  33 + import { validateDuplicateValue } from '@/utils/util'
  34 + import {createEmptyIn} from '@/api/api'
  35 +
  36 + export default {
  37 + name: "EmptyInTaskModal",
  38 + components: {
  39 + },
  40 + data () {
  41 + return {
  42 + title:"操作",
  43 + width:500,
  44 + visible: false,
  45 + model:{
  46 + },
  47 + labelCol: {
  48 + xs: { span: 24 },
  49 + sm: { span: 5 },
  50 + },
  51 + wrapperCol: {
  52 + xs: { span: 24 },
  53 + sm: { span: 16 },
  54 + },
  55 +
  56 + confirmLoading: false,
  57 + validatorRules: {
  58 + containerCode: [
  59 + { required: true, message: '请输入容器编码!'},
  60 + ],
  61 + },
  62 + url: {
  63 + add: "/task/taskHeader/createEmptyIn",
  64 + }
  65 +
  66 + }
  67 + },
  68 + created () {
  69 + //备份model原始值
  70 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  71 + },
  72 + methods: {
  73 + add () {
  74 + this.edit(this.modelDefault);
  75 + },
  76 + edit () {
  77 + this.visible = true;
  78 + },
  79 + close () {
  80 + this.$emit('close');
  81 + this.visible = false;
  82 + this.$refs.form.clearValidate();
  83 + },
  84 + handleOk () {
  85 + const that = this;
  86 + // 触发表单验证
  87 + this.$refs.form.validate(valid => {
  88 + if (valid) {
  89 + that.confirmLoading = true;
  90 + createEmptyIn(this.model).then((res)=>{
  91 + if(res.success){
  92 + that.$message.success(res.message);
  93 + that.$emit('ok');
  94 + that.model.containerCode = '';
  95 + that.model.toLocationCode = '';
  96 + }else{
  97 + that.$message.warning(res.message);
  98 + }
  99 + }).finally(() => {
  100 + that.confirmLoading = false;
  101 + that.close();
  102 + })
  103 + }else{
  104 + return false
  105 + }
  106 + })
  107 + },
  108 + handleCancel () {
  109 + this.close()
  110 + },
  111 +
  112 +
  113 + }
  114 + }
  115 +</script>
0 \ No newline at end of file 116 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/EmptyOutTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  16 + <a-input v-model="model.containerCode" placeholder="请输入容器编码" @keyup="getPortList"></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="toPortCode">
  21 + <a-select
  22 + show-search
  23 + placeholder="请选择出库口"
  24 + option-filter-prop="children"
  25 + :filter-option="filterOption"
  26 + v-model="model.toPortCode">
  27 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + </a-row>
  32 + </a-form-model>
  33 + </a-spin>
  34 + </j-modal>
  35 +</template>
  36 +
  37 +<script>
  38 +
  39 + import { httpAction } from '@/api/manage'
  40 + import { validateDuplicateValue } from '@/utils/util'
  41 + import {createEmptyOut} from '@/api/api'
  42 + import {selectOutPort} from '@/api/api'
  43 +
  44 + export default {
  45 + name: "EmptyOutTaskModal",
  46 + components: {
  47 + },
  48 + data () {
  49 + return {
  50 + title:"操作",
  51 + width:500,
  52 + portList:[],
  53 + querySource:{},
  54 + visible: false,
  55 + model:{
  56 + },
  57 + labelCol: {
  58 + xs: { span: 24 },
  59 + sm: { span: 5 },
  60 + },
  61 + wrapperCol: {
  62 + xs: { span: 24 },
  63 + sm: { span: 16 },
  64 + },
  65 +
  66 + confirmLoading: false,
  67 + validatorRules: {
  68 + containerCode: [
  69 + { required: true, message: '请输入容器编码!'},
  70 + ],
  71 + toPortCode: [
  72 + { required: true, message: '请选择出库口!'},
  73 + ],
  74 + },
  75 + url: {
  76 + add: "/task/taskHeader/createEmptyOut",
  77 + }
  78 +
  79 + }
  80 + },
  81 + created () {
  82 + //备份model原始值
  83 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  84 + },
  85 + methods: {
  86 + add () {
  87 + this.edit(this.modelDefault);
  88 + },
  89 + edit () {
  90 + // this.getPortList();
  91 + // this.model = Object.assign({}, record);
  92 + this.visible = true;
  93 + },
  94 + close () {
  95 + this.$emit('close');
  96 + this.visible = false;
  97 + this.$refs.form.clearValidate();
  98 + },
  99 + getPortList() {
  100 + this.querySource.containerCode = this.model.containerCode;
  101 + selectOutPort(this.querySource).then((res) => {
  102 + if (res.success) {
  103 + this.portList = res.result;
  104 + this.visible = true;
  105 + }
  106 + });
  107 + },
  108 + handleOk () {
  109 + const that = this;
  110 + // 触发表单验证
  111 + this.$refs.form.validate(valid => {
  112 + if (valid) {
  113 + that.confirmLoading = true;
  114 + createEmptyOut(this.model).then((res)=>{
  115 + if(res.success){
  116 + that.$message.success(res.message);
  117 + that.$emit('ok');
  118 + that.model.containerCode = '';
  119 + that.model.toPortCode = '';
  120 + }else{
  121 + that.$message.warning(res.message);
  122 + }
  123 + }).finally(() => {
  124 + that.confirmLoading = false;
  125 + that.close();
  126 + })
  127 + }else{
  128 + return false
  129 + }
  130 + })
  131 + },
  132 + handleCancel () {
  133 + this.close()
  134 + },
  135 +
  136 +
  137 + }
  138 + }
  139 +</script>
0 \ No newline at end of file 140 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/ManyEmptyInTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="容器号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  16 + <a-input v-model="model.containerCode" placeholder="请输入容器号" ></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="目标库位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toLocationCode">
  21 + <a-input v-model="model.toLocationCode" placeholder="请输入目标库位" ></a-input>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + </a-row>
  25 + </a-form-model>
  26 + </a-spin>
  27 + </j-modal>
  28 +</template>
  29 +
  30 +<script>
  31 +
  32 + import { httpAction } from '@/api/manage'
  33 + import { validateDuplicateValue } from '@/utils/util'
  34 + import {createManyEmptyIn} from '@/api/api'
  35 +
  36 + export default {
  37 + name: "ManyEmptyInTaskModal",
  38 + components: {
  39 + },
  40 + data () {
  41 + return {
  42 + title:"操作",
  43 + width:500,
  44 + visible: false,
  45 + model:{
  46 + },
  47 + labelCol: {
  48 + xs: { span: 24 },
  49 + sm: { span: 5 },
  50 + },
  51 + wrapperCol: {
  52 + xs: { span: 24 },
  53 + sm: { span: 16 },
  54 + },
  55 +
  56 + confirmLoading: false,
  57 + validatorRules: {
  58 + containerCode: [
  59 + { required: true, message: '请输入容器编码!'},
  60 + ],
  61 + },
  62 + url: {
  63 + add: "/task/taskHeader/createManyEmptyIn",
  64 + }
  65 +
  66 + }
  67 + },
  68 + created () {
  69 + //备份model原始值
  70 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  71 + },
  72 + methods: {
  73 + add () {
  74 + this.edit(this.modelDefault);
  75 + },
  76 + edit () {
  77 + this.visible = true;
  78 + },
  79 + close () {
  80 + this.$emit('close');
  81 + this.visible = false;
  82 + this.$refs.form.clearValidate();
  83 + },
  84 + handleOk () {
  85 + const that = this;
  86 + // 触发表单验证
  87 + this.$refs.form.validate(valid => {
  88 + if (valid) {
  89 + that.confirmLoading = true;
  90 + createManyEmptyIn(this.model).then((res)=>{
  91 + if(res.success){
  92 + that.$message.success(res.message);
  93 + that.$emit('ok');
  94 + that.model.containerCode = '';
  95 + that.model.toLocationCode = '';
  96 + }else{
  97 + that.$message.warning(res.message);
  98 + }
  99 + }).finally(() => {
  100 + that.confirmLoading = false;
  101 + that.close();
  102 + })
  103 + }else{
  104 + return false
  105 + }
  106 + })
  107 + },
  108 + handleCancel () {
  109 + this.close()
  110 + },
  111 +
  112 +
  113 + }
  114 + }
  115 +</script>
0 \ No newline at end of file 116 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/ManyEmptyOutTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  16 + <a-input v-model="model.containerCode" placeholder="请输入容器编码" @keyup="getPortList"></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="toPortCode">
  21 + <a-select
  22 + show-search
  23 + placeholder="请选择出库口"
  24 + option-filter-prop="children"
  25 + :filter-option="filterOption"
  26 + v-model="model.toPortCode">
  27 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + </a-row>
  32 + </a-form-model>
  33 + </a-spin>
  34 + </j-modal>
  35 +</template>
  36 +
  37 +<script>
  38 +
  39 + import { httpAction } from '@/api/manage'
  40 + import { validateDuplicateValue } from '@/utils/util'
  41 + import {createManyEmptyOut} from '@/api/api'
  42 + import {selectOutPort} from '@/api/api'
  43 +
  44 + export default {
  45 + name: "ManyEmptyOutTaskModal",
  46 + components: {
  47 + },
  48 + data () {
  49 + return {
  50 + title:"操作",
  51 + width:500,
  52 + portList:[],
  53 + querySource:{},
  54 + visible: false,
  55 + model:{
  56 + },
  57 + labelCol: {
  58 + xs: { span: 24 },
  59 + sm: { span: 5 },
  60 + },
  61 + wrapperCol: {
  62 + xs: { span: 24 },
  63 + sm: { span: 16 },
  64 + },
  65 +
  66 + confirmLoading: false,
  67 + validatorRules: {
  68 + containerCode: [
  69 + { required: true, message: '请输入容器编码!'},
  70 + ],
  71 + toPortCode: [
  72 + { required: true, message: '请选择出库口!'},
  73 + ],
  74 + },
  75 + url: {
  76 + add: "/task/taskHeader/createManyEmptyOut",
  77 + }
  78 +
  79 + }
  80 + },
  81 + created () {
  82 + //备份model原始值
  83 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  84 + },
  85 + methods: {
  86 + add () {
  87 + this.edit(this.modelDefault);
  88 + },
  89 + edit () {
  90 + this.visible = true;
  91 + },
  92 + close () {
  93 + this.$emit('close');
  94 + this.visible = false;
  95 + this.$refs.form.clearValidate();
  96 + },
  97 + getPortList() {
  98 + this.querySource.containerCode = this.model.containerCode;
  99 + selectOutPort(this.querySource).then((res) => {
  100 + if (res.success) {
  101 + this.portList = res.result;
  102 + this.visible = true;
  103 + }
  104 + });
  105 + },
  106 + handleOk () {
  107 + const that = this;
  108 + // 触发表单验证
  109 + this.$refs.form.validate(valid => {
  110 + if (valid) {
  111 + that.confirmLoading = true;
  112 + createManyEmptyOut(this.model).then((res)=>{
  113 + if(res.success){
  114 + that.$message.success(res.message);
  115 + that.$emit('ok');
  116 + that.model.containerCode = '';
  117 + that.model.toPortCode = '';
  118 + }else{
  119 + that.$message.warning(res.message);
  120 + }
  121 + }).finally(() => {
  122 + that.confirmLoading = false;
  123 + that.close();
  124 + })
  125 + }else{
  126 + return false
  127 + }
  128 + })
  129 + },
  130 + handleCancel () {
  131 + this.close()
  132 + },
  133 +
  134 +
  135 + }
  136 + }
  137 +</script>
0 \ No newline at end of file 138 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/OverStationTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  16 + <a-input v-model="model.containerCode" placeholder="请输入容器编码" @keyup="getPortList"></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="fromPortCode">
  21 + <a-select
  22 + show-search
  23 + placeholder="请选择起始站台"
  24 + option-filter-prop="children"
  25 + :filter-option="filterOption"
  26 + v-model="model.fromPortCode">
  27 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  28 + </a-select>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + <a-col :span="24">
  32 + <a-form-model-item label="目标站台" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toPortCode">
  33 + <a-select
  34 + show-search
  35 + placeholder="请选择目标站台"
  36 + option-filter-prop="children"
  37 + :filter-option="filterOption"
  38 + v-model="model.toPortCode">
  39 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option>
  40 + </a-select>
  41 + </a-form-model-item>
  42 + </a-col>
  43 + </a-row>
  44 + </a-form-model>
  45 + </a-spin>
  46 + </j-modal>
  47 +</template>
  48 +
  49 +<script>
  50 +
  51 + import { httpAction } from '@/api/manage'
  52 + import { validateDuplicateValue } from '@/utils/util'
  53 + import {createOverStationTask} from '@/api/api'
  54 + import {selectPort} from '@/api/api'
  55 +
  56 + export default {
  57 + name: "OverStationTaskModal",
  58 + components: {
  59 + },
  60 + data () {
  61 + return {
  62 + title:"操作",
  63 + width:500,
  64 + portList:[],
  65 + querySource:{},
  66 + visible: false,
  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 +
  78 + confirmLoading: false,
  79 + validatorRules: {
  80 + containerCode: [
  81 + { required: true, message: '请输入容器编码!'},
  82 + ],
  83 + fromPortCode: [
  84 + { required: true, message: '请选择起始入口!'},
  85 + ],
  86 + toPortCode: [
  87 + { required: true, message: '请选择目标出口!'},
  88 + ],
  89 + },
  90 + url: {
  91 + add: "/task/taskHeader/createEmptyOut",
  92 + }
  93 +
  94 + }
  95 + },
  96 + created () {
  97 + //备份model原始值
  98 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  99 + },
  100 + methods: {
  101 + add () {
  102 + this.edit(this.modelDefault);
  103 + },
  104 + edit () {
  105 + // this.getPortList();
  106 + // this.model = Object.assign({}, record);
  107 + this.visible = true;
  108 + },
  109 + close () {
  110 + this.$emit('close');
  111 + this.visible = false;
  112 + this.$refs.form.clearValidate();
  113 + },
  114 + getPortList() {
  115 + this.querySource.containerCode = this.model.containerCode;
  116 + selectPort(this.querySource).then((res) => {
  117 + if (res.success) {
  118 + this.portList = res.result;
  119 + this.visible = true;
  120 + }
  121 + });
  122 + },
  123 + handleOk () {
  124 + const that = this;
  125 + // 触发表单验证
  126 + this.$refs.form.validate(valid => {
  127 + if (valid) {
  128 + that.confirmLoading = true;
  129 + createOverStationTask(this.model).then((res)=>{
  130 + if(res.success){
  131 + that.$message.success(res.message);
  132 + that.$emit('ok');
  133 + that.model.containerCode = '';
  134 + that.model.toPortCode = '';
  135 + }else{
  136 + that.$message.warning(res.message);
  137 + }
  138 + }).finally(() => {
  139 + that.confirmLoading = false;
  140 + that.close();
  141 + })
  142 + }else{
  143 + return false
  144 + }
  145 + })
  146 + },
  147 + handleCancel () {
  148 + this.close()
  149 + },
  150 +
  151 +
  152 + }
  153 + }
  154 +</script>
0 \ No newline at end of file 155 \ No newline at end of file
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/modules/TransferTaskModal.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="fromLocationCode">
  16 + <a-input v-model="model.fromLocationCode" 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="toLocationCode">
  21 + <a-input v-model="model.toLocationCode" placeholder="请输入目标库位号" ></a-input>
  22 + </a-form-model-item>
  23 + </a-col>
  24 + </a-row>
  25 + </a-form-model>
  26 + </a-spin>
  27 + </j-modal>
  28 +</template>
  29 +
  30 +<script>
  31 +
  32 + import { httpAction } from '@/api/manage'
  33 + import { validateDuplicateValue } from '@/utils/util'
  34 + import {createTransferTask} from '@/api/api'
  35 +
  36 + export default {
  37 + name: "TransferTaskModal",
  38 + components: {
  39 + },
  40 + data () {
  41 + return {
  42 + title:"操作",
  43 + width:500,
  44 + portList:[],
  45 + querySource:{},
  46 + visible: false,
  47 + model:{
  48 + },
  49 + labelCol: {
  50 + xs: { span: 24 },
  51 + sm: { span: 5 },
  52 + },
  53 + wrapperCol: {
  54 + xs: { span: 24 },
  55 + sm: { span: 16 },
  56 + },
  57 +
  58 + confirmLoading: false,
  59 + validatorRules: {
  60 + fromLocationCode: [
  61 + { required: true, message: '请输入起始库位号!'},
  62 + ],
  63 + toLocationCode: [
  64 + { required: true, message: '请输入目标库位号!'},
  65 + ],
  66 + },
  67 + url: {
  68 + add: "/task/taskHeader/createTransferTask",
  69 + }
  70 +
  71 + }
  72 + },
  73 + created () {
  74 + //备份model原始值
  75 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  76 + },
  77 + methods: {
  78 + add () {
  79 + this.edit(this.modelDefault);
  80 + },
  81 + edit () {
  82 + // this.getPortList();
  83 + // this.model = Object.assign({}, record);
  84 + this.visible = true;
  85 + },
  86 + close () {
  87 + this.$emit('close');
  88 + this.visible = false;
  89 + this.$refs.form.clearValidate();
  90 + },
  91 + handleOk () {
  92 + const that = this;
  93 + // 触发表单验证
  94 + this.$refs.form.validate(valid => {
  95 + if (valid) {
  96 + that.confirmLoading = true;
  97 + createTransferTask(this.model).then((res)=>{
  98 + if(res.success){
  99 + that.$message.success(res.message);
  100 + that.$emit('ok');
  101 + that.model.fromLocationCode = '';
  102 + that.model.toLocationCode = '';
  103 + }else{
  104 + that.$message.warning(res.message);
  105 + }
  106 + }).finally(() => {
  107 + that.confirmLoading = false;
  108 + that.close();
  109 + })
  110 + }else{
  111 + return false
  112 + }
  113 + })
  114 + },
  115 + handleCancel () {
  116 + this.close()
  117 + },
  118 +
  119 +
  120 + }
  121 + }
  122 +</script>
0 \ No newline at end of file 123 \ No newline at end of file
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
@@ -4,14 +4,20 @@ package org.jeecg.modules.wms.api.wcs.controller; @@ -4,14 +4,20 @@ package org.jeecg.modules.wms.api.wcs.controller;
4 import io.swagger.annotations.ApiOperation; 4 import io.swagger.annotations.ApiOperation;
5 import org.jeecg.common.api.vo.Result; 5 import org.jeecg.common.api.vo.Result;
6 import org.jeecg.common.aspect.annotation.AutoLog; 6 import org.jeecg.common.aspect.annotation.AutoLog;
  7 +import org.jeecg.common.system.base.controller.JeecgController;
  8 +import org.jeecg.common.system.util.JwtUtil;
  9 +import org.jeecg.modules.wms.api.wcs.entity.ManyEmptyDomain;
7 import org.jeecg.modules.wms.api.wcs.entity.WarecellDomain; 10 import org.jeecg.modules.wms.api.wcs.entity.WarecellDomain;
8 import org.jeecg.modules.wms.api.wcs.service.WcsService; 11 import org.jeecg.modules.wms.api.wcs.service.WcsService;
9 import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; 12 import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger;
10 import org.jeecg.modules.wms.framework.controller.BaseController; 13 import org.jeecg.modules.wms.framework.controller.BaseController;
  14 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
11 import org.jeecg.utils.StringUtils; 15 import org.jeecg.utils.StringUtils;
  16 +import org.springframework.transaction.annotation.Transactional;
12 import org.springframework.web.bind.annotation.*; 17 import org.springframework.web.bind.annotation.*;
13 18
14 import javax.annotation.Resource; 19 import javax.annotation.Resource;
  20 +import javax.servlet.http.HttpServletRequest;
15 21
16 @RestController 22 @RestController
17 @RequestMapping("/API/WMS/v2") 23 @RequestMapping("/API/WMS/v2")
@@ -19,6 +25,8 @@ public class WcsController extends BaseController { @@ -19,6 +25,8 @@ public class WcsController extends BaseController {
19 25
20 @Resource 26 @Resource
21 private WcsService wcsService; 27 private WcsService wcsService;
  28 + @Resource
  29 + private ITaskHeaderService taskHeaderService;
22 30
23 /* 31 /*
24 WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型 32 WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型
@@ -28,17 +36,22 @@ public class WcsController extends BaseController { @@ -28,17 +36,22 @@ public class WcsController extends BaseController {
28 @ApiOperation(value="wcs仓位分配", notes="wcs仓位分配", httpMethod = "POST") 36 @ApiOperation(value="wcs仓位分配", notes="wcs仓位分配", httpMethod = "POST")
29 @ResponseBody 37 @ResponseBody
30 @ApiLogger(apiName = "仓位分配", from="WCS") 38 @ApiLogger(apiName = "仓位分配", from="WCS")
31 - public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain) { 39 + public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain, HttpServletRequest req) {
  40 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  41 + if (StringUtils.isEmpty(warehouseCode)) {
  42 + return Result.error("仓位分配, 仓库号为空");
  43 + }
32 if (StringUtils.isEmpty(warecellDomain.getTaskNo())) { 44 if (StringUtils.isEmpty(warecellDomain.getTaskNo())) {
33 - return Result.error("任务号为空"); 45 + return Result.error("仓位分配, 任务号为空");
34 } 46 }
35 if (StringUtils.isEmpty(warecellDomain.getZoneCode())) { 47 if (StringUtils.isEmpty(warecellDomain.getZoneCode())) {
36 - return Result.error("目的区域为空"); 48 + return Result.error("仓位分配, 目的区域为空");
37 } 49 }
38 if (StringUtils.isEmpty(warecellDomain.getHeight())) { 50 if (StringUtils.isEmpty(warecellDomain.getHeight())) {
39 - return Result.error("高度为空"); 51 + return Result.error("仓位分配, 高度为空");
40 } 52 }
41 - Result result = handleMultiProcess(new MultiProcessListener() { 53 + warecellDomain.setWarehouseCode(warehouseCode);
  54 + Result result = handleMultiProcess("warecellAllocation", new JeecgController.MultiProcessListener() {
42 @Override 55 @Override
43 public Result doProcess() { 56 public Result doProcess() {
44 Result result = wcsService.warecellAllocation(warecellDomain); 57 Result result = wcsService.warecellAllocation(warecellDomain);
@@ -47,4 +60,53 @@ public class WcsController extends BaseController { @@ -47,4 +60,53 @@ public class WcsController extends BaseController {
47 }); 60 });
48 return result; 61 return result;
49 } 62 }
  63 +
  64 + /**
  65 + * WCS申请空托盘组入库
  66 + * @return
  67 + */
  68 + @AutoLog(value = "WCS申请空托盘组入库")
  69 + @PostMapping("/manyEmptyIn")
  70 + @ApiOperation(value="WCS申请空托盘组入库", notes="WCS申请空托盘组入库", httpMethod = "POST")
  71 + @ResponseBody
  72 + @ApiLogger(apiName = "manyEmptyIn", from="WCS")
  73 + public Result manyEmptyIn(@RequestBody ManyEmptyDomain manyEmptyDomain, HttpServletRequest req) {
  74 + String containerCode = manyEmptyDomain.getContainerCode();
  75 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  76 + String zoneCode = manyEmptyDomain.getZoneCode();
  77 + String height = manyEmptyDomain.getHeight();
  78 + String roadWay = manyEmptyDomain.getRoadWay();
  79 +
  80 + Result result = handleMultiProcess("manyEmptyIn", new JeecgController.MultiProcessListener() {
  81 + @Override
  82 + public Result doProcess() {
  83 + Result result = taskHeaderService.createManyEmptyInTask(containerCode, zoneCode, roadWay, height, warehouseCode);
  84 + return result;
  85 + }
  86 + });
  87 + return result;
  88 + }
  89 +
  90 + /**
  91 + * WCS申请空托盘组出库
  92 + * @return
  93 + */
  94 + @AutoLog(value = "WCS申请空托盘组出库")
  95 + @PostMapping("/manyEmptyOut")
  96 + @ApiOperation(value="WCS申请空托盘组出库", notes="WCS申请空托盘组出库", httpMethod = "POST")
  97 + @ResponseBody
  98 + @ApiLogger(apiName = "manyEmptyOut", from="WCS")
  99 + public Result manyEmptyOut(@RequestBody ManyEmptyDomain manyEmptyDomain, HttpServletRequest req) {
  100 + String containerCode = manyEmptyDomain.getContainerCode();
  101 + String toPortCode = manyEmptyDomain.getPort();
  102 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  103 + Result result = handleMultiProcess("manyEmptyOut", new JeecgController.MultiProcessListener() {
  104 + @Override
  105 + public Result doProcess() {
  106 + Result result = taskHeaderService.createManyEmptyOutTask(containerCode, toPortCode, warehouseCode);
  107 + return result;
  108 + }
  109 + });
  110 + return result;
  111 + }
50 } 112 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyDomain.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.entity;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class ManyEmptyDomain {
  7 +
  8 + private String containerCode;
  9 + private String length;
  10 + private String width;
  11 + private String height;
  12 + private String weight;
  13 + //可用巷道
  14 + private String roadWay;
  15 + private String zoneCode;
  16 + private String port;
  17 +
  18 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
@@ -270,7 +270,7 @@ public class WcsServiceImpl implements WcsService { @@ -270,7 +270,7 @@ public class WcsServiceImpl implements WcsService {
270 case QuantityConstant.TASK_TYPE_EMPTYSHIPMENT: 270 case QuantityConstant.TASK_TYPE_EMPTYSHIPMENT:
271 case QuantityConstant.TASK_TYPE_CYCLECOUNT: 271 case QuantityConstant.TASK_TYPE_CYCLECOUNT:
272 case QuantityConstant.TASK_TYPE_TRANSFER: 272 case QuantityConstant.TASK_TYPE_TRANSFER:
273 - case QuantityConstant.TASK_TYPE_VIEW: 273 + case QuantityConstant.TASK_TYPE_CHECK_OUT:
274 case QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT: 274 case QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT:
275 if(fromLocation == null) { 275 if(fromLocation == null) {
276 return Result.error("起始库位为空"); 276 return Result.error("起始库位为空");
@@ -280,9 +280,6 @@ public class WcsServiceImpl implements WcsService { @@ -280,9 +280,6 @@ public class WcsServiceImpl implements WcsService {
280 case QuantityConstant.TASK_TYPE_WHOLERECEIPT: 280 case QuantityConstant.TASK_TYPE_WHOLERECEIPT:
281 case QuantityConstant.TASK_TYPE_EMPTYRECEIPT: 281 case QuantityConstant.TASK_TYPE_EMPTYRECEIPT:
282 case QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT: 282 case QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT:
283 - if(toLocation == null) {  
284 - return Result.error("终点库位为空");  
285 - }  
286 direction = true; 283 direction = true;
287 break; 284 break;
288 default: 285 default:
@@ -347,8 +344,8 @@ public class WcsServiceImpl implements WcsService { @@ -347,8 +344,8 @@ public class WcsServiceImpl implements WcsService {
347 wcsTask.setTaskNo(taskHeader.getId().toString()); 344 wcsTask.setTaskNo(taskHeader.getId().toString());
348 wcsTask.setWarehouseCode(warehouseCode); 345 wcsTask.setWarehouseCode(warehouseCode);
349 wcsTask.setTaskType(taskType); 346 wcsTask.setTaskType(taskType);
350 - wcsTask.setFromPort(taskHeader.getFromPort());  
351 - wcsTask.setToPort(taskHeader.getToPort()); 347 + wcsTask.setFromPort(taskHeader.getFromPortCode());
  348 + wcsTask.setToPort(taskHeader.getToPortCode());
352 wcsTask.setContainerCode(taskHeader.getContainerCode()); 349 wcsTask.setContainerCode(taskHeader.getContainerCode());
353 if (preTaskNo != 0) { 350 if (preTaskNo != 0) {
354 wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); 351 wcsTask.setPreTaskNo(String.valueOf(preTaskNo));
@@ -418,7 +415,7 @@ public class WcsServiceImpl implements WcsService { @@ -418,7 +415,7 @@ public class WcsServiceImpl implements WcsService {
418 case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: 415 case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT:
419 case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: 416 case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT:
420 case QuantityConstant.TASK_TYPE_CYCLECOUNT: 417 case QuantityConstant.TASK_TYPE_CYCLECOUNT:
421 - case QuantityConstant.TASK_TYPE_VIEW: 418 + case QuantityConstant.TASK_TYPE_CHECK_OUT:
422 wcsTask.setTaskType(400); 419 wcsTask.setTaskType(400);
423 break; 420 break;
424 case QuantityConstant.TASK_TYPE_TRANSFER: 421 case QuantityConstant.TASK_TYPE_TRANSFER:
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/entity/Container.java
@@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException; @@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
5 import java.util.Date; 5 import java.util.Date;
6 import java.math.BigDecimal; 6 import java.math.BigDecimal;
7 import com.baomidou.mybatisplus.annotation.IdType; 7 import com.baomidou.mybatisplus.annotation.IdType;
  8 +import com.baomidou.mybatisplus.annotation.TableField;
8 import com.baomidou.mybatisplus.annotation.TableId; 9 import com.baomidou.mybatisplus.annotation.TableId;
9 import com.baomidou.mybatisplus.annotation.TableName; 10 import com.baomidou.mybatisplus.annotation.TableName;
10 import lombok.Data; 11 import lombok.Data;
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService; @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
4 import org.jeecg.common.api.vo.Result; 4 import org.jeecg.common.api.vo.Result;
5 import org.jeecg.modules.wms.config.container.entity.Container; 5 import org.jeecg.modules.wms.config.container.entity.Container;
6 6
  7 +import java.util.List;
  8 +
7 /** 9 /**
8 * @Description: 容器管理 10 * @Description: 容器管理
9 * @Author: jeecg-boot 11 * @Author: jeecg-boot
@@ -22,4 +24,6 @@ public interface IContainerService extends IService&lt;Container&gt; { @@ -22,4 +24,6 @@ public interface IContainerService extends IService&lt;Container&gt; {
22 String status, String warehouseCode); 24 String status, String warehouseCode);
23 //创建零时容器 25 //创建零时容器
24 Container createLSContainer(String warehouseCode); 26 Container createLSContainer(String warehouseCode);
  27 +
  28 + List<Container> getContainerListByStatus(String status, String warehouseCode);
25 } 29 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
@@ -103,6 +103,15 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container @@ -103,6 +103,15 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
103 return container; 103 return container;
104 } 104 }
105 105
  106 + @Override
  107 + public List<Container> getContainerListByStatus(String status, String warehouseCode) {
  108 + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
  109 + containerLambdaQueryWrapper.eq(Container::getStatus, status)
  110 + .eq(Container::getWarehouseCode, warehouseCode);
  111 + List<Container> containerList = list(containerLambdaQueryWrapper);
  112 + return containerList;
  113 + }
  114 +
106 115
107 private int getStartNumber(String containerTypeCode, String warehouseCode) { 116 private int getStartNumber(String containerTypeCode, String warehouseCode) {
108 LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); 117 LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationHigh/service/ILocationHighService.java
@@ -3,6 +3,8 @@ package org.jeecg.modules.wms.config.locationHigh.service; @@ -3,6 +3,8 @@ package org.jeecg.modules.wms.config.locationHigh.service;
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
4 import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh; 4 import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh;
5 5
  6 +import java.util.List;
  7 +
6 /** 8 /**
7 * @Description: 库位高度管理 9 * @Description: 库位高度管理
8 * @Author: jeecg-boot 10 * @Author: jeecg-boot
@@ -11,4 +13,6 @@ import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh; @@ -11,4 +13,6 @@ import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh;
11 */ 13 */
12 public interface ILocationHighService extends IService<LocationHigh> { 14 public interface ILocationHighService extends IService<LocationHigh> {
13 15
  16 + LocationHigh getLocationHighByHighLevel(int highHeight,
  17 + List<String> locationTypeCodeList, String warehouseCode);
14 } 18 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationHigh/service/impl/LocationHighServiceImpl.java
1 package org.jeecg.modules.wms.config.locationHigh.service.impl; 1 package org.jeecg.modules.wms.config.locationHigh.service.impl;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh; 5 import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh;
4 import org.jeecg.modules.wms.config.locationHigh.mapper.LocationHighMapper; 6 import org.jeecg.modules.wms.config.locationHigh.mapper.LocationHighMapper;
5 import org.jeecg.modules.wms.config.locationHigh.service.ILocationHighService; 7 import org.jeecg.modules.wms.config.locationHigh.service.ILocationHighService;
@@ -7,6 +9,8 @@ import org.springframework.stereotype.Service; @@ -7,6 +9,8 @@ import org.springframework.stereotype.Service;
7 9
8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 10 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 11
  12 +import java.util.List;
  13 +
10 /** 14 /**
11 * @Description: 库位高度管理 15 * @Description: 库位高度管理
12 * @Author: jeecg-boot 16 * @Author: jeecg-boot
@@ -16,4 +20,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +20,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 @Service 20 @Service
17 public class LocationHighServiceImpl extends ServiceImpl<LocationHighMapper, LocationHigh> implements ILocationHighService { 21 public class LocationHighServiceImpl extends ServiceImpl<LocationHighMapper, LocationHigh> implements ILocationHighService {
18 22
  23 + @Override
  24 + public LocationHigh getLocationHighByHighLevel(int highHeight,
  25 + List<String> locationTypeCodeList, String warehouseCode) {
  26 + LambdaQueryWrapper<LocationHigh> locationHighLambdaQueryWrapper = Wrappers.lambdaQuery();
  27 + locationHighLambdaQueryWrapper.eq(LocationHigh::getHighLevel, highHeight)
  28 + .eq(LocationHigh::getWarehouseCode, warehouseCode)
  29 + .in(LocationHigh::getLocationTypeCode, locationTypeCodeList);
  30 + LocationHigh locationHigh = getOne(locationHighLambdaQueryWrapper);
  31 + return locationHigh;
  32 + }
19 } 33 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationType/service/ILocationTypeService.java
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService; @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
4 import org.jeecg.modules.wms.config.locationType.entity.LocationType; 4 import org.jeecg.modules.wms.config.locationType.entity.LocationType;
5 import org.jeecg.modules.wms.config.zone.entity.Zone; 5 import org.jeecg.modules.wms.config.zone.entity.Zone;
6 6
  7 +import java.util.List;
  8 +
7 /** 9 /**
8 * @Description: 库位类型 10 * @Description: 库位类型
9 * @Author: jeecg-boot 11 * @Author: jeecg-boot
@@ -13,4 +15,6 @@ import org.jeecg.modules.wms.config.zone.entity.Zone; @@ -13,4 +15,6 @@ import org.jeecg.modules.wms.config.zone.entity.Zone;
13 public interface ILocationTypeService extends IService<LocationType> { 15 public interface ILocationTypeService extends IService<LocationType> {
14 16
15 LocationType getLocationTypeByCode(String locationTypeCode, String wareohuseCode); 17 LocationType getLocationTypeByCode(String locationTypeCode, String wareohuseCode);
  18 +
  19 + List<LocationType> getLocationTypeListByZoneCode(String zoneCode, String warehouseCode);
16 } 20 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationType/service/impl/LocationTypeServiceImpl.java
@@ -9,6 +9,8 @@ import org.springframework.stereotype.Service; @@ -9,6 +9,8 @@ import org.springframework.stereotype.Service;
9 9
10 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 10 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11 11
  12 +import java.util.List;
  13 +
12 /** 14 /**
13 * @Description: 库位类型 15 * @Description: 库位类型
14 * @Author: jeecg-boot 16 * @Author: jeecg-boot
@@ -26,4 +28,13 @@ public class LocationTypeServiceImpl extends ServiceImpl&lt;LocationTypeMapper, Loc @@ -26,4 +28,13 @@ public class LocationTypeServiceImpl extends ServiceImpl&lt;LocationTypeMapper, Loc
26 LocationType locationType = getOne(locationTypeMapperLambdaQueryWrapper); 28 LocationType locationType = getOne(locationTypeMapperLambdaQueryWrapper);
27 return locationType; 29 return locationType;
28 } 30 }
  31 +
  32 + @Override
  33 + public List<LocationType> getLocationTypeListByZoneCode(String zoneCode, String warehouseCode) {
  34 + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery();
  35 + locationTypeLambdaQueryWrapper.eq(LocationType::getZoneCode, zoneCode)
  36 + .eq(LocationType::getWarehouseCode, warehouseCode);
  37 + List<LocationType> locationTypeList = list(locationTypeLambdaQueryWrapper);
  38 + return locationTypeList;
  39 + }
29 } 40 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/port/service/IPortService.java
@@ -15,4 +15,8 @@ import java.util.List; @@ -15,4 +15,8 @@ import java.util.List;
15 public interface IPortService extends IService<Port> { 15 public interface IPortService extends IService<Port> {
16 16
17 List<Port> getPortListByType(int type, String zoneCode, String warehouseCode); 17 List<Port> getPortListByType(int type, String zoneCode, String warehouseCode);
  18 +
  19 + Port getPortByCode(String code, String zoneCode, String warehouseCode);
  20 +
  21 + Port getPortByCode(String code, String warehouseCode);
18 } 22 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/port/service/impl/PortServiceImpl.java
@@ -31,4 +31,23 @@ public class PortServiceImpl extends ServiceImpl&lt;PortMapper, Port&gt; implements IP @@ -31,4 +31,23 @@ public class PortServiceImpl extends ServiceImpl&lt;PortMapper, Port&gt; implements IP
31 List<Port> portList = list(portLambdaQueryWrapper); 31 List<Port> portList = list(portLambdaQueryWrapper);
32 return portList; 32 return portList;
33 } 33 }
  34 +
  35 + @Override
  36 + public Port getPortByCode(String code, String zoneCode, String warehouseCode) {
  37 + LambdaQueryWrapper<Port> portLambdaQueryWrapper = Wrappers.lambdaQuery();
  38 + portLambdaQueryWrapper.eq(Port::getCode, code)
  39 + .eq(Port::getZoneCode, zoneCode)
  40 + .eq(Port::getWarehouseCode, warehouseCode);
  41 + Port port = getOne(portLambdaQueryWrapper);
  42 + return port;
  43 + }
  44 +
  45 + @Override
  46 + public Port getPortByCode(String code, String warehouseCode) {
  47 + LambdaQueryWrapper<Port> portLambdaQueryWrapper = Wrappers.lambdaQuery();
  48 + portLambdaQueryWrapper.eq(Port::getCode, code)
  49 + .eq(Port::getWarehouseCode, warehouseCode);
  50 + Port port = getOne(portLambdaQueryWrapper);
  51 + return port;
  52 + }
34 } 53 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/framework/controller/BaseController.java
1 package org.jeecg.modules.wms.framework.controller; 1 package org.jeecg.modules.wms.framework.controller;
2 2
  3 +import org.apache.commons.collections.MapUtils;
3 import org.jeecg.common.api.vo.Result; 4 import org.jeecg.common.api.vo.Result;
  5 +import org.jeecg.common.system.base.controller.JeecgController;
4 6
  7 +import java.util.HashMap;
  8 +import java.util.Map;
5 import java.util.concurrent.Semaphore; 9 import java.util.concurrent.Semaphore;
6 10
7 /** 11 /**
@@ -9,28 +13,51 @@ import java.util.concurrent.Semaphore; @@ -9,28 +13,51 @@ import java.util.concurrent.Semaphore;
9 */ 13 */
10 public class BaseController { 14 public class BaseController {
11 15
  16 + //下发任务并发控制
  17 + Map<String, Boolean> runningTaskMap = new HashMap<>();
  18 +
  19 + //并发控制,一次只允许一个请求
  20 + public Result handleQuest(String taskKey, JeecgController.MultiProcessListener multiProcessListener) {
  21 + Result result = null;
  22 + if(MapUtils.getBoolean(runningTaskMap, taskKey, false)) {
  23 + return Result.error("重复请求,清稍后重试");
  24 + }
  25 + runningTaskMap.put(taskKey, true);
  26 + try {
  27 + result = multiProcessListener.doProcess();
  28 + } catch (Exception e) {
  29 + e.printStackTrace();
  30 + throw new RuntimeException(e);
  31 + } finally {
  32 + runningTaskMap.put(taskKey, false);
  33 + }
  34 + return result;
  35 + }
  36 +
12 Semaphore semaphore=new Semaphore(1); 37 Semaphore semaphore=new Semaphore(1);
  38 + //下发任务并发控制
  39 + Map<String, Boolean> multiProcessMap = new HashMap<>();
13 40
14 - public Result handleMultiProcess(MultiProcessListener multiProcessListener) { 41 + public Result handleMultiProcess(String taskKey, JeecgController.MultiProcessListener multiProcessListener) {
15 Result result = null; 42 Result result = null;
16 int max_time = 30 * 1000; 43 int max_time = 30 * 1000;
17 int now = 0; 44 int now = 0;
18 boolean avail = true; 45 boolean avail = true;
19 while(avail) { 46 while(avail) {
20 - int availablePermits = semaphore.availablePermits();  
21 - if(availablePermits >0) { 47 + boolean availablePermits = MapUtils.getBoolean(multiProcessMap, taskKey, false);
  48 + if(!availablePermits) {
22 avail = false; 49 avail = false;
23 try { 50 try {
24 - semaphore.acquire(1); 51 + multiProcessMap.put(taskKey, true);
25 result = multiProcessListener.doProcess(); 52 result = multiProcessListener.doProcess();
26 } catch (Exception e) { 53 } catch (Exception e) {
27 e.printStackTrace(); 54 e.printStackTrace();
28 - result = Result.error(e.getMessage()); 55 + throw new RuntimeException(e);
29 } finally { 56 } finally {
30 - semaphore.release(1); 57 + multiProcessMap.put(taskKey, false);
31 } 58 }
32 } else { 59 } else {
33 - result = Result.error("多线程处理异常"); 60 + result = Result.error("多线程处理异常, 待处理现场太多,等待时间超出30秒");
34 try { 61 try {
35 now = now + 200; 62 now = now + 200;
36 Thread.sleep(200); 63 Thread.sleep(200);
@@ -45,7 +72,4 @@ public class BaseController { @@ -45,7 +72,4 @@ public class BaseController {
45 return result; 72 return result;
46 } 73 }
47 74
48 - public interface MultiProcessListener {  
49 - Result doProcess();  
50 - }  
51 } 75 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java
@@ -47,10 +47,14 @@ public class InventoryTransaction implements Serializable { @@ -47,10 +47,14 @@ public class InventoryTransaction implements Serializable {
47 @Excel(name = "容器编码", width = 15) 47 @Excel(name = "容器编码", width = 15)
48 @ApiModelProperty(value = "容器编码") 48 @ApiModelProperty(value = "容器编码")
49 private String containerCode; 49 private String containerCode;
50 - /**库位编码*/  
51 - @Excel(name = "库位编码", width = 15)  
52 - @ApiModelProperty(value = "库位编码")  
53 - private String locationCode; 50 + /**起始库位编码*/
  51 + @Excel(name = "起始库位编码", width = 15)
  52 + @ApiModelProperty(value = "起始库位编码")
  53 + private String fromLocationCode;
  54 + /**目标库位编码*/
  55 + @Excel(name = "目标库位编码", width = 15)
  56 + @ApiModelProperty(value = "目标库位编码")
  57 + private String toLocationCode;
54 /**交易类型*/ 58 /**交易类型*/
55 @Excel(name = "交易类型", width = 15, dicCode = "inventory_transaction_type") 59 @Excel(name = "交易类型", width = 15, dicCode = "inventory_transaction_type")
56 @Dict(dicCode = "inventory_transaction_type") 60 @Dict(dicCode = "inventory_transaction_type")
@@ -99,6 +103,7 @@ public class InventoryTransaction implements Serializable { @@ -99,6 +103,7 @@ public class InventoryTransaction implements Serializable {
99 /**库存状态*/ 103 /**库存状态*/
100 @Excel(name = "库存状态", width = 15) 104 @Excel(name = "库存状态", width = 15)
101 @ApiModelProperty(value = "库存状态") 105 @ApiModelProperty(value = "库存状态")
  106 + @Dict(dicCode = "inventory_status")
102 private String inventoryStatus; 107 private String inventoryStatus;
103 /**数量*/ 108 /**数量*/
104 @Excel(name = "数量", width = 15) 109 @Excel(name = "数量", width = 15)
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContainerHeaderService.java
@@ -37,5 +37,17 @@ public interface IReceiptContainerHeaderService extends IService&lt;ReceiptContaine @@ -37,5 +37,17 @@ public interface IReceiptContainerHeaderService extends IService&lt;ReceiptContaine
37 // 获取没有完成的入库组盘 37 // 获取没有完成的入库组盘
38 List<ReceiptContainerHeader> getUnCompleteCombineList(); 38 List<ReceiptContainerHeader> getUnCompleteCombineList();
39 39
40 - boolean havaUnCompleteCombine(String containerCode, String warehouseCode); 40 + boolean havaUnCompleteCombineByContainerCode(String containerCode, String warehouseCode);
  41 +
  42 + boolean havaUnCompleteCombineByLocationCode(String locationCode, String warehouseCode);
  43 +
  44 + boolean havaUnCompleteCombineByFromLocationCode(String fromLocationCode, String warehouseCode);
  45 +
  46 + boolean havaUnCompleteCombineByToLocationCode(String toLocationCode, String warehouseCode);
  47 +
  48 + /**
  49 + * 取消入库任务
  50 + * @return
  51 + */
  52 + boolean cancelReceiptTask(Integer receiptContainerHeaderId);
41 } 53 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
@@ -92,15 +92,10 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -92,15 +92,10 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
92 } 92 }
93 93
94 @Override 94 @Override
95 - @Transactional 95 + @Transactional(rollbackFor = ServiceException.class)
96 public Result createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode) { 96 public Result createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode) {
97 - int id = receiptContainerHeader.getId();  
98 - receiptContainerHeader = this.getById(id);  
99 - if (receiptContainerHeader == null) {  
100 - return Result.error("id:" + id + "的入库组盘不存在!");  
101 - }  
102 if (!receiptContainerHeader.getWarehouseCode().equals(warehouseCode)) { 97 if (!receiptContainerHeader.getWarehouseCode().equals(warehouseCode)) {
103 - return Result.error("id:" + id + "的入库组盘不能在" + warehouseCode + "仓库操作"); 98 + return Result.error("id:" + receiptContainerHeader.getId() + "的入库组盘不能在" + warehouseCode + "仓库操作");
104 } 99 }
105 String containerCode = receiptContainerHeader.getContainerCode(); 100 String containerCode = receiptContainerHeader.getContainerCode();
106 Container container = containerService.getContainerByCode(containerCode, warehouseCode); 101 Container container = containerService.getContainerByCode(containerCode, warehouseCode);
@@ -110,27 +105,27 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -110,27 +105,27 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
110 List<ReceiptContainerDetail> receiptContainerDetailList = 105 List<ReceiptContainerDetail> receiptContainerDetailList =
111 receiptContainerDetailService.getReceiptContainerDetailListByHeaderId(receiptContainerHeader.getId()); 106 receiptContainerDetailService.getReceiptContainerDetailListByHeaderId(receiptContainerHeader.getId());
112 if(receiptContainerDetailList.size() == 0) { 107 if(receiptContainerDetailList.size() == 0) {
113 - return Result.error("id:" + id + "的入库组盘,没有组盘明细,请先组盘!"); 108 + return Result.error("id:" + receiptContainerHeader.getId() + "的入库组盘,没有组盘明细,请先组盘!");
114 } 109 }
115 - boolean result = containerService.updateStatus(containerCode, 110 + boolean success = containerService.updateStatus(containerCode,
116 QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); 111 QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
117 - if(!result) { 112 + if(!success) {
118 throw new ServiceException("更新容器状态失败"); 113 throw new ServiceException("更新容器状态失败");
119 } 114 }
120 String fromLocationCode = receiptContainerHeader.getFromLocationCode(); 115 String fromLocationCode = receiptContainerHeader.getFromLocationCode();
121 String toLocaitonCode = receiptContainerHeader.getToLocationCode(); 116 String toLocaitonCode = receiptContainerHeader.getToLocationCode();
122 if(StringUtils.isNotEmpty(fromLocationCode)) { 117 if(StringUtils.isNotEmpty(fromLocationCode)) {
123 - result = locationService.updateStatus(fromLocationCode, 118 + success = locationService.updateStatus(fromLocationCode,
124 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); 119 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
125 - if(!result) { 120 + if(!success) {
126 throw new ServiceException("更新起始库位状态失败"); 121 throw new ServiceException("更新起始库位状态失败");
127 } 122 }
128 } 123 }
129 String zoneCode = null; 124 String zoneCode = null;
130 if(StringUtils.isNotEmpty(toLocaitonCode)) { 125 if(StringUtils.isNotEmpty(toLocaitonCode)) {
131 - result = locationService.updateStatus(toLocaitonCode, 126 + success = locationService.updateStatus(toLocaitonCode,
132 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); 127 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
133 - if(!result) { 128 + if(!success) {
134 throw new ServiceException("更新目标库位状态失败"); 129 throw new ServiceException("更新目标库位状态失败");
135 } 130 }
136 Location toLocation = locationService.getLocationByCode(toLocaitonCode, warehouseCode); 131 Location toLocation = locationService.getLocationByCode(toLocaitonCode, warehouseCode);
@@ -148,8 +143,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -148,8 +143,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
148 throw new ServiceException("入库组盘状态不是创建状态"); 143 throw new ServiceException("入库组盘状态不是创建状态");
149 } 144 }
150 receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); 145 receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK);
151 - result = receiptContainerHeaderService.updateById(receiptContainerHeader);  
152 - if(!result) { 146 + success = receiptContainerHeaderService.updateById(receiptContainerHeader);
  147 + if(!success) {
153 throw new ServiceException("更新入库组盘头状态失败"); 148 throw new ServiceException("更新入库组盘头状态失败");
154 } 149 }
155 TaskHeader taskHeader = new TaskHeader(); 150 TaskHeader taskHeader = new TaskHeader();
@@ -163,9 +158,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -163,9 +158,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
163 taskHeader.setReceiptContainerHeaderId(receiptContainerHeader.getId()); 158 taskHeader.setReceiptContainerHeaderId(receiptContainerHeader.getId());
164 taskHeader.setWarehouseCode(warehouseCode); 159 taskHeader.setWarehouseCode(warehouseCode);
165 taskHeader.setZoneCode(zoneCode); 160 taskHeader.setZoneCode(zoneCode);
166 - taskHeader.setToPort(receiptContainerHeader.getToPort());  
167 - result = taskHeaderService.save(taskHeader);  
168 - if(!result) { 161 + taskHeader.setToPortCode(receiptContainerHeader.getToPort());
  162 + success = taskHeaderService.save(taskHeader);
  163 + if(!success) {
169 throw new ServiceException("任务生成失败"); 164 throw new ServiceException("任务生成失败");
170 } 165 }
171 List<TaskDetail> taskDetailList = new ArrayList<>(); 166 List<TaskDetail> taskDetailList = new ArrayList<>();
@@ -196,24 +191,24 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -196,24 +191,24 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
196 receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_WAIT_SHELF); 191 receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_WAIT_SHELF);
197 receiptDetailList.add(receiptDetail); 192 receiptDetailList.add(receiptDetail);
198 } 193 }
199 - result = taskDetailService.saveBatch(taskDetailList);  
200 - if(!result) { 194 + success = taskDetailService.saveBatch(taskDetailList);
  195 + if(!success) {
201 throw new ServiceException("任务详情生成失败"); 196 throw new ServiceException("任务详情生成失败");
202 } 197 }
203 receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); 198 receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK);
204 - result = this.updateById(receiptContainerHeader);  
205 - if(!result) { 199 + success = this.updateById(receiptContainerHeader);
  200 + if(!success) {
206 throw new ServiceException("生成任务时,更新入库组盘头失败"); 201 throw new ServiceException("生成任务时,更新入库组盘头失败");
207 } 202 }
208 - result = receiptDetailService.updateBatchById(receiptDetailList);  
209 - if(!result) { 203 + success = receiptDetailService.updateBatchById(receiptDetailList);
  204 + if(!success) {
210 throw new ServiceException("更新入库单明细失败"); 205 throw new ServiceException("更新入库单明细失败");
211 } 206 }
212 List<Integer> receiptIdList =receiptDetailList.stream() 207 List<Integer> receiptIdList =receiptDetailList.stream()
213 .map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); 208 .map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList());
214 for(Integer receiptId : receiptIdList) { 209 for(Integer receiptId : receiptIdList) {
215 - result = receiptHeaderService.updateReceiptHeaderStatus(receiptId);  
216 - if (!result) { 210 + success = receiptHeaderService.updateReceiptHeaderStatus(receiptId);
  211 + if (!success) {
217 throw new ServiceException("更新入库单明细失败"); 212 throw new ServiceException("更新入库单明细失败");
218 } 213 }
219 } 214 }
@@ -241,7 +236,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -241,7 +236,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
241 } 236 }
242 237
243 @Override 238 @Override
244 - public boolean havaUnCompleteCombine(String containerCode, String warehouseCode) { 239 + public boolean havaUnCompleteCombineByContainerCode(String containerCode, String warehouseCode) {
245 LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); 240 LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
246 receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getContainerCode, containerCode) 241 receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getContainerCode, containerCode)
247 .eq(ReceiptContainerHeader::getWarehouseCode, warehouseCode) 242 .eq(ReceiptContainerHeader::getWarehouseCode, warehouseCode)
@@ -253,4 +248,87 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -253,4 +248,87 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
253 return false; 248 return false;
254 } 249 }
255 250
  251 + @Override
  252 + public boolean havaUnCompleteCombineByLocationCode(String locationCode, String warehouseCode) {
  253 + boolean success = havaUnCompleteCombineByFromLocationCode(locationCode, warehouseCode);
  254 + if(!success) {
  255 + success = havaUnCompleteCombineByToLocationCode(locationCode, warehouseCode);
  256 + }
  257 + return success;
  258 + }
  259 +
  260 + @Override
  261 + public boolean havaUnCompleteCombineByFromLocationCode(String fromLocationCode, String warehouseCode) {
  262 + LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  263 + receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getFromLocationCode, fromLocationCode)
  264 + .eq(ReceiptContainerHeader::getWarehouseCode, warehouseCode)
  265 + .lt(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED);
  266 + ReceiptContainerHeader receiptContainerHeader = getOne(receiptContainerHeaderLambdaQueryWrapper);
  267 + if(receiptContainerHeader != null) {
  268 + return true;
  269 + }
  270 + return false;
  271 + }
  272 +
  273 + @Override
  274 + public boolean havaUnCompleteCombineByToLocationCode(String toLocationCode, String warehouseCode) {
  275 + LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  276 + receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getToLocationCode, toLocationCode)
  277 + .eq(ReceiptContainerHeader::getWarehouseCode, warehouseCode)
  278 + .lt(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED);
  279 + ReceiptContainerHeader receiptContainerHeader = getOne(receiptContainerHeaderLambdaQueryWrapper);
  280 + if(receiptContainerHeader != null) {
  281 + return true;
  282 + }
  283 + return false;
  284 + }
  285 +
  286 +
  287 + @Override
  288 + @Transactional(rollbackFor = ServiceException.class)
  289 + public boolean cancelReceiptTask(Integer receiptContainerHeaderId) {
  290 + ReceiptContainerHeader receiptContainerHeader = getById(receiptContainerHeaderId);
  291 + if(receiptContainerHeader == null) {
  292 + return false;
  293 + }
  294 + int receiptContainerStatus = receiptContainerHeader.getStatus();
  295 + if(receiptContainerStatus == QuantityConstant.RECEIPT_CONTAINER_TASK) {
  296 + throw new ServiceException("取消入库任务时, ");
  297 + }
  298 + receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_BUILD);
  299 + boolean success = receiptContainerHeaderService.updateById(receiptContainerHeader);
  300 + if(!success) {
  301 + throw new ServiceException("取消入库任务时, 更新入库组盘头失败");
  302 + }
  303 +
  304 + List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.
  305 + getReceiptContainerDetailListByHeaderId(receiptContainerHeader.getId());
  306 + List<ReceiptDetail> receiptDetailList = new ArrayList<>();
  307 + for(ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) {
  308 + ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId());
  309 + if(receiptDetail == null) {
  310 + throw new ServiceException("取消入库任务时, 没有找到入库单详情" + receiptContainerDetail.getReceiptDetailId());
  311 + }
  312 + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_RECEIVING);
  313 + receiptDetailList.add(receiptDetail);
  314 + }
  315 + if(receiptDetailList.size() != 0) {
  316 + success = receiptDetailService.updateBatchById(receiptDetailList);
  317 + if(!success) {
  318 + throw new ServiceException("取消入库任务时, 更新入库单详情头失败");
  319 + }
  320 +
  321 + List<Integer> receiptIdList = receiptDetailList.stream()
  322 + .map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList());
  323 + for(Integer receiptId : receiptIdList) {
  324 + success = receiptHeaderService.updateReceiptHeaderStatus(receiptId);
  325 + if (!success) {
  326 + throw new ServiceException("更新入库单明细失败");
  327 + }
  328 + }
  329 + }
  330 +
  331 + return true;
  332 + }
  333 +
256 } 334 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/shipmentCombinationController.java
@@ -122,6 +122,10 @@ public class shipmentCombinationController { @@ -122,6 +122,10 @@ public class shipmentCombinationController {
122 return Result.error("选择分拣口时, 库区为空"); 122 return Result.error("选择分拣口时, 库区为空");
123 } 123 }
124 int type = QuantityConstant.PORT_TYPE_PICK; 124 int type = QuantityConstant.PORT_TYPE_PICK;
  125 + int tasktType = shipmentContainerHeader.getTaskType();
  126 + if(tasktType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT || tasktType == QuantityConstant.TASK_TYPE_EMPTYSHIPMENT) {
  127 + type = QuantityConstant.PORT_TYPE_OUT;
  128 + }
125 List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode); 129 List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode);
126 if(portList.size() == 0) { 130 if(portList.size() == 0) {
127 return Result.error("选择分拣口时, 没有找到合适的分拣口"); 131 return Result.error("选择分拣口时, 没有找到合适的分拣口");
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
@@ -234,7 +234,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi @@ -234,7 +234,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
234 if(!warehouseCode.equals(shipmentDetail.getWarehouseCode())) { 234 if(!warehouseCode.equals(shipmentDetail.getWarehouseCode())) {
235 return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致"); 235 return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致");
236 } 236 }
237 - boolean success = receiptContainerHeaderService.havaUnCompleteCombine(containerCode, warehouseCode); 237 + boolean success = receiptContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode);
238 if(success) { 238 if(success) {
239 return Result.error("配盘时, 容器:" + containerCode + " 已经用于入库组盘"); 239 return Result.error("配盘时, 容器:" + containerCode + " 已经用于入库组盘");
240 } 240 }
@@ -500,7 +500,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi @@ -500,7 +500,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
500 taskHeader.setWarehouseCode(warehouseCode); 500 taskHeader.setWarehouseCode(warehouseCode);
501 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); 501 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
502 taskHeader.setContainerCode(containerCode); 502 taskHeader.setContainerCode(containerCode);
503 - taskHeader.setToPort(shipmentContainerHeader.getToPort()); 503 + taskHeader.setToPortCode(shipmentContainerHeader.getToPort());
504 taskHeader.setFromLocationCode(fromLocationCode); 504 taskHeader.setFromLocationCode(fromLocationCode);
505 if(taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { 505 if(taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) {
506 taskHeader.setToLocationCode(toLocationCode); 506 taskHeader.setToLocationCode(toLocationCode);
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/IShipmentContainerHeaderService.java
@@ -28,6 +28,11 @@ public interface IShipmentContainerHeaderService extends IService&lt;ShipmentContai @@ -28,6 +28,11 @@ public interface IShipmentContainerHeaderService extends IService&lt;ShipmentContai
28 28
29 public List<ShipmentContainerHeader> getUnCompleteCombineList(); 29 public List<ShipmentContainerHeader> getUnCompleteCombineList();
30 30
31 - boolean havaUnCompleteCombine(String containerCode, String warehouseCode); 31 + boolean havaUnCompleteCombineByContainerCode(String containerCode, String warehouseCode);
32 32
  33 + boolean havaUnCompleteCombineByLocationCode(String locationCode, String warehouseCode);
  34 +
  35 + boolean havaUnCompleteCombineByFromLocationCode(String fromLocationCode, String warehouseCode);
  36 +
  37 + boolean havaUnCompleteCombineByToLocationCode(String toLocationCode, String warehouseCode);
33 } 38 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java
@@ -68,10 +68,31 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -68,10 +68,31 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
68 } 68 }
69 69
70 @Override 70 @Override
71 - public boolean havaUnCompleteCombine(String containerCode, String warehouseCode) { 71 + public boolean havaUnCompleteCombineByContainerCode(String containerCode, String warehouseCode) {
72 LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); 72 LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
73 - shipmentContainerHeaderLambdaQueryWrapper  
74 - .eq(ShipmentContainerHeader::getContainerCode, containerCode) 73 + shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode, containerCode)
  74 + .eq(ShipmentContainerHeader::getWarehouseCode, warehouseCode)
  75 + .lt(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED);
  76 + ShipmentContainerHeader shipmentContainerHeader = getOne(shipmentContainerHeaderLambdaQueryWrapper);
  77 + if(shipmentContainerHeader != null) {
  78 + return true;
  79 + }
  80 + return false;
  81 + }
  82 +
  83 + @Override
  84 + public boolean havaUnCompleteCombineByLocationCode(String locationCode, String warehouseCode) {
  85 + boolean success = havaUnCompleteCombineByFromLocationCode(locationCode, warehouseCode);
  86 + if(!success) {
  87 + success = havaUnCompleteCombineByToLocationCode(locationCode, warehouseCode);
  88 + }
  89 + return success;
  90 + }
  91 +
  92 + @Override
  93 + public boolean havaUnCompleteCombineByFromLocationCode(String fromLocationCode, String warehouseCode) {
  94 + LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  95 + shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getFromLocationCode, fromLocationCode)
75 .eq(ShipmentContainerHeader::getWarehouseCode, warehouseCode) 96 .eq(ShipmentContainerHeader::getWarehouseCode, warehouseCode)
76 .lt(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED); 97 .lt(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED);
77 ShipmentContainerHeader shipmentContainerHeader = getOne(shipmentContainerHeaderLambdaQueryWrapper); 98 ShipmentContainerHeader shipmentContainerHeader = getOne(shipmentContainerHeaderLambdaQueryWrapper);
@@ -81,6 +102,18 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -81,6 +102,18 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
81 return false; 102 return false;
82 } 103 }
83 104
  105 + @Override
  106 + public boolean havaUnCompleteCombineByToLocationCode(String toLocationCode, String warehouseCode) {
  107 + LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  108 + shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getToLocationCode, toLocationCode)
  109 + .eq(ShipmentContainerHeader::getWarehouseCode, warehouseCode)
  110 + .lt(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED);
  111 + ShipmentContainerHeader shipmentContainerHeader = getOne(shipmentContainerHeaderLambdaQueryWrapper);
  112 + if(shipmentContainerHeader != null) {
  113 + return true;
  114 + }
  115 + return false;
  116 + }
84 117
85 118
86 } 119 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
1 package org.jeecg.modules.wms.task.taskHeader.controller; 1 package org.jeecg.modules.wms.task.taskHeader.controller;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 import org.apache.shiro.authz.annotation.RequiresPermissions; 5 import org.apache.shiro.authz.annotation.RequiresPermissions;
4 import org.jeecg.common.system.query.QueryGenerator; 6 import org.jeecg.common.system.query.QueryGenerator;
5 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 7 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -8,14 +10,28 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -8,14 +10,28 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8 import lombok.extern.slf4j.Slf4j; 10 import lombok.extern.slf4j.Slf4j;
9 import org.jeecg.common.system.base.controller.JeecgController; 11 import org.jeecg.common.system.base.controller.JeecgController;
10 import org.jeecg.common.api.vo.Result; 12 import org.jeecg.common.api.vo.Result;
  13 +import org.jeecg.common.system.util.JwtUtil;
  14 +import org.jeecg.modules.wms.config.container.entity.Container;
  15 +import org.jeecg.modules.wms.config.container.service.IContainerService;
  16 +import org.jeecg.modules.wms.config.location.entity.Location;
  17 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  18 +import org.jeecg.modules.wms.config.port.entity.Port;
  19 +import org.jeecg.modules.wms.config.port.service.IPortService;
  20 +import org.jeecg.modules.wms.config.zone.entity.Zone;
  21 +import org.jeecg.modules.wms.config.zone.service.IZoneService;
  22 +import org.jeecg.modules.wms.framework.Convert;
11 import org.jeecg.modules.wms.framework.controller.BaseController; 23 import org.jeecg.modules.wms.framework.controller.BaseController;
  24 +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
12 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; 25 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
13 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; 26 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
14 import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; 27 import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
15 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; 28 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
16 import org.jeecg.utils.StringUtils; 29 import org.jeecg.utils.StringUtils;
  30 +import org.jeecg.utils.constant.QuantityConstant;
17 import org.springframework.beans.factory.annotation.Autowired; 31 import org.springframework.beans.factory.annotation.Autowired;
18 import org.springframework.web.bind.annotation.*; 32 import org.springframework.web.bind.annotation.*;
  33 +
  34 +import javax.annotation.Resource;
19 import javax.servlet.http.HttpServletRequest; 35 import javax.servlet.http.HttpServletRequest;
20 import javax.servlet.http.HttpServletResponse; 36 import javax.servlet.http.HttpServletResponse;
21 import org.springframework.web.servlet.ModelAndView; 37 import org.springframework.web.servlet.ModelAndView;
@@ -55,6 +71,14 @@ public class TaskHeaderController extends JeecgController&lt;TaskHeader, ITaskHeade @@ -55,6 +71,14 @@ public class TaskHeaderController extends JeecgController&lt;TaskHeader, ITaskHeade
55 71
56 @Autowired 72 @Autowired
57 private ITaskDetailService taskDetailService; 73 private ITaskDetailService taskDetailService;
  74 + @Resource
  75 + private ILocationService locationService;
  76 + @Resource
  77 + private IContainerService containerService;
  78 + @Resource
  79 + private IPortService portService;
  80 + @Resource
  81 + private IZoneService zoneService;
58 82
59 83
60 /*---------------------------------主表处理-begin-------------------------------------*/ 84 /*---------------------------------主表处理-begin-------------------------------------*/
@@ -316,6 +340,31 @@ public class TaskHeaderController extends JeecgController&lt;TaskHeader, ITaskHeade @@ -316,6 +340,31 @@ public class TaskHeaderController extends JeecgController&lt;TaskHeader, ITaskHeade
316 } 340 }
317 341
318 /** 342 /**
  343 + * 取消任务
  344 + */
  345 + @AutoLog(value = "任务表-取消任务")
  346 + @ApiOperation(value="任务表-取消任务", notes="任务表-取消任务")
  347 + @PostMapping( "/cancelTask")
  348 + @ResponseBody
  349 + public Result cancelTask(String ids) {
  350 + if (StringUtils.isEmpty(ids)) {
  351 + return Result.error("taskId不能为空");
  352 + }
  353 + Result result = null;
  354 + Integer[] idList = Convert.toIntArray(ids);
  355 + for (int taskId : idList) {
  356 + result = handleMultiProcess("cancelTask", new MultiProcessListener() {
  357 + @Override
  358 + public Result doProcess() {
  359 + Result result = taskHeaderService.cancelTask(taskId);
  360 + return result;
  361 + }
  362 + });
  363 + }
  364 + return result;
  365 + }
  366 +
  367 + /**
319 * 执行任务 368 * 执行任务
320 */ 369 */
321 @AutoLog(value = "任务表-执行任务") 370 @AutoLog(value = "任务表-执行任务")
@@ -337,4 +386,258 @@ public class TaskHeaderController extends JeecgController&lt;TaskHeader, ITaskHeade @@ -337,4 +386,258 @@ public class TaskHeaderController extends JeecgController&lt;TaskHeader, ITaskHeade
337 return result; 386 return result;
338 } 387 }
339 } 388 }
  389 +
  390 + /**
  391 + * 创建空托入库任务
  392 + */
  393 + @AutoLog(value = "任务表-创建空托入库任务")
  394 + @ApiOperation(value="任务表-创建空托入库任务", notes="任务表-创建空托入库任务")
  395 + @PostMapping( "/createEmptyIn")
  396 + public Result createEmptyIn(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  397 + String contaienrCode = taskHeader.getContainerCode();
  398 + String toLocationCode = taskHeader.getToLocationCode();
  399 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  400 + Result result = handleMultiProcess("createEmptyIn", new MultiProcessListener() {
  401 + @Override
  402 + public Result doProcess() {
  403 + Result result = taskHeaderService.createEmptyIn(contaienrCode,
  404 + toLocationCode, warehouseCode);
  405 + return result;
  406 + }
  407 + });
  408 + return result;
  409 + }
  410 +
  411 + /**
  412 + * 创建空托出库任务
  413 + */
  414 + @AutoLog(value = "任务表-创建空托出库任务")
  415 + @ApiOperation(value="任务表-创建空托出库任务", notes="任务表-创建空托出库任务")
  416 + @PostMapping( "/createEmptyOut")
  417 + public Result createEmptyOut(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  418 + String contaienrCode = taskHeader.getContainerCode();
  419 + String toPortCode = taskHeader.getToPortCode();
  420 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  421 + Result result = handleMultiProcess("createEmptyOut", new MultiProcessListener() {
  422 + @Override
  423 + public Result doProcess() {
  424 + Result result = taskHeaderService.createEmptyOut(contaienrCode,
  425 + toPortCode, warehouseCode);
  426 + return result;
  427 + }
  428 + });
  429 + return result;
  430 + }
  431 +
  432 + /**
  433 + * 创建移库任务
  434 + */
  435 + @AutoLog(value = "任务表-创建移库任务")
  436 + @ApiOperation(value="任务表-创建移库任务", notes="任务表-创建移库任务")
  437 + @PostMapping( "/createTransferTask")
  438 + public Result createTransferTask(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  439 + String fromLocationCode = taskHeader.getFromLocationCode();
  440 + String toLocationCode = taskHeader.getToLocationCode();
  441 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  442 + Result result = handleMultiProcess("createTransferTask", new MultiProcessListener() {
  443 + @Override
  444 + public Result doProcess() {
  445 + Result result = taskHeaderService.createTransferTask(fromLocationCode,
  446 + toLocationCode, warehouseCode);
  447 + return result;
  448 + }
  449 + });
  450 + return result;
  451 + }
  452 +
  453 + /**
  454 + * 创建出库查看任务
  455 + */
  456 + @AutoLog(value = "任务表-创建出库查看任务")
  457 + @ApiOperation(value="任务表-创建出库查看任务", notes="任务表-创建出库查看任务")
  458 + @PostMapping( "/createCheckOutTask")
  459 + public Result createCheckOutTask(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  460 + String containerCode = taskHeader.getContainerCode();
  461 + String toPortCode = taskHeader.getToPortCode();
  462 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  463 + Result result = handleMultiProcess("createCheckOutTask", new MultiProcessListener() {
  464 + @Override
  465 + public Result doProcess() {
  466 + Result result = taskHeaderService.createCheckOutTask(containerCode,
  467 + toPortCode, warehouseCode);
  468 + return result;
  469 + }
  470 + });
  471 + return result;
  472 + }
  473 +
  474 + /**
  475 + * 创建跨站任务
  476 + */
  477 + @AutoLog(value = "任务表-创建跨站任务")
  478 + @ApiOperation(value="任务表-创建跨站任务", notes="任务表-创建跨站任务")
  479 + @PostMapping( "/createOverStationTask")
  480 + public Result createOverStationTask(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  481 + String containerCode = taskHeader.getContainerCode();
  482 + String fromPortCode = taskHeader.getFromPortCode();
  483 + String toPortCode = taskHeader.getToPortCode();
  484 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  485 + Result result = handleMultiProcess("createOverStationTask", new MultiProcessListener() {
  486 + @Override
  487 + public Result doProcess() {
  488 + Result result = taskHeaderService.createOverStationTask(containerCode,
  489 + fromPortCode, toPortCode, warehouseCode);
  490 + return result;
  491 + }
  492 + });
  493 + return result;
  494 + }
  495 +
  496 + /**
  497 + * 创建空托盘组入库
  498 + */
  499 + @AutoLog(value = "任务表-创建空托盘组入库")
  500 + @ApiOperation(value="任务表-创建空托盘组入库", notes="任务表-创建空托盘组入库")
  501 + @PostMapping( "/createManyEmptyIn")
  502 + public Result createManyEmptyIn(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  503 + String containerCode = taskHeader.getContainerCode();
  504 + String toLocationCode = taskHeader.getToLocationCode();
  505 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  506 + Result result = handleMultiProcess("createManyEmptyIn", new MultiProcessListener() {
  507 + @Override
  508 + public Result doProcess() {
  509 + Result result = taskHeaderService.createManyEmptyIn(containerCode, toLocationCode, warehouseCode);
  510 + return result;
  511 + }
  512 + });
  513 + return result;
  514 + }
  515 +
  516 + /**
  517 + * 创建空托盘组出库
  518 + */
  519 + @AutoLog(value = "任务表-创建空托盘组出库")
  520 + @ApiOperation(value="任务表-创建空托盘组出库", notes="任务表-创建空托盘组出库")
  521 + @PostMapping( "/createManyEmptyOut")
  522 + public Result createManyEmptyOut(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  523 + String containerCode = taskHeader.getContainerCode();
  524 + String toPortCode = taskHeader.getToPortCode();
  525 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  526 + Result result = handleMultiProcess("createManyEmptyOut", new MultiProcessListener() {
  527 + @Override
  528 + public Result doProcess() {
  529 + Result result = taskHeaderService.createManyEmptyOut(containerCode, toPortCode, warehouseCode);
  530 + return result;
  531 + }
  532 + });
  533 + return result;
  534 + }
  535 +
  536 + /**
  537 + * 选择整出口
  538 + * @return
  539 + */
  540 + @ApiOperation(value="任务表-选择整出口", notes="任务表-选择整出口")
  541 + @PostMapping("/selectOutPort")
  542 + @ResponseBody
  543 + public Result selectOutPort(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  544 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  545 + String containerCode = taskHeader.getContainerCode();
  546 + if(StringUtils.isEmpty(containerCode)) {
  547 + return Result.error("选择整出口, 托盘号为空");
  548 + }
  549 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  550 + if(container == null) {
  551 + return Result.error("选择整出口, 没有找到托盘" + containerCode);
  552 + }
  553 + String fromLocationCode = container.getLocationCode();
  554 + if(StringUtils.isEmpty(fromLocationCode)) {
  555 + return Result.error("选择整出口, 起始库位号为空");
  556 + }
  557 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  558 + if(fromLocation == null) {
  559 + return Result.error("选择整出口, 根据库位号" + fromLocationCode + " 没有找到库位");
  560 + }
  561 + String zoneCode = fromLocation.getZoneCode();
  562 + if(StringUtils.isEmpty(zoneCode)) {
  563 + return Result.error("选择整出口, 库区编码为空");
  564 + }
  565 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  566 + if(zone == null) {
  567 + return Result.error("选择整出口, 库区为空");
  568 + }
  569 + int type = QuantityConstant.PORT_TYPE_OUT;
  570 + List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode);
  571 + if(portList.size() == 0) {
  572 + return Result.error("选择整出口, 没有找到合适的整出口");
  573 + }
  574 + return Result.OK(portList);
  575 + }
  576 +
  577 + /**
  578 + * 选择分拣口
  579 + * @return
  580 + */
  581 + @ApiOperation(value="任务表-选择分拣口", notes="任务表-选择分拣口")
  582 + @PostMapping("/selectPickPort")
  583 + @ResponseBody
  584 + public Result selectPickPort(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  585 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  586 + String containerCode = taskHeader.getContainerCode();
  587 + if(StringUtils.isEmpty(containerCode)) {
  588 + return Result.error("选择分拣口, 托盘号为空");
  589 + }
  590 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  591 + if(container == null) {
  592 + return Result.error("选择分拣口, 没有找到托盘" + containerCode);
  593 + }
  594 + String fromLocationCode = container.getLocationCode();
  595 + if(StringUtils.isEmpty(fromLocationCode)) {
  596 + return Result.error("选择整出口, 起始库位号为空");
  597 + }
  598 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  599 + if(fromLocation == null) {
  600 + return Result.error("选择分拣口, 根据库位号" + fromLocationCode + " 没有找到库位");
  601 + }
  602 + String zoneCode = fromLocation.getZoneCode();
  603 + if(StringUtils.isEmpty(zoneCode)) {
  604 + return Result.error("选择分拣口, 库区编码为空");
  605 + }
  606 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  607 + if(zone == null) {
  608 + return Result.error("选择分拣口, 库区为空");
  609 + }
  610 + int type = QuantityConstant.PORT_TYPE_PICK;
  611 + List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode);
  612 + if(portList.size() == 0) {
  613 + return Result.error("选择分拣口, 没有找到合适的分拣口");
  614 + }
  615 + return Result.OK(portList);
  616 + }
  617 +
  618 + /**
  619 + * 选择站台
  620 + * @return
  621 + */
  622 + @ApiOperation(value="任务表-选择站台", notes="任务表-选择站台")
  623 + @PostMapping("/selectPort")
  624 + @ResponseBody
  625 + public Result selectPort(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
  626 + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req);
  627 + String containerCode = taskHeader.getContainerCode();
  628 + if(StringUtils.isEmpty(containerCode)) {
  629 + return Result.error("选择站台, 托盘号为空");
  630 + }
  631 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  632 + if(container == null) {
  633 + return Result.error("选择站台, 没有找到托盘" + containerCode);
  634 + }
  635 + LambdaQueryWrapper<Port> portLambdaQueryWrapper = Wrappers.lambdaQuery();
  636 + portLambdaQueryWrapper.eq(Port::getWarehouseCode, warehouseCode);
  637 + List<Port> portList = portService.list(portLambdaQueryWrapper);
  638 + if(portList.size() == 0) {
  639 + return Result.error("选择站台, 没有找到合适的选择站台");
  640 + }
  641 + return Result.OK(portList);
  642 + }
340 } 643 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java
@@ -97,11 +97,11 @@ public class TaskHeader implements Serializable { @@ -97,11 +97,11 @@ public class TaskHeader implements Serializable {
97 /**起始出入口*/ 97 /**起始出入口*/
98 @Excel(name = "起始出入口", width = 15) 98 @Excel(name = "起始出入口", width = 15)
99 @ApiModelProperty(value = "起始出入口") 99 @ApiModelProperty(value = "起始出入口")
100 - private String fromPort; 100 + private String fromPortCode;
101 /**目标出入口*/ 101 /**目标出入口*/
102 @Excel(name = "目标出入口", width = 15) 102 @Excel(name = "目标出入口", width = 15)
103 @ApiModelProperty(value = "目标出入口") 103 @ApiModelProperty(value = "目标出入口")
104 - private String toPort; 104 + private String toPortCode;
105 @Excel(name = "重量", width = 15) 105 @Excel(name = "重量", width = 15)
106 @ApiModelProperty(value = "重量") 106 @ApiModelProperty(value = "重量")
107 private Integer weight; 107 private Integer weight;
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
@@ -27,18 +27,156 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; { @@ -27,18 +27,156 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
27 */ 27 */
28 void delBatchMain (Collection<? extends Serializable> idList); 28 void delBatchMain (Collection<? extends Serializable> idList);
29 29
  30 + /**
  31 + * 判断旁边库位是否有未完成的任务,如果有
  32 + * @param location
  33 + * @return
  34 + */
30 boolean haveUncompleteTaskInNear(Location location); 35 boolean haveUncompleteTaskInNear(Location location);
31 36
32 - Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode);  
33 -  
34 - 37 + /**
  38 + * 通过起始库位号,获取任务信息
  39 + * @param fromLocationCode
  40 + * @param warehouseCode
  41 + * @return
  42 + */
35 TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode); 43 TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode);
36 44
  45 + /**
  46 + * 通过目标库位号,获取任务信息
  47 + * @param toLocationCode
  48 + * @param warehouseCode
  49 + * @return
  50 + */
37 TaskHeader getUnCompleteTaskByToLocationCode(String toLocationCode, String warehouseCode); 51 TaskHeader getUnCompleteTaskByToLocationCode(String toLocationCode, String warehouseCode);
38 52
  53 + /**
  54 + * 通过库位号,获取任务信息
  55 + * @param locationCode
  56 + * @param warehouseCode
  57 + * @return
  58 + */
39 TaskHeader getUnCompleteTaskByLocationCode(String locationCode, String warehouseCode); 59 TaskHeader getUnCompleteTaskByLocationCode(String locationCode, String warehouseCode);
40 60
  61 + /**
  62 + * 通过托盘号,获取未完成任务信息
  63 + * @param containerCode
  64 + * @param warehouseCode
  65 + * @return
  66 + */
  67 + TaskHeader getUnCompleteTaskByContainerCode(String containerCode, String warehouseCode);
  68 +
  69 + /**
  70 + * 通过前置任务号,获取未完成任务信息
  71 + * @param preTaskNo
  72 + * @param warehouseCode
  73 + * @return
  74 + */
  75 + TaskHeader getUnCompleteTaskByPreTaskNo(int preTaskNo, String warehouseCode);
  76 +
  77 + /**
  78 + * 完成WMS任务
  79 + * @param taskId
  80 + * @return
  81 + */
41 Result completeTaskByWMS(Integer taskId); 82 Result completeTaskByWMS(Integer taskId);
42 83
  84 + /**
  85 + * 取消WMS任务
  86 + * @param taskId
  87 + * @return
  88 + */
  89 + Result cancelTask(Integer taskId);
  90 +
  91 + /**
  92 + * 下发任务给WCS
  93 + * @param taskId
  94 + * @return
  95 + */
43 Result sendTaskToWcs(Integer taskId); 96 Result sendTaskToWcs(Integer taskId);
  97 +
  98 + /**
  99 + * 创建空托盘入库任务
  100 + * @param containerCode
  101 + * @param toLocationCode
  102 + * @param warehouseCode
  103 + * @return
  104 + */
  105 + Result createEmptyIn(String containerCode, String toLocationCode, String warehouseCode);
  106 +
  107 + /**
  108 + * 创建空托盘出库任务
  109 + * @param containerCode
  110 + * @param toPortCode
  111 + * @param warehouseCode
  112 + * @return
  113 + */
  114 + Result createEmptyOut(String containerCode, String toPortCode, String warehouseCode);
  115 +
  116 + /**
  117 + * 创建移库任务
  118 + * @param fromLocationCode
  119 + * @param toLocationCode
  120 + * @param warehouseCode
  121 + * @return
  122 + */
  123 + Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode);
  124 +
  125 + /**
  126 + * 创建出库查看任务
  127 + * @param containerCode
  128 + * @param toPortCode
  129 + * @param warehouseCode
  130 + * @return
  131 + */
  132 + Result createCheckOutTask(String containerCode, String toPortCode, String warehouseCode);
  133 +
  134 + /**
  135 + * 创建跨站任务任务
  136 + * @param containerCode
  137 + * @param fromPortCode
  138 + * @param toPortCode
  139 + * @param warehouseCode
  140 + * @return
  141 + */
  142 + Result createOverStationTask(String containerCode, String fromPortCode, String toPortCode, String warehouseCode);
  143 +
  144 + /**
  145 + * WCS申请空托盘组入库
  146 + * @param containerCode
  147 + * @param zoneCode
  148 + * @param roadWay
  149 + * @parap height
  150 + * @param warehouseCode
  151 + * @return
  152 + */
  153 + Result createManyEmptyInTask(String containerCode, String zoneCode, String roadWay, String height, String warehouseCode);
  154 +
  155 + /**
  156 + * 创建空托盘组入库
  157 + * @param containerCode
  158 + * @param toLocationCode
  159 + * @param warehouseCode
  160 + * @return
  161 + */
  162 + Result createManyEmptyIn(String containerCode, String toLocationCode, String warehouseCode);
  163 +
  164 + /**
  165 + * WCS申请空托盘组出库
  166 + * @param zoneCode
  167 + * @param toPortCode
  168 + * @param warehouseCode
  169 + * @return
  170 + */
  171 + Result createManyEmptyOutTask(String zoneCode, String toPortCode, String warehouseCode);
  172 +
  173 + /**
  174 + * 创建空托盘组出库
  175 + * @param containerCode
  176 + * @param toPortCode
  177 + * @param warehouseCode
  178 + * @return
  179 + */
  180 + Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode);
  181 +
44 } 182 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -5,19 +5,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -5,19 +5,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 5 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
6 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7 import org.jeecg.common.api.vo.Result; 7 import org.jeecg.common.api.vo.Result;
  8 +import org.jeecg.modules.wms.api.wcs.service.LocationAllocationService;
8 import org.jeecg.modules.wms.api.wcs.service.WcsService; 9 import org.jeecg.modules.wms.api.wcs.service.WcsService;
9 import org.jeecg.modules.wms.config.container.entity.Container; 10 import org.jeecg.modules.wms.config.container.entity.Container;
10 import org.jeecg.modules.wms.config.container.service.IContainerService; 11 import org.jeecg.modules.wms.config.container.service.IContainerService;
11 import org.jeecg.modules.wms.config.location.entity.Location; 12 import org.jeecg.modules.wms.config.location.entity.Location;
12 import org.jeecg.modules.wms.config.location.service.ILocationService; 13 import org.jeecg.modules.wms.config.location.service.ILocationService;
  14 +import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh;
  15 +import org.jeecg.modules.wms.config.locationHigh.service.ILocationHighService;
  16 +import org.jeecg.modules.wms.config.locationType.entity.LocationType;
  17 +import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService;
13 import org.jeecg.modules.wms.config.material.entity.Material; 18 import org.jeecg.modules.wms.config.material.entity.Material;
14 import org.jeecg.modules.wms.config.material.service.IMaterialService; 19 import org.jeecg.modules.wms.config.material.service.IMaterialService;
  20 +import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
  21 +import org.jeecg.modules.wms.config.port.entity.Port;
  22 +import org.jeecg.modules.wms.config.port.service.IPortService;
  23 +import org.jeecg.modules.wms.config.zone.entity.Zone;
  24 +import org.jeecg.modules.wms.config.zone.service.IZoneService;
15 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; 25 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
16 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; 26 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
17 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; 27 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
18 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; 28 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
19 import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; 29 import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction;
20 import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; 30 import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService;
  31 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
21 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; 32 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
22 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; 33 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
23 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; 34 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
@@ -45,10 +56,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -45,10 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
45 import javax.annotation.Resource; 56 import javax.annotation.Resource;
46 import java.io.Serializable; 57 import java.io.Serializable;
47 import java.math.BigDecimal; 58 import java.math.BigDecimal;
48 -import java.util.ArrayList;  
49 -import java.util.Date;  
50 -import java.util.List;  
51 -import java.util.Collection; 59 +import java.util.*;
52 import java.util.stream.Collectors; 60 import java.util.stream.Collectors;
53 61
54 /** 62 /**
@@ -96,6 +104,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -96,6 +104,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
96 private IMaterialService materialService; 104 private IMaterialService materialService;
97 @Resource 105 @Resource
98 private WcsService wcsService; 106 private WcsService wcsService;
  107 + @Resource
  108 + private IPortService portService;
  109 + @Resource
  110 + private IParameterConfigurationService parameterConfigurationService;
  111 + @Resource
  112 + private IZoneService zoneService;
  113 + @Resource
  114 + private ILocationTypeService locationTypeService;
  115 + @Resource
  116 + private ILocationHighService locationHighService;
  117 + @Resource
  118 + private LocationAllocationService allocationService;
99 119
100 @Override 120 @Override
101 @Transactional 121 @Transactional
@@ -134,55 +154,76 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -134,55 +154,76 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
134 @Override 154 @Override
135 @Transactional(rollbackFor = Exception.class) 155 @Transactional(rollbackFor = Exception.class)
136 public Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode) { 156 public Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode) {
  157 + if(StringUtils.isEmpty(fromLocationCode)) {
  158 + return Result.error("创建移库任务时,起始库位为空");
  159 + }
  160 + if(StringUtils.isEmpty(toLocationCode)) {
  161 + return Result.error("创建移库任务时,目标库位为空");
  162 + }
137 Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); 163 Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
138 Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); 164 Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
139 Integer preTaskNo = 0; 165 Integer preTaskNo = 0;
140 // 1. 判断起点库位和终点库位是否满足移库条件 166 // 1. 判断起点库位和终点库位是否满足移库条件
141 if(fromLocation == null) { 167 if(fromLocation == null) {
142 - return Result.error("库位:" + fromLocationCode + "未找到"); 168 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "未找到");
143 } 169 }
144 if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(fromLocation.getStatus())) { 170 if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(fromLocation.getStatus())) {
145 - return Result.error("库位:" + fromLocationCode + "状态非空闲"); 171 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "状态非空闲");
146 } 172 }
147 if (StringUtils.isEmpty(fromLocation.getContainerCode())) { 173 if (StringUtils.isEmpty(fromLocation.getContainerCode())) {
148 - return Result.error("库位:" + fromLocationCode + "不存在托盘"); 174 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "不存在托盘");
149 } 175 }
150 //这里增加组盘校验,如果此托盘存在未完成的组盘数据,则不能移库 176 //这里增加组盘校验,如果此托盘存在未完成的组盘数据,则不能移库
151 //校验入库组盘 177 //校验入库组盘
152 -// if (inventoryHeaderService.getUncompleteReceiptContainer(fromLocationCode, warehouseCode) > 0) {  
153 -// return Result.error("源库位:" + fromLocationCode + "存在入库组盘,不能移库");  
154 -// }  
155 -// if (inventoryHeaderService.getUncompleteShipmentContainer(toLocationCode, warehouseCode) > 0) {  
156 -// return Result.error("源库位:" + toLocationCode + "存在出库组盘,不能移库");  
157 -// } 178 + if (receiptContainerHeaderService.havaUnCompleteCombineByLocationCode(fromLocationCode, warehouseCode)) {
  179 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "存在入库组盘,不能移库");
  180 + }
  181 + //校验出库组盘
  182 + if (shipmentContainerHeaderService.havaUnCompleteCombineByLocationCode(fromLocationCode, warehouseCode)) {
  183 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "存在出库组盘,不能移库");
  184 + }
  185 +
158 if (toLocation == null) { 186 if (toLocation == null) {
159 - return Result.error("目标库位:" + toLocationCode + "未找到"); 187 + return Result.error("创建移库任务时,目标库位:" + toLocationCode + "未找到");
160 } 188 }
161 if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(toLocation.getStatus())) { 189 if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(toLocation.getStatus())) {
162 - return Result.error("目标库位:" + toLocationCode + "状态非空闲"); 190 + return Result.error("创建移库任务时,目标库位:" + toLocationCode + "状态非空闲");
163 } 191 }
164 if (StringUtils.isNotEmpty(toLocation.getContainerCode())) { 192 if (StringUtils.isNotEmpty(toLocation.getContainerCode())) {
165 - return Result.error("目标库位:" + toLocationCode + "存在托盘"); 193 + return Result.error("创建移库任务时,目标库位:" + toLocationCode + "存在托盘");
  194 + }
  195 + //校验入库组盘
  196 + if (receiptContainerHeaderService.havaUnCompleteCombineByLocationCode(toLocationCode, warehouseCode)) {
  197 + return Result.error("创建移库任务时,目标库位:" + toLocationCode + "存在入库组盘,不能移库");
  198 + }
  199 + //校验出库组盘
  200 + if (shipmentContainerHeaderService.havaUnCompleteCombineByLocationCode(toLocationCode, warehouseCode)) {
  201 + return Result.error("创建移库任务时, 目标库位:" + toLocationCode + "存在出库组盘,不能移库");
166 } 202 }
167 if (taskHeaderService.haveUncompleteTaskInNear(toLocation)) { 203 if (taskHeaderService.haveUncompleteTaskInNear(toLocation)) {
168 - return Result.error("目标库位:" + toLocationCode + "旁边存在任务,请完成任务以后再分配"); 204 + return Result.error("创建移库任务时,目标库位:" + toLocationCode + "旁边存在任务,请完成任务以后再分配");
169 } 205 }
  206 +
170 if(!fromLocation.getRoadWay().equals(toLocation.getRoadWay())) { 207 if(!fromLocation.getRoadWay().equals(toLocation.getRoadWay())) {
171 - return Result.error("目标库位和源库位不在同一个巷道"); 208 + return Result.error("创建移库任务时,目标库位和源库位不在同一个巷道");
172 } 209 }
173 if(!fromLocation.getHigh().equals(toLocation.getHigh())) { 210 if(!fromLocation.getHigh().equals(toLocation.getHigh())) {
174 - return Result.error("目标库位和源库位高度不一样"); 211 + return Result.error("创建移库任务时,目标库位和源库位高度不一样");
175 } 212 }
176 if(!fromLocation.getLocationTypeCode().equals(toLocation.getLocationTypeCode())) { 213 if(!fromLocation.getLocationTypeCode().equals(toLocation.getLocationTypeCode())) {
177 - return Result.error("目标库位和源库位库位类型不一样"); 214 + return Result.error("创建移库任务时,目标库位和源库位库位类型不一样");
178 } 215 }
179 if(!fromLocation.getZoneCode().equals(toLocation.getZoneCode())) { 216 if(!fromLocation.getZoneCode().equals(toLocation.getZoneCode())) {
180 - return Result.error("目标库位和源库位不在同一个区域"); 217 + return Result.error("创建移库任务时,目标库位和源库位不在同一个区域");
181 } 218 }
  219 +
182 // 2. 记住移库前的容器类型,因为空托盘组无法区分 220 // 2. 记住移库前的容器类型,因为空托盘组无法区分
183 Container container = containerService.getContainerByCode(fromLocation.getContainerCode(), warehouseCode); 221 Container container = containerService.getContainerByCode(fromLocation.getContainerCode(), warehouseCode);
184 container.setLastStatus(container.getStatus()); 222 container.setLastStatus(container.getStatus());
185 - containerService.updateById(container); 223 + boolean success = containerService.updateById(container);
  224 + if(!success) {
  225 + throw new ServiceException("创建移库任务时,更新容器状态失败,容器号" + fromLocation.getContainerCode());
  226 + }
186 227
187 // 3. 判断源库位旁边有托盘但是没有任务,那么不允许移库 228 // 3. 判断源库位旁边有托盘但是没有任务,那么不允许移库
188 if(fromLocation.getRowFlag() == QuantityConstant.ROW_OUT) { 229 if(fromLocation.getRowFlag() == QuantityConstant.ROW_OUT) {
@@ -194,12 +235,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -194,12 +235,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
194 if(taskHeader != null) { 235 if(taskHeader != null) {
195 preTaskNo = taskHeader.getId(); 236 preTaskNo = taskHeader.getId();
196 } else { 237 } else {
197 - return Result.error("库位:" + fromLocationCode + "旁边库位有托盘无法移库"); 238 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "旁边库位有托盘无法移库");
198 } 239 }
199 } else { 240 } else {
200 TaskHeader taskHeader = getUnCompleteTaskByToLocationCode(locationCode, warehouseCode); 241 TaskHeader taskHeader = getUnCompleteTaskByToLocationCode(locationCode, warehouseCode);
201 if(taskHeader != null) { 242 if(taskHeader != null) {
202 - return Result.error("库位:" + fromLocationCode + "旁边库位有任务无法移库"); 243 + return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "旁边库位有任务无法移库");
203 } 244 }
204 } 245 }
205 } 246 }
@@ -208,73 +249,384 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -208,73 +249,384 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
208 TaskHeader taskHeader = new TaskHeader(); 249 TaskHeader taskHeader = new TaskHeader();
209 taskHeader.setWarehouseCode(warehouseCode); 250 taskHeader.setWarehouseCode(warehouseCode);
210 taskHeader.setTaskType(QuantityConstant.TASK_TYPE_TRANSFER); 251 taskHeader.setTaskType(QuantityConstant.TASK_TYPE_TRANSFER);
211 - taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); 252 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_TRANSFER_POSITION);
212 taskHeader.setZoneCode(fromLocation.getZoneCode()); 253 taskHeader.setZoneCode(fromLocation.getZoneCode());
213 taskHeader.setContainerCode(fromLocation.getContainerCode()); 254 taskHeader.setContainerCode(fromLocation.getContainerCode());
214 taskHeader.setFromLocationCode(fromLocationCode); 255 taskHeader.setFromLocationCode(fromLocationCode);
215 taskHeader.setToLocationCode(toLocationCode); 256 taskHeader.setToLocationCode(toLocationCode);
216 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); 257 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
217 taskHeader.setPreTaskNo(preTaskNo); 258 taskHeader.setPreTaskNo(preTaskNo);
218 - boolean result = taskHeaderService.save(taskHeader);  
219 - if(!result) {  
220 - throw new ServiceException("创建任务失败"); 259 + success = taskHeaderService.save(taskHeader);
  260 + if(!success) {
  261 + throw new ServiceException("创建移库任务时,创建任务失败");
221 } 262 }
222 263
223 - result = locationService.updateStatus(fromLocationCode, 264 + success = locationService.updateStatus(fromLocationCode,
224 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); 265 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
225 - if(!result) {  
226 - throw new ServiceException("库位“ + fromLocationCode + “更新失败"); 266 + if(!success) {
  267 + throw new ServiceException("创建移库任务时, 库位" + fromLocationCode + "更新失败");
227 } 268 }
228 - result = locationService.updateStatus(toLocationCode, 269 + success = locationService.updateStatus(toLocationCode,
229 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); 270 QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
230 - if(!result) {  
231 - throw new ServiceException("库位“ + toLocationCode + “更新失败"); 271 + if(!success) {
  272 + throw new ServiceException("创建移库任务时, 库位" + toLocationCode + "更新失败");
232 } 273 }
233 - result = containerService.updateLocationCodeAndStatus(fromLocation.getContainerCode(), 274 + success = containerService.updateLocationCodeAndStatus(fromLocation.getContainerCode(),
234 fromLocationCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); 275 fromLocationCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
235 - if(!result) {  
236 - throw new ServiceException("容器“ + fromLocation.getContainerCode() + “更新失败");  
237 - }  
238 -  
239 -// LambdaUpdateWrapper<InventoryDetail> detailLambdaUpdateWrapper = Wrappers.lambdaUpdate();  
240 -// detailLambdaUpdateWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode);  
241 -// detailLambdaUpdateWrapper.eq(InventoryDetail::getLocationCode, sourceLocationCode);  
242 -// List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(detailLambdaUpdateWrapper);  
243 -// for (InventoryDetail inventoryDetail : inventoryDetailList) {  
244 -// TaskDetail taskDetail = new TaskDetail();  
245 -// taskDetail.setTaskId(taskHeader.getId());  
246 -// taskDetail.setTaskType(taskHeader.getTaskType());  
247 -// taskDetail.setInternalTaskType(taskHeader.getInternalTaskType());  
248 -// taskDetail.setWarehouseCode(taskHeader.getWarehouseCode());;  
249 -// taskDetail.setCompanyCode(inventoryDetail.getCompanyCode());  
250 -// taskDetail.setMaterialCode(inventoryDetail.getMaterialCode());  
251 -// taskDetail.setMaterialName(inventoryDetail.getMaterialName());  
252 -// taskDetail.setMaterialSpec(inventoryDetail.getMaterialSpec());  
253 -// taskDetail.setMaterialUnit(inventoryDetail.getMaterialUnit());  
254 -// taskDetail.setQty(inventoryDetail.getQty());  
255 -// taskDetail.setFromLocation(inventoryDetail.getLocationCode());  
256 -// taskDetail.setToLocation(desLocationCode);  
257 -// taskDetail.setContainerCode(inventoryDetail.getContainerCode());  
258 -// taskDetail.setStatus(QuantityConstant.TASK_STATUS_BUILD);  
259 -// taskDetail.setReferenceCode(inventoryDetail.getReferCode());  
260 -// taskDetail.setAttribute1(inventoryDetail.getAttribute1());  
261 -// taskDetail.setAttribute2(inventoryDetail.getAttribute2());  
262 -// taskDetail.setAttribute3(inventoryDetail.getAttribute3());  
263 -// taskDetail.setBatch(inventoryDetail.getBatch());  
264 -// taskDetail.setLot(inventoryDetail.getLot());  
265 -// taskDetail.setProjectNo(inventoryDetail.getProjectNo());  
266 -// taskDetail.setManufactureDate(inventoryDetail.getManufactureDate());  
267 -// taskDetail.setExpirationDate(inventoryDetail.getExpirationDate());  
268 -// taskDetail.setAgingDate(inventoryDetail.getAgingDate());  
269 -// taskDetail.setInventorySts(inventoryDetail.getInventorySts());  
270 -// taskDetail.setFromInventoryId(inventoryDetail.getId());  
271 -// taskDetail.setToInventoryId(inventoryDetail.getId());  
272 -// if (!taskDetailService.save(taskDetail) || !inventoryDetailService.updateById(inventoryDetail)) {  
273 -// throw new ServiceException("创建任务失败");  
274 -// }  
275 -// }  
276 -  
277 - return Result.OK(taskHeader.getId()); 276 + if(!success) {
  277 + throw new ServiceException("创建移库任务时,容器" + fromLocation.getContainerCode() + "更新失败");
  278 + }
  279 + return Result.OK("创建移库任务成功");
  280 + }
  281 +
  282 + @Override
  283 + @Transactional(rollbackFor = Exception.class)
  284 + public Result createCheckOutTask(String containerCode, String toPortCode, String warehouseCode) {
  285 + if(StringUtils.isEmpty(containerCode)) {
  286 + return Result.error("创建出库查看任务时,容器编码为空");
  287 + }
  288 + if(StringUtils.isEmpty(toPortCode)) {
  289 + return Result.error("创建出库查看任务时,目标站台号为空");
  290 + }
  291 + if(StringUtils.isEmpty(warehouseCode)) {
  292 + return Result.error("创建出库查看任务时,仓库编码为空");
  293 + }
  294 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  295 + if(container == null) {
  296 + return Result.error("创建出库查看任务时,容器为空");
  297 + }
  298 + String fromLocationCode = container.getLocationCode();
  299 + if(StringUtils.isEmpty(fromLocationCode)) {
  300 + return Result.error("创建出库查看任务时,容器不在库位上");
  301 + }
  302 + Location location = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  303 + if(location == null) {
  304 + return Result.error("创建出库查看任务时,没有找到库位:" + fromLocationCode);
  305 + }
  306 + String zoneCode = location.getZoneCode();
  307 + Port port = portService.getPortByCode(toPortCode, zoneCode, warehouseCode);
  308 + if(port == null) {
  309 + return Result.error("创建出库查看任务时,没有找到出库口:" + toPortCode);
  310 + }
  311 + boolean success = false;
  312 + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  313 + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, containerCode)
  314 + .eq(InventoryDetail::getWarehouseCode, warehouseCode)
  315 + .eq(InventoryDetail::getLocationCode, fromLocationCode);
  316 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper);
  317 + if(inventoryDetailList.size() != 0) {
  318 + for (InventoryDetail inventoryDetail : inventoryDetailList) {
  319 + inventoryDetail.setTaskQty(inventoryDetail.getQty());
  320 + }
  321 + success = inventoryDetailService.updateBatchById(inventoryDetailList);
  322 + if (!success) {
  323 + throw new ServiceException("创建出库查看任务时,更新库存详情失败");
  324 + }
  325 + }
  326 + success = locationService.updateStatus(fromLocationCode,
  327 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  328 + if(!success) {
  329 + throw new ServiceException("创建出库查看任务时,更新库位状态失败");
  330 + }
  331 + success = containerService.updateStatus(containerCode,
  332 + QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  333 + if(!success) {
  334 + throw new ServiceException("创建出库查看任务时,更新容器状态失败");
  335 + }
  336 + TaskHeader taskHeader = new TaskHeader();
  337 + taskHeader.setWarehouseCode(warehouseCode);
  338 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_CHECK_OUT);
  339 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT);
  340 + taskHeader.setContainerCode(containerCode);
  341 + taskHeader.setZoneCode(zoneCode);
  342 + taskHeader.setFromLocationCode(fromLocationCode);
  343 + taskHeader.setToPortCode(toPortCode);
  344 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION);
  345 + int taskLocationRule = Integer.parseInt(value);
  346 + if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) {
  347 + taskHeader.setToLocationCode(fromLocationCode);
  348 + }
  349 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  350 + success = taskHeaderService.save(taskHeader);
  351 + if(!success) {
  352 + throw new ServiceException("创建出库查看任务时, 创建任务失败");
  353 + }
  354 + return Result.OK("创建出库查看任务成功");
  355 + }
  356 +
  357 + @Override
  358 + @Transactional(rollbackFor = Exception.class)
  359 + public Result createOverStationTask(String containerCode, String fromPortCode,
  360 + String toPortCode, String warehouseCode) {
  361 + if(StringUtils.isEmpty(containerCode)) {
  362 + return Result.error("创建跨站任务时,容器号为空");
  363 + }
  364 + if(StringUtils.isEmpty(fromPortCode)) {
  365 + return Result.error("创建跨站任务时,起始站台号为空");
  366 + }
  367 + if(StringUtils.isEmpty(toPortCode)) {
  368 + return Result.error("创建跨站任务时,目标站台号为空");
  369 + }
  370 + if(StringUtils.isEmpty(warehouseCode)) {
  371 + return Result.error("创建跨站任务时,仓库编码为空");
  372 + }
  373 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  374 + if(container == null) {
  375 + return Result.error("创建跨站任务时,容器为空");
  376 + }
  377 + if(!container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)) {
  378 + return Result.error("创建跨站任务时,容器状态不为空托盘");
  379 + }
  380 + Port fromPort = portService.getPortByCode(fromPortCode, warehouseCode);
  381 + if(fromPort == null) {
  382 + return Result.error("创建跨站任务时,起始站台为空");
  383 + }
  384 + Port toPort = portService.getPortByCode(toPortCode, warehouseCode);
  385 + if(toPort == null) {
  386 + return Result.error("创建跨站任务时,目标站台为空");
  387 + }
  388 +
  389 + TaskHeader taskHeader = new TaskHeader();
  390 + taskHeader.setWarehouseCode(warehouseCode);
  391 + taskHeader.setContainerCode(containerCode);
  392 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_OVER_STATION);
  393 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_TRANSFER_POSITION);
  394 + taskHeader.setFromPortCode(fromPortCode);
  395 + taskHeader.setToPortCode(toPortCode);
  396 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  397 + boolean success = taskHeaderService.save(taskHeader);
  398 + if(!success) {
  399 + return Result.error("创建跨站任务时, 创建任务失败");
  400 + }
  401 + success = containerService.updateStatus(containerCode,
  402 + QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  403 + if(!success) {
  404 + return Result.error("创建跨站任务时, 更新容器状态失败");
  405 + }
  406 + return Result.ok("创建跨站任务成功");
  407 + }
  408 +
  409 + @Override
  410 + @Transactional(rollbackFor = Exception.class)
  411 + public Result createManyEmptyInTask(String containerCode, String zoneCode,
  412 + String roadWay, String height, String warehouseCode) {
  413 + if(StringUtils.isEmpty(containerCode)) {
  414 + return Result.error("创建空托盘组入库任务时,容器号为空");
  415 + }
  416 + if(StringUtils.isEmpty(zoneCode)) {
  417 + return Result.error("创建空托盘组入库任务时,库区编码为空");
  418 + }
  419 + if(StringUtils.isEmpty(roadWay)) {
  420 + return Result.error("创建空托盘组入库任务时,巷道为空");
  421 + }
  422 + if(StringUtils.isEmpty(height)) {
  423 + return Result.error("创建空托盘组入库任务时,高度值为空");
  424 + }
  425 + if(StringUtils.isEmpty(height)) {
  426 + return Result.error("创建空托盘组入库任务时,仓库编码为空");
  427 + }
  428 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  429 + if(container == null) {
  430 + return Result.error("创建空托盘组入库任务时,没有找到容器");
  431 + }
  432 + if (StringUtils.isNotEmpty(container.getLocationCode())) {
  433 + return Result.error("容器已在库位" + container.getLocationCode() + "上");
  434 + }
  435 + List<Integer> roadWays = new ArrayList<>();
  436 + String[] strList = roadWay.split(",");
  437 + for(String str : strList) {
  438 + roadWays.add(Integer.parseInt(str));
  439 + }
  440 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_ALLOCATION);
  441 + if (StringUtils.isEmpty(value)) {
  442 + return Result.error("未绑定定位规则");
  443 + }
  444 + int allocationRule = Integer.parseInt(value);
  445 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  446 + if(zone == null) {
  447 + return Result.error("创建空托盘组入库任务时,没有找到库区");
  448 + }
  449 + TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode);
  450 + if(taskHeader != null) {
  451 + return Result.ok("创建空托盘组入库任务时, 已经生成空托盘组任务");
  452 + }
  453 + List<LocationType> locationTypeList = locationTypeService.
  454 + getLocationTypeListByZoneCode(zoneCode, warehouseCode);
  455 + if(locationTypeList.size() == 0) {
  456 + return Result.error("创建空托盘组入库任务时,没有找到库位类型");
  457 + }
  458 + List<String> locationTypeCodeList = locationTypeList.stream().
  459 + map(t -> t.getCode()).collect(Collectors.toList());
  460 + int highHeight = Float.valueOf(height).intValue();
  461 + LocationHigh locationHigh = locationHighService.
  462 + getLocationHighByHighLevel(highHeight, locationTypeCodeList, warehouseCode);
  463 + if(locationHigh == null) {
  464 + return Result.error("创建空托盘组入库任务时,没有获取到库位高度");
  465 + }
  466 + int high = locationHigh.getHigh();
  467 + String toLocationCode = allocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode,
  468 + roadWays, warehouseCode, containerCode, null);
  469 + if(StringUtils.isEmpty(toLocationCode)) {
  470 + throw new ServiceException("创建空托盘组入库任务时,目标库位为空");
  471 + }
  472 + Result result = createManyEmptyIn(containerCode, toLocationCode, warehouseCode);
  473 + if(!result.isSuccess()) {
  474 + throw new ServiceException(result.getMessage());
  475 + }
  476 + return Result.ok("创建空托盘组入库任务成功");
  477 + }
  478 +
  479 + @Override
  480 + @Transactional(rollbackFor = Exception.class)
  481 + public Result createManyEmptyIn(String containerCode, String toLocationCode, String warehouseCode) {
  482 + if(StringUtils.isEmpty(containerCode)) {
  483 + return Result.error("创建空托盘组入库任务时,容器号为空");
  484 + }
  485 + if(StringUtils.isEmpty(warehouseCode)) {
  486 + return Result.error("创建空托盘组入库任务时,仓库编码为空");
  487 + }
  488 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  489 + if(container == null) {
  490 + return Result.error("创建空托盘组入库任务时,没有找到容器");
  491 + }
  492 + if (StringUtils.isNotEmpty(container.getLocationCode())) {
  493 + return Result.error("创建空托盘组入库任务时, 容器已在库位" + container.getLocationCode() + "上");
  494 + }
  495 + if (!container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)) {
  496 + return Result.error("创建空托盘组入库任务时,容器状态不为空容器");
  497 + }
  498 + boolean success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  499 + if(!success) {
  500 + throw new ServiceException("创建空托盘组入库任务时, 更新容器状态失败");
  501 + }
  502 + if(StringUtils.isNotEmpty(toLocationCode)) {
  503 + Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
  504 + if (toLocation == null) {
  505 + return Result.error("创建空托盘组入库任务时,没有找到目标库位");
  506 + }
  507 + if (toLocation.getStatus() != QuantityConstant.STATUS_LOCATION_EMPTY) {
  508 + return Result.error("创建空托盘组入库任务时,目标库位状态不是空闲");
  509 + }
  510 + success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  511 + if (!success) {
  512 + throw new ServiceException("创建空托盘组入库任务时, 更新库位状态失败");
  513 + }
  514 + }
  515 + TaskHeader taskHeader = new TaskHeader();
  516 + taskHeader.setWarehouseCode(warehouseCode);
  517 + taskHeader.setContainerCode(containerCode);
  518 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT);
  519 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT);
  520 + taskHeader.setToLocationCode(toLocationCode);
  521 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  522 + success =taskHeaderService.save(taskHeader);
  523 + if(!success) {
  524 + throw new ServiceException("创建空托盘组入库任务时, 创建任务失败");
  525 + }
  526 + return Result.ok("创建空托盘组入库任务成功");
  527 + }
  528 +
  529 + @Override
  530 + @Transactional(rollbackFor = Exception.class)
  531 + public Result createManyEmptyOutTask(String zoneCode, String toPortCode, String warehouseCode) {
  532 + if(StringUtils.isEmpty(toPortCode)) {
  533 + return Result.error("创建空托盘组出库任务时,目标出入口为空");
  534 + }
  535 + if(StringUtils.isEmpty(zoneCode)) {
  536 + return Result.error("创建空托盘组出库任务时,库区编码为空");
  537 + }
  538 + if(StringUtils.isEmpty(warehouseCode)) {
  539 + return Result.error("创建空托盘组出库任务时,仓库编码为空");
  540 + }
  541 + List<Container> containerList = containerService.getContainerListByStatus(
  542 + QuantityConstant.STATUS_CONTAINER_MANY, warehouseCode);
  543 + if(containerList.size() == 0) {
  544 + return Result.error("创建空托盘组出库任务时,没有找到空托盘组");
  545 + }
  546 + List<Container> removeContainerList = new ArrayList<>();
  547 + if(containerList.size() > 0) {
  548 + for(Container container : containerList) {
  549 + String locationCode = container.getLocationCode();
  550 + Location location = locationService.getLocationByCode(locationCode, warehouseCode);
  551 + if(!location.getZoneCode().equals(zoneCode)) {
  552 + removeContainerList.add(container);
  553 + }
  554 + }
  555 + }
  556 + boolean success = containerList.removeAll(removeContainerList);
  557 + if(!success) {
  558 + throw new ServiceException("创建空托盘组出库任务时,删除不符合的空托盘组失败");
  559 + }
  560 + if(containerList.size() <= 0) {
  561 + throw new ServiceException("没有找到合适的空托盘组!");
  562 + }
  563 + String containerCode = containerList.get(0).getCode();
  564 + TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode);
  565 + if(taskHeader != null) {
  566 + return Result.ok("创建空托盘组出库任务时, 已经生成空托盘组出库任务");
  567 + }
  568 + Result result = createManyEmptyOut(containerCode, toPortCode, warehouseCode);
  569 + if(!result.isSuccess()) {
  570 + throw new ServiceException(result.getMessage());
  571 + }
  572 + return Result.ok("创建空托盘组出库任务成功");
  573 + }
  574 +
  575 + @Override
  576 + @Transactional(rollbackFor = Exception.class)
  577 + public Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode) {
  578 + if(StringUtils.isEmpty(containerCode)) {
  579 + return Result.error("创建空托盘组出库任务时,托盘号为空");
  580 + }
  581 + if(StringUtils.isEmpty(toPortCode)) {
  582 + return Result.error("创建空托盘组出库任务时,目标出入口为空");
  583 + }
  584 + if(StringUtils.isEmpty(warehouseCode)) {
  585 + return Result.error("创建空托盘组出库任务时,仓库编码为空");
  586 + }
  587 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  588 + if(container == null) {
  589 + return Result.error("创建空托盘组出库任务时, 没有找到容器:" + containerCode);
  590 + }
  591 + if(!QuantityConstant.STATUS_CONTAINER_MANY.equals(container.getStatus())) {
  592 + return Result.error("创建空托盘组出库任务时, 容器状态不为空托盘组状态");
  593 + }
  594 + String fromLocationCode = container.getLocationCode();
  595 + if(StringUtils.isEmpty(fromLocationCode)) {
  596 + return Result.error("创建空托盘组出库任务时, 该容器不在库位上");
  597 + }
  598 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  599 + if(fromLocation == null) {
  600 + return Result.error("创建空托盘组出库任务时, 没有找到库位:" + fromLocationCode);
  601 + }
  602 + String zoneCode = fromLocation.getZoneCode();
  603 + if(StringUtils.isEmpty(zoneCode)) {
  604 + return Result.error("创建空托盘组出库任务时, 库区为空");
  605 + }
  606 + boolean success = containerService.updateStatus(containerCode,
  607 + QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  608 + if (!success) {
  609 + throw new ServiceException("创建空托盘组出库任务时, 更新容器状态失败");
  610 + }
  611 + success = locationService.updateStatus(fromLocationCode,
  612 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  613 + if (!success) {
  614 + throw new ServiceException("创建空托盘组出库任务时, 更新库位状态失败");
  615 + }
  616 + TaskHeader taskHeader = new TaskHeader();
  617 + taskHeader.setWarehouseCode(warehouseCode);
  618 + taskHeader.setZoneCode(zoneCode);
  619 + taskHeader.setContainerCode(containerCode);
  620 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT);
  621 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT);
  622 + taskHeader.setFromLocationCode(fromLocationCode);
  623 + taskHeader.setToPortCode(toPortCode);
  624 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  625 + success = taskHeaderService.save(taskHeader);
  626 + if(!success) {
  627 + throw new ServiceException("创建空托盘组出库任务时,生成任务失败");
  628 + }
  629 + return Result.ok("创建空托盘组出库任务成功");
278 } 630 }
279 631
280 @Override 632 @Override
@@ -306,6 +658,26 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -306,6 +658,26 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
306 return taskHeader; 658 return taskHeader;
307 } 659 }
308 660
  661 + @Override
  662 + public TaskHeader getUnCompleteTaskByContainerCode(String containerCode, String warehouseCode) {
  663 + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  664 + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getContainerCode, containerCode)
  665 + .eq(TaskHeader::getWarehouseCode, warehouseCode)
  666 + .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED);
  667 + TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
  668 + return taskHeader;
  669 + }
  670 +
  671 + @Override
  672 + public TaskHeader getUnCompleteTaskByPreTaskNo(int preTaskNo, String warehouseCode) {
  673 + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  674 + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getPreTaskNo, preTaskNo)
  675 + .eq(TaskHeader::getWarehouseCode, warehouseCode)
  676 + .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED);
  677 + TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
  678 + return taskHeader;
  679 + }
  680 +
309 /** 681 /**
310 * WMS完成任务 682 * WMS完成任务
311 */ 683 */
@@ -319,12 +691,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -319,12 +691,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
319 if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { 691 if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) {
320 return Result.ok("任务(" +taskId + ")任务已经是完成的!"); 692 return Result.ok("任务(" +taskId + ")任务已经是完成的!");
321 } 693 }
322 - if (StringUtils.isEmpty(taskHeader.getFromLocationCode())  
323 - && StringUtils.isEmpty(taskHeader.getToLocationCode())) {  
324 - return Result.error("任务" + taskId + "没有库位,执行中止"); 694 + int taskType = taskHeader.getTaskType().intValue();
  695 + if(taskType != QuantityConstant.TASK_TYPE_OVER_STATION) {
  696 + if (StringUtils.isEmpty(taskHeader.getFromLocationCode())
  697 + && StringUtils.isEmpty(taskHeader.getToLocationCode())) {
  698 + return Result.error("任务" + taskId + "没有库位,执行中止");
  699 + }
325 } 700 }
326 Result result = null; 701 Result result = null;
327 - int taskType = taskHeader.getTaskType().intValue();  
328 switch (taskType) { 702 switch (taskType) {
329 //整盘入库、补充入库 703 //整盘入库、补充入库
330 case QuantityConstant.TASK_TYPE_WHOLERECEIPT: 704 case QuantityConstant.TASK_TYPE_WHOLERECEIPT:
@@ -335,6 +709,65 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -335,6 +709,65 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
335 case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: 709 case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT:
336 result = completeShipmentTask(taskHeader); 710 result = completeShipmentTask(taskHeader);
337 break; 711 break;
  712 + case QuantityConstant.TASK_TYPE_EMPTYRECEIPT:
  713 + result = completeEmptyInTask(taskHeader);
  714 + break;
  715 + case QuantityConstant.TASK_TYPE_EMPTYSHIPMENT:
  716 + result = completeEmptyOutTask(taskHeader);
  717 + break;
  718 + case QuantityConstant.TASK_TYPE_TRANSFER:
  719 + result = completeTransferTask(taskHeader);
  720 + break;
  721 + case QuantityConstant.TASK_TYPE_CHECK_OUT:
  722 + result = completeCheckOutTask(taskHeader);
  723 + break;
  724 + case QuantityConstant.TASK_TYPE_OVER_STATION:
  725 + result = completeOverStationTask(taskHeader);
  726 + break;
  727 + case QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT:
  728 + result = completeManyEmptyInTask(taskHeader);
  729 + break;
  730 + case QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT:
  731 + result = completeManyEmptyOutTask(taskHeader);
  732 + break;
  733 + default:
  734 + throw new ServiceException("不支持的任务类型" + taskType);
  735 + }
  736 + return result;
  737 + }
  738 +
  739 + @Override
  740 + public Result cancelTask(Integer taskId) {
  741 + TaskHeader taskHeader = getById(taskId);
  742 + if(taskHeader == null) {
  743 + return Result.error("任务" + taskId + "未找到,执行中止");
  744 + }
  745 + if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) {
  746 + return Result.ok("任务(" +taskId + ")任务已经是完成的!");
  747 + }
  748 + int taskType = taskHeader.getTaskType().intValue();
  749 + int preTaskNo = taskId;
  750 + String warehouseCode = taskHeader.getWarehouseCode();
  751 + TaskHeader preTaskHeader = getUnCompleteTaskByPreTaskNo(preTaskNo, warehouseCode);
  752 + if (preTaskHeader != null) {
  753 + return Result.error("取消任务失败,有前置任务" + preTaskHeader.getId());
  754 + }
  755 + boolean success = taskHeaderService.removeById(taskId);
  756 + if(!success) {
  757 + return Result.error("取消任务失败, 删除任务失败");
  758 + }
  759 + Result result = null;
  760 + switch (taskType) {
  761 + case QuantityConstant.TASK_TYPE_WHOLERECEIPT:
  762 + case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT:
  763 + cancelLocationAndContainerStatus(taskHeader);
  764 + result = cancelReceiptTask(taskHeader);
  765 + break;
  766 + case QuantityConstant.TASK_TYPE_WHOLESHIPMENT:
  767 + case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT:
  768 + cancelLocationAndContainerStatus(taskHeader);
  769 + result = cancelShipmentTask(taskHeader);
  770 + break;
338 default: 771 default:
339 throw new ServiceException("不支持的任务类型" + taskType); 772 throw new ServiceException("不支持的任务类型" + taskType);
340 } 773 }
@@ -342,6 +775,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -342,6 +775,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
342 } 775 }
343 776
344 @Override 777 @Override
  778 + @Transactional(rollbackFor = Exception.class)
345 public Result sendTaskToWcs(Integer taskId) { 779 public Result sendTaskToWcs(Integer taskId) {
346 TaskHeader taskHeader = taskHeaderService.getById(taskId); 780 TaskHeader taskHeader = taskHeaderService.getById(taskId);
347 if(taskHeader == null) { 781 if(taskHeader == null) {
@@ -363,64 +797,141 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -363,64 +797,141 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
363 return Result.ok("执行下发任务成功"); 797 return Result.ok("执行下发任务成功");
364 } 798 }
365 799
  800 + /**
  801 + * 创建空托盘入库
  802 + * 1. 判断托盘号、库位号是否满足要求
  803 + * 2. 创建任务,锁定容器、库位
  804 + * @param containerCode
  805 + * @param toLocationCode
  806 + * @param warehouseCode
  807 + * @return
  808 + */
  809 + @Override
366 @Transactional(rollbackFor = Exception.class) 810 @Transactional(rollbackFor = Exception.class)
367 - public boolean combineInventoryDetail(TaskHeader taskHeader) {  
368 - boolean success = false;  
369 - String warehouseCode = taskHeader.getWarehouseCode();  
370 - String containerCode = taskHeader.getContainerCode();  
371 -  
372 - InventoryHeader inventoryHeader = inventoryHeaderService.  
373 - getInventoryHeaderByContainerCode(containerCode, warehouseCode);  
374 - if(inventoryHeader == null) {  
375 - throw new ServiceException("合并库存时, 没有找到库存头");  
376 - }  
377 - List<InventoryDetail> inventoryDetailList = inventoryDetailService.  
378 - getInventoryDetailListByInventoryHeaderId(inventoryHeader.getId());  
379 - if(inventoryDetailList.size() == 0) {  
380 - throw new ServiceException("合并库存时, 没有找到库存详情");  
381 - }  
382 -// if(inventoryDetailList.size() == 1) {  
383 -// return true;  
384 -// }  
385 - for (int i = 0; i < inventoryDetailList.size() - 1; i++) {  
386 - for (int j = inventoryDetailList.size() - 1; j > i; j--) {  
387 - InventoryDetail inventoryDetail1 = inventoryDetailList.get(i);  
388 - InventoryDetail inventoryDetail2 = inventoryDetailList.get(j);  
389 - if (inventoryDetail1.getMaterialCode().equals(inventoryDetail2.getMaterialCode())  
390 - && inventoryDetail1.getBatch().equals(inventoryDetail2.getBatch())  
391 - && inventoryDetail1.getLot().equals(inventoryDetail2.getLot())  
392 - && inventoryDetail1.getProject().equals(inventoryDetail2.getProject())) {  
393 - BigDecimal totalQty = inventoryDetail1.getQty().add(inventoryDetail2.getQty());  
394 - inventoryDetail1.setQty(totalQty);  
395 - success = inventoryDetailService.updateById(inventoryDetail1);  
396 - if(!success) {  
397 - throw new ServiceException("合并库存时, 更新库存详情失败:" + inventoryDetail1.getId());  
398 - }  
399 - success = inventoryDetailService.removeById(inventoryDetail2.getId());  
400 - if(!success) {  
401 - throw new ServiceException("合并库存时, 删除库存详情失败:" + inventoryDetail2.getId());  
402 - }  
403 - inventoryDetailList.remove(j);  
404 - }  
405 - } 811 + public Result createEmptyIn(String containerCode, String toLocationCode, String warehouseCode) {
  812 + if(StringUtils.isEmpty(containerCode)) {
  813 + return Result.error("创建空托盘入库时, 托盘号为空");
406 } 814 }
407 - BigDecimal totalQty = new BigDecimal(0);  
408 - int totalLines = 0;  
409 - for (InventoryDetail inventoryDetail : inventoryDetailList) {  
410 - totalQty = totalQty.add(inventoryDetail.getQty());  
411 - totalLines++; 815 + if(StringUtils.isEmpty(warehouseCode)) {
  816 + return Result.error("创建空托盘入库时, 仓库编码为空");
412 } 817 }
413 Container container = containerService.getContainerByCode(containerCode, warehouseCode); 818 Container container = containerService.getContainerByCode(containerCode, warehouseCode);
414 if(container == null) { 819 if(container == null) {
415 - throw new ServiceException("合并库存时, 没有找到容器, 容器号为" + containerCode); 820 + return Result.error("创建空托盘入库时, 没有找到托盘" + containerCode);
416 } 821 }
417 - inventoryHeader.setTotalQty(totalQty);  
418 - inventoryHeader.setTotalLines(totalLines);  
419 - inventoryHeader.setContainerStatus(container.getStatus());  
420 - success = inventoryHeaderService.updateById(inventoryHeader);  
421 - return success;  
422 - }  
423 - /** 822 + if(!container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)) {
  823 + return Result.error("创建空托盘入库时, 托盘状态并非空托盘状态");
  824 + }
  825 + if (StringUtils.isNotEmpty(container.getLocationCode())) {
  826 + return Result.error("创建空托盘入库时, 容器已在库位" + container.getLocationCode() + "上");
  827 + }
  828 +
  829 + if (StringUtils.isNotEmpty(toLocationCode)) {
  830 + Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
  831 + if (toLocation == null) {
  832 + return Result.error("创建空托盘入库时," + toLocationCode + "目标库位不存在" );
  833 + }
  834 + if (StringUtils.isNotEmpty(toLocation.getContainerCode())) {
  835 + return Result.error("创建空托盘入库时," + toLocationCode+"上已存在容器" + toLocation.getContainerCode());
  836 + }
  837 + if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(toLocation.getStatus())) {
  838 + return Result.error("创建空托盘入库时, 目标库位非空闲");
  839 + }
  840 + boolean success = locationService.updateStatus(toLocationCode,
  841 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  842 + if(!success) {
  843 + throw new ServiceException("创建空托盘入库时,更新库位状态失败");
  844 + }
  845 + }
  846 +
  847 + boolean success = containerService.updateStatus(containerCode,
  848 + QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  849 + if(!success) {
  850 + throw new ServiceException("创建空托盘入库时,更新容器状态失败");
  851 + }
  852 + TaskHeader taskHeader = new TaskHeader();
  853 + taskHeader.setWarehouseCode(warehouseCode);
  854 + taskHeader.setContainerCode(containerCode);
  855 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYRECEIPT);
  856 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT);
  857 + taskHeader.setToLocationCode(toLocationCode);
  858 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  859 + success = taskHeaderService.save(taskHeader);
  860 + if(!success) {
  861 + throw new ServiceException("创建空托盘入库时,保存任务失败");
  862 + }
  863 + return Result.OK("创建空托盘入库任务成功");
  864 + }
  865 +
  866 + /**
  867 + * 创建空托盘出库
  868 + * @param containerCode
  869 + * @param toPortCode
  870 + * @param warehouseCode
  871 + * @return
  872 + */
  873 + @Override
  874 + @Transactional(rollbackFor = Exception.class)
  875 + public Result createEmptyOut(String containerCode, String toPortCode, String warehouseCode) {
  876 + if(StringUtils.isEmpty(containerCode)) {
  877 + return Result.error("创建空托盘出库时, 托盘号为空");
  878 + }
  879 + if(StringUtils.isEmpty(toPortCode)) {
  880 + return Result.error("创建空托盘出库时, 出库口为空");
  881 + }
  882 + if(StringUtils.isEmpty(warehouseCode)) {
  883 + return Result.error("创建空托盘出库时, 仓库编码为空");
  884 + }
  885 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  886 + if(container == null) {
  887 + return Result.error("创建空托盘出库时, 没有找到托盘" + containerCode);
  888 + }
  889 + if(!container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)) {
  890 + return Result.error("创建空托盘出库时, 托盘状态并非空托盘状态");
  891 + }
  892 + String fromLocationCode = container.getLocationCode();
  893 + if (StringUtils.isEmpty(fromLocationCode)) {
  894 + return Result.error("创建空托盘出库时, 容器不在库位上");
  895 + }
  896 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  897 + if(fromLocation == null) {
  898 + return Result.error("创建空托盘出库时, 起始库位为空");
  899 + }
  900 + String zoneCode = fromLocation.getZoneCode();
  901 + if (StringUtils.isEmpty(zoneCode)) {
  902 + return Result.error("创建空托盘出库时, 起始库位的库区为空");
  903 + }
  904 + Port port = portService.getPortByCode(toPortCode, zoneCode, warehouseCode);
  905 + if(port == null) {
  906 + return Result.error("创建空托盘出库时, 没有找到出库口" + toPortCode);
  907 + }
  908 + boolean success = locationService.updateStatus(fromLocationCode,
  909 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  910 + if(!success) {
  911 + throw new ServiceException("创建空托盘出库时,更新库位状态失败");
  912 + }
  913 + success = containerService.updateStatus(containerCode,
  914 + QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  915 + if(!success) {
  916 + throw new ServiceException("创建空托盘出库时,更新容器状态失败");
  917 + }
  918 + TaskHeader taskHeader = new TaskHeader();
  919 + taskHeader.setWarehouseCode(warehouseCode);
  920 + taskHeader.setZoneCode(zoneCode);
  921 + taskHeader.setContainerCode(containerCode);
  922 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT);
  923 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT);
  924 + taskHeader.setFromLocationCode(fromLocationCode);
  925 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  926 + taskHeader.setToPortCode(toPortCode);
  927 + success = taskHeaderService.save(taskHeader);
  928 + if(!success) {
  929 + throw new ServiceException("创建空托盘出库时,保存任务失败");
  930 + }
  931 + return Result.OK("创建空托盘出库任务成功");
  932 + }
  933 +
  934 + /**
424 * 完成入库任务 935 * 完成入库任务
425 * @param taskHeader 任务 936 * @param taskHeader 任务
426 * @return AjaxResult 完成入库任务结果 937 * @return AjaxResult 完成入库任务结果
@@ -520,7 +1031,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -520,7 +1031,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
520 inventoryTransaction.setWarehouseCode(taskDetail.getWarehouseCode()); 1031 inventoryTransaction.setWarehouseCode(taskDetail.getWarehouseCode());
521 inventoryTransaction.setCompanyCode(taskDetail.getCompanyCode()); 1032 inventoryTransaction.setCompanyCode(taskDetail.getCompanyCode());
522 inventoryTransaction.setContainerCode(containerCode); 1033 inventoryTransaction.setContainerCode(containerCode);
523 - inventoryTransaction.setLocationCode(toLocationCode); 1034 + inventoryTransaction.setToLocationCode(toLocationCode);
524 inventoryTransaction.setMaterialCode(taskDetail.getMaterialCode()); 1035 inventoryTransaction.setMaterialCode(taskDetail.getMaterialCode());
525 inventoryTransaction.setMaterialName(taskDetail.getMaterialName()); 1036 inventoryTransaction.setMaterialName(taskDetail.getMaterialName());
526 inventoryTransaction.setMaterialSpec(taskDetail.getMaterialSpec()); 1037 inventoryTransaction.setMaterialSpec(taskDetail.getMaterialSpec());
@@ -673,7 +1184,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -673,7 +1184,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
673 inventoryTransaction.setWarehouseCode(warehouseCode); 1184 inventoryTransaction.setWarehouseCode(warehouseCode);
674 inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); 1185 inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode());
675 inventoryTransaction.setContainerCode(containerCode); 1186 inventoryTransaction.setContainerCode(containerCode);
676 - inventoryTransaction.setLocationCode(fromLocationCode); 1187 + inventoryTransaction.setFromLocationCode(fromLocationCode);
677 inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); 1188 inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode());
678 inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); 1189 inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName());
679 inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec()); 1190 inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec());
@@ -766,4 +1277,585 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -766,4 +1277,585 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
766 } 1277 }
767 return Result.ok("完成出库任务"); 1278 return Result.ok("完成出库任务");
768 } 1279 }
  1280 +
  1281 + @Transactional(rollbackFor = Exception.class)
  1282 + public boolean combineInventoryDetail(TaskHeader taskHeader) {
  1283 + boolean success = false;
  1284 + String warehouseCode = taskHeader.getWarehouseCode();
  1285 + String containerCode = taskHeader.getContainerCode();
  1286 +
  1287 + InventoryHeader inventoryHeader = inventoryHeaderService.
  1288 + getInventoryHeaderByContainerCode(containerCode, warehouseCode);
  1289 + if(inventoryHeader == null) {
  1290 + throw new ServiceException("合并库存时, 没有找到库存头");
  1291 + }
  1292 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.
  1293 + getInventoryDetailListByInventoryHeaderId(inventoryHeader.getId());
  1294 + if(inventoryDetailList.size() == 0) {
  1295 + throw new ServiceException("合并库存时, 没有找到库存详情");
  1296 + }
  1297 + for (int i = 0; i < inventoryDetailList.size() - 1; i++) {
  1298 + for (int j = inventoryDetailList.size() - 1; j > i; j--) {
  1299 + InventoryDetail inventoryDetail1 = inventoryDetailList.get(i);
  1300 + InventoryDetail inventoryDetail2 = inventoryDetailList.get(j);
  1301 + if (inventoryDetail1.getMaterialCode().equals(inventoryDetail2.getMaterialCode())
  1302 + && inventoryDetail1.getBatch().equals(inventoryDetail2.getBatch())
  1303 + && inventoryDetail1.getLot().equals(inventoryDetail2.getLot())
  1304 + && inventoryDetail1.getProject().equals(inventoryDetail2.getProject())) {
  1305 + BigDecimal totalQty = inventoryDetail1.getQty().add(inventoryDetail2.getQty());
  1306 + inventoryDetail1.setQty(totalQty);
  1307 + success = inventoryDetailService.updateById(inventoryDetail1);
  1308 + if(!success) {
  1309 + throw new ServiceException("合并库存时, 更新库存详情失败:" + inventoryDetail1.getId());
  1310 + }
  1311 + success = inventoryDetailService.removeById(inventoryDetail2.getId());
  1312 + if(!success) {
  1313 + throw new ServiceException("合并库存时, 删除库存详情失败:" + inventoryDetail2.getId());
  1314 + }
  1315 + inventoryDetailList.remove(j);
  1316 + }
  1317 + }
  1318 + }
  1319 + BigDecimal totalQty = new BigDecimal(0);
  1320 + int totalLines = 0;
  1321 + for (InventoryDetail inventoryDetail : inventoryDetailList) {
  1322 + totalQty = totalQty.add(inventoryDetail.getQty());
  1323 + totalLines++;
  1324 + }
  1325 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1326 + if(container == null) {
  1327 + throw new ServiceException("合并库存时, 没有找到容器, 容器号为" + containerCode);
  1328 + }
  1329 + inventoryHeader.setTotalQty(totalQty);
  1330 + inventoryHeader.setTotalLines(totalLines);
  1331 + inventoryHeader.setContainerStatus(container.getStatus());
  1332 + success = inventoryHeaderService.updateById(inventoryHeader);
  1333 + return success;
  1334 + }
  1335 +
  1336 + /**
  1337 + * 完成空托盘入库任务
  1338 + * @param taskHeader 任务
  1339 + * @return Result 完成入库任务结果
  1340 + */
  1341 + @Transactional(rollbackFor = Exception.class)
  1342 + public Result completeEmptyInTask(TaskHeader taskHeader) {
  1343 + String warehouseCode = taskHeader.getWarehouseCode();
  1344 + String toLocationCode = taskHeader.getToLocationCode();
  1345 + String containerCode = taskHeader.getContainerCode();
  1346 + if(StringUtils.isEmpty(containerCode)) {
  1347 + return Result.error("完成空托盘入库任务时, 托盘号为空");
  1348 + }
  1349 + if(StringUtils.isEmpty(warehouseCode)) {
  1350 + return Result.error("完成空托盘入库任务时, 仓库编码为空");
  1351 + }
  1352 + if(StringUtils.isEmpty(toLocationCode)) {
  1353 + return Result.error("完成空托盘入库任务时, 目标库位号为空");
  1354 + }
  1355 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1356 + if(container == null) {
  1357 + return Result.error("完成空托盘入库任务时, 没有找到托盘" + containerCode);
  1358 + }
  1359 + Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
  1360 + if (toLocation == null) {
  1361 + return Result.error("完成空托盘入库任务时," + toLocationCode + "目标库位不存在" );
  1362 + }
  1363 + boolean success = containerService.updateLocationCodeAndStatus(containerCode,
  1364 + toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  1365 + if(!success) {
  1366 + throw new ServiceException("完成空托盘入库任务时, 更新容器的库位号和状态失败");
  1367 + }
  1368 + success = locationService.updateContainerCodeAndStatus(toLocationCode,
  1369 + containerCode, QuantityConstant.STATUS_LOCATION_EMPTY,warehouseCode);
  1370 + if(!success) {
  1371 + throw new ServiceException("完成空托盘入库任务时, 更新库位的容器号和状态失败");
  1372 + }
  1373 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1374 + success = taskHeaderService.updateById(taskHeader);
  1375 + if(!success) {
  1376 + throw new ServiceException("完成空托盘入库任务时, 更新任务失败");
  1377 + }
  1378 + return Result.OK("完成空托盘入库成功");
  1379 + }
  1380 +
  1381 + /**
  1382 + * 完成空托盘出库任务
  1383 + * @param taskHeader 任务
  1384 + * @return Result 完成出库任务结果
  1385 + */
  1386 + @Transactional(rollbackFor = Exception.class)
  1387 + public Result completeEmptyOutTask(TaskHeader taskHeader) {
  1388 + String warehouseCode = taskHeader.getWarehouseCode();
  1389 + String fromLocationCode = taskHeader.getFromLocationCode();
  1390 + String containerCode = taskHeader.getContainerCode();
  1391 + String toPortCode = taskHeader.getToPortCode();
  1392 + String zoneCode = taskHeader.getZoneCode();
  1393 + if(StringUtils.isEmpty(containerCode)) {
  1394 + return Result.error("完成空托盘出库任务时, 托盘号为空");
  1395 + }
  1396 + if(StringUtils.isEmpty(warehouseCode)) {
  1397 + return Result.error("完成空托盘出库任务时, 仓库编码为空");
  1398 + }
  1399 + if(StringUtils.isEmpty(fromLocationCode)) {
  1400 + return Result.error("完成空托盘出库任务时, 起始库位号为空");
  1401 + }
  1402 + if(StringUtils.isEmpty(toPortCode)) {
  1403 + return Result.error("完成空托盘出库任务时, 目标出入口号为空");
  1404 + }
  1405 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1406 + if(container == null) {
  1407 + return Result.error("完成空托盘出库任务时, 没有找到托盘" + containerCode);
  1408 + }
  1409 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  1410 + if (fromLocation == null) {
  1411 + return Result.error("完成空托盘出库任务时," + fromLocationCode + "目标库位不存在" );
  1412 + }
  1413 + Port port = portService.getPortByCode(toPortCode, zoneCode, warehouseCode);
  1414 + if(port == null) {
  1415 + return Result.error("完成空托盘出库任务时," + toPortCode + "目标出库口不存在" );
  1416 + }
  1417 + boolean success = containerService.updateLocationCodeAndStatus(containerCode,
  1418 + QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  1419 + if(!success) {
  1420 + throw new ServiceException("完成空托盘出库任务时, 更新容器的库位号和状态失败");
  1421 + }
  1422 + success = locationService.updateContainerCodeAndStatus(fromLocationCode,
  1423 + QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1424 + if(!success) {
  1425 + throw new ServiceException("完成空托盘出库任务时, 更新库位的容器号和状态失败");
  1426 + }
  1427 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1428 + success = taskHeaderService.updateById(taskHeader);
  1429 + if(!success) {
  1430 + throw new ServiceException("完成空托盘出库任务时, 更新任务失败");
  1431 + }
  1432 + return Result.OK("完成空托盘出库成功");
  1433 + }
  1434 +
  1435 + /**
  1436 + * 完成移库任务
  1437 + * @param taskHeader 任务
  1438 + * @return Result 完成移库任务结果
  1439 + */
  1440 + @Transactional(rollbackFor = Exception.class)
  1441 + public Result completeTransferTask(TaskHeader taskHeader) {
  1442 + String warehouseCode = taskHeader.getWarehouseCode();
  1443 + String containerCode = taskHeader.getContainerCode();
  1444 + String fromLocationCode = taskHeader.getFromLocationCode();
  1445 + String toLocationCode = taskHeader.getToLocationCode();
  1446 +
  1447 + if(StringUtils.isEmpty(containerCode)) {
  1448 + return Result.error("完成移库任务时, 托盘号为空");
  1449 + }
  1450 + if(StringUtils.isEmpty(warehouseCode)) {
  1451 + return Result.error("完成移库任务时, 仓库编码为空");
  1452 + }
  1453 + if(StringUtils.isEmpty(fromLocationCode)) {
  1454 + return Result.error("完成移库任务时, 起始库位号为空");
  1455 + }
  1456 + if(StringUtils.isEmpty(toLocationCode)) {
  1457 + return Result.error("完成移库任务时, 目标库位号为空");
  1458 + }
  1459 +
  1460 + List<InventoryTransaction> inventoryTransactionList = new ArrayList<>();
  1461 + LambdaUpdateWrapper<InventoryDetail> inventoryDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  1462 + inventoryDetailLambdaUpdateWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode)
  1463 + .eq(InventoryDetail::getContainerCode, containerCode)
  1464 + .eq(InventoryDetail::getLocationCode, fromLocationCode);
  1465 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaUpdateWrapper);
  1466 + for(InventoryDetail inventoryDetail : inventoryDetailList) {
  1467 + inventoryDetail.setLocationCode(toLocationCode);
  1468 + InventoryTransaction inventoryTransaction = new InventoryTransaction();
  1469 + inventoryTransaction.setWarehouseCode(inventoryDetail.getWarehouseCode());
  1470 + inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode());
  1471 + inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode());
  1472 + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_TRANSFER);
  1473 + inventoryTransaction.setFromLocationCode(fromLocationCode);
  1474 + inventoryTransaction.setToLocationCode(toLocationCode);
  1475 + inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode());
  1476 + inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName());
  1477 + inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec());
  1478 + inventoryTransaction.setMaterialUnit(inventoryDetail.getMaterialUnit());
  1479 + inventoryTransaction.setQty(inventoryDetail.getQty());
  1480 + inventoryTransaction.setInventoryStatus(inventoryDetail.getInventoryStatus());
  1481 + inventoryTransaction.setBatch(inventoryDetail.getBatch());
  1482 + inventoryTransaction.setProject(inventoryDetail.getProject());
  1483 + inventoryTransaction.setLot(inventoryDetail.getLot());
  1484 + inventoryTransactionList.add(inventoryTransaction);
  1485 + }
  1486 + boolean success = false;
  1487 + if(inventoryTransactionList.size() > 0) {
  1488 + success = inventoryTransactionService.saveBatch(inventoryTransactionList);
  1489 + if (!success) {
  1490 + throw new ServiceException("完成移库任务时,保存库存交易失败");
  1491 + }
  1492 + }
  1493 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1494 + success = taskHeaderService.updateById(taskHeader);
  1495 + if(!success) {
  1496 + throw new ServiceException("完成移库任务时, 更新任务失败");
  1497 + }
  1498 + if(inventoryDetailList.size() > 0) {
  1499 + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode,
  1500 + QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode);
  1501 + if(!success) {
  1502 + throw new ServiceException("完成移库任务时, 更新容器状态失败");
  1503 + }
  1504 + } else {
  1505 + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode,
  1506 + QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  1507 + if(!success) {
  1508 + throw new ServiceException("完成移库任务时, 更新容器状态失败");
  1509 + }
  1510 + }
  1511 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1512 + container.setLastStatus(QuantityConstant.EMPTY_STRING);
  1513 + success = containerService.updateById(container);
  1514 + if(!success) {
  1515 + throw new ServiceException("完成移库任务时, 更新容器状态失败");
  1516 + }
  1517 + success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING,
  1518 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1519 + if(!success) {
  1520 + throw new ServiceException("完成移库任务时, 更新起始库位状态失败");
  1521 + }
  1522 + success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode,
  1523 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1524 + if(!success) {
  1525 + throw new ServiceException("完成移库任务时, 更新目标库位状态失败");
  1526 + }
  1527 + LambdaUpdateWrapper<InventoryHeader> inventoryHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  1528 + inventoryHeaderLambdaUpdateWrapper.eq(InventoryHeader::getWarehouseCode, warehouseCode)
  1529 + .eq(InventoryHeader::getContainerCode, containerCode)
  1530 + .eq(InventoryHeader::getLocationCode, fromLocationCode);
  1531 + InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaUpdateWrapper);
  1532 + if(inventoryHeader != null) {
  1533 + inventoryHeader.setLocationCode(toLocationCode);
  1534 + success = inventoryHeaderService.updateById(inventoryHeader);
  1535 + if(!success) {
  1536 + throw new ServiceException("完成移库任务时, 更新库存头失败");
  1537 + }
  1538 + }
  1539 + if(inventoryDetailList.size() != 0) {
  1540 + success = inventoryDetailService.updateBatchById(inventoryDetailList);
  1541 + if(!success) {
  1542 + throw new ServiceException("完成移库任务时, 更新库存详情失败");
  1543 + }
  1544 + }
  1545 + return Result.OK("完成移库任务成功");
  1546 + }
  1547 +
  1548 + /**
  1549 + * 完成出库查看任务
  1550 + * @param taskHeader 任务
  1551 + * @return Result 完成出库查看任务结果
  1552 + */
  1553 + @Transactional(rollbackFor = Exception.class)
  1554 + public Result completeCheckOutTask(TaskHeader taskHeader) {
  1555 + String warehouseCode = taskHeader.getWarehouseCode();
  1556 + String containerCode = taskHeader.getContainerCode();
  1557 + String fromLocationCode = taskHeader.getFromLocationCode();
  1558 + String toLocationCode = taskHeader.getToLocationCode();
  1559 + String toPortCode = taskHeader.getToPortCode();
  1560 +
  1561 + if(StringUtils.isEmpty(containerCode)) {
  1562 + return Result.error("完成出库查看任务时, 托盘号为空");
  1563 + }
  1564 + if(StringUtils.isEmpty(warehouseCode)) {
  1565 + return Result.error("完成出库查看任务时, 仓库编码为空");
  1566 + }
  1567 + if(StringUtils.isEmpty(fromLocationCode)) {
  1568 + return Result.error("完成出库查看任务时, 起始库位号为空");
  1569 + }
  1570 + if(StringUtils.isEmpty(toPortCode)) {
  1571 + return Result.error("完成出库查看任务时, 目标出入口号为空");
  1572 + }
  1573 + if(StringUtils.isEmpty(toLocationCode)) {
  1574 + return Result.error("完成出库查看任务时, 目标库位号为空");
  1575 + }
  1576 +
  1577 + boolean success = false;
  1578 + LambdaUpdateWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaUpdate();
  1579 + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode)
  1580 + .eq(InventoryDetail::getContainerCode, containerCode)
  1581 + .eq(InventoryDetail::getLocationCode, fromLocationCode);
  1582 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper);
  1583 + if(inventoryDetailList.size() != 0) {
  1584 + for (InventoryDetail inventoryDetail : inventoryDetailList) {
  1585 + inventoryDetail.setTaskQty(BigDecimal.ZERO);
  1586 + }
  1587 + success = inventoryDetailService.updateBatchById(inventoryDetailList);
  1588 + if (!success) {
  1589 + throw new ServiceException("完成出库查看任务时,更新库存详情失败");
  1590 + }
  1591 + success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode);
  1592 + if (!success) {
  1593 + throw new ServiceException("完成出库查看任务时,更新容器状态失败");
  1594 + }
  1595 + } else {
  1596 + success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  1597 + if (!success) {
  1598 + throw new ServiceException("完成出库查看任务时,更新容器状态失败");
  1599 + }
  1600 + }
  1601 + success = locationService.updateContainerCodeAndStatus(fromLocationCode,
  1602 + QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1603 + if (!success) {
  1604 + throw new ServiceException("完成出库查看任务时,更新起始库位状态失败");
  1605 + }
  1606 + success = locationService.updateContainerCodeAndStatus(toLocationCode,
  1607 + containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1608 + if (!success) {
  1609 + throw new ServiceException("完成出库查看任务时,更新目标库位状态失败");
  1610 + }
  1611 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1612 + success = taskHeaderService.updateById(taskHeader);
  1613 + if (!success) {
  1614 + throw new ServiceException("完成出库查看任务时,保存任务失败");
  1615 + }
  1616 + return Result.ok("完成出库查看任务");
  1617 + }
  1618 +
  1619 + /**
  1620 + * 完成跨站任务
  1621 + * @param taskHeader 任务
  1622 + * @return Result 完成跨站任务结果
  1623 + */
  1624 + @Transactional(rollbackFor = Exception.class)
  1625 + public Result completeOverStationTask(TaskHeader taskHeader) {
  1626 + String warehouseCode = taskHeader.getWarehouseCode();
  1627 + String containerCode = taskHeader.getContainerCode();
  1628 + String fromPortCode = taskHeader.getFromPortCode();
  1629 + String toPortCode = taskHeader.getToPortCode();
  1630 + if(StringUtils.isEmpty(containerCode)) {
  1631 + return Result.error("完成跨站任务时, 托盘号为空");
  1632 + }
  1633 + if(StringUtils.isEmpty(warehouseCode)) {
  1634 + return Result.error("完成跨站任务时, 仓库编码为空");
  1635 + }
  1636 + if(StringUtils.isEmpty(fromPortCode)) {
  1637 + return Result.error("完成跨站任务时, 起始出入口号为空");
  1638 + }
  1639 + if(StringUtils.isEmpty(toPortCode)) {
  1640 + return Result.error("完成跨站任务时, 目标出入口号为空");
  1641 + }
  1642 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1643 + if(container == null) {
  1644 + return Result.error("创建跨站任务时,容器为空");
  1645 + }
  1646 + Port fromPort = portService.getPortByCode(fromPortCode, warehouseCode);
  1647 + if(fromPort == null) {
  1648 + return Result.error("创建跨站任务时,起始站台为空");
  1649 + }
  1650 + Port toPort = portService.getPortByCode(toPortCode, warehouseCode);
  1651 + if(toPort == null) {
  1652 + return Result.error("创建跨站任务时,目标站台为空");
  1653 + }
  1654 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1655 + boolean success = taskHeaderService.updateById(taskHeader);
  1656 + if(!success) {
  1657 + throw new ServiceException("创建跨站任务时, 更新任务失败");
  1658 + }
  1659 + success = containerService.updateStatus(containerCode,
  1660 + QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  1661 + if(!success) {
  1662 + throw new ServiceException("创建跨站任务时, 更新容器状态失败");
  1663 + }
  1664 + return Result.OK("完成跨站任务成功");
  1665 + }
  1666 +
  1667 + /**
  1668 + * 完成空托盘组入库任务
  1669 + * @param taskHeader 任务
  1670 + * @return Result 完成空托盘组入库任务结果
  1671 + */
  1672 + @Transactional(rollbackFor = Exception.class)
  1673 + public Result completeManyEmptyInTask(TaskHeader taskHeader) {
  1674 + String warehouseCode = taskHeader.getWarehouseCode();
  1675 + String containerCode = taskHeader.getContainerCode();
  1676 + String toLocationCode = taskHeader.getToLocationCode();
  1677 + if(StringUtils.isEmpty(containerCode)) {
  1678 + return Result.error("完成空托盘组入库任务时, 托盘号为空");
  1679 + }
  1680 + if(StringUtils.isEmpty(warehouseCode)) {
  1681 + return Result.error("完成空托盘组入库任务时, 仓库编码为空");
  1682 + }
  1683 + if(StringUtils.isEmpty(toLocationCode)) {
  1684 + return Result.error("完成空托盘组入库任务时, 目标库位号为空");
  1685 + }
  1686 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1687 + if(container == null) {
  1688 + return Result.error("完成空托盘组入库任务时,没有找到容器" + containerCode);
  1689 + }
  1690 + Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
  1691 + if(toLocation == null) {
  1692 + return Result.error("完成空托盘组入库任务时,没有找到库位" + toLocationCode);
  1693 + }
  1694 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1695 + boolean success = taskHeaderService.updateById(taskHeader);
  1696 + if(!success) {
  1697 + throw new ServiceException("完成空托盘组入库任务时, 更新任务失败");
  1698 + }
  1699 + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode,
  1700 + QuantityConstant.STATUS_CONTAINER_MANY, warehouseCode);
  1701 + if(!success) {
  1702 + throw new ServiceException("完成空托盘组入库任务时, 更新容器失败");
  1703 + }
  1704 + success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode,
  1705 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1706 + if(!success) {
  1707 + throw new ServiceException("完成空托盘组入库任务时, 更新库位失败");
  1708 + }
  1709 + return Result.ok("完成空托盘组入库任务成功");
  1710 + }
  1711 +
  1712 + /**
  1713 + * 完成空托盘组出库任务
  1714 + * @param taskHeader 任务
  1715 + * @return Result 完成空托盘组出库任务结果
  1716 + */
  1717 + @Transactional(rollbackFor = Exception.class)
  1718 + public Result completeManyEmptyOutTask(TaskHeader taskHeader) {
  1719 + String warehouseCode = taskHeader.getWarehouseCode();
  1720 + String containerCode = taskHeader.getContainerCode();
  1721 + String toPortCode = taskHeader.getToPortCode();
  1722 + if(StringUtils.isEmpty(containerCode)) {
  1723 + return Result.error("完成空托盘组出库任务时, 托盘号为空");
  1724 + }
  1725 + if(StringUtils.isEmpty(warehouseCode)) {
  1726 + return Result.error("完成空托盘组出库任务时, 仓库编码为空");
  1727 + }
  1728 + if(StringUtils.isEmpty(toPortCode)) {
  1729 + return Result.error("完成空托盘组出库任务时, 目标出入口为空");
  1730 + }
  1731 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1732 + if(container == null) {
  1733 + return Result.error("完成空托盘组出库任务时,没有找到容器" + containerCode);
  1734 + }
  1735 + String toLocationCode = container.getLocationCode();
  1736 + if(StringUtils.isEmpty(toLocationCode)) {
  1737 + return Result.error("完成空托盘组出库任务时, 容器不在库位上");
  1738 + }
  1739 + Port port = portService.getPortByCode(toPortCode, warehouseCode);
  1740 + if(port == null) {
  1741 + return Result.error("完成空托盘组出库任务时,没有找到出入口" + toPortCode);
  1742 + }
  1743 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
  1744 + boolean success = taskHeaderService.updateById(taskHeader);
  1745 + if(!success) {
  1746 + throw new ServiceException("完成空托盘组出库任务时, 更新任务失败");
  1747 + }
  1748 + success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING,
  1749 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1750 + if(!success) {
  1751 + throw new ServiceException("完成空托盘组出库任务时, 更新容器失败");
  1752 + }
  1753 + success = locationService.updateContainerCodeAndStatus(toLocationCode, QuantityConstant.EMPTY_STRING,
  1754 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1755 + if(!success) {
  1756 + throw new ServiceException("完成空托盘组出库任务时, 更新库位失败");
  1757 + }
  1758 + return Result.ok("完成空托盘组出库任务成功");
  1759 + }
  1760 +
  1761 + /**
  1762 + * 取消入库任务
  1763 + * @param taskHeader 任务
  1764 + * @return Result 取消入库任务结果
  1765 + */
  1766 + @Transactional(rollbackFor = Exception.class)
  1767 + public Result cancelReceiptTask(TaskHeader taskHeader) {
  1768 + int receiptContainerHeaderId = taskHeader.getReceiptContainerHeaderId();
  1769 + boolean success = receiptContainerHeaderService.cancelReceiptTask(receiptContainerHeaderId);
  1770 + if(!success) {
  1771 + throw new ServiceException("取消入库任务时, 更新组盘头状态失败");
  1772 + }
  1773 + String containerCode = taskHeader.getContainerCode();
  1774 + String warehouseCode = taskHeader.getWarehouseCode();
  1775 + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.
  1776 + getUnCompleteReceiptContainerByCode(containerCode, warehouseCode);
  1777 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION);
  1778 + if(StringUtils.isEmpty(value)) {
  1779 + throw new ServiceException("取消入库任务时, 没有获取到配置属性");
  1780 + }
  1781 + int taskLocationRule = Integer.parseInt(value);
  1782 + if (taskLocationRule == QuantityConstant.RULE_TASK_NOT_LOCATION) {
  1783 + receiptContainerHeader.setToLocationCode(QuantityConstant.EMPTY_STRING);
  1784 + success = receiptContainerHeaderService.updateById(receiptContainerHeader);
  1785 + if(!success) {
  1786 + throw new ServiceException("取消入库任务时, 更新组盘头状态失败!!");
  1787 + }
  1788 + }
  1789 + return Result.ok("取消入库任务成功");
  1790 + }
  1791 +
  1792 + /**
  1793 + * 取消出库任务
  1794 + * @param taskHeader 任务
  1795 + * @return Result 取消出库任务结果
  1796 + */
  1797 + @Transactional(rollbackFor = Exception.class)
  1798 + public Result cancelShipmentTask(TaskHeader taskHeader) {
  1799 +
  1800 + return Result.ok("取消出库任务成功");
  1801 + }
  1802 +
  1803 + /**
  1804 + * 取消任务,恢复容器和库位状态
  1805 + * @param taskHeader
  1806 + * @return
  1807 + */
  1808 + @Transactional(rollbackFor = Exception.class)
  1809 + public Result cancelLocationAndContainerStatus(TaskHeader taskHeader) {
  1810 + String containerCode = taskHeader.getContainerCode();
  1811 + String fromLocationCode = taskHeader.getFromLocationCode();
  1812 + String toLocationCode = taskHeader.getToLocationCode();
  1813 + String warehouseCode = taskHeader.getWarehouseCode();
  1814 +
  1815 + boolean success = false;
  1816 + if(StringUtils.isEmpty(fromLocationCode)) {
  1817 + success = locationService.updateStatus(fromLocationCode,
  1818 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1819 + if(!success) {
  1820 + throw new ServiceException("取消任务时, 更新起始库位状态失败");
  1821 + }
  1822 + }
  1823 + if(StringUtils.isEmpty(toLocationCode)) {
  1824 + success = locationService.updateStatus(toLocationCode,
  1825 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1826 + if(!success) {
  1827 + throw new ServiceException("取消任务时, 更新目标库位状态失败");
  1828 + }
  1829 + }
  1830 + InventoryHeader inventoryHeader = inventoryHeaderService.
  1831 + getInventoryHeaderByContainerCode(containerCode, warehouseCode);
  1832 +
  1833 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1834 + if(container == null) {
  1835 + throw new ServiceException("取消任务时, 没有找到容器");
  1836 + }
  1837 + if (inventoryHeader != null) {
  1838 + if (QuantityConstant.STATUS_CONTAINER_SOME.equals(inventoryHeader.getContainerStatus())) {
  1839 + container.setStatus(QuantityConstant.STATUS_CONTAINER_SOME);
  1840 + }
  1841 + inventoryHeader.setContainerStatus(QuantityConstant.STATUS_CONTAINER_SOME);
  1842 + success = inventoryHeaderService.updateById(inventoryHeader);
  1843 + if(!success) {
  1844 + throw new ServiceException("取消任务时, 更新库存成功");
  1845 + }
  1846 + } else {
  1847 + container.setStatus(QuantityConstant.STATUS_CONTAINER_EMPTY);
  1848 + }
  1849 + String lastStatus = container.getLastStatus();
  1850 + if (StringUtils.isNotEmpty(lastStatus)) {
  1851 + container.setStatus(lastStatus); //解决空托盘组移库问题
  1852 + }
  1853 + container.setLastStatus(QuantityConstant.EMPTY_STRING);
  1854 + container.setLocationCode(fromLocationCode);
  1855 + success = containerService.updateById(container);
  1856 + if(!success) {
  1857 + throw new ServiceException("取消任务时, 更新容器失败");
  1858 + }
  1859 + return Result.ok("取消任务成功");
  1860 + }
769 } 1861 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
@@ -183,7 +183,7 @@ public class QuantityConstant { @@ -183,7 +183,7 @@ public class QuantityConstant {
183 public static final int TASK_TYPE_TRANSFER = 800; 183 public static final int TASK_TYPE_TRANSFER = 800;
184 184
185 /** 出库查看 */ 185 /** 出库查看 */
186 - public static final int TASK_TYPE_VIEW = 900; 186 + public static final int TASK_TYPE_CHECK_OUT = 900;
187 187
188 /** 换站 */ 188 /** 换站 */
189 public static final int TASK_TYPE_OVER_STATION = 1000; 189 public static final int TASK_TYPE_OVER_STATION = 1000;
@@ -307,24 +307,13 @@ public class QuantityConstant { @@ -307,24 +307,13 @@ public class QuantityConstant {
307 public static final Integer INVENTORY_TRANSACTION_SHIPMENT = 20; 307 public static final Integer INVENTORY_TRANSACTION_SHIPMENT = 20;
308 308
309 /** 调整入 */ 309 /** 调整入 */
310 - public static final Integer INVENTORY_TRANSACTION_ADJUSTINTO = 30; 310 + public static final Integer INVENTORY_TRANSACTION_CYCLEINTO = 30;
311 311
312 /** 调整出 */ 312 /** 调整出 */
313 - public static final Integer INVENTORY_TRANSACTION_ADJUSTOUT = 40; 313 + public static final Integer INVENTORY_TRANSACTION_CYCLEOUT = 40;
314 314
315 - /** 调整属性 */  
316 - public static final Integer INVENTORY_TRANSACTION_ADJUSTPROPERTIES = 50;  
317 -  
318 - /** 盘点 */  
319 - public static final Integer INVENTORY_TRANSACTION_CYCLECOUNT = 60;  
320 -  
321 - /** 移库入 */  
322 - public static final Integer INVENTORY_TRANSACTION_TRANSFERINTO = 70;  
323 -  
324 - /** 移库出 */  
325 - public static final Integer INVENTORY_TRANSACTION_TRANSFEROUT = 80;  
326 - /**空出*/  
327 - public static final Integer INVENTORY_TRANSACTION_EMPTYOUT = 90; 315 + /** 移库 */
  316 + public static final Integer INVENTORY_TRANSACTION_TRANSFER = 50;
328 317
329 318
330 319
@@ -351,10 +340,10 @@ public class QuantityConstant { @@ -351,10 +340,10 @@ public class QuantityConstant {
351 /** 拣货任务*/ 340 /** 拣货任务*/
352 public static final Integer TASK_INTENERTYPE_SHIPMENT = 200; 341 public static final Integer TASK_INTENERTYPE_SHIPMENT = 200;
353 342
354 - /** 工作任务*/  
355 - public static final Integer TASK_INTENERTYPE_WORK = 300; 343 + /** 移位任务*/
  344 + public static final Integer TASK_INTENERTYPE_TRANSFER_POSITION = 300;
356 345
357 - //盘点任务 346 + /** 盘点任务*/
358 public static final Integer TASK_INTENERTYPE_CYCLECOUNT = 400; 347 public static final Integer TASK_INTENERTYPE_CYCLECOUNT = 400;
359 348
360 349