diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js b/jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js index 1f78402..1333a23 100644 --- a/jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/api/api.js @@ -126,7 +126,7 @@ export const completeTaskByWMS = (params)=>postAction('/task/taskHeader/complete //下发任务给WCS export const execute = (params)=>postAction('/task/taskHeader/execute', params); //取消任务 -export const cancelTask = (params)=>postAction('/task/taskHeader/cancelTask?1', params); +export const cancelTask = (params)=>postAction('/task/taskHeader/cancelTask?ids=' + params, params); //自动配盘 export const autoCombination = (params)=>postAction('/shipment/shipmentCombination/autoCombination', params); //创建出库任务 @@ -155,6 +155,8 @@ export const createOverStationTask = (params)=>postAction('/task/taskHeader/crea export const createManyEmptyIn = (params)=>postAction('/task/taskHeader/createManyEmptyIn', params); //创建空托盘组出库任务 export const createManyEmptyOut = (params)=>postAction('/task/taskHeader/createManyEmptyOut', params); +//获取打印数据 +export const getPrintContent = (params)=>postAction('/config/container/getPrintContent?ids=' + params, params); // 中转HTTP请求 export const transitRESTful = { diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue index e4ad7ba..2784306 100644 --- a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue @@ -50,6 +50,7 @@ <!-- 操作按钮区域 --> <div class="table-operator"> + <a-button @click="batchPrint()" type="primary" icon="plus">打印</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button type="primary" icon="download" @click="handleExportXls('容器管理')">导出</a-button> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> @@ -119,7 +120,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">编辑</a> + <a @click="editForm(record)">编辑</a> <a-divider type="vertical" /> <a-dropdown> @@ -141,6 +142,8 @@ </div> <container-modal ref="modalForm" @ok="modalFormOk"></container-modal> + <container-edit-modal ref="modalEditForm" @ok="modalFormOk"></container-edit-modal> + <container-print-modal ref="modalPrintForm" @ok="modalFormOk"></container-print-modal> </a-card> </template> @@ -153,11 +156,15 @@ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {getZoneList} from '@/api/api' import {getContainerTypeList} from '@/api/api' + import ContainerEditModal from "./modules/ContainerEditModal"; + import ContainerPrintModal from "./modules/ContainerPrintModal"; export default { name: 'ContainerList', mixins:[JeecgListMixin, mixinDevice], components: { + ContainerPrintModal, + ContainerEditModal, ContainerModal }, data () { @@ -266,6 +273,26 @@ fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) this.superFieldList = fieldList }, + editForm(record) { + this.$refs.modalEditForm.edit(record); + this.$refs.modalEditForm.title = "编辑容器"; + this.$refs.modalEditForm.disableSubmit = false; + }, + batchPrint() { + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!'); + return; + } else { + var ids = ""; + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ","; + } + console.log(ids); + this.$refs.modalPrintForm.edit(ids); + this.$refs.modalPrintForm.title = "打印容器编码"; + this.$refs.modalPrintForm.disableSubmit = false; + } + }, loadFrom() { getZoneList().then((res) => { if (res.success) { diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationList.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationList.vue index 47f38a7..fcd5d52 100644 --- a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationList.vue +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationList.vue @@ -99,6 +99,7 @@ <!-- 操作按钮区域 --> <div class="table-operator"> + <a-button @click="batchAdd()" type="primary" icon="plus">批量新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button type="primary" icon="download" @click="handleExportXls('库位管理')">导出</a-button> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> @@ -190,6 +191,7 @@ </div> <location-modal ref="modalForm" @ok="modalFormOk"></location-modal> + <location-batch-add-modal ref="batchAddModalForm" @ok="modalFormOk"></location-batch-add-modal> </a-card> </template> @@ -202,11 +204,13 @@ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {getLocationTypeList} from '@/api/api' import {getZoneList} from '@/api/api' + import LocationBatchAddModal from "./modules/LocationBatchAddModal"; export default { name: 'LocationList', mixins:[JeecgListMixin, mixinDevice], components: { + LocationBatchAddModal, LocationModal }, data () { @@ -217,14 +221,9 @@ // 表头 columns: [ { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, + title:'ID', align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } + dataIndex: 'id' }, { title:'库位编码', @@ -382,6 +381,11 @@ } }) }, + batchAdd() { + this.$refs.batchAddModalForm.add(); + this.$refs.batchAddModalForm.title = "批量新增"; + this.$refs.batchAddModalForm.disableSubmit = false; + }, solutionZoneCode(value) { var actions = [] Object.keys(this.zoneList).some((key) => { diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditForm.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditForm.vue new file mode 100644 index 0000000..2e55316 --- /dev/null +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditForm.vue @@ -0,0 +1,142 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="容器类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerTypeCode"> + <a-select + show-search + placeholder="请选择容器类型" + option-filter-prop="children" + :filter-option="filterOption" + v-model="model.containerTypeCode"> + <a-select-option v-for="item in containerTypeList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option> + </a-select> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="库位编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationCode"> + <a-input v-model="model.locationCode" placeholder="请输入库位编码" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> + <j-dict-select-tag type="list" v-model="model.status" dictCode="container_status" placeholder="请选择状态" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + import {getZoneList} from '@/api/api' + import {getContainerTypeList} from '@/api/api' + + export default { + name: 'ContainerEditForm', + components: { + }, + props: { + //表单禁用 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + zoneList:[], + containerTypeList:[], + validatorRules: { + containerTypeCode: [ + { required: true, message: '请选择容器类型!'}, + ], + }, + url: { + add: "/config/container/add", + edit: "/config/container/edit", + queryById: "/config/container/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //备份model原始值 + this.model.status = "empty"; + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + this.loadFrom(); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + loadFrom() { + getZoneList().then((res) => { + if (res.success) { + this.zoneList = res.result + } + }); + getContainerTypeList().then((res) => { + if (res.success) { + this.containerTypeList = res.result + } + }); + }, + submitForm () { + const that = this; + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditModal.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditModal.vue new file mode 100644 index 0000000..fd577ca --- /dev/null +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerEditModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="关闭"> + <location="realForm" @ok="submitCallback" :disabled="disableSubmit"></container-edit-form> + </j-modal> +</template> + +<script> + + import ContainerEditForm from './ContainerEditForm' + export default { + name: 'ContainerEditModal', + components: { + ContainerEditForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintForm.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintForm.vue new file mode 100644 index 0000000..79eb342 --- /dev/null +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintForm.vue @@ -0,0 +1,142 @@ +<template> + <div class="container" style=" width:600px;/*height:228px;*/color: #333"> + + <div class="noprint container" style="text-align:right; float: right"> + <a-button v-print="'#printContent'" ghost type="primary">打印</a-button> + </div> + + <div class="row" id="printContent" > + <table width="100%" + v-for="source in dataSource"> + <caption style="font-size:22px;text-align:center; color:#333; padding-bottom: 3px;"></caption> + <tbody> + <tr > + <td scope="col" style="font-size:12px;font-weight:bold" >物料图号:{{source.code}}</td> + </tr> +<!-- <tr >--> +<!-- <td rowspan="4" style="padding: 1px">--> +<!-- <vue-qr :text="source.code" :size="70" :margin="0"></vue-qr>--> +<!-- </td>--> +<!-- </tr>--> + </tbody> + </table> + </div> + </div> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + import {getZoneList} from '@/api/api' + import {getContainerTypeList, getPrintContent} from '@/api/api' + import JsBarcode from 'jsbarcode' + + export default { + name: 'ContainerPrintForm', + components: { + JsBarcode, + }, + props: { + //表单禁用 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + dataSource:[], + ids:{}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + zoneList:[], + containerTypeList:[], + url: { + add: "/config/container/add", + edit: "/config/container/edit", + queryById: "/config/container/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //备份model原始值 + this.model.status = "empty"; + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + this.loadFrom(); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + // this.model = Object.assign({}, this.modelDefault); + getPrintContent(record).then((res) => { + if (res.success) { + // var data = res.result; + console.log("getPrintContent:" + res.result); + this.dataSource = res.result; + console.log("getPrintContent!!:" + this.dataSource.length); + this.visible = true; + } + }); + }, + loadFrom() { + getZoneList().then((res) => { + if (res.success) { + this.zoneList = res.result + } + }); + getContainerTypeList().then((res) => { + if (res.success) { + this.containerTypeList = res.result + } + }); + }, + submitForm () { + const that = this; + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintModal.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintModal.vue new file mode 100644 index 0000000..497ee24 --- /dev/null +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/ContainerPrintModal.vue @@ -0,0 +1,61 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="关闭"> + <container-print-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></container-print-form> + </j-modal> +</template> + +<script> + + import ContainerPrintForm from './ContainerPrintForm' + export default { + name: 'ContainerPrintModal', + components: { + ContainerPrintForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + console.log("record:" + record); + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddForm.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddForm.vue new file mode 100644 index 0000000..86e1db7 --- /dev/null +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddForm.vue @@ -0,0 +1,223 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="编码前缀" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prefix"> + <a-input v-model="model.prefix" placeholder="请输入编码前缀" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="起始行" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstRow"> + <a-input v-model="model.firstRow" placeholder="请输入起始行" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="最后行" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastRow"> + <a-input v-model="model.lastRow" placeholder="请输入最后行" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="起始列" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstColumn"> + <a-input v-model="model.firstColumn" placeholder="请输入起始列" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="最后列" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastColumn"> + <a-input v-model="model.lastColumn" placeholder="请输入最后列" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="起始层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstLayer"> + <a-input v-model="model.firstLayer" placeholder="请输入起始层" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="最后层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastLayer"> + <a-input v-model="model.lastLayer" placeholder="请输入最后层" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="巷道" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="roadWay"> + <a-input v-model="model.roadWay" placeholder="请输入巷道" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="高低位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="high"> + <j-dict-select-tag type="list" v-model="model.high" dictCode="high_status" placeholder="请选择高低位" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode"> + <a-select + show-search + placeholder="请选择库区" + option-filter-prop="children" + :filter-option="filterOption" + v-model="model.zoneCode"> + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option> + </a-select> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="库位类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationTypeCode"> + <a-select + show-search + placeholder="请选择库位类型" + option-filter-prop="children" + :filter-option="filterOption" + v-model="model.locationTypeCode"> + <a-select-option v-for="item in locationTypeList" :key="item.name" :value="item.code">{{ item.name }}</a-select-option> + </a-select> + </a-form-model-item> + </a-col> +<!-- <a-col :span="24">--> +<!-- <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">--> +<!-- <j-dict-select-tag type="list" v-model="model.status" dictCode="location_status" placeholder="请选择状态" />--> +<!-- </a-form-model-item>--> +<!-- </a-col>--> +<!-- <a-col :span="24">--> +<!-- <a-form-model-item label="是否可用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enable">--> +<!-- <j-dict-select-tag type="list" v-model="model.enable" dictCode="enable_status" placeholder="请选择是否可用" />--> +<!-- </a-form-model-item>--> +<!-- </a-col>--> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + import {getZoneList} from '@/api/api' + import {getLocationTypeList} from '@/api/api' + + export default { + name: 'LocationBatchAddForm', + components: { + }, + props: { + //表单禁用 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + zoneList:[], + locationTypeList:[], + validatorRules: { + prefix: [ + { required: true, message: '请输入编码前缀!'}, + ], + firstRow: [ + { required: true, message: '请输入起始行!'}, + ], + lastRow: [ + { required: true, message: '请输入最后行'}, + ], + firstColumn: [ + { required: true, message: '请输入起始列!'}, + ], + lastColumn: [ + { required: true, message: '请输入最后列'}, + ], + firstLayer: [ + { required: true, message: '请输入起始层!'}, + ], + lastLayer: [ + { required: true, message: '请输入最后层'}, + ], + roadWay: [ + { required: true, message: '请输入巷道!'}, + ], + zoneCode: [ + { required: true, message: '请输入库区!'}, + ], + locationTypeCode: [ + { required: true, message: '请输入库位类型!'}, + ], + high: [ + { required: true, message: '请输入高低位!'}, + ], + }, + url: { + add: "/config/location/batchAdd", + edit: "/config/location/edit", + queryById: "/config/location/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //备份model原始值 + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + this.loadFrom(); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + loadFrom() { + getZoneList().then((res) => { + if (res.success) { + this.zoneList = res.result + } + }); + getLocationTypeList().then((res) => { + if (res.success) { + this.locationTypeList = res.result + } + }) + }, + submitForm () { + const that = this; + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + httpurl+=this.url.add; + method = 'post'; + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddModal.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddModal.vue new file mode 100644 index 0000000..40433bb --- /dev/null +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAddModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="关闭"> + <location-batch-add-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></location-batch-add-form> + </j-modal> +</template> + +<script> + + import LocationBatchAddForm from "./LocationBatchAddForm"; + export default { + name: 'LocationBatchAddModal', + components: { + LocationBatchAddForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue index 830eb45..25acdff 100644 --- a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue @@ -404,6 +404,7 @@ cancelTask(record) { this.loading = true; this.model = Object.assign({}, record); + console.log() cancelTask(this.model.id).then((res) => { this.loading = false; if (res.success) { diff --git a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue index a0dcfb5..2ffddf2 100644 --- a/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue +++ b/jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue @@ -148,6 +148,8 @@ <span slot="action" slot-scope="text, record"> <a v-if="record.status == 1" @click="executeTask(record)">执行</a> <a-divider type="vertical" /> + <a v-if="record.status < 100" @click="cancelTask(record)">取消</a> + <a-divider type="vertical" /> <a v-if="record.status < 100" @click="completeTask(record)">完成</a> <a-divider type="vertical" /> <a-dropdown> @@ -189,7 +191,7 @@ import TaskDetailList from './TaskDetailList' import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil' import '@/assets/less/TableExpand.less' - import {completeTaskByWMS} from '@/api/api' + import {completeTaskByWMS, cancelTask} from '@/api/api' import {execute} from '@/api/api' import {getZoneList} from '@/api/api' import EmptyOutTaskModal from './modules/EmptyOutTaskModal' @@ -394,6 +396,20 @@ this.loading = false; }) }, + cancelTask(record) { + this.loading = true; + this.model = Object.assign({}, record); + cancelTask(this.model.id).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } + else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + }, completeTask(record) { this.loading = true; this.model = Object.assign({}, record); diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java index b0b4cbb..095d512 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java @@ -35,8 +35,8 @@ import org.jeecg.common.util.oConvertUtils; public class JwtUtil { // Token过期时间2天(用户登录过期时间是此时间的两倍,以token在reids缓存时间为准) - public static final long EXPIRE_TIME = 2 * 24 * 60 * 60 * 1000; - +// public static final long EXPIRE_TIME = 2 * 24 * 60 * 60 * 1000; + public static final long EXPIRE_TIME = -1; /** * * @param response diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java index 090c1a8..e126d53 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/controller/ContainerController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.wms.config.container.controller; +import java.lang.ref.WeakReference; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -7,8 +8,13 @@ import java.util.stream.Collectors; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.aliyun.oss.ServiceException; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.util.JwtUtil; @@ -21,6 +27,8 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.wms.config.container.entity.Container; import org.jeecg.modules.wms.config.container.service.IContainerService; +import org.jeecg.modules.wms.config.location.entity.Location; +import org.jeecg.modules.wms.config.location.service.ILocationService; import org.jeecg.utils.StringUtils; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; @@ -51,6 +59,8 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class ContainerController extends JeecgController<Container, IContainerService> { @Autowired private IContainerService containerService; + @Resource + private ILocationService locationService; /** * 分页列表查询 @@ -71,8 +81,10 @@ public class ContainerController extends JeecgController<Container, IContainerSe String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); container.setWarehouseCode(warehouseCode); QueryWrapper<Container> queryWrapper = QueryGenerator.initQueryWrapper(container, null); + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = queryWrapper.lambda(); + containerLambdaQueryWrapper.orderByAsc(Container::getId); Page<Container> page = new Page<Container>(pageNo, pageSize); - IPage<Container> pageList = containerService.page(page, queryWrapper); + IPage<Container> pageList = containerService.page(page, containerLambdaQueryWrapper); return Result.OK(pageList); } @@ -105,7 +117,17 @@ public class ContainerController extends JeecgController<Container, IContainerSe @ApiOperation(value="容器管理-编辑", notes="容器管理-编辑") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result<String> edit(@RequestBody Container container) { - containerService.updateById(container); + String locationCode = container.getLocationCode(); + if(StringUtils.isNotEmpty(locationCode)) { + Location location = locationService.getLocationByCode(locationCode, container.getWarehouseCode()); + if(location == null) { + throw new ServiceException("编辑的库位号不存在"); + } + } + boolean success = containerService.updateById(container); + if(!success) { + throw new ServiceException("编辑失败"); + } return Result.OK("编辑成功!"); } @@ -137,6 +159,23 @@ public class ContainerController extends JeecgController<Container, IContainerSe return Result.OK("批量删除成功!"); } + /** + * 获取打印数据 + * + * @param ids + * @return + */ + @AutoLog(value = "容器管理-获取打印数据") + @ApiOperation(value="容器管理-获取打印数据", notes="容器管理-获取打印数据") + @PostMapping(value = "/getPrintContent") + @ResponseBody + public Result getPrintContent(@RequestParam(name="ids",required=true) String ids) { + List<String> idlist = Arrays.asList(ids.split(",")); + List<Container> containerList = containerService.listByIds(idlist); + return Result.OK(containerList); + } + + /** * 通过id查询 * diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java index e5bb09f..65b5336 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java @@ -9,6 +9,8 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.util.JwtUtil; @@ -19,9 +21,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.wms.config.container.entity.Container; +import org.jeecg.modules.wms.config.location.entity.BatchLocation; import org.jeecg.modules.wms.config.location.entity.Location; import org.jeecg.modules.wms.config.location.service.ILocationService; import org.jeecg.utils.StringUtils; +import org.jeecg.utils.constant.QuantityConstant; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -70,14 +75,16 @@ public class LocationController extends JeecgController<Location, ILocationServi HttpServletRequest req) { String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); location.setWarehouseCode(warehouseCode); - QueryWrapper<Location> queryWrapper = QueryGenerator.initQueryWrapper(location, req.getParameterMap()); + QueryWrapper<Location> queryWrapper = QueryGenerator.initQueryWrapper(location, null); + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = queryWrapper.lambda(); + locationLambdaQueryWrapper.orderByAsc(Location::getId); Page<Location> page = new Page<Location>(pageNo, pageSize); - IPage<Location> pageList = locationService.page(page, queryWrapper); + IPage<Location> pageList = locationService.page(page, locationLambdaQueryWrapper); return Result.OK(pageList); } /** - * 添加 + * 添加 * * @param location * @return @@ -94,6 +101,25 @@ public class LocationController extends JeecgController<Location, ILocationServi return Result.OK("添加成功!"); } + /** + * 批量添加 + * + * @param batchLocation + * @return + */ + @AutoLog(value = "库位管理-批量添加") + @ApiOperation(value="库位管理-批量添加", notes="库位管理-批量添加") + @PostMapping(value = "/batchAdd") + public Result<String> batchAdd(@RequestBody BatchLocation batchLocation, HttpServletRequest req) { + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); + if(StringUtils.isNotEmpty(warehouseCode)) { + batchLocation.setWarehouseCode(warehouseCode); + } + batchLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); + Result result = locationService.batchAdd(batchLocation); + return result; + } + /** * 编辑 * diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/entity/BatchLocation.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/entity/BatchLocation.java new file mode 100644 index 0000000..2890d89 --- /dev/null +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/entity/BatchLocation.java @@ -0,0 +1,26 @@ +package org.jeecg.modules.wms.config.location.entity; + +import lombok.Data; + +/** + * @author 游杰 + */ +@Data +public class BatchLocation { + + private String prefix; + private Integer firstRow; + private Integer lastRow; + private Integer firstColumn; + private Integer lastColumn; + private Integer firstLayer; + private Integer lastLayer; + private Integer firstGrid; + private Integer lastGrid; + private Integer roadWay; + private String zoneCode; + private String locationTypeCode; + private String status; + private int high; + private String warehouseCode; +} diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java index 77aeed6..0df9608 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java @@ -1,6 +1,8 @@ package org.jeecg.modules.wms.config.location.service; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.wms.config.location.entity.BatchLocation; import org.jeecg.modules.wms.config.location.entity.Location; import java.util.List; @@ -36,4 +38,5 @@ public interface ILocationService extends IService<Location> { boolean haveUncompleteTaskInNear(Location location); + Result batchAdd(BatchLocation batchLocation); } diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java index 5eec4bf..29d7a68 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java @@ -1,17 +1,27 @@ package org.jeecg.modules.wms.config.location.service.impl; +import com.aliyun.oss.ServiceException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.wms.config.location.entity.BatchLocation; import org.jeecg.modules.wms.config.location.entity.Location; import org.jeecg.modules.wms.config.location.mapper.LocationMapper; import org.jeecg.modules.wms.config.location.service.ILocationService; +import org.jeecg.modules.wms.config.locationType.entity.LocationType; +import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService; +import org.jeecg.modules.wms.config.zone.entity.Zone; +import org.jeecg.modules.wms.config.zone.service.IZoneService; import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; +import org.jeecg.utils.StringUtils; import org.jeecg.utils.constant.QuantityConstant; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -28,6 +38,10 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i @Resource private ITaskHeaderService taskHeaderService; + @Resource + private ILocationTypeService locationTypeService; + @Resource + private IZoneService zoneService; @Override public Location getLocationByCode(String locationCode, String warehouseCode) { @@ -229,6 +243,95 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i return false; } + @Override + @Transactional(rollbackFor = Exception.class) + public Result batchAdd(BatchLocation batchLocation) { + String prefix = batchLocation.getPrefix(); + Integer firstRow = batchLocation.getFirstRow(); + Integer lastRow = batchLocation.getLastRow(); + Integer firstColumn = batchLocation.getFirstColumn(); + Integer lastColumn = batchLocation.getLastColumn(); + Integer firstLayer = batchLocation.getFirstLayer(); + Integer lastLayer = batchLocation.getLastLayer(); + Integer roadWay = batchLocation.getRoadWay(); + String zoneCode = batchLocation.getZoneCode(); + String locationTypeCode = batchLocation.getLocationTypeCode(); + String status = batchLocation.getStatus(); + int high = batchLocation.getHigh(); + String warehouseCode = batchLocation.getWarehouseCode(); + if(StringUtils.isEmpty(prefix)) { + return Result.error("批量增加库位时, 前缀为空"); + } + if(StringUtils.isEmpty(zoneCode)) { + return Result.error("批量增加库位时, 库区编码为空"); + } + if(StringUtils.isEmpty(locationTypeCode)) { + return Result.error("批量增加库位时, 库位类型编码为空"); + } + if(StringUtils.isEmpty(status)) { + return Result.error("批量增加库位时, 状态为空"); + } + if(StringUtils.isEmpty(warehouseCode)) { + return Result.error("批量增加库位时, 仓库编码为空"); + } + LocationType locationType = locationTypeService.getLocationTypeByCode(locationTypeCode, warehouseCode); + if(locationType == null) { + return Result.error("批量增加库位时, 没有找到库位类型"); + } + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); + if(zone == null) { + return Result.error("批量增加库位时, 没有找到库区"); + } + List<Location> locationList = new ArrayList<>(); + for(int i=firstRow; i<=lastRow; i++) { + for(int j=firstColumn; j<= lastColumn; j++) { + for( int k=firstLayer; k<= lastLayer; k++) { + Location location = new Location(); + location.setRow(i); + location.setIcolumn(j); + location.setLayer(k); + location.setRoadWay(roadWay); + location.setZoneCode(zoneCode); + location.setLocationTypeCode(locationTypeCode); + location.setStatus(status); + location.setHigh(high); + location.setRowFlag(QuantityConstant.ROW_IN); + location.setWarehouseCode(warehouseCode); + location.setEnable(QuantityConstant.STATUS_ENABLE); + String code = MessageFormat.format("{0}{1}{2}{3}", + prefix, + String.format("%02d", i), + String.format("%02d", j), + String.format("%02d", k)); + location.setCode(code); + locationList.add(location); + } + } + } + // 计算有多少列 + int rowSize = lastRow - firstRow; + if(rowSize == 4) { + for (Location location3 : locationList) { + for (int i = 0; i < rowSize; i++) { + int row = location3.getRow(); + row = row % rowSize; + // 每个巷道的第1行和第4行为外侧,深库位 + if(row == 1 || row == 0) { + location3.setRowFlag(QuantityConstant.ROW_OUT); + } else { + location3.setRowFlag(QuantityConstant.ROW_IN); + } + } + } + } + + boolean success = saveBatch(locationList); + if(!success) { + throw new ServiceException("批量增加库位失败"); + } + return Result.ok("批量增加库位成功"); + } + private boolean getOutSideCanMove(Location location) { Location locaiton2 = getInsideNear(location); if (locaiton2.getStatus().equals(QuantityConstant.STATUS_LOCATION_LOCK)) { diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java index 82468fa..41df1d0 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java @@ -346,7 +346,7 @@ public class TaskHeaderController extends JeecgController<TaskHeader, ITaskHeade @ApiOperation(value="任务表-取消任务", notes="任务表-取消任务") @PostMapping( "/cancelTask") @ResponseBody - public Result cancelTask(String ids) { + public Result cancelTask(@RequestParam(name="ids",required=true) String ids) { if (StringUtils.isEmpty(ids)) { return Result.error("taskId不能为空"); } diff --git a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index bb71d34..6686493 100644 --- a/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -737,6 +737,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } @Override + @Transactional(rollbackFor = Exception.class) public Result cancelTask(Integer taskId) { TaskHeader taskHeader = getById(taskId); if(taskHeader == null) { @@ -756,21 +757,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if(!success) { return Result.error("取消任务失败, 删除任务失败"); } - Result result = null; + Result result = Result.ok("取消任务成功"); switch (taskType) { case QuantityConstant.TASK_TYPE_WHOLERECEIPT: case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: - cancelLocationAndContainerStatus(taskHeader); result = cancelReceiptTask(taskHeader); break; case QuantityConstant.TASK_TYPE_WHOLESHIPMENT: case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: - cancelLocationAndContainerStatus(taskHeader); result = cancelShipmentTask(taskHeader); break; - default: - throw new ServiceException("不支持的任务类型" + taskType); } + cancelLocationAndContainerStatus(taskHeader); return result; } @@ -1813,14 +1811,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea String warehouseCode = taskHeader.getWarehouseCode(); boolean success = false; - if(StringUtils.isEmpty(fromLocationCode)) { + if(StringUtils.isNotEmpty(fromLocationCode)) { success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if(!success) { throw new ServiceException("取消任务时, 更新起始库位状态失败"); } } - if(StringUtils.isEmpty(toLocationCode)) { + if(StringUtils.isNotEmpty(toLocationCode)) { success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); if(!success) {